@darkobits/formation
Version:
2 lines • 42.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ramda"),require("angular"),require("angular-messages")):"function"==typeof define&&define.amd?define(["ramda","angular","angular-messages"],t):"object"==typeof exports?exports.Formation=t(require("ramda"),require("angular"),require("angular-messages")):e.Formation=t(e.R,e.angular,e[void 0])}(this,function(e,t,r){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=22)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MODULE_NAME="Formation",t.FORM_COMPONENT_NAME="fm",t.FORM_GROUP_COMPONENT_NAME="fmGroup",t.DEFAULT_PREFIX="fm",t.FORM_CONTROLLER="$formController",t.NG_MODEL_CTRL="$ngModelCtrl",t.COMPONENT_CONFIGURATION="$configuration",t.CUSTOM_ERROR_KEY="$custom",t.CONFIGURABLE_VALIDATOR="$configurableValidator"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e){try{return"Object"===Object.getPrototypeOf(e).constructor.name}catch(e){if(/cannot read property/gi.test(e.message))return!0;throw e}}function i(e,t){return Array.isArray(e)&&2===e.length||s(["Expected "+(t?t+" to be a ":"")+"[key, value] entry,","but got "+(0,_.type)(e)+"."].join(" ")),!0}function a(e){return void 0!==e}function u(e){return(0,_.is)(Function,e)||"function"==typeof e}function s(e){throw new Error("["+v.MODULE_NAME+"] "+e)}function l(e){return e&&String(e).substr(0,1).toUpperCase()+String(e).substr(1)}function c(e){return e&&String(e).substr(0,1).toLowerCase()+String(e).substr(1)}function f(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(r.length>=2){var i=(0,_.nth)(-2,r)||{},a=(0,_.nth)(-1,r)||{},u=(0,_.mergeWith)(e,i,a);if(2===r.length)return u;var s=(0,_.slice)(0,-2,r);return f.apply(void 0,[e].concat(n((0,_.append)(u,s))))}return 1===r.length?(0,_.head)(r):{}}function d(e){if(e&&""!==e){var t=(0,_.map)(function(e){return e.length&&"$"+e.replace(/[, ]/g,"")},String(e).split(/, ?| /g));return(0,_.filter)(_.identity,t)}}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=(new Date).getTime()/1e3;return new Promise(function(o,i){var a=setInterval(function(){var u=(new Date).getTime()/1e3;void 0!==e[t]?(o(e[t]),clearInterval(a)):u-n>r&&(i(new Error("[onReady] Timed-out.")),clearInterval(a))},1)})}function g(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=_.identity,o=_.identity,i=[];switch(t.length){case 1:throw new Error("toPairsWith expects at least 2 arguments.");case 3:n=t[0],o=t[1],i=t[2];break;case 2:default:n=t[0],i=t[1]}return u(n)||s('Expected key generation function to be of type "Function", but got "'+(void 0===n?"undefined":E(n))+'".'),u(o)||s('Expected key value generation function to be of type "Function", but got "'+(void 0===o?"undefined":E(o))+'".'),Array.isArray(i)||s('Expected collection to be of type "Array", but got "'+(void 0===i?"undefined":E(i))+'".'),i.map(function(){return[String(n.apply(void 0,arguments)),o.apply(void 0,arguments)]})}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=R("mergeEntries");return r(Array,"first argument",e),r(Array,"second argument",t),e.map(function(e){i(e);var r=t.find(function(t){return i(t)&&t[0]===e[0]});return[e[0],e[1],r?r[1]:void 0]})}function y(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return t&&u(t[e])&&t[e].apply(t,n)}function h(e,t){var r=(0,_.path)(["$id"],y("$getScope",e))||0,n=(0,_.path)(["$id"],y("$getScope",t))||0;return Number(r)>Number(n)?e:t}function b(e,t,r,n){var o=g(t,e),i=Object.entries(n||{}),a=m(o,i);return(0,_.map)(function(e){var t=O(e,3),n=t[0],o=t[1],i=t[2];return[n,y(r,o,i)]},a)}Object.defineProperty(t,"__esModule",{value:!0}),t.assignToScope=t.mergeDeep=t.assertType=void 0;var O=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.assertIsEntry=i,t.isDefined=a,t.isFunction=u,t.throwError=s,t.capitalizeFirst=l,t.lowercaseFirst=c,t.mergeWithDeep=f,t.parseFlags=d,t.onReady=p,t.toPairsWith=g,t.mergeEntries=m,t.invoke=y,t.greaterScopeId=h,t.applyToCollection=b;var _=r(5),v=r(0),R=t.assertType=(0,_.curry)(function(e,t,r,n){(t=[].concat(t),t.reduce(function(e,t){var r=void 0;switch(t){case Function:r=u;break;case Array:r=Array.isArray;break;case void 0:r=(0,_.equals)(void 0);break;case null:r=(0,_.equals)(null);break;default:r=(0,_.is)(t)}return e||r(n)},!1))||s([e+" expected "+r+" to be of type",t.map(function(e){try{return e.prototype.constructor.name}catch(t){return(0,_.type)(e)}}).join(" or ")+",","but got "+(0,_.type)(n)+"."].join(" "));return!0}),C=function e(t,r){return Array.isArray(t)&&Array.isArray(r)?(0,_.concat)(t,r):o(t)&&o(r)?f(e,t,r):r},M=t.mergeDeep=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return f.apply(void 0,[C].concat(t))},$=t.assignToScope=(0,_.curry)(function(e,t,r,n){var o=void 0;(o=""===n?e('this[""]').assign:e(n).assign)&&o(t,r)});t.default={applyToCollection:b,assertIsEntry:i,assertType:R,assignToScope:$,capitalizeFirst:l,greaterScopeId:h,invoke:y,isDefined:a,isFunction:u,lowercaseFirst:c,mergeDeep:M,mergeEntries:m,mergeWithDeep:f,onReady:p,parseFlags:d,throwError:s,toPairsWith:g}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Reset=t.SetModelValue=t.GetModelValue=t.ClearCustomErrorMessage=t.SetCustomErrorMessage=t.RegisterForm=t.RegisterControl=t.RegisterNgForm=t.RegisterNgModel=t.Configure=void 0;var n=r(23);t.Configure=new n.Interface("Configure"),t.RegisterNgModel=new n.Interface("RegisterNgModel",[Object]),t.RegisterNgForm=new n.Interface("RegisterNgForm",[Object]),t.RegisterControl=new n.Interface("RegisterControl",[Object]),t.RegisterForm=new n.Interface("RegisterForm",[Object]),t.SetCustomErrorMessage=new n.Interface("SetCustomErrorMessage"),t.ClearCustomErrorMessage=new n.Interface("ClearCustomErrorMessage"),t.GetModelValue=new n.Interface("GetModelValue"),t.SetModelValue=new n.Interface("SetModelValue",[n.Any]),t.Reset=new n.Interface("Reset")},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),o=function(e){return e&&e.__esModule?e:{default:e}}(n);r(24);var i=r(0),a=o.default.module(i.MODULE_NAME,["ngMessages"]);t.default=a},function(e,t,r){"use strict";(function(e){function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,i){try{var a=t[o](i),u=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}return n("next")})}}function o(t,r,i,p,O,E,_){function v(){return++T}function R(){return new Promise(function(e){var t="Form."+m+".$pending",r=E.$watch(t,function(t){t||(r(),e())})})}function C(){N[g.ClearCustomErrorMessage](),N[m].$setSubmitted(!0),N.$submitting=!0,N.disable(),E.$parent.$broadcast(y)}function M(){N.$submitting=!1,N.enable(),E.$parent.$broadcast(h)}var $=this,N=this,T=-1,L=[],F={},w=[],S=new Map,I=(0,u.partial)(d.applyToCollection,[w,(0,u.prop)("name")]),D=(0,d.assignToScope)(O)(E.$parent)(N);g.RegisterNgForm.implementedBy(N).as(function(e){N[m]&&(0,d.throwError)("ngForm already registered with Formation."),N[m]=e,(0,u.forEach)(function(e){Reflect.defineProperty(N,e,{get:function(){return N[m][e]}})},["$dirty","$invalid","$pending","$pristine","$submitted","$valid"])}),g.RegisterForm.implementedBy(N).as(function(e){var t=e.name;N.getForm(t)&&(0,d.throwError)('Cannot register child form "'+t+'"; another child form with this name already exists.'),N.getControl(t)&&(0,d.throwError)('Cannot register child form "'+t+'"; a control with this name already exists.'),N.$debug('Registering child form "'+t+'".'),w.push(e),(0,d.invoke)(g.Configure,e,F[t])}),g.RegisterControl.implementedBy(N).as(function(e){var t=e.name||"control";N.getForm(t)&&(0,d.throwError)('Cannot register control "'+t+'"; a child form with this name already exists.'),N.$debug('Registering control "'+t+'".'),e.$uid=t+"-"+v(),w.push(e),(0,d.invoke)(g.Configure,e,F[t])}),g.RegisterNgModel.implementedBy(N).as(function(e){N[g.RegisterControl](new f.MockControl(e,N,E))}),g.Configure.implementedBy(N).as(function(e){b("configuration",e),F=(0,d.mergeDeep)(F,e),I(g.Configure,F)}),g.GetModelValue.implementedBy(N).as(function(){return(0,u.fromPairs)(I(g.GetModelValue))}),g.SetModelValue.implementedBy(N).as(function(e){b("model values",e),I(g.SetModelValue,e)}),g.SetCustomErrorMessage.implementedBy(N).as(function(e){b("error messages",e),I(g.SetCustomErrorMessage,e)}),g.ClearCustomErrorMessage.implementedBy(N).as(function(){I(g.ClearCustomErrorMessage)}),g.Reset.implementedBy(N).as(function(e){b("model values",e),N[m].$setPristine(),I(g.Reset,e)}),N.$postLink=function(){function e(e){var t=a.default.element(e)[0].tagName;r(e)(E,function(e){i.append(e)}),_(E.$parent.$new(),function(e,r){r.$fm=N,i.find(t).append(e)})}e(N.$parentForm?"\n <ng-form></ng-form>\n ":'\n <form novalidate\n ng-submit="Form.$submit()"\n ng-model-options="{getterSetter: true}">\n </form>\n ')},N.$onInit=function(){var e=(0,d.greaterScopeId)(N.$parentForm,N.$parentFormGroup);N.name=N.name||"Form-"+(0,s.$getNextId)(),F=(0,d.mergeDeep)(F,N.$controlConfiguration),Reflect.has(t,"debug")&&(N.$debugging=!0),e?(e[g.RegisterForm](N),E.$on(y,function(){N.$submitting||C()}),E.$on(h,function(){N.$submitting&&M()})):D(N.name),L=(0,d.parseFlags)(N.$showErrorsOn||(0,s.$getShowErrorsOnStr)())},N.$onChanges=function(e){if(e.name&&!e.name.isFirstChange()){var t=e.name,r=t.currentValue,n=t.previousValue;N.$debug('Name changed from "'+n+'" to "'+r+'".'),D(r)}if(e.$showErrorsOn&&!e.$showErrorsOn.isFirstChange()){var o=e.$showErrorsOn.currentValue;L=(0,d.parseFlags)(o||(0,s.$getShowErrorsOnStr)())}},N.$onDestroy=function(){N.$parentForm&&N.$parentForm.$unregisterForm(N)},N.$debug=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];N.$debugging&&p.log.apply(p,["["+N.name+"]"].concat(t))},N.$getScope=function(){return E},N.$getModelValue=function(e){return(0,u.clone)(S.get(e))},N.$setModelValue=function(e,t){E.$applyAsync(function(){S.set(e,(0,u.clone)(t))})},N.$unregisterControl=function(e){N.$debug('Unregistering control "'+e.name+'".'),w=(0,u.reject)((0,u.propEq)("$uid",e.$uid),w)},N.$unregisterForm=function(e){N.$debug('Unregistering child form "'+e.name+'".'),w=(0,u.reject)((0,u.propEq)("name",e.name),w)},N.$submit=n(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!N.$submitting){t.next=4;break}throw N.$debug("Submit already in progress."),new Error("SUBMIT_IN_PROGRESS");case 4:return t.next=6,R();case 6:if(C(),!N[m].$invalid){t.next=9;break}throw new Error("NG_FORM_INVALID");case 9:if("function"!=typeof N.$onSubmit){t.next=14;break}return t.next=12,Promise.resolve(N.$onSubmit(N.getModelValues()));case 12:r=t.sent,N[g.SetCustomErrorMessage](r);case 14:t.next=21;break;case 16:if(t.prev=16,t.t0=t.catch(0),void 0===e||"test"!==e.env.NODE_ENV&&"development"!==e.env.NODE_ENV){t.next=21;break}throw N.$debug("[Logged During Development Only]",t.t0.message),t.t0;case 21:return t.prev=21,E.$apply(function(){M()}),t.finish(21);case 24:case"end":return t.stop()}},t,$,[[0,16,21,24]])})),N.$getErrorBehavior=function(){return(0,u.clone)(L)},N.getControl=function(e){var t=(0,u.find)((0,u.propEq)("name",e),w);if((0,u.is)(c.FormationControl,t)||(0,u.is)(f.MockControl,t))return t},N.getForm=function(e){var t=(0,u.find)((0,u.propEq)("name",e),w);if((0,u.is)(o,t)||(0,u.is)(l.FormGroupController,t))return t},N.isDisabled=function(){return N.$disabled||N.$ngDisabled||N.$parentForm&&N.$parentForm.isDisabled()},N.disable=function(){N.$disabled=!0},N.enable=function(){N.$disabled=!1},N.configure=N[g.Configure],N.getModelValues=N[g.GetModelValue],N.reset=N[g.Reset],N.setModelValues=N[g.SetModelValue]}Object.defineProperty(t,"__esModule",{value:!0}),t.END_SUBMIT_EVENT=t.BEGIN_SUBMIT_EVENT=t.NG_FORM_CONTROLLER=void 0,t.FormController=o;var i=r(10),a=function(e){return e&&e.__esModule?e:{default:e}}(i),u=r(5),s=r(2),l=r(8),c=r(1),f=r(16),d=r(3),p=r(0),g=r(4),m=t.NG_FORM_CONTROLLER="$ngFormController",y=t.BEGIN_SUBMIT_EVENT="$fmInitiateSubmit",h=t.END_SUBMIT_EVENT="$fmTerminateSubmit",b=(0,d.assertType)("Form",[Object,void 0]);o[p.FORM_CONTROLLER]=!0,o.$inject=["$attrs","$compile","$element","$log","$parse","$scope","$transclude"],(0,s.$registerComponent)(p.FORM_COMPONENT_NAME,{require:{$parentForm:"?^^"+p.FORM_COMPONENT_NAME,$parentFormGroup:"?^^"+p.FORM_GROUP_COMPONENT_NAME},bindings:{name:"@",$controlConfiguration:"<controls",$onSubmit:"<onSubmit",$showErrorsOn:"@showErrorsOn",$ngDisabled:"<ngDisabled"},transclude:!0,controller:o,controllerAs:"Form"}),t.default=o}).call(t,r(9))},function(e,t,r){"use strict";function n(e,t,r,n,l,d,p){var g=this,m=[],y=[],h=(0,i.partial)(s.applyToCollection,[y,function(e,t){return t}]);c.RegisterForm.implementedBy(g).as(function(e){var t=e.name;g.getForm(t)&&(0,s.throwError)('Cannot register child form "'+t+'"; another child form with this name already exists.'),g.$debug('Registering child form "'+t+'".'),y.push(e),(0,s.invoke)(c.Configure,e,m[y.indexOf(e)])}),c.Configure.implementedBy(g).as(function(e){f("configuration",e),Array.isArray(e)&&(m=e),h(c.Configure,m)}),c.GetModelValue.implementedBy(g).as(function(){return(0,i.map)(function(e){return o(e,2)[1]},h(c.GetModelValue))}),c.SetModelValue.implementedBy(g).as(function(e){f("model values",e),h(c.SetModelValue,e)}),c.SetCustomErrorMessage.implementedBy(g).as(function(e){f("error messages",e),h(c.SetCustomErrorMessage,e)}),c.ClearCustomErrorMessage.implementedBy(g).as(function(){h(c.ClearCustomErrorMessage)}),c.Reset.implementedBy(g).as(function(e){f("model values",e),h(c.Reset,e)}),g.$postLink=function(){p(d.$parent.$new(),function(e){r.append(e)})},g.$onInit=function(){g.name=g.name||"FormGroup-"+(0,u.$getNextId)(),Reflect.has(e,"debug")&&(g.$debugging=!0),g.$parentForm?g.$parentForm[c.RegisterForm](g):(0,s.throwError)("Form groups must have a parent form.")},g.$onDestroy=function(){g.$parentForm&&g.$parentForm.$unregisterForm(g)},g.$debug=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];g.$debugging&&n.log.apply(n,["["+g.name+"]"].concat(t))},g.$getScope=function(){return d},g.$unregisterForm=function(e){g.$debug('Unregistering child form "'+e.name+'".'),y=(0,i.without)(e,y)},g.getForm=function(e){var t=(0,i.find)((0,i.propEq)("name",e),y);if((0,i.is)(a.FormController,t))return t},g.isDisabled=function(){return g.$disabled||g.$ngDisabled||g.$parentForm&&g.$parentForm.isDisabled()},g.disable=function(){g.$disabled=!0},g.enable=function(){g.$disabled=!1},g.configure=g[c.Configure],g.getModelValues=g[c.GetModelValue],g.reset=g[c.Reset],g.setModelValues=g[c.SetModelValue]}Object.defineProperty(t,"__esModule",{value:!0}),t.END_SUBMIT_EVENT=t.BEGIN_SUBMIT_EVENT=t.NG_FORM_CONTROLLER=void 0;var o=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.FormGroupController=n;var i=r(5),a=r(7),u=r(2),s=r(3),l=r(0),c=r(4),f=(t.NG_FORM_CONTROLLER="$ngFormController",t.BEGIN_SUBMIT_EVENT="$fmInitiateSubmit",t.END_SUBMIT_EVENT="$fmTerminateSubmit",(0,s.assertType)("Form Group",[Array,void 0]));n.$inject=["$attrs","$compile","$element","$log","$parse","$scope","$transclude"],(0,u.$registerComponent)(l.FORM_GROUP_COMPONENT_NAME,{require:{$parentForm:"?^^"+l.FORM_COMPONENT_NAME},bindings:{name:"@",$ngDisabled:"<ngDisabled"},transclude:!0,controller:n,controllerAs:"FormGroup"}),t.default=n},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?g=p.concat(g):y=-1,g.length&&u())}function u(){if(!m){var e=o(a);m=!0;for(var t=g.length;t;){for(p=g,g=[];++y<t;)p&&p[y].run();y=-1,t=g.length}p=null,m=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,f,d=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var p,g=[],m=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];g.push(new s(e,t)),1!==g.length||m||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},function(e,t,r){"use strict";r(7),r(8),r(18),r(17),r(20),r(19)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurableValidator=void 0;var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),a=r(3);t.ConfigurableValidator=function(){function e(t){n(this,e),(0,a.assertType)("ConfigurableValidator",[Function,void 0],"validator",t),this.validator=t.bind(this),this[i.CONFIGURABLE_VALIDATOR]=!0}return o(e,[{key:"configure",value:function(e){return this.form=e[i.FORM_CONTROLLER],this.scope=this.form.$getScope(),this.ngModelCtrl=e[i.NG_MODEL_CTRL],this.validator}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.FormationControl=t.CUSTOM_ERROR_MESSAGE_KEY=t.NG_MESSAGES=void 0;var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(5),a=r(0),u=r(3),s=r(4),l=t.NG_MESSAGES="$ngMessages",c=t.CUSTOM_ERROR_MESSAGE_KEY="$customError",f=(0,u.assertType)("FormationControl",Function),d=t.FormationControl=function(){function e(){n(this,e),this[l]=[],this.getModelValue=this[s.GetModelValue],this.setModelValue=this[s.SetModelValue]}return o(e,[{key:"$getName",value:function(){return this.name||this.for}},{key:"$getFormName",value:function(){return this[a.FORM_CONTROLLER]&&this[a.FORM_CONTROLLER].name}},{key:"$onDestroy",value:function(){this[a.NG_MODEL_CTRL]&&this[a.FORM_CONTROLLER].$unregisterControl(this)}},{key:"$getControl",value:function(){return this[a.FORM_CONTROLLER].getControl(this.$getName())}},{key:"$getCanonicalControlId",value:function(){return this.$getControl().getControlId()}},{key:"$ngModelGetterSetter",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!(t.length>0))return this[s.GetModelValue]();var n=t[0];this[a.FORM_CONTROLLER].$setModelValue(this.$getName(),(0,i.clone)(n))}},{key:"getControlId",value:function(){return this[a.FORM_CONTROLLER].name+"-"+this.$uid}},{key:"getErrors",value:function(){var e=this;if(!this.$getControl())return!1;var t=this.$getControl()[a.NG_MODEL_CTRL],r=this[a.FORM_CONTROLLER].$getErrorBehavior();return!t.$valid&&((0,i.isNil)(r)||""===r?!t.$valid&&t.$error:!!r.reduce(function(r,n){var o=t[n],i=e[a.FORM_CONTROLLER][n];return r||o||i},!1)&&t.$error)}},{key:"getErrorMessages",value:function(){return this.$getControl(this.$getName())[l]||[]}},{key:"getCustomErrorMessage",value:function(){return this[a.FORM_CONTROLLER].getControl(this.$getName())[c]}},{key:"isDisabled",value:function(){return this.$ngDisabled||this.$disabled||this[a.FORM_CONTROLLER].isDisabled()}},{key:"enable",value:function(){this.$disabled=!1}},{key:"disable",value:function(){this.$disabled=!0}}]),e}();s.Configure.implementedBy(d).as(function(e){var t=this;if(this[a.NG_MODEL_CTRL]){var r=(0,u.mergeDeep)((0,i.pathOr)({},[a.COMPONENT_CONFIGURATION],this),e),n=r.errors,o=r.parsers,s=r.formatters,c=r.validators,d=r.asyncValidators,p=r.ngModelOptions;this[a.FORM_CONTROLLER].$debug('Applying configuration to "'+this.$getName()+'":',r),Array.isArray(n)&&n.forEach(function(e){(0,u.assertIsEntry)(e,"error message"),(0,i.contains)(e,t[l])||t[l].push(e)}),Array.isArray(o)&&o.forEach(function(e){if((0,i.has)(e,t[a.NG_MODEL_CTRL].$parsers))return void t[a.FORM_CONTROLLER].$debug('Control "'+t.$getName()+'" already has parser:',e);f("parser",e),t[a.NG_MODEL_CTRL].$parsers.push(e.bind(t[a.NG_MODEL_CTRL]))}),Array.isArray(s)&&s.forEach(function(e){if((0,i.has)(e,t[a.NG_MODEL_CTRL].$formatters))return void t[a.FORM_CONTROLLER].$debug('Control "'+t.$getName()+'" already has formatter:',e);f("formatter",e),t[a.NG_MODEL_CTRL].$formatters.push(e.bind(t[a.NG_MODEL_CTRL]))}),(0,i.is)(Object,c)&&(0,i.mapObjIndexed)(function(e,r){return!1===e?((0,i.has)(r,t[a.NG_MODEL_CTRL].$validators)&&t[a.FORM_CONTROLLER].$debug('Removing validator "'+r+'" from control "'+t.$getName()+'".'),Reflect.deleteProperty(t[a.NG_MODEL_CTRL].$validators,r),void t[a.NG_MODEL_CTRL].$setValidity(r,!0)):Object.values(t[a.NG_MODEL_CTRL].$validators).includes(e)?void t[a.FORM_CONTROLLER].$debug('Control "'+t.$getName()+'" already has validator:',e):void(e&&e[a.CONFIGURABLE_VALIDATOR]?t[a.NG_MODEL_CTRL].$validators[r]=e.configure(t):(f("validator",e),t[a.NG_MODEL_CTRL].$validators[r]=e.bind(t[a.NG_MODEL_CTRL])))},c),(0,i.is)(Object,d)&&(0,i.mapObjIndexed)(function(e,r){return!1===e?((0,i.has)(r,t[a.NG_MODEL_CTRL].$asyncValidators)&&t[a.FORM_CONTROLLER].$debug('Removing async validator "'+r+'" from control "'+t.$getName()+'".'),Reflect.deleteProperty(t[a.NG_MODEL_CTRL].$asyncValidators,r),void t[a.NG_MODEL_CTRL].$setValidity(r,!0)):Object.values(t[a.NG_MODEL_CTRL].$asyncValidators).includes(e)?void t[a.FORM_CONTROLLER].$debug('Control "'+t.$getName()+'" already has async validator:',e):void(e&&e[a.CONFIGURABLE_VALIDATOR]?t[a.NG_MODEL_CTRL].$asyncValidators[r]=e.configure(t):(f("async validator",e),t[a.NG_MODEL_CTRL].$asyncValidators[r]=e.bind(t[a.NG_MODEL_CTRL])))},d),(0,i.is)(Object,p)&&(this[a.NG_MODEL_CTRL].$options=this[a.NG_MODEL_CTRL].$options.createChild(p)),this[a.NG_MODEL_CTRL].$validate()}}),s.RegisterNgModel.implementedBy(d).as(function(e){this[a.COMPONENT_CONFIGURATION]&&this[s.Configure](),this[a.FORM_CONTROLLER]&&(this[a.NG_MODEL_CTRL]=e,this[a.FORM_CONTROLLER][s.RegisterControl](this))}),s.GetModelValue.implementedBy(d).as(function(){return this[a.FORM_CONTROLLER].$getModelValue(this.$getName())}),s.SetModelValue.implementedBy(d).as(function(e){void 0!==e&&this[a.FORM_CONTROLLER].$setModelValue(this.$getName(),(0,i.clone)(e))}),s.SetCustomErrorMessage.implementedBy(d).as(function(e){e&&((0,u.assertType)("FormationControl",String,"error message",e),this[a.FORM_CONTROLLER].$debug('Setting custom error "'+e+'" on control "'+this.$getName()+'".'),this[c]=e,this[a.NG_MODEL_CTRL].$setValidity(a.CUSTOM_ERROR_KEY,!1))}),s.ClearCustomErrorMessage.implementedBy(d).as(function(){(0,i.path)([a.NG_MODEL_CTRL,"$error",a.CUSTOM_ERROR_KEY],this)&&(this[a.FORM_CONTROLLER].$debug('Clearing custom error on control "'+this.$getName()+'".'),this[a.NG_MODEL_CTRL].$setValidity(a.CUSTOM_ERROR_KEY,!0),Reflect.deleteProperty(this,c))}),s.Reset.implementedBy(d).as(function(e){this[a.NG_MODEL_CTRL]&&(this[a.NG_MODEL_CTRL].$setUntouched(),this[a.NG_MODEL_CTRL].$setPristine(),void 0!==e&&this.setModelValue(e),this[a.NG_MODEL_CTRL].$validate())}),t.default={FormationControl:d}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.MockControl=void 0;var o=r(0),i=r(4),a=t.MockControl=function e(t,r,a){var u=this;n(this,e),this.name=t.$name,this.getModelValue=this[i.GetModelValue],this.setModelValue=this[i.SetModelValue],this[o.NG_MODEL_CTRL]=t,this[o.FORM_CONTROLLER]=r;var s=a.$watch(function(){return t.$modelValue},function(e){r.$setModelValue(u.name,e)});a.$on("$destroy",s)};i.GetModelValue.implementedBy(a).as(function(){return this[o.FORM_CONTROLLER].$getModelValue(this.name)}),i.SetModelValue.implementedBy(a).as(function(e){})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=r(2),u=r(1),s=r(0),l=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),t}(u.FormationControl);(0,a.registerControl)("Errors",{bindings:{for:"@"},controller:l,controllerAs:"Errors",template:'\n <label for="{{::Errors.$getCanonicalControlId() }}"\n ng-if="Errors.getErrors()"\n ng-class="{\n \'is-disabled\': Errors.isDisabled()\n }"\n ng-messages="Errors.getErrors()">\n <span ng-repeat="error in Errors.getErrorMessages()"\n ng-message="{{::error[0] }}">\n {{::error[1] }}\n </span>\n <span ng-message="'+s.CUSTOM_ERROR_KEY+'">\n {{ Errors.getCustomErrorMessage() }}\n </span>\n </label>\n '})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=r(2),u=r(0),s=r(1),l=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),t}(s.FormationControl);(0,a.registerControl)("Input",{bindings:{name:"@",placeholder:"@",type:"@",ngValue:"<"},transclude:!0,controller:l,controllerAs:"Input",template:"\n <label for=\"{{::Input.getControlId() }}\"\n ng-if=\"Input.type !== 'radio' && Input.type !== 'checkbox'\"\n ng-class=\"{\n 'has-error': Input.getErrors(),\n 'is-pending': Input."+u.NG_MODEL_CTRL+'.$pending,\n \'is-disabled\': Input.isDisabled()\n }"\n ng-transclude>\n </label>\n <input id="{{::Input.getControlId() }}"\n type="{{::Input.type }}"\n name="{{::Input.type === \'radio\' ? Input.$getFormName() + \'-\' + Input.name : Input.name }}"\n placeholder="{{::Input.placeholder }}"\n ng-model="Input.$ngModelGetterSetter"\n ng-value="Input.ngValue"\n ng-class="{\n \'has-error\': Input.getErrors(),\n \'is-pending\': Input.'+u.NG_MODEL_CTRL+".$pending,\n 'is-disabled': Input.isDisabled()\n }\"\n ng-disabled=\"Input.isDisabled()\">\n <label for=\"{{::Input.getControlId() }}\"\n ng-if=\"Input.type === 'radio' || Input.type === 'checkbox'\"\n ng-class=\"{\n 'has-error': Input.getErrors(),\n 'is-pending': Input."+u.NG_MODEL_CTRL+".$pending,\n 'is-disabled': Input.isDisabled()\n }\"\n ng-transclude>\n </label>\n "})},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=r(2),s=r(0),l=r(1),c=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(l.FormationControl);(0,u.$registerComponent)((0,u.$getPrefixedName)("Select"),function(){var e;return{restrict:"E",scope:!0,bindToController:(e={},n(e,s.COMPONENT_CONFIGURATION,"<config"),n(e,"name","@"),n(e,"placeholder","@"),n(e,"multiple","@"),n(e,"$ngDisabled","<ngDisabled"),e),require:n({},s.FORM_CONTROLLER,"^^"+s.FORM_COMPONENT_NAME),transclude:!0,compile:function(e,t){e.find("select").attr("ng-options",t.options)},controller:c,controllerAs:"Select",template:"\n <label for=\"{{::Select.getControlId() }}\"\n ng-class=\"{\n 'has-error': Select.getErrors(),\n 'is-pending': Select."+s.NG_MODEL_CTRL+'.$pending,\n \'is-disabled\': Select.isDisabled()\n }"\n ng-transclude>\n </label>\n <select id="{{::Select.getControlId() }}"\n name="{{::Select.name }}"\n ng-model="Select.$ngModelGetterSetter"\n ng-if="::!Select.multiple"\n ng-disabled="Select.isDisabled()"\n ng-class="{\n \'has-error\': Select.getErrors(),\n \'is-pending\': Select.'+s.NG_MODEL_CTRL+'.$pending,\n \'is-disabled\': Select.isDisabled()\n }">\n <option value=""\n ng-if="::Select.placeholder"\n hidden>\n {{::Select.placeholder }}\n </option>\n </select>\n <select id="{{::Select.getControlId() }}"\n name="{{::Select.name }}"\n ng-model="Select.$ngModelGetterSetter"\n ng-if="::Select.multiple"\n ng-disabled="Select.isDisabled()"\n ng-class="{\n \'has-error\': Select.getErrors(),\n \'is-pending\': Select.'+s.NG_MODEL_CTRL+".$pending,\n 'is-disabled': Select.isDisabled()\n }\"\n multiple>\n </select>\n "}})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=r(2),u=r(0),s=r(1),l=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),t}(s.FormationControl);(0,a.registerControl)("Textarea",{bindings:{name:"@",placeholder:"@"},transclude:!0,controller:l,controllerAs:"Textarea",template:"\n <label for=\"{{::Textarea.getControlId() }}\"\n ng-class=\"{\n 'has-error': Input.getErrors(),\n 'is-pending': Input."+u.NG_MODEL_CTRL+'.$pending,\n \'is-disabled\': Textarea.isDisabled()\n }"\n ng-transclude>\n </label>\n <textarea id="{{::Textarea.getControlId() }}"\n type="{{::Textarea.type }}"\n name="{{::Textarea.name }}"\n placeholder="{{::Textarea.placeholder }}"\n ng-model="Textarea.$ngModelGetterSetter"\n ng-class="{\n \'has-error\': Textarea.getErrors(),\n \'is-pending\': Textarea.'+u.NG_MODEL_CTRL+'.$pending,\n \'is-disabled\': Textarea.isDisabled()\n }"\n ng-disabled="Textarea.isDisabled()">\n '})},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){v.push(e),p.default.config(["$compileProvider",function(r){"function"==typeof t?r.directive((0,h.lowercaseFirst)(e),t):r.component((0,h.lowercaseFirst)(e),t)}])}function i(){return++_}function a(){return E}function u(e){return""+(O||m.DEFAULT_PREFIX)+(0,h.capitalizeFirst)(e)}function s(e,t){var r;o((0,h.lowercaseFirst)(u(e)),(0,h.mergeDeep)({bindings:(r={},n(r,m.COMPONENT_CONFIGURATION,"<config"),n(r,"$ngDisabled","<ngDisabled"),r),require:n({},m.FORM_CONTROLLER,"^^"+m.FORM_COMPONENT_NAME)},t))}function l(e){b||(0,h.throwError)("Formation cannot be configured once Angular has bootstrapped."),R(Object,"options",e),R([String,void 0],"showErrorsOn",e.showErrorsOn)&&(E=e.showErrorsOn),R([String,void 0],"prefix",e.prefix)&&(O=e.prefix)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.$registerComponent=o,t.$getNextId=i,t.$getShowErrorsOnStr=a,t.$getPrefixedName=u,t.registerControl=s,t.FormationConfigurator=l;var f=r(5),d=r(6),p=function(e){return e&&e.__esModule?e:{default:e}}(d),g=r(1),m=r(0),y=r(4),h=r(3),b=!0,O=m.DEFAULT_PREFIX,E=void 0,_=-1,v=[],R=(0,h.assertType)("FormationConfigurator");p.default.config(["$provide",function(e){b=!1,[{directives:["formDirective","ngFormDirective"],require:["?^^fm"],postLink:function(e,t,r,n){var o=c(n,1),i=o[0],a=(0,f.find)(function(e){return(0,f.path)(["constructor",m.FORM_CONTROLLER],e)},n);a&&(0,h.isFunction)(a[y.RegisterNgForm])&&a[y.RegisterNgForm](i)}},{directives:["ngModelDirective"],require:(0,f.map)(function(e){return"?^^"+e},v),postLink:function(e,t,r,n){var o=c(n,1),i=o[0],a=(0,f.find)((0,f.is)(g.FormationControl),n),u=(0,f.find)(function(e){return(0,f.path)(["constructor",m.FORM_CONTROLLER],e)},n);a&&(0,h.isFunction)(a[y.RegisterNgModel])?a[y.RegisterNgModel](i):u&&(0,h.isFunction)(u[y.RegisterNgModel])&&u[y.RegisterNgModel](i)}}].forEach(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.directives,n=t.require,o=t.postLink;r.forEach(function(t){e.decorator(t,["$delegate",function(e){var t=c(e,1),r=t[0],i=r.compile;return r.require=(0,f.concat)(r.require||[],n),r.compile=function(){var e=Reflect.apply(i,this,arguments);return{pre:function(){(0,h.isFunction)(e.pre)&&Reflect.apply(e.pre,this,arguments)},post:function(){(0,h.isFunction)(e.post)&&Reflect.apply(e.post,this,arguments),Reflect.apply(o,this,arguments)}}},e}])})})}])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.$constants=t.onReady=t.registerControl=t.FormationConfigurator=t.FormationControl=t.ConfigurableValidator=void 0;var n=r(11);Object.defineProperty(t,"ConfigurableValidator",{enumerable:!0,get:function(){return n.ConfigurableValidator}});var o=r(1);Object.defineProperty(t,"FormationControl",{enumerable:!0,get:function(){return o.FormationControl}});var i=r(2);Object.defineProperty(t,"FormationConfigurator",{enumerable:!0,get:function(){return i.FormationConfigurator}}),Object.defineProperty(t,"registerControl",{enumerable:!0,get:function(){return i.registerControl}});var a=r(3);Object.defineProperty(t,"onReady",{enumerable:!0,get:function(){return a.onReady}});var u=r(6),s=function(e){return e&&e.__esModule?e:{default:e}}(u);r(12);var l=r(0),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(l);t.$constants=c,t.default=s.default.name},function(e,t,r){(function(t){!function(t,r){e.exports=r()}(0,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,r,n){"use strict";function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return null!==t&&(t.constructor===e||t instanceof e)}function u(){try{return void 0!==t&&t.env&&"test"===t.env.NODE_ENV}catch(e){return!1}}function s(){try{return Boolean(Symbol(null))}catch(e){return!1}}Object.defineProperty(r,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r.Any="ANY",d=r.Interface=function(){function e(t,r){if(i(this,e),!a(String,t))throw new Error(['[Interface] Constructor expected argument 1 to be of type "String"','but got "'+(void 0===t?"undefined":l(t))+'".'].join(" "));if(r&&!a(Array,r))throw new Error(["[Interface] Constructor expected argument 2 to be undefined or of type",'"Array" but got "'+(void 0===r?"undefined":l(r))+'".'].join(" "));this.name=t,this.descriptor=s()?Symbol.for("@@"+t):"@@"+t,this.argTypes=r||[]}return c(e,[{key:"checkArguments",value:function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r&&r.length>=this.argTypes.length)return r.forEach(function(t,r){if(e.argTypes[r]===f);else if(e.argTypes[r]&&!a(e.argTypes[r],t))throw new Error(["[Interface: "+e.name+"]","Expected argument "+(r+1)+' to be of type "'+e.argTypes[r].name+'"','but got "'+(void 0===t?"undefined":l(t))+'".'].join(" "))}),!0;throw new Error(["[Interface: "+this.name+"]","Must be invoked with at least "+this.argTypes.length,"argument"+(this.argTypes.length>1?"s":"")+"."].join(" "))}},{key:"isImplementedBy",value:function(e){return Boolean(e[this.descriptor])}},{key:"implementedBy",value:function(e){var t=this,r=this;return{as:function(n){var i=a(Function,e)?e.prototype:e;if(t.isImplementedBy(i))throw new Error('[Interface] Delegate object already implements interface "'+r.name+'".');if(!a(Function,n))throw new Error("["+r.name+"] Implementation must be a function.");if(n.length<r.argTypes.length)throw new Error("["+r.name+"] Expected implementation to have minimum arity of "+r.argTypes.length+".");Object.defineProperty(i,r.descriptor,{enumerable:!1,configurable:!1,writable:u(),value:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.checkArguments.apply(r,o(t))&&n.call.apply(n,[this].concat(o(t)))}})}}}},{key:"toString",value:function(){return this.descriptor}}]),e}();r.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(o).default}})}])})}).call(t,r(9))},function(e,t){e.exports=r}])});
//# sourceMappingURL=index.min.js.map