New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mstform

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mstform - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

6

CHANGES.md

@@ -0,1 +1,7 @@

# 0.15.1
- `setRaw` was an `async` function and was trying to set values directly
after an `await`. This doesn't in strict mode. Now use actions to set the
value.
# 0.15

@@ -2,0 +8,0 @@

2

dist/mstform.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("mobx"),require("mobx-state-tree")):"function"==typeof define&&define.amd?define(["mobx","mobx-state-tree"],t):"object"==typeof exports?exports.mstform=t(require("mobx"),require("mobx-state-tree")):e.mstform=t(e.mobx,e["mobx-state-tree"])}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";r.r(t);var n={value:function(e){return{value:e.raw,onChange:function(t){return e.setRaw(t.target.value)}}},checked:function(e){return{checked:e.raw,onChange:function(t){return e.setRaw(t.target.checked)}}},object:function(e){return{value:e.raw,onChange:function(t){return e.setRaw(t)}}}},o=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},i=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=function(){return function(e){this.value=e}}(),a=function(){function e(e){this.definition=e,this.emptyRaw=e.emptyRaw,this.defaultControlled=e.defaultControlled?e.defaultControlled:n.object}return e.prototype.convert=function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return this.definition.rawValidate?[4,this.definition.rawValidate(e)]:[3,2];case 1:if(!r.sent())return[2,"ConversionError"];r.label=2;case 2:return t=this.definition.convert(e),this.definition.validate?[4,this.definition.validate(t)]:[3,4];case 3:if(!r.sent())return[2,"ConversionError"];r.label=4;case 4:return[2,new s(t)]}})})},e.prototype.render=function(e){return this.definition.render(e)},e}(),u=r(0),c=r(1),p=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},f=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},h=function(){return{}};function y(e){h=e}var g=function(){function e(e,t,r,n,o){this.state=e,this.definition=t,this.parent=r,this.allowedKeys=o,this.fieldAccessors=u.observable.map(),this.repeatingFormAccessors=u.observable.map(),this.subFormAccessors=u.observable.map(),this.keys=null!=o?o:Object.keys(this.definition),this._addMode=n,this.initialize()}return e.prototype.validate=function(){return d(this,void 0,void 0,function(){var e;return f(this,function(t){switch(t.label){case 0:return e=this.accessors.map(function(e){return e.validate()}),[4,Promise.all(e)];case 1:return[2,t.sent().every(function(e){return e})]}})})},e.prototype.setError=function(e){},e.prototype.clearError=function(){},e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return null==this.parent?"":this.parent.path},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.accessors.every(function(e){return e.isValid})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){var e=this,t=[];return this.keys.forEach(function(r){var n=e.definition[r];n instanceof N?t.push(e.field(r)):n instanceof z?t.push(e.repeatingForm(r)):n instanceof D&&t.push(e.subForm(r))}),t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){var e=[];return this.accessors.forEach(function(t){t instanceof b?e.push(t):t instanceof v?(e.push.apply(e,t.flatAccessors),e.push(t)):t instanceof w&&(e.push.apply(e,t.flatAccessors),e.push(t))}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return!!this._addMode||null!=this.parent&&this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){if(this.keys.includes(e))try{return this.field(e)}catch(t){try{return this.repeatingForm(e)}catch(t){try{return this.subForm(e)}catch(e){return}}}},e.prototype.accessBySteps=function(e){if(0===e.length)return this;var t=e[0],r=e.slice(1),n=this.access(t);return 0===r.length?n:void 0===n?n:n.accessBySteps(r)},e.prototype.initialize=function(){var e=this;this.keys.forEach(function(t){var r=e.definition[t];r instanceof N?e.createField(t,r):r instanceof z?e.createRepeatingForm(t,r):r instanceof D&&e.createSubForm(t,r)})},e.prototype.createField=function(e,t){var r=new b(this.state,t,this,e);this.fieldAccessors.set(e,r)},e.prototype.field=function(e){var t=this.fieldAccessors.get(e);if(null==t)throw new Error(e+" is not a Field");return t},e.prototype.createRepeatingForm=function(e,t){var r=new v(this.state,t,this,e);this.repeatingFormAccessors.set(e,r),r.initialize()},e.prototype.repeatingForm=function(e){var t=this.repeatingFormAccessors.get(e);if(null==t)throw new Error(e+" is not a RepeatingForm");return t},e.prototype.createSubForm=function(e,t){var r=new w(this.state,t.definition,this,e);this.subFormAccessors.set(e,r),r.initialize()},e.prototype.subForm=function(e){var t=this.subFormAccessors.get(e);if(null==t)throw new Error(e+" is not a SubForm");return t},e.prototype.repeatingField=function(e){},p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),e}(),b=function(){function e(e,t,r,n){var o=this;this.state=e,this.field=t,this.parent=r,this._isValidating=!1,this._addMode=!1,this.handleChange=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d(o,void 0,void 0,function(){var t,r;return f(this,function(n){switch(n.label){case 0:return r=(t=this.field).getRaw.apply(t,e),[4,this.setRaw(r)];case 1:return n.sent(),[2]}})})},this.handleFocus=function(e){null!=o.state.focusFunc&&o.state.focusFunc(e,o)},this.name=n,this.createDerivedReaction()}var t,r,n;return e.prototype.clear=function(){null!=this._disposer&&this._disposer()},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),e.prototype.setDisposer=function(e){this._disposer=e},e.prototype.createDerivedReaction=function(){var e=this,t=this.field.derivedFunc;if(null!=t&&null==this._disposer){var r=Object(u.reaction)(function(){return e.node?t(e.node):void 0},function(t){void 0!==t&&e.setRaw(e.field.render(t))});this._disposer=r}},Object.defineProperty(e.prototype,"node",{get:function(){try{return this.state.getValue(this.parent.path)}catch(e){return}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return void 0===this._raw&&(this._addMode||this.parent.addMode)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raw",{get:function(){var e=this._raw;return void 0!==e?!Object(u.isObservable)(e)||e instanceof Array?Object(u.toJS)(e):e:this.addMode?this.field.converter.emptyRaw:this.field.render(this.value)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){if(this.addMode)throw new Error("Cannot access field in add mode until it has been set once");return this.state.getValue(this.path)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorValue",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canShowValidationMessages",{get:function(){if("rightAfter"===this.state.saveStatus)return!0;var e="before"===this.state.saveStatus?this.state.validationBeforeSave:this.state.validationAfterSave;return"immediate"===e||"no"!==e&&("blur"!==e&&"pause"!==e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this.canShowValidationMessages?this.errorValue:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValidating",{get:function(){return this._isValidating},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.state.isDisabledFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this.state.isHiddenFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readOnly",{get:function(){return this.state.isReadOnlyFunc(this)},enumerable:!0,configurable:!0}),e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.setRaw(this.raw)];case 1:return e.sent(),[2,this.isValid]}})})},Object.defineProperty(e.prototype,"isValid",{get:function(){return void 0===this.errorValue},enumerable:!0,configurable:!0}),e.prototype.setRaw=function(e){return d(this,void 0,void 0,function(){var t,r,n,o;return f(this,function(i){switch(i.label){case 0:"rightAfter"===this.state.saveStatus&&this.state.setSaveStatus("after"),this._raw=e,this._isValidating=!0,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.field.process(e)];case 2:return t=i.sent(),[3,4];case 3:return i.sent(),this._error="Something went wrong",this._isValidating=!1,[2];case 4:if(r=this._raw,!u.comparer.structural(r,e))return[2];if(this._isValidating=!1,t instanceof T)return this._error=t.message,[2];if(this._error=void 0,!(t instanceof q))throw new Error("Unknown process result");return"string"==typeof(n=this.state.extraValidationFunc(this,t.value))&&n&&(this._error=n),u.comparer.structural(this.value,t.value)?[2]:(this.state.setValueWithoutRawUpdate(this.path,t.value),null!=(o=this.field.changeFunc)&&o(this.node,t.value),[2])}})})},e.prototype.setRawFromValue=function(){var e=this.state.getValue(this.path);this._raw=this.field.render(e),this.validate()},e.prototype.setError=function(e){this._error=e},e.prototype.clearError=function(){this._error=void 0},Object.defineProperty(e.prototype,"inputProps",{get:function(){var e=this.field.controlled(this);return e.disabled=this.disabled,this.readOnly&&(e.readOnly=this.readOnly),null!=this.state.focusFunc&&(e.onFocus=this.handleFocus),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validationProps",{get:function(){return h(this)},enumerable:!0,configurable:!0}),e.prototype.accessBySteps=function(e){throw new Error("Cannot step through field accessor")},p([u.observable,l("design:type",Object)],e.prototype,"_raw",void 0),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_isValidating",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],e.prototype,"setDisposer",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"node",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type","function"==typeof(t="undefined"!=typeof R&&R)&&t||Object),l("design:paramtypes",[])],e.prototype,"raw",null),p([u.computed,l("design:type","function"==typeof(r="undefined"!=typeof V&&V)&&r||Object),l("design:paramtypes",[])],e.prototype,"value",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"errorValue",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"canShowValidationMessages",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValidating",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"disabled",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"hidden",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"readOnly",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.action,l("design:type",Function),l("design:paramtypes",["function"==typeof(n="undefined"!=typeof R&&R)&&n||Object]),l("design:returntype",Promise)],e.prototype,"setRaw",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"inputProps",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"validationProps",null),e}(),v=function(){function e(e,t,r,n){this.state=e,this.repeatingForm=t,this.parent=r,this.repeatingFormIndexedAccessors=u.observable.map(),this.name=n}return e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),e.prototype.setError=function(e){this._error=e},e.prototype.clearError=function(){this._error=void 0},e.prototype.validate=function(){return d(this,void 0,void 0,function(){var e,t,r,n;return f(this,function(o){switch(o.label){case 0:for(e=[],t=0,r=this.accessors;t<r.length;t++)n=r[t],e.push(n.validate());return[4,Promise.all(e)];case 1:return[2,o.sent().every(function(e){return e})]}})})},Object.defineProperty(e.prototype,"addMode",{get:function(){return this.parent.addMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.accessors.every(function(e){return e.isValid})},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var e=this,t=0;this.state.getValue(this.path).forEach(function(){e.createFormIndexedAccessor(t),t++})},e.prototype.createFormIndexedAccessor=function(e){var t=new m(this.state,this.repeatingForm.definition,this,e);this.repeatingFormIndexedAccessors.set(e,t),t.initialize()},e.prototype.index=function(e){var t=this.repeatingFormIndexedAccessors.get(e);if(null==t)throw new Error(e+" is not a RepeatingFormIndexedAccessor");return t},Object.defineProperty(e.prototype,"disabled",{get:function(){return this.state.isRepeatingFormDisabledFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){for(var e=[],t=0;t<this.length;t++)e.push(this.index(t));return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){var e=[];return this.accessors.forEach(function(t){e.push.apply(e,t.flatAccessors)}),e},enumerable:!0,configurable:!0}),e.prototype.accessBySteps=function(e){var t=e[0],r=e.slice(1),n=parseInt(t,10);if(isNaN(n))throw new Error("Expected index of repeating form");return this.index(n).accessBySteps(r)},Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),e.prototype.insert=function(e,t){var r=this.path+"/"+e;Object(c.applyPatch)(this.state.node,[{op:"add",path:r,value:t}])},e.prototype.push=function(e){var t=Object(c.resolvePath)(this.state.node,this.path),r=this.path+"/"+t.length;Object(c.applyPatch)(this.state.node,[{op:"add",path:r,value:e}])},e.prototype.remove=function(e){var t=Object(c.resolvePath)(this.state.node,this.path).indexOf(e);if(-1===t)throw new Error("Cannot find node to remove.");Object(c.applyPatch)(this.state.node,[{op:"remove",path:this.path+"/"+t}])},e.prototype.removeIndex=function(e){var t=this.repeatingFormIndexedAccessors;if(t.delete(e)){var r=[],n=[];t.forEach(function(t,o){o<=e||(t.setIndex(o-1),r.push(o),n.push(t))}),this.executeRenumber(r,n)}},e.prototype.addIndex=function(e){var t=[],r=[];this.repeatingFormIndexedAccessors.forEach(function(n,o){o<e||(n.setIndex(o+1),t.push(o),r.push(n))}),this.executeRenumber(t,r),this.createFormIndexedAccessor(e)},e.prototype.executeRenumber=function(e,t){var r=this.repeatingFormIndexedAccessors;e.forEach(function(e){r.delete(e)}),t.forEach(function(e){r.set(e.index,e)})},Object.defineProperty(e.prototype,"length",{get:function(){return Object(c.resolvePath)(this.state.node,this.path).length},enumerable:!0,configurable:!0}),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Map)],e.prototype,"repeatingFormIndexedAccessors",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"disabled",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),e}(),m=function(){function e(e,t,r,n){this.state=e,this.definition=t,this.parent=r,this._addMode=!1,this.index=n,this.formAccessor=new g(e,t,this,!1)}return e.prototype.initialize=function(){this.formAccessor.initialize()},e.prototype.clear=function(){return this.formAccessor.flatAccessors.forEach(function(e){e.clear()}),this.parent.removeIndex(this.index)},e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){return[2,this.formAccessor.validate()]})})},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.index},enumerable:!0,configurable:!0}),e.prototype.setIndex=function(e){this.index=e},e.prototype.setError=function(e){this._error=e},e.prototype.setAddMode=function(){this._addMode=!0},e.prototype.clearError=function(){this._error=void 0},Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return this._addMode||this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.accessBySteps=function(e){return 0===e.length?this:this.formAccessor.accessBySteps(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Number)],e.prototype,"index",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[Number]),l("design:returntype",void 0)],e.prototype,"setIndex",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"setAddMode",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),e}(),w=function(){function e(e,t,r,n){this.state=e,this.definition=t,this.parent=r,this.name=n,this.name=n,this.formAccessor=new g(e,t,this,!1)}return e.prototype.initialize=function(){this.formAccessor.initialize()},e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){return[2,this.formAccessor.validate()]})})},e.prototype.setError=function(e){},e.prototype.clearError=function(){},e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.accessBySteps=function(e){return 0===e.length?this:this.formAccessor.accessBySteps(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),e}();function F(e){return e}function O(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/")}function j(e){return Number.isInteger(parseInt(e,10))}function A(e,t){return function e(t,r){var n=r[0],o=r.slice(1);if(0===o.length)return t[n];var i=t[n];if(void 0===i)return;return e(i,o)}(e,O(t))}function P(e,t){return function e(t,r){var n=r[0],o=r.slice(1);0===o.length&&delete t[n];var i=t[n];if(void 0===i)return;e(i,o)}(e,O(t))}var x=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},E=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},S=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},_=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},B=function(){function e(e,t,r){var n=this;this.form=e,this.node=t,this.saveStatus="before",this.additionalErrorTree={},this.noRawUpdate=!1,Object(c.onPatch)(t,function(e){"remove"===e.op?n.removePath(e.path):"add"===e.op?n.addPath(e.path):"replace"===e.op&&n.replacePath(e.path)});var o=null!=r&&r.addMode||!1;if(this.formAccessor=new g(this,this.form.definition,null,o),this.formAccessor.initialize(),null==r)this.saveFunc=M,this.isDisabledFunc=function(){return!1},this.isHiddenFunc=function(){return!1},this.isReadOnlyFunc=function(){return!1},this.isRepeatingFormDisabledFunc=function(){return!1},this.extraValidationFunc=function(){return!1},this.validationBeforeSave="immediate",this.validationAfterSave="immediate",this.validationPauseDuration=0,this.focusFunc=null;else{this.saveFunc=r.save?r.save:M,this.isDisabledFunc=r.isDisabled?r.isDisabled:function(){return!1},this.isHiddenFunc=r.isHidden?r.isHidden:function(){return!1},this.isReadOnlyFunc=r.isReadOnly?r.isReadOnly:function(){return!1},this.isRepeatingFormDisabledFunc=r.isRepeatingFormDisabled?r.isRepeatingFormDisabled:function(){return!1},this.extraValidationFunc=r.extraValidation?r.extraValidation:function(){return!1};var i=r.validation||{};this.validationBeforeSave=i.beforeSave||"immediate",this.validationAfterSave=i.afterSave||"immediate",this.validationPauseDuration=i.pauseDuration||0,this.focusFunc=r.focus?r.focus:null}}return e.prototype.setSaveStatus=function(e){this.saveStatus=e},e.prototype.setValueWithoutRawUpdate=function(e,t){this.noRawUpdate=!0,Object(c.applyPatch)(this.node,[{op:"replace",path:e,value:t}]),this.noRawUpdate=!1},e.prototype.replacePath=function(e){if(!this.noRawUpdate){var t=this.accessByPath(e);void 0!==t&&t instanceof b&&t.setRawFromValue()}},e.prototype.removePath=function(e){var t;try{t=this.accessByPath(e)}catch(e){return}void 0!==t&&t instanceof m&&t.clear()},e.prototype.addPath=function(e){var t=O(e);if(0!==t.length){var r=parseInt(t[t.length-1],10);if(!isNaN(r)){var n=this.accessByPath(function(e){var t=e.join("/");return t.startsWith("/")?t:"/"+t}(t.slice(0,t.length-1)));if(void 0!==n&&n instanceof v){n.addIndex(r);var o=this.accessByPath(e);void 0!==o&&o instanceof m&&o.setAddMode()}}}},e.prototype.validate=function(){return S(this,void 0,void 0,function(){return _(this,function(e){return[2,this.formAccessor.validate()]})})},Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),e.prototype.save=function(){return S(this,void 0,void 0,function(){var e,t;return _(this,function(r){switch(r.label){case 0:return[4,this.validate()];case 1:return e=r.sent(),this.setSaveStatus("rightAfter"),e?[4,this.saveFunc(this.node)]:[2,!1];case 2:return null!=(t=r.sent())?(this.setErrors(t),[2,!1]):(this.clearErrors(),[2,!0])}})})},e.prototype.setErrors=function(e){var t=function(e){return JSON.parse(JSON.stringify(e))}(e);this.flatAccessors.map(function(r){var n=A(e,r.path);null!=n&&(r.setError(n),P(t,r.path))}),this.additionalErrorTree=t},e.prototype.clearErrors=function(){this.additionalErrorTree={},this.flatAccessors.map(function(e){e.clearError()})},e.prototype.getValue=function(e){return Object(c.resolvePath)(this.node,e)},e.prototype.getMstType=function(e){for(var t=O(e),r=this.form.model,n=0,o=t;n<o.length;n++){var i=o[n];j(i)?r=r.getChildType(i):r=r.getChildType(i)}return r},Object.defineProperty(e.prototype,"isValidating",{get:function(){return this.flatAccessors.some(function(e){return e instanceof b&&e.isValidating})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),e.prototype.accessByPath=function(e){var t=O(e);return this.accessBySteps(t)},e.prototype.accessBySteps=function(e){return this.formAccessor.accessBySteps(e)},e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},e.prototype.subForm=function(e){return this.formAccessor.subForm(e)},e.prototype.repeatingField=function(e){},e.prototype.additionalError=function(e){var t=this.additionalErrorTree[e];if("string"==typeof t)return t},Object.defineProperty(e.prototype,"additionalErrors",{get:function(){var e=this,t=[];return Object.keys(this.additionalErrorTree).forEach(function(r){var n=e.additionalErrorTree[r];"string"==typeof n&&t.push(n)}),t.sort(),t},enumerable:!0,configurable:!0}),x([u.observable,E("design:type",Object)],e.prototype,"additionalErrorTree",void 0),x([u.observable,E("design:type",String)],e.prototype,"saveStatus",void 0),x([u.action,E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",void 0)],e.prototype,"setSaveStatus",null),x([u.action,E("design:type",Function),E("design:paramtypes",[String,Object]),E("design:returntype",void 0)],e.prototype,"setValueWithoutRawUpdate",null),x([u.action,E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",void 0)],e.prototype,"replacePath",null),x([u.action,E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",void 0)],e.prototype,"removePath",null),x([u.action,E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",void 0)],e.prototype,"addPath",null),x([u.computed,E("design:type",Boolean),E("design:paramtypes",[])],e.prototype,"isValid",null),x([u.action,E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Promise)],e.prototype,"save",null),x([u.action,E("design:type",Function),E("design:paramtypes",[Object]),E("design:returntype",void 0)],e.prototype,"setErrors",null),x([u.action,E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",void 0)],e.prototype,"clearErrors",null),x([u.computed,E("design:type",Boolean),E("design:paramtypes",[])],e.prototype,"isValidating",null),x([u.computed,E("design:type",Array),E("design:paramtypes",[])],e.prototype,"accessors",null),x([u.computed,E("design:type",Array),E("design:paramtypes",[])],e.prototype,"flatAccessors",null),x([u.computed,E("design:type",Array),E("design:paramtypes",[])],e.prototype,"additionalErrors",null),e}();function M(){return S(this,void 0,void 0,function(){return _(this,function(e){return console.warn("No mstform save function configured"),[2,null]})})}var C=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},k=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},I=function(){function e(e,t){this.model=e,this.definition=t}return Object.defineProperty(e.prototype,"FormStateType",{get:function(){throw new Error("For introspection")},enumerable:!0,configurable:!0}),e.prototype.state=function(e,t){return new B(this,e,t)},e}(),D=function(){return function(e){this.definition=e}}(),T=function(){return function(e){this.message=e}}(),q=function(){return function(e){this.value=e}}(),N=function(){function e(e,t){if(this.converter=e,this.options=t,t){if(this.rawValidators=t.rawValidators?t.rawValidators:[],this.validators=t.validators?t.validators:[],this.conversionError=t.conversionError||"Could not convert",this.requiredError=t.requiredError||"Required",this.required=t.required||!1,t.fromEvent){if(t.getRaw)throw new Error("Cannot have fromEvent and getRaw defined at same time");this.getRaw=function(e){return e.target.value}}else this.getRaw=t.getRaw||F;this.derivedFunc=t.derived,this.changeFunc=t.change,this.controlled=t.controlled||this.createDefaultControlled()}else this.rawValidators=[],this.validators=[],this.conversionError="Could not convert",this.requiredError="Required",this.required=!1,this.getRaw=F,this.controlled=this.createDefaultControlled()}return e.prototype.createDefaultControlled=function(){var e=this;return this.getRaw!==F?function(t){return{value:t.raw,onChange:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.setRaw(e.getRaw.apply(e,r))}}}:this.converter.defaultControlled},Object.defineProperty(e.prototype,"RawType",{get:function(){throw new Error("This is a function to enable type introspection")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ValueType",{get:function(){throw new Error("This is a function to enable type introspection")},enumerable:!0,configurable:!0}),e.prototype.process=function(e){return C(this,void 0,void 0,function(){var t,r,n,o,i,s;return k(this,function(a){switch(a.label){case 0:if(e===this.converter.emptyRaw&&this.required)return[2,new T(this.requiredError)];t=0,r=this.rawValidators,a.label=1;case 1:return t<r.length?[4,(0,r[t])(e)]:[3,4];case 2:if("string"==typeof(s=a.sent())&&s)return[2,new T(s)];a.label=3;case 3:return t++,[3,1];case 4:return[4,this.converter.convert(e)];case 5:if("ConversionError"===(n=a.sent()))return e===this.converter.emptyRaw?[2,new T(this.requiredError)]:[2,new T(this.conversionError)];o=0,i=this.validators,a.label=6;case 6:return o<i.length?[4,(0,i[o])(n.value)]:[3,9];case 7:if("string"==typeof(s=a.sent())&&s)return[2,new T(s)];a.label=8;case 8:return o++,[3,6];case 9:return[2,new q(n.value)]}})})},e.prototype.render=function(e){return this.converter.render(e)},e}(),z=function(){return function(e){this.definition=e}}(),U=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},G=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},H=new RegExp("^-?(0|[1-9]\\d*)(\\.\\d*)?$"),J=new RegExp("^-?(0|[1-9]\\d*)$"),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultControlled=n.value,t}return U(t,e),t}(a),K=new $({emptyRaw:"",convert:function(e){return e},render:function(e){return e}}),L=new $({emptyRaw:"",rawValidate:function(e){return e.startsWith(".")&&(e="0"+e),H.test(e)},convert:function(e){return+e},render:function(e){return e.toString()}}),Q=new $({emptyRaw:"",rawValidate:function(e){return J.test(e)},convert:function(e){return+e},render:function(e){return e.toString()}}),X=new a({emptyRaw:!1,convert:function(e){return e},render:function(e){return e},defaultControlled:n.checked}),Y=function(){function e(e,t){this.maxWholeDigits=e,this.decimalPlaces=t,this.defaultControlled=n.value,this.emptyRaw="";var r=new RegExp("^-?(0|[1-9]\\d{0,"+(e-1)+"})(\\.\\d{0,"+t+"})?$");this.converter=new $({emptyRaw:"",rawValidate:function(e){return e.startsWith(".")&&(e="0"+e),r.test(e)},convert:function(e){return e},render:function(e){return e}})}return e.prototype.convert=function(e){return this.converter.convert(e)},e.prototype.render=function(e){return this.converter.render(e)},e.prototype.getRaw=function(e){return e},e}();var Z=new a({emptyRaw:[],convert:function(e){return u.observable.array(e)},render:function(e){return e.slice()}});var ee=function(){function e(e){this.converter=e,this.defaultControlled=n.value,this.emptyRaw=""}return e.prototype.convert=function(e){return W(this,void 0,void 0,function(){return G(this,function(t){return""===e.trim()?[2,new s(null)]:[2,this.converter.convert(e)]})})},e.prototype.render=function(e){return null===e?"":this.converter.render(e)},e}(),te=function(){function e(e){this.emptyRaw=null,this.defaultControlled=n.object}return e.prototype.convert=function(e){return W(this,void 0,void 0,function(){return G(this,function(t){return null===e?[2,"ConversionError"]:[2,new s(e)]})})},e.prototype.render=function(e){return e},e}();var re={string:K,number:L,integer:Q,decimal:function(e,t){return new Y(e,t)},boolean:X,stringArray:Z,maybe:function(e){return e instanceof $?new ee(e):new a({emptyRaw:null,convert:F,render:F,defaultControlled:n.object})},model:function(e){return new te(e)},object:new a({emptyRaw:null,convert:F,render:F})};var ne={validationProps:function(e){var t=e.error,r=e.isValidating;return t?{validateStatus:r?"validating":"error",help:t}:{validateStatus:r?"validating":""}}};r.d(t,"Form",function(){return I}),r.d(t,"SubForm",function(){return D}),r.d(t,"ValidationMessage",function(){return T}),r.d(t,"ProcessValue",function(){return q}),r.d(t,"Field",function(){return N}),r.d(t,"RepeatingForm",function(){return z}),r.d(t,"ConversionValue",function(){return s}),r.d(t,"CONVERSION_ERROR",function(){return"ConversionError"}),r.d(t,"Converter",function(){return a}),r.d(t,"StringConverter",function(){return $}),r.d(t,"converters",function(){return re}),r.d(t,"setupValidationProps",function(){return y}),r.d(t,"FormAccessor",function(){return g}),r.d(t,"FieldAccessor",function(){return b}),r.d(t,"RepeatingFormAccessor",function(){return v}),r.d(t,"RepeatingFormIndexedAccessor",function(){return m}),r.d(t,"SubFormAccessor",function(){return w}),r.d(t,"controlled",function(){return n}),r.d(t,"antd",function(){return ne}),r.d(t,"FormState",function(){return B})}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("mobx"),require("mobx-state-tree")):"function"==typeof define&&define.amd?define(["mobx","mobx-state-tree"],t):"object"==typeof exports?exports.mstform=t(require("mobx"),require("mobx-state-tree")):e.mstform=t(e.mobx,e["mobx-state-tree"])}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";r.r(t);var n={value:function(e){return{value:e.raw,onChange:function(t){return e.setRaw(t.target.value)}}},checked:function(e){return{checked:e.raw,onChange:function(t){return e.setRaw(t.target.checked)}}},object:function(e){return{value:e.raw,onChange:function(t){return e.setRaw(t)}}}},o=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},i=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=function(){return function(e){this.value=e}}(),a=function(){function e(e){this.definition=e,this.emptyRaw=e.emptyRaw,this.defaultControlled=e.defaultControlled?e.defaultControlled:n.object}return e.prototype.convert=function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return this.definition.rawValidate?[4,this.definition.rawValidate(e)]:[3,2];case 1:if(!r.sent())return[2,"ConversionError"];r.label=2;case 2:return t=this.definition.convert(e),this.definition.validate?[4,this.definition.validate(t)]:[3,4];case 3:if(!r.sent())return[2,"ConversionError"];r.label=4;case 4:return[2,new s(t)]}})})},e.prototype.render=function(e){return this.definition.render(e)},e}(),u=r(0),c=r(1),p=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},f=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},h=function(){return{}};function y(e){h=e}var g=function(){function e(e,t,r,n,o){this.state=e,this.definition=t,this.parent=r,this.allowedKeys=o,this.fieldAccessors=u.observable.map(),this.repeatingFormAccessors=u.observable.map(),this.subFormAccessors=u.observable.map(),this.keys=null!=o?o:Object.keys(this.definition),this._addMode=n,this.initialize()}return e.prototype.validate=function(){return d(this,void 0,void 0,function(){var e;return f(this,function(t){switch(t.label){case 0:return e=this.accessors.map(function(e){return e.validate()}),[4,Promise.all(e)];case 1:return[2,t.sent().every(function(e){return e})]}})})},e.prototype.setError=function(e){},e.prototype.clearError=function(){},e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return null==this.parent?"":this.parent.path},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.accessors.every(function(e){return e.isValid})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){var e=this,t=[];return this.keys.forEach(function(r){var n=e.definition[r];n instanceof N?t.push(e.field(r)):n instanceof z?t.push(e.repeatingForm(r)):n instanceof D&&t.push(e.subForm(r))}),t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){var e=[];return this.accessors.forEach(function(t){t instanceof b?e.push(t):t instanceof v?(e.push.apply(e,t.flatAccessors),e.push(t)):t instanceof w&&(e.push.apply(e,t.flatAccessors),e.push(t))}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return!!this._addMode||null!=this.parent&&this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){if(this.keys.includes(e))try{return this.field(e)}catch(t){try{return this.repeatingForm(e)}catch(t){try{return this.subForm(e)}catch(e){return}}}},e.prototype.accessBySteps=function(e){if(0===e.length)return this;var t=e[0],r=e.slice(1),n=this.access(t);return 0===r.length?n:void 0===n?n:n.accessBySteps(r)},e.prototype.initialize=function(){var e=this;this.keys.forEach(function(t){var r=e.definition[t];r instanceof N?e.createField(t,r):r instanceof z?e.createRepeatingForm(t,r):r instanceof D&&e.createSubForm(t,r)})},e.prototype.createField=function(e,t){var r=new b(this.state,t,this,e);this.fieldAccessors.set(e,r)},e.prototype.field=function(e){var t=this.fieldAccessors.get(e);if(null==t)throw new Error(e+" is not a Field");return t},e.prototype.createRepeatingForm=function(e,t){var r=new v(this.state,t,this,e);this.repeatingFormAccessors.set(e,r),r.initialize()},e.prototype.repeatingForm=function(e){var t=this.repeatingFormAccessors.get(e);if(null==t)throw new Error(e+" is not a RepeatingForm");return t},e.prototype.createSubForm=function(e,t){var r=new w(this.state,t.definition,this,e);this.subFormAccessors.set(e,r),r.initialize()},e.prototype.subForm=function(e){var t=this.subFormAccessors.get(e);if(null==t)throw new Error(e+" is not a SubForm");return t},e.prototype.repeatingField=function(e){},p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),e}(),b=function(){function e(e,t,r,n){var o=this;this.state=e,this.field=t,this.parent=r,this._isValidating=!1,this._addMode=!1,this.handleChange=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d(o,void 0,void 0,function(){var t,r;return f(this,function(n){switch(n.label){case 0:return r=(t=this.field).getRaw.apply(t,e),[4,this.setRaw(r)];case 1:return n.sent(),[2]}})})},this.handleFocus=function(e){null!=o.state.focusFunc&&o.state.focusFunc(e,o)},this.name=n,this.createDerivedReaction()}var t,r,n;return e.prototype.clear=function(){null!=this._disposer&&this._disposer()},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),e.prototype.setDisposer=function(e){this._disposer=e},e.prototype.createDerivedReaction=function(){var e=this,t=this.field.derivedFunc;if(null!=t&&null==this._disposer){var r=Object(u.reaction)(function(){return e.node?t(e.node):void 0},function(t){void 0!==t&&e.setRaw(e.field.render(t))});this._disposer=r}},Object.defineProperty(e.prototype,"node",{get:function(){try{return this.state.getValue(this.parent.path)}catch(e){return}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return void 0===this._raw&&(this._addMode||this.parent.addMode)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raw",{get:function(){var e=this._raw;return void 0!==e?!Object(u.isObservable)(e)||e instanceof Array?Object(u.toJS)(e):e:this.addMode?this.field.converter.emptyRaw:this.field.render(this.value)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){if(this.addMode)throw new Error("Cannot access field in add mode until it has been set once");return this.state.getValue(this.path)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorValue",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canShowValidationMessages",{get:function(){if("rightAfter"===this.state.saveStatus)return!0;var e="before"===this.state.saveStatus?this.state.validationBeforeSave:this.state.validationAfterSave;return"immediate"===e||"no"!==e&&("blur"!==e&&"pause"!==e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this.canShowValidationMessages?this.errorValue:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValidating",{get:function(){return this._isValidating},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.state.isDisabledFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this.state.isHiddenFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readOnly",{get:function(){return this.state.isReadOnlyFunc(this)},enumerable:!0,configurable:!0}),e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.setRaw(this.raw)];case 1:return e.sent(),[2,this.isValid]}})})},Object.defineProperty(e.prototype,"isValid",{get:function(){return void 0===this.errorValue},enumerable:!0,configurable:!0}),e.prototype.setRaw=function(e){return d(this,void 0,void 0,function(){var t,r,n,o;return f(this,function(i){switch(i.label){case 0:"rightAfter"===this.state.saveStatus&&this.state.setSaveStatus("after"),this._raw=e,this.setValidating(!0),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.field.process(e)];case 2:return t=i.sent(),[3,4];case 3:return i.sent(),this.setError("Something went wrong"),this.setValidating(!1),[2];case 4:if(r=this._raw,!u.comparer.structural(r,e))return[2];if(this.setValidating(!1),t instanceof T)return this.setError(t.message),[2];if(this.clearError(),!(t instanceof q))throw new Error("Unknown process result");return"string"==typeof(n=this.state.extraValidationFunc(this,t.value))&&n&&this.setError(n),u.comparer.structural(this.value,t.value)?[2]:(this.state.setValueWithoutRawUpdate(this.path,t.value),null!=(o=this.field.changeFunc)&&o(this.node,t.value),[2])}})})},e.prototype.setRawFromValue=function(){var e=this.state.getValue(this.path);this._raw=this.field.render(e),this.validate()},e.prototype.setError=function(e){this._error=e},e.prototype.clearError=function(){this._error=void 0},e.prototype.setValidating=function(e){this._isValidating=e},Object.defineProperty(e.prototype,"inputProps",{get:function(){var e=this.field.controlled(this);return e.disabled=this.disabled,this.readOnly&&(e.readOnly=this.readOnly),null!=this.state.focusFunc&&(e.onFocus=this.handleFocus),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validationProps",{get:function(){return h(this)},enumerable:!0,configurable:!0}),e.prototype.accessBySteps=function(e){throw new Error("Cannot step through field accessor")},p([u.observable,l("design:type",Object)],e.prototype,"_raw",void 0),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_isValidating",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[Function]),l("design:returntype",void 0)],e.prototype,"setDisposer",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"node",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type","function"==typeof(t="undefined"!=typeof R&&R)&&t||Object),l("design:paramtypes",[])],e.prototype,"raw",null),p([u.computed,l("design:type","function"==typeof(r="undefined"!=typeof V&&V)&&r||Object),l("design:paramtypes",[])],e.prototype,"value",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"errorValue",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"canShowValidationMessages",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValidating",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"disabled",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"hidden",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"readOnly",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.action,l("design:type",Function),l("design:paramtypes",["function"==typeof(n="undefined"!=typeof R&&R)&&n||Object]),l("design:returntype",Promise)],e.prototype,"setRaw",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[Boolean]),l("design:returntype",void 0)],e.prototype,"setValidating",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"inputProps",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"validationProps",null),e}(),v=function(){function e(e,t,r,n){this.state=e,this.repeatingForm=t,this.parent=r,this.repeatingFormIndexedAccessors=u.observable.map(),this.name=n}return e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),e.prototype.setError=function(e){this._error=e},e.prototype.clearError=function(){this._error=void 0},e.prototype.validate=function(){return d(this,void 0,void 0,function(){var e,t,r,n;return f(this,function(o){switch(o.label){case 0:for(e=[],t=0,r=this.accessors;t<r.length;t++)n=r[t],e.push(n.validate());return[4,Promise.all(e)];case 1:return[2,o.sent().every(function(e){return e})]}})})},Object.defineProperty(e.prototype,"addMode",{get:function(){return this.parent.addMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.accessors.every(function(e){return e.isValid})},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var e=this,t=0;this.state.getValue(this.path).forEach(function(){e.createFormIndexedAccessor(t),t++})},e.prototype.createFormIndexedAccessor=function(e){var t=new m(this.state,this.repeatingForm.definition,this,e);this.repeatingFormIndexedAccessors.set(e,t),t.initialize()},e.prototype.index=function(e){var t=this.repeatingFormIndexedAccessors.get(e);if(null==t)throw new Error(e+" is not a RepeatingFormIndexedAccessor");return t},Object.defineProperty(e.prototype,"disabled",{get:function(){return this.state.isRepeatingFormDisabledFunc(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){for(var e=[],t=0;t<this.length;t++)e.push(this.index(t));return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){var e=[];return this.accessors.forEach(function(t){e.push.apply(e,t.flatAccessors)}),e},enumerable:!0,configurable:!0}),e.prototype.accessBySteps=function(e){var t=e[0],r=e.slice(1),n=parseInt(t,10);if(isNaN(n))throw new Error("Expected index of repeating form");return this.index(n).accessBySteps(r)},Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),e.prototype.insert=function(e,t){var r=this.path+"/"+e;Object(c.applyPatch)(this.state.node,[{op:"add",path:r,value:t}])},e.prototype.push=function(e){var t=Object(c.resolvePath)(this.state.node,this.path),r=this.path+"/"+t.length;Object(c.applyPatch)(this.state.node,[{op:"add",path:r,value:e}])},e.prototype.remove=function(e){var t=Object(c.resolvePath)(this.state.node,this.path).indexOf(e);if(-1===t)throw new Error("Cannot find node to remove.");Object(c.applyPatch)(this.state.node,[{op:"remove",path:this.path+"/"+t}])},e.prototype.removeIndex=function(e){var t=this.repeatingFormIndexedAccessors;if(t.delete(e)){var r=[],n=[];t.forEach(function(t,o){o<=e||(t.setIndex(o-1),r.push(o),n.push(t))}),this.executeRenumber(r,n)}},e.prototype.addIndex=function(e){var t=[],r=[];this.repeatingFormIndexedAccessors.forEach(function(n,o){o<e||(n.setIndex(o+1),t.push(o),r.push(n))}),this.executeRenumber(t,r),this.createFormIndexedAccessor(e)},e.prototype.executeRenumber=function(e,t){var r=this.repeatingFormIndexedAccessors;e.forEach(function(e){r.delete(e)}),t.forEach(function(e){r.set(e.index,e)})},Object.defineProperty(e.prototype,"length",{get:function(){return Object(c.resolvePath)(this.state.node,this.path).length},enumerable:!0,configurable:!0}),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Map)],e.prototype,"repeatingFormIndexedAccessors",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"disabled",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),e}(),m=function(){function e(e,t,r,n){this.state=e,this.definition=t,this.parent=r,this._addMode=!1,this.index=n,this.formAccessor=new g(e,t,this,!1)}return e.prototype.initialize=function(){this.formAccessor.initialize()},e.prototype.clear=function(){return this.formAccessor.flatAccessors.forEach(function(e){e.clear()}),this.parent.removeIndex(this.index)},e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){return[2,this.formAccessor.validate()]})})},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.index},enumerable:!0,configurable:!0}),e.prototype.setIndex=function(e){this.index=e},e.prototype.setError=function(e){this._error=e},e.prototype.setAddMode=function(){this._addMode=!0},e.prototype.clearError=function(){this._error=void 0},Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return this._addMode||this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.accessBySteps=function(e){return 0===e.length?this:this.formAccessor.accessBySteps(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),p([u.observable,l("design:type",Object)],e.prototype,"_error",void 0),p([u.observable,l("design:type",Number)],e.prototype,"index",void 0),p([u.observable,l("design:type",Boolean)],e.prototype,"_addMode",void 0),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.action,l("design:type",Function),l("design:paramtypes",[Number]),l("design:returntype",void 0)],e.prototype,"setIndex",null),p([u.action,l("design:type",Function),l("design:paramtypes",[String]),l("design:returntype",void 0)],e.prototype,"setError",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"setAddMode",null),p([u.action,l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],e.prototype,"clearError",null),p([u.computed,l("design:type",Object),l("design:paramtypes",[])],e.prototype,"error",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),e}(),w=function(){function e(e,t,r,n){this.state=e,this.definition=t,this.parent=r,this.name=n,this.name=n,this.formAccessor=new g(e,t,this,!1)}return e.prototype.initialize=function(){this.formAccessor.initialize()},e.prototype.validate=function(){return d(this,void 0,void 0,function(){return f(this,function(e){return[2,this.formAccessor.validate()]})})},e.prototype.setError=function(e){},e.prototype.clearError=function(){},e.prototype.clear=function(){},Object.defineProperty(e.prototype,"path",{get:function(){return this.parent.path+"/"+this.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addMode",{get:function(){return this.parent.addMode},enumerable:!0,configurable:!0}),e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.accessBySteps=function(e){return 0===e.length?this:this.formAccessor.accessBySteps(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),p([u.computed,l("design:type",String),l("design:paramtypes",[])],e.prototype,"path",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"isValid",null),p([u.computed,l("design:type",Boolean),l("design:paramtypes",[])],e.prototype,"addMode",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"accessors",null),p([u.computed,l("design:type",Array),l("design:paramtypes",[])],e.prototype,"flatAccessors",null),e}();function F(e){return e}function O(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/")}function j(e){return Number.isInteger(parseInt(e,10))}function A(e,t){return function e(t,r){var n=r[0],o=r.slice(1);if(0===o.length)return t[n];var i=t[n];if(void 0===i)return;return e(i,o)}(e,O(t))}function P(e,t){return function e(t,r){var n=r[0],o=r.slice(1);0===o.length&&delete t[n];var i=t[n];if(void 0===i)return;e(i,o)}(e,O(t))}var E=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},x=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},S=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},_=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},B=function(){function e(e,t,r){var n=this;this.form=e,this.node=t,this.saveStatus="before",this.additionalErrorTree={},this.noRawUpdate=!1,Object(c.onPatch)(t,function(e){"remove"===e.op?n.removePath(e.path):"add"===e.op?n.addPath(e.path):"replace"===e.op&&n.replacePath(e.path)});var o=null!=r&&r.addMode||!1;if(this.formAccessor=new g(this,this.form.definition,null,o),this.formAccessor.initialize(),null==r)this.saveFunc=M,this.isDisabledFunc=function(){return!1},this.isHiddenFunc=function(){return!1},this.isReadOnlyFunc=function(){return!1},this.isRepeatingFormDisabledFunc=function(){return!1},this.extraValidationFunc=function(){return!1},this.validationBeforeSave="immediate",this.validationAfterSave="immediate",this.validationPauseDuration=0,this.focusFunc=null;else{this.saveFunc=r.save?r.save:M,this.isDisabledFunc=r.isDisabled?r.isDisabled:function(){return!1},this.isHiddenFunc=r.isHidden?r.isHidden:function(){return!1},this.isReadOnlyFunc=r.isReadOnly?r.isReadOnly:function(){return!1},this.isRepeatingFormDisabledFunc=r.isRepeatingFormDisabled?r.isRepeatingFormDisabled:function(){return!1},this.extraValidationFunc=r.extraValidation?r.extraValidation:function(){return!1};var i=r.validation||{};this.validationBeforeSave=i.beforeSave||"immediate",this.validationAfterSave=i.afterSave||"immediate",this.validationPauseDuration=i.pauseDuration||0,this.focusFunc=r.focus?r.focus:null}}return e.prototype.setSaveStatus=function(e){this.saveStatus=e},e.prototype.setValueWithoutRawUpdate=function(e,t){this.noRawUpdate=!0,Object(c.applyPatch)(this.node,[{op:"replace",path:e,value:t}]),this.noRawUpdate=!1},e.prototype.replacePath=function(e){if(!this.noRawUpdate){var t=this.accessByPath(e);void 0!==t&&t instanceof b&&t.setRawFromValue()}},e.prototype.removePath=function(e){var t;try{t=this.accessByPath(e)}catch(e){return}void 0!==t&&t instanceof m&&t.clear()},e.prototype.addPath=function(e){var t=O(e);if(0!==t.length){var r=parseInt(t[t.length-1],10);if(!isNaN(r)){var n=this.accessByPath(function(e){var t=e.join("/");return t.startsWith("/")?t:"/"+t}(t.slice(0,t.length-1)));if(void 0!==n&&n instanceof v){n.addIndex(r);var o=this.accessByPath(e);void 0!==o&&o instanceof m&&o.setAddMode()}}}},e.prototype.validate=function(){return S(this,void 0,void 0,function(){return _(this,function(e){return[2,this.formAccessor.validate()]})})},Object.defineProperty(e.prototype,"isValid",{get:function(){return this.formAccessor.isValid},enumerable:!0,configurable:!0}),e.prototype.save=function(){return S(this,void 0,void 0,function(){var e,t;return _(this,function(r){switch(r.label){case 0:return[4,this.validate()];case 1:return e=r.sent(),this.setSaveStatus("rightAfter"),e?[4,this.saveFunc(this.node)]:[2,!1];case 2:return null!=(t=r.sent())?(this.setErrors(t),[2,!1]):(this.clearErrors(),[2,!0])}})})},e.prototype.setErrors=function(e){var t=function(e){return JSON.parse(JSON.stringify(e))}(e);this.flatAccessors.map(function(r){var n=A(e,r.path);null!=n&&(r.setError(n),P(t,r.path))}),this.additionalErrorTree=t},e.prototype.clearErrors=function(){this.additionalErrorTree={},this.flatAccessors.map(function(e){e.clearError()})},e.prototype.getValue=function(e){return Object(c.resolvePath)(this.node,e)},e.prototype.getMstType=function(e){for(var t=O(e),r=this.form.model,n=0,o=t;n<o.length;n++){var i=o[n];j(i)?r=r.getChildType(i):r=r.getChildType(i)}return r},Object.defineProperty(e.prototype,"isValidating",{get:function(){return this.flatAccessors.some(function(e){return e instanceof b&&e.isValidating})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessors",{get:function(){return this.formAccessor.accessors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flatAccessors",{get:function(){return this.formAccessor.flatAccessors},enumerable:!0,configurable:!0}),e.prototype.accessByPath=function(e){var t=O(e);return this.accessBySteps(t)},e.prototype.accessBySteps=function(e){return this.formAccessor.accessBySteps(e)},e.prototype.access=function(e){return this.formAccessor.access(e)},e.prototype.field=function(e){return this.formAccessor.field(e)},e.prototype.repeatingForm=function(e){return this.formAccessor.repeatingForm(e)},e.prototype.subForm=function(e){return this.formAccessor.subForm(e)},e.prototype.repeatingField=function(e){},e.prototype.additionalError=function(e){var t=this.additionalErrorTree[e];if("string"==typeof t)return t},Object.defineProperty(e.prototype,"additionalErrors",{get:function(){var e=this,t=[];return Object.keys(this.additionalErrorTree).forEach(function(r){var n=e.additionalErrorTree[r];"string"==typeof n&&t.push(n)}),t.sort(),t},enumerable:!0,configurable:!0}),E([u.observable,x("design:type",Object)],e.prototype,"additionalErrorTree",void 0),E([u.observable,x("design:type",String)],e.prototype,"saveStatus",void 0),E([u.action,x("design:type",Function),x("design:paramtypes",[String]),x("design:returntype",void 0)],e.prototype,"setSaveStatus",null),E([u.action,x("design:type",Function),x("design:paramtypes",[String,Object]),x("design:returntype",void 0)],e.prototype,"setValueWithoutRawUpdate",null),E([u.action,x("design:type",Function),x("design:paramtypes",[String]),x("design:returntype",void 0)],e.prototype,"replacePath",null),E([u.action,x("design:type",Function),x("design:paramtypes",[String]),x("design:returntype",void 0)],e.prototype,"removePath",null),E([u.action,x("design:type",Function),x("design:paramtypes",[String]),x("design:returntype",void 0)],e.prototype,"addPath",null),E([u.computed,x("design:type",Boolean),x("design:paramtypes",[])],e.prototype,"isValid",null),E([u.action,x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",Promise)],e.prototype,"save",null),E([u.action,x("design:type",Function),x("design:paramtypes",[Object]),x("design:returntype",void 0)],e.prototype,"setErrors",null),E([u.action,x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",void 0)],e.prototype,"clearErrors",null),E([u.computed,x("design:type",Boolean),x("design:paramtypes",[])],e.prototype,"isValidating",null),E([u.computed,x("design:type",Array),x("design:paramtypes",[])],e.prototype,"accessors",null),E([u.computed,x("design:type",Array),x("design:paramtypes",[])],e.prototype,"flatAccessors",null),E([u.computed,x("design:type",Array),x("design:paramtypes",[])],e.prototype,"additionalErrors",null),e}();function M(){return S(this,void 0,void 0,function(){return _(this,function(e){return console.warn("No mstform save function configured"),[2,null]})})}var C=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},k=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},I=function(){function e(e,t){this.model=e,this.definition=t}return Object.defineProperty(e.prototype,"FormStateType",{get:function(){throw new Error("For introspection")},enumerable:!0,configurable:!0}),e.prototype.state=function(e,t){return new B(this,e,t)},e}(),D=function(){return function(e){this.definition=e}}(),T=function(){return function(e){this.message=e}}(),q=function(){return function(e){this.value=e}}(),N=function(){function e(e,t){if(this.converter=e,this.options=t,t){if(this.rawValidators=t.rawValidators?t.rawValidators:[],this.validators=t.validators?t.validators:[],this.conversionError=t.conversionError||"Could not convert",this.requiredError=t.requiredError||"Required",this.required=t.required||!1,t.fromEvent){if(t.getRaw)throw new Error("Cannot have fromEvent and getRaw defined at same time");this.getRaw=function(e){return e.target.value}}else this.getRaw=t.getRaw||F;this.derivedFunc=t.derived,this.changeFunc=t.change,this.controlled=t.controlled||this.createDefaultControlled()}else this.rawValidators=[],this.validators=[],this.conversionError="Could not convert",this.requiredError="Required",this.required=!1,this.getRaw=F,this.controlled=this.createDefaultControlled()}return e.prototype.createDefaultControlled=function(){var e=this;return this.getRaw!==F?function(t){return{value:t.raw,onChange:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.setRaw(e.getRaw.apply(e,r))}}}:this.converter.defaultControlled},Object.defineProperty(e.prototype,"RawType",{get:function(){throw new Error("This is a function to enable type introspection")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ValueType",{get:function(){throw new Error("This is a function to enable type introspection")},enumerable:!0,configurable:!0}),e.prototype.process=function(e){return C(this,void 0,void 0,function(){var t,r,n,o,i,s;return k(this,function(a){switch(a.label){case 0:if(e===this.converter.emptyRaw&&this.required)return[2,new T(this.requiredError)];t=0,r=this.rawValidators,a.label=1;case 1:return t<r.length?[4,(0,r[t])(e)]:[3,4];case 2:if("string"==typeof(s=a.sent())&&s)return[2,new T(s)];a.label=3;case 3:return t++,[3,1];case 4:return[4,this.converter.convert(e)];case 5:if("ConversionError"===(n=a.sent()))return e===this.converter.emptyRaw?[2,new T(this.requiredError)]:[2,new T(this.conversionError)];o=0,i=this.validators,a.label=6;case 6:return o<i.length?[4,(0,i[o])(n.value)]:[3,9];case 7:if("string"==typeof(s=a.sent())&&s)return[2,new T(s)];a.label=8;case 8:return o++,[3,6];case 9:return[2,new q(n.value)]}})})},e.prototype.render=function(e){return this.converter.render(e)},e}(),z=function(){return function(e){this.definition=e}}(),U=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},G=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},H=new RegExp("^-?(0|[1-9]\\d*)(\\.\\d*)?$"),J=new RegExp("^-?(0|[1-9]\\d*)$"),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultControlled=n.value,t}return U(t,e),t}(a),K=new $({emptyRaw:"",convert:function(e){return e},render:function(e){return e}}),L=new $({emptyRaw:"",rawValidate:function(e){return e.startsWith(".")&&(e="0"+e),H.test(e)},convert:function(e){return+e},render:function(e){return e.toString()}}),Q=new $({emptyRaw:"",rawValidate:function(e){return J.test(e)},convert:function(e){return+e},render:function(e){return e.toString()}}),X=new a({emptyRaw:!1,convert:function(e){return e},render:function(e){return e},defaultControlled:n.checked}),Y=function(){function e(e,t){this.maxWholeDigits=e,this.decimalPlaces=t,this.defaultControlled=n.value,this.emptyRaw="";var r=new RegExp("^-?(0|[1-9]\\d{0,"+(e-1)+"})(\\.\\d{0,"+t+"})?$");this.converter=new $({emptyRaw:"",rawValidate:function(e){return e.startsWith(".")&&(e="0"+e),r.test(e)},convert:function(e){return e},render:function(e){return e}})}return e.prototype.convert=function(e){return this.converter.convert(e)},e.prototype.render=function(e){return this.converter.render(e)},e.prototype.getRaw=function(e){return e},e}();var Z=new a({emptyRaw:[],convert:function(e){return u.observable.array(e)},render:function(e){return e.slice()}});var ee=function(){function e(e){this.converter=e,this.defaultControlled=n.value,this.emptyRaw=""}return e.prototype.convert=function(e){return W(this,void 0,void 0,function(){return G(this,function(t){return""===e.trim()?[2,new s(null)]:[2,this.converter.convert(e)]})})},e.prototype.render=function(e){return null===e?"":this.converter.render(e)},e}(),te=function(){function e(e){this.emptyRaw=null,this.defaultControlled=n.object}return e.prototype.convert=function(e){return W(this,void 0,void 0,function(){return G(this,function(t){return null===e?[2,"ConversionError"]:[2,new s(e)]})})},e.prototype.render=function(e){return e},e}();var re={string:K,number:L,integer:Q,decimal:function(e,t){return new Y(e,t)},boolean:X,stringArray:Z,maybe:function(e){return e instanceof $?new ee(e):new a({emptyRaw:null,convert:F,render:F,defaultControlled:n.object})},model:function(e){return new te(e)},object:new a({emptyRaw:null,convert:F,render:F})};var ne={validationProps:function(e){var t=e.error,r=e.isValidating;return t?{validateStatus:r?"validating":"error",help:t}:{validateStatus:r?"validating":""}}};r.d(t,"Form",function(){return I}),r.d(t,"SubForm",function(){return D}),r.d(t,"ValidationMessage",function(){return T}),r.d(t,"ProcessValue",function(){return q}),r.d(t,"Field",function(){return N}),r.d(t,"RepeatingForm",function(){return z}),r.d(t,"ConversionValue",function(){return s}),r.d(t,"CONVERSION_ERROR",function(){return"ConversionError"}),r.d(t,"Converter",function(){return a}),r.d(t,"StringConverter",function(){return $}),r.d(t,"converters",function(){return re}),r.d(t,"setupValidationProps",function(){return y}),r.d(t,"FormAccessor",function(){return g}),r.d(t,"FieldAccessor",function(){return b}),r.d(t,"RepeatingFormAccessor",function(){return v}),r.d(t,"RepeatingFormIndexedAccessor",function(){return m}),r.d(t,"SubFormAccessor",function(){return w}),r.d(t,"controlled",function(){return n}),r.d(t,"antd",function(){return ne}),r.d(t,"FormState",function(){return B})}])});
//# sourceMappingURL=mstform.js.map

@@ -93,2 +93,3 @@ import { IReactionDisposer } from "mobx";

clearError(): void;
setValidating(flag: boolean): void;
handleChange: (...args: any[]) => Promise<void>;

@@ -95,0 +96,0 @@ handleFocus: (event: any) => void;

{
"name": "mstform",
"version": "0.15.0",
"version": "0.15.1",
"description": "mobx-state-tree powered forms",

@@ -5,0 +5,0 @@ "main": "dist/mstform.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc