UNPKG

@formio/core

Version:

The core Form.io renderering framework.

1 lines 31.6 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FormioCore=e():t.FormioCore=e()}(self,(function(){return function(){"use strict";var t={2937:function(t,e,n){var r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.intersection=e.map=e.head=e.last=e.filter=e.findEach=e.matches=e.findIndex=e.find=e.each=e.dropRight=e.drop=e.difference=e.concat=e.compact=e.chunk=void 0;var o=n(7739),i=n(1769);function u(t,e){var n=Array.isArray(t);for(var r in t)if(t.hasOwnProperty(r)&&!0===e(t[r],n?Number(r):r))break}function c(t,e,n){if(void 0===n&&(n=!1),t){if(Array.isArray(t)&&"function"==typeof e)return n?t.findIndex(e):t.find(e);var r=void 0,o=0;return s(t,e,(function(t,e){return r=t,o=e,!0})),n?o:r}}function a(t){var e=[],n={};return"string"==typeof t?(e=[t],n[t]=!0):(e=Object.keys(t),n=t),function(t){return(0,o.isEqual)((0,i.pick)(t,e),n)}}function s(t,e,n){u(t,(function(t,r){if(a(e)(t)&&!0===n(t,r))return!0}))}e.chunk=function(t,e){return t.reduce((function(t,n,o){return o%e==0?r(r([],t,!0),[[n]],!1):r(r([],t.slice(0,-1),!0),[r(r([],t.slice(-1)[0],!0),[n],!1)],!1)}),[])},e.compact=function(t){return t.filter(Boolean)},e.concat=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.concat.apply(t,e)},e.difference=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t.filter((function(t){return!e.includes(t)}))}))},e.drop=function(t,e){return void 0===e&&(e=1),e>0?t.slice(e):t},e.dropRight=function(t,e){return void 0===e&&(e=1),e>0?t.slice(0,-e):t},e.each=u,e.find=c,e.findIndex=function(t,e){return c(t,e,!0)},e.matches=a,e.findEach=s,e.filter=function(t,e){if(!t)return[];if(e||(e=function(t){return!!t}),Array.isArray(t)&&"function"==typeof e)return t.filter(e);var n=[];return s(t,e,(function(e,r){n.push(e),Array.isArray(e)?t.splice(r,1):delete t[r]})),n},e.last=function(t){return t[t.length-1]},e.head=function(t){return t[0]},e.map=function(t,e){return t.map(e)},e.intersection=function(t,e){return t.filter((function(t){return e.includes(t)}))}},3254:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=void 0,e.debounce=function(t,e){var n;return void 0===e&&(e=100),function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&clearTimeout(n),n=setTimeout((function(){n=null,t.apply(void 0,r)}),e)}}},2373:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},u=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)},c=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.chain=void 0;var a=i(n(2937)),s=function(){function t(t){this.chain=[],this.currentValue=[],this.currentValue=t}return t.prototype.value=function(){return this.chain.reduce((function(t,e){var n;return(n=a)[e.method].apply(n,c([t],e.args,!1))}),this.currentValue)},t}(),f=function(t){a.hasOwnProperty(t)&&(s.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.chain.push({method:t,args:e}),this})};for(var l in a)f(l);function p(t){return new s(t)}e.chain=p,e.default=p,u(n(2937),e),u(n(3254),e),u(n(7739),e),u(n(7592),e),u(n(1769),e),u(n(7150),e)},7739:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.isRegExp=e.isBoolean=e.isNumber=e.isPlainObject=e.isObject=e.isObjectLike=e.isArray=e.isNull=e.isNil=e.isNaN=e.isInteger=e.isEmpty=e.isString=e.isEqual=e.noop=void 0;var r=n(2937);function o(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function i(t){return"object"==typeof t&&null!==t}function u(t){var e=typeof t;return null!=t&&("object"===e||"function"===e)}e.noop=function(){},e.isEqual=function t(e,n){var o=!1;return e===n||(e&&n&&(Array.isArray(e)||u(e))&&(o=!0,(0,r.each)(e,(function(e,r){return!Array.isArray(e)&&!u(e)||t(n[r],e)?n[r]!==e?(o=!1,!0):void 0:(o=!1,!0)}))),o)},e.isString=function(t){return"string"==typeof t},e.isEmpty=function(t){return[Object,Array].includes((t||{}).constructor)&&!Object.entries(t||{}).length},e.isInteger=function(t){return Number.isInteger(t)},e.isNaN=function(t){return Number.isNaN(t)},e.isNil=function(t){return null==t},e.isNull=function(t){return null===t},e.isArray=function(t){return Array.isArray(t)},e.isObjectLike=i,e.isObject=u,e.isPlainObject=function(t){if(!i(t)||"[object Object]"!=o(t))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},e.isNumber=function(t){return"number"==typeof t||i(t)&&"[object Number]"==o(t)},e.isBoolean=function(t){return!0===t||!1===t||i(t)&&"[object Boolean]"==o(t)},e.isRegExp=function(t){return i(t)&&"[object RegExp]"==o(t)}},7592:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.sumBy=e.sum=e.mod=e.subtract=e.round=e.multiply=e.minBy=e.min=e.meanBy=e.mean=e.maxBy=e.max=e.floor=e.divide=e.ceil=e.add=void 0;var r=n(7739),o=n(1769);function i(t,e,n){return void 0===n&&(n=0),n?e(t*(n=Math.pow(10,n)))/n:e(t)}function u(t,e,n){var i=t[0];if(t.length<=1)return i;var u=(0,r.isString)(e);return t.slice(1).reduce((function(t,r){var i=u?(0,o.get)(t,e):e(t),c=u?(0,o.get)(r,e):e(r);return n(i,c)===c?r:t}),i)}function c(t,e){return t+e}function a(t){return t.reduce(c,0)}function s(t,e){return function(t,e,n){var i=t[0];if(t.length<=1)return i;var u=(0,r.isString)(e);return t.slice(1).reduce((function(t,n){return r=t,i=u?(0,o.get)(n,e):e(n),r+i;var r,i}),u?(0,o.get)(i,e):e(i))}(t,e)}e.add=c,e.ceil=function(t,e){return void 0===e&&(e=0),i(t,Math.ceil,e)},e.divide=function(t,e){return t/e},e.floor=function(t,e){return void 0===e&&(e=0),i(t,Math.floor,e)},e.max=function(t){return Math.max.apply(Math,t)},e.maxBy=function(t,e){return u(t,e,Math.max)},e.mean=function(t){return a(t)/t.length},e.meanBy=function(t,e){return s(t,e)/t.length},e.min=function(t){return Math.min.apply(Math,t)},e.minBy=function(t,e){return u(t,e,Math.min)},e.multiply=function(t,e){return t*e},e.round=function(t,e){return void 0===e&&(e=0),i(t,Math.round,e)},e.subtract=function(t,e){return t-e},e.mod=function(t,e){return t%e},e.sum=a,e.sumBy=s},1769:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.pick=e.defaults=e.cloneDeep=e.clone=e.fastCloneDeep=e.merge=e.set=e.has=e.propertyOf=e.property=e.get=e.pathParts=e.values=e.keys=void 0;var i=n(7739),u=n(2937);function c(t){return t?("["===t[0]&&(t=t.replace(/^\[([^\]]+)\]/,"$1")),t.replace(/\[/g,".").replace(/\]/g,"").split(".")):[]}function a(t,e,n){var r=c(e).reduce((function(t,e){return(t||{})[e]}),t);return void 0!==n&&void 0===r?n:r}function s(t,e){try{return e in t}catch(t){return!1}}function f(t,e){return s(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function l(t,e){for(var n in e)if(e.hasOwnProperty(n)){if(f(t,n))return;s(t,n)?t[n]=h(t[n],e[n]):t[n]=y(e[n])}return t}function p(t,e){return e.forEach((function(e,n){t[n]=h(t[n],e)})),t}function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();return t.reduce((function(e,n,r){return e&&e!==n?(0,i.isArray)(n)?((0,i.isArray)(e)||(t[r]=e=[]),p(e,n)):(0,i.isPlainObject)(n)?l(e,n):y(n):y(n)}),n)}function y(t){return Array.isArray(t)?t.map(y):null===t||"object"!=typeof t?t:Object.fromEntries(Object.entries(t).map((function(t){return[t[0],y(t[1])]})))}e.keys=function(t){return Object.keys(t)},e.values=function(t){return(0,i.isArray)(t)?t:Object.values(t)},e.pathParts=c,e.get=a,e.property=function(t){return function(e){return a(e,t)}},e.propertyOf=function(t){return function(e){return a(t,e)}},e.has=function(t,e){return void 0!==a(t,e,void 0)},e.set=function(t,e,n){var r=c(e);return r.reduce((function(t,e,o){return isNaN(Number(e))||(e=Number(e)),((Array.isArray(t)?e>=t.length:!t.hasOwnProperty(e))||o<r.length-1&&!Array.isArray(t[e])&&!(0,i.isObject)(t[e]))&&(t[e]=isNaN(Number(r[o+1]))?{}:[]),o===r.length-1&&(t[e]=n),t[e]}),t),t},e.merge=h,e.fastCloneDeep=function(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return console.log("Clone Failed: ".concat(t.message)),null}},e.clone=function(t){return Array.isArray(t)?o([],t,!0):r({},t)},e.cloneDeep=y,e.defaults=function(t,e){return(0,u.each)(e,(function(e,n){t.hasOwnProperty(n)||(t[n]=e)})),t},e.pick=function(t,e){return e.reduce((function(e,n){return t&&t.hasOwnProperty(n)&&(e[n]=t[n]),e}),{})}},7150:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.endsWith=e.trim=void 0,e.trim=function(t,e){return void 0===e&&(e="\\s"),t.replace(new RegExp("^([".concat(e,"]*)(.*?)([").concat(e,"]*)$")),"$2")},String.prototype.endsWith||(String.prototype.endsWith=function(t,e){return(void 0===e||e>this.length)&&(e=this.length),this.substring(e-t.length,e)===t}),e.endsWith=function(t,e){return t.endsWith(e)}},6729:function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function i(t,e,r,i,u){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,i||t,u),a=n?n+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],c]:t._events[a].push(c):(t._events[a]=c,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var t,r,o=[];if(0===this._eventsCount)return o;for(r in t=this._events)e.call(t,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},c.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,u=new Array(i);o<i;o++)u[o]=r[o].fn;return u},c.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},c.prototype.emit=function(t,e,r,o,i,u){var c=n?n+t:t;if(!this._events[c])return!1;var a,s,f=this._events[c],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,o),!0;case 5:return f.fn.call(f.context,e,r,o,i),!0;case 6:return f.fn.call(f.context,e,r,o,i,u),!0}for(s=1,a=new Array(l-1);s<l;s++)a[s-1]=arguments[s];f.fn.apply(f.context,a)}else{var p,h=f.length;for(s=0;s<h;s++)switch(f[s].once&&this.removeListener(t,f[s].fn,void 0,!0),l){case 1:f[s].fn.call(f[s].context);break;case 2:f[s].fn.call(f[s].context,e);break;case 3:f[s].fn.call(f[s].context,e,r);break;case 4:f[s].fn.call(f[s].context,e,r,o);break;default:if(!a)for(p=1,a=new Array(l-1);p<l;p++)a[p-1]=arguments[p];f[s].fn.apply(f[s].context,a)}}return!0},c.prototype.on=function(t,e,n){return i(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return i(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,r,o){var i=n?n+t:t;if(!this._events[i])return this;if(!e)return u(this,i),this;var c=this._events[i];if(c.fn)c.fn!==e||o&&!c.once||r&&c.context!==r||u(this,i);else{for(var a=0,s=[],f=c.length;a<f;a++)(c[a].fn!==e||o&&!c[a].once||r&&c[a].context!==r)&&s.push(c[a]);s.length?this._events[i]=1===s.length?s[0]:s:u(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&u(this,e)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,t.exports=c},3020:function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitterBase=e.EventEmitter=void 0;var c=u(n(6729));e.EventEmitterBase=c.default,e.EventEmitter=function(t){return t||(t=function(){}),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.parent=null,e.events=new c.default,e}return o(e,t),e.prototype.bubble=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this.parent?(e=this.parent).bubble.apply(e,i([t],n,!1)):this.emit.apply(this,i([t],n,!1))},e.prototype.emit=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(e=this.events).emit.apply(e,i([t],n,!1))},e.prototype.on=function(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return(n=this.events).on.apply(n,i([t,e],r,!1))},e.prototype.once=function(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return(n=this.events).once.apply(n,i([t,e],r,!1))},e.prototype.off=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(e=this.events).off.apply(e,i([t],n,!1))},e}(t)}},7627:function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},u=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),c=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&u(e,t,n);return c(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}a((r=r.apply(t,e||[])).next())}))},f=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Model=void 0;var l=a(n(2373)),p=n(3020);e.Model=function(t){return void 0===t&&(t={}),t.schema||(t.schema={}),t.schema.key||(t.schema.key=""),function(e){return function(e){function n(t,n,r){void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={});var o=e.call(this,t,n,r)||this;return o.component=t,o.options=n,o.data=r,o.root=null,o.validator=null,o.id="e".concat(Math.random().toString(36).substring(7)),o.component=l.merge({},o.defaultSchema,o.component),o.options=i(i({},o.defaultOptions),o.options),o.options.noInit||o.init(),o}return o(n,e),n.schema=function(){return t.schema},Object.defineProperty(n.prototype,"defaultOptions",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"defaultSchema",{get:function(){return n.schema()},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.hook("init"),this.options.validator&&(this.validator=this.options.validator.fromComponent(this))},n.prototype.checkComponentValidity=function(){return s(this,void 0,void 0,(function(){return f(this,(function(t){return[2,!this.validator||this.validator.check()]}))}))},n.prototype.checkValidity=function(){return s(this,void 0,void 0,(function(){return f(this,(function(t){return[2,this.checkComponentValidity()]}))}))},Object.defineProperty(n.prototype,"errors",{get:function(){return this.validator.errors},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"emptyValue",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.isEmpty=function(t){void 0===t&&(t=this.dataValue);var e=!(!l.isArray(t)||1!==t.length)&&l.isEqual(t[0],this.emptyValue);return null==t||0===t.length||l.isEqual(t,this.emptyValue)||e},Object.defineProperty(n.prototype,"dataValue",{get:function(){return l.get(this.data,this.component.key)},set:function(t){this.component.key&&l.set(this.data,this.component.key,t)},enumerable:!1,configurable:!0}),n.prototype.hasChanged=function(t){return String(t)!==String(this.dataValue)},n.prototype.updateValue=function(t){var e=this.hasChanged(t);return this.dataValue=t,e&&this.bubble("change",t),e},n.prototype.getValue=function(){return this.dataValue},n.prototype.hook=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(this.options&&this.options.hooks&&this.options.hooks[t])return this.options.hooks[t].apply(this,e);var r="function"==typeof e[e.length-1]?e[e.length-1]:null;return r?r(null,e[1]):e[1]},n}((0,p.EventEmitter)(e))}}},9494:function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),u=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return u(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.NestedArrayModel=void 0;var a=c(n(2373)),s=n(2006);e.NestedArrayModel=function(t){return void 0===t&&(t={}),function(e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"defaultValue",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.row=function(t){return t<this.rows.length?this.rows[t]:[]},e.prototype.removeRow=function(t){var e=this;this.row(t).forEach((function(t){return e.removeComponent(t)})),this.dataValue.splice(t,1),this.rows.splice(t,1)},e.prototype.addRow=function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var n=t;this.dataValue[e]=n,this.createRowComponents(n,e)},e.prototype.setRowData=function(t,e){var n;this.dataValue[e]=t,null===(n=this.row(e))||void 0===n||n.forEach((function(e){return e.data=t}))},e.prototype.rowChanged=function(t,e){var n,r=!1;return null===(n=this.row(e))||void 0===n||n.forEach((function(e){var n=e.hasChanged(a.get(t,e.component.key));r=n||r,n&&e.bubble("change",e)})),r},e.prototype.createComponents=function(t){var e=this;this.rows=[];var n=[];return this.eachRowValue(t,(function(t,r){n=n.concat(e.createRowComponents(t,r))})),n},e.prototype.createRowComponents=function(e,n){void 0===n&&(n=0);var r=t.prototype.createComponents.call(this,e,(function(t){t.rowIndex=n}));return this.rows[n]=r,r},e.prototype.getIndexes=function(e){return t.prototype.getIndexes?t.prototype.getIndexes.call(this,e):{min:0,max:e.length-1}},e.prototype.eachRowValue=function(t,e){if(t&&t.length)for(var n=this.getIndexes(t),r=n.min;r<=n.max;r++)e(t[r],r)},Object.defineProperty(e.prototype,"emptyValue",{get:function(){return[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataValue",{get:function(){return a.get(this.data,this.component.key)},set:function(t){var e=this;if(Array.isArray(t)){var n=this.dataValue;if(this.eachRowValue(t,(function(t,r){r>=n.length&&e.addRow(t,r),e.setRowData(t,r)})),n.length>t.length)for(var r=t.length;r<n.length;r++)this.removeRow(r)}},enumerable:!1,configurable:!0}),e.prototype.hasChanged=function(t){var e=this,n=this.dataValue;if(t.length!==n.length)return this.emit("changed",this),!0;var r=!1;return this.eachRowValue(t,(function(t,n){r=e.rowChanged(t,n)||r})),r},e.prototype.setValue=function(t){var e=!1;return this.eachComponentValue(t,(function(t,n){e=t.setValue(n)||e})),e},e}((0,s.NestedDataModel)(t)(e))}}},2006:function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),u=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return u(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.NestedDataModel=void 0;var a=c(n(2373)),s=n(4113);e.NestedDataModel=function(t){return void 0===t&&(t={}),function(e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"emptyValue",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultValue",{get:function(){return{}},enumerable:!1,configurable:!0}),e.prototype.componentData=function(){var t=a.get(this.data,this.component.key,this.defaultValue);return Object.keys(t).length||a.set(this.data,this.component.key,t),t},Object.defineProperty(e.prototype,"dataValue",{get:function(){return a.get(this.data,this.component.key)},set:function(t){this.eachComponentValue(t,(function(t,e){return t.dataValue=e}))},enumerable:!1,configurable:!0}),e}((0,s.NestedModel)(t)(e))}}},4113:function(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},u=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),c=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&u(e,t,n);return c(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}a((r=r.apply(t,e||[])).next())}))},f=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.NestedModel=void 0;var l=a(n(2373)),p=n(7627);e.NestedModel=function(t){return void 0===t&&(t={}),t.schema||(t.schema={}),t.schema.components||(t.schema.components=[]),function(e){return function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return o(n,e),n.prototype.init=function(){e.prototype.init.call(this),this.components=[],this.createComponents(this.componentData())},n.prototype.componentData=function(){return this.data},n.prototype.createComponent=function(e,n,r){if(!t.factory)return console.log('Cannot create components. No "factory" provided.'),null;var o=t.factory.create(e,i({noInit:!0},n),r);return o.parent=this,o.root=this.root||this,o.init(),o},n.prototype.createComponents=function(t,e){var n=this,r=[];return(this.component.components||[]).forEach((function(o){var i=n.createComponent(o,n.options,t);i&&(n.components.push(i),r.push(i),e&&e(i))})),r},n.prototype.removeComponent=function(t){var e=this;(this.components||[]).forEach((function(n,r){n===t&&(n.detach&&n.detach(),e.components.splice(r,1))}))},n.prototype.checkValidity=function(){return s(this,void 0,void 0,(function(){return f(this,(function(t){return[2,this.components.reduce((function(t,e){return t&&e.checkValidity()}),this.checkComponentValidity())]}))}))},Object.defineProperty(n.prototype,"defaultValue",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"emptyValue",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataValue",{get:function(){return this.data},set:function(t){this.eachComponentValue(t,(function(t,e){return t.dataValue=e}))},enumerable:!1,configurable:!0}),n.prototype.eachComponent=function(t){l.each(this.components,(function(e,n){if(!1===t(e,n))return!1}))},n.prototype.eachComponentValue=function(t,e){Object.keys(t).length&&this.eachComponent((function(n){e(n,l.get(t,n.component.key))}))},n.prototype.setValue=function(t){var e=!1;return this.eachComponentValue(t,(function(t,n){e=t.setValue(n)||e})),e},n}((0,p.Model)(t)(e))}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}var r={};return function(){var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.NestedArrayModel=t.NestedDataModel=t.NestedModel=t.Model=t.EventEmitter=void 0;var e=n(3020);Object.defineProperty(t,"EventEmitter",{enumerable:!0,get:function(){return e.EventEmitter}});var o=n(7627);Object.defineProperty(t,"Model",{enumerable:!0,get:function(){return o.Model}});var i=n(4113);Object.defineProperty(t,"NestedModel",{enumerable:!0,get:function(){return i.NestedModel}});var u=n(2006);Object.defineProperty(t,"NestedDataModel",{enumerable:!0,get:function(){return u.NestedDataModel}});var c=n(9494);Object.defineProperty(t,"NestedArrayModel",{enumerable:!0,get:function(){return c.NestedArrayModel}})}(),r}()}));