devfab 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,n,i,a,s,"next",e)}function s(e){asyncGeneratorStep(o,n,i,a,s,"throw",e)}a(void 0)})}}function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _regenerator(){
1
+ "use strict";function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _regenerator(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return _regeneratorDefine(c,"_invoke",function(r,n,i){var o,s,u,c=0,l=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,u=e,f.n=r,a}};function h(r,n){for(s=r,u=n,t=0;!d&&c&&!i&&t<l.length;t++){var i,o=l[t],h=f.p,p=o[2];r>3?(i=p===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(i||r>1)return a;throw d=!0,n}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&h(l,p),s=l,u=p;(t=s<2?e:u)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,u)):f.n=u:f.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?u:r.call(n,f))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:d}}}(r,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=c,_regeneratorDefine(d,"constructor",c),_regeneratorDefine(c,"constructor",u),u.displayName="GeneratorFunction",_regeneratorDefine(c,i,"GeneratorFunction"),_regeneratorDefine(d),_regeneratorDefine(d,i,"Generator"),_regeneratorDefine(d,n,function(){return this}),_regeneratorDefine(d,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:o,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function o(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine(e,t,r,n)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _typeof(e){return _typeof="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},_typeof(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},__devfab_requirejs={};
3
+ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return _regeneratorDefine(c,"_invoke",function(r,n,i){var a,s,u,c=0,l=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,u=e,f.n=r,o}};function p(r,n){for(s=r,u=n,t=0;!d&&c&&!i&&t<l.length;t++){var i,a=l[t],p=f.p,h=a[2];r>3?(i=h===n)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(i=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(i||r>1)return o;throw d=!0,n}return function(i,l,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&p(l,h),s=l,u=h;(t=s<2?e:u)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,u)):f.n=u:f.v=u);try{if(c=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(d=f.n<0)?u:r.call(n,f))!==o)break}catch(t){a=e,s=1,u=t}finally{c=1}}return{value:t,done:d}}}(r,i,a),!0),c}var o={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=c,_regeneratorDefine(d,"constructor",c),_regeneratorDefine(c,"constructor",u),u.displayName="GeneratorFunction",_regeneratorDefine(c,i,"GeneratorFunction"),_regeneratorDefine(d),_regeneratorDefine(d,i,"Generator"),_regeneratorDefine(d,n,function(){return this}),_regeneratorDefine(d,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _typeof(e){return _typeof="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},_typeof(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}
4
4
  /** vim: et:ts=4:sw=4:sts=4
5
5
  * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
6
6
  * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
7
- */window.__devfab_requirejs=__devfab_requirejs,function(global,setTimeout){var requirejs,require,define,req,s,head,baseElement,dataMain,src,body,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var r;if(e)for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}function eachReverse(e,t){var r;if(e)for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,n){return t&&eachProp(t,function(t,i){!r&&hasProp(e,i)||(!n||"object"!==_typeof(t)||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[i]=t:(e[i]||(e[i]={}),mixin(e[i],t,r,n)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,r,n){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=n,r&&(i.originalError=r),i}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,r,n){var i,o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=r,r=n):e=[]),o&&o.context&&(s=o.context),a.name&&(s=a.name),(i=getOwn(contexts,s))||(i=contexts[s]=req.s.newContext(s,a)),o&&i.configure(o),i.require(e,t,r)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$|\.css$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],body=s.body=document.getElementsByTagName("body")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,r){var n,i="";try{r.split("?")[0].endsWith(".css")&&(i="css")}catch(e){}return"css"===i?((n=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:link"):document.createElement("link")).href=r,n.rel="stylesheet",n.type=e.linkType||"text/css",n):((n=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script")).type=e.scriptType||"text/javascript",n.charset="utf-8",n.async=!1,n)},req.load=function(e,t,r){var n,i=e&&e.config||{};if(isBrowser)return(n=req.createNode(i,t,r)).setAttribute("data-requirecontext",e.contextName),n.setAttribute("data-requiremodule",t),!n.attachEvent||n.attachEvent.toString&&n.attachEvent.toString().indexOf("[native code")<0||isOpera?(n.addEventListener("load",e.onScriptLoad,!1),n.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,n.attachEvent("onreadystatechange",e.onScriptLoad)),n.src=r,i.onNodeCreated&&i.onNodeCreated(n,i,t,r),currentlyAddingScript=n,baseElement?head.insertBefore(n,baseElement):body?body.appendChild(n):head.appendChild(n),currentlyAddingScript=null,n;if(isWebWorker)try{setTimeout(function(){},0),importScripts(r),e.completeLoad(t)}catch(n){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+r,n,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,r){var n,i;"string"!=typeof e&&(r=t,t=e,e=null),isArray(t)||(r=t,t=null),!t&&isFunction(r)&&(t=[],r.length&&(r.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,r){t.push(r)}),t=(1===r.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(n=currentlyAddingScript||getInteractiveScript())&&(e||(e=n.getAttribute("data-requiremodule")),i=contexts[n.getAttribute("data-requirecontext")]),i?(i.defQueue.push([e,t,r]),i.defQueueMap[e]=!0):globalDefQueue.push([e,t,r])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},__devfab_requirejs.require=require,__devfab_requirejs.define=define,req(cfg)}function newContext(e){var t,r,n,i,o,a={waitSeconds:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).waitSeconds||30,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},s={},u={},c={},l=[],d={},f={},h={},p=1,v=1;function y(e,t,r){var n,i,o,s,u,c,l,d,f,h,p=t&&t.split("/"),v=a.map,y=v&&v["*"];if(e&&(c=(e=e.split("/")).length-1,a.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),function(e){var t,r;for(t=0;t<e.length;t++)if("."===(r=e[t]))e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(p||y)){for(o=(i=e.split("/")).length;o>0;o-=1){if(u=i.slice(0,o).join("/"),p){var g=!1;for(s=p.length;s>0;s-=1)if((n=getOwn(v,p.slice(0,s).join("/")))&&(n=getOwn(n,u))){l=n,d=o,g=!0;break}if(g)break}!f&&y&&getOwn(y,u)&&(f=getOwn(y,u),h=o)}!l&&f&&(l=f,d=h),l&&(i.splice(0,d,l),e=i.join("/"))}return getOwn(a.pkgs,e)||e}function g(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===n.contextName)return t.parentNode.removeChild(t),!0})}function _(e){var t=getOwn(a.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),n.require.undef(e),n.makeRequire(null,{skipMap:!0})([e]),!0}function m(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function b(e,t,r,i){var o,a,s,u,c=null,l=t?t.name:null,f=e,h=!0,g="";return e||(h=!1,e="_@r"+(p+=1)),c=(u=m(e))[0],e=u[1],c&&(c=y(c,l,i),a=getOwn(d,c)),e&&(c?g=a&&a.normalize?a.normalize(e,function(e){return y(e,l,i)}):-1===e.indexOf("!")?y(e,l,i):e:(c=(u=m(g=y(e,l,i)))[0],g=u[1],r=!0,o=n.nameToUrl(g))),{prefix:c,name:g,parentMap:t,unnormalized:!!(s=!c||a||r?"":"_unnormalized"+(v+=1)),url:o,originalName:f,isDefine:h,id:(c?c+"!"+g:g)+s}}function k(e){var t=e.id,r=getOwn(s,t);return r||(r=s[t]=new n.Module(e)),r}function x(e,t,r){var n=e.id,i=getOwn(s,n);!hasProp(d,n)||i&&!i.defineEmitComplete?(i=k(e)).error&&"error"===t?r(i.error):i.on(t,r):"defined"===t&&r(d[n])}function w(e,t){var r=e.requireModules,n=!1;t?t(e):(each(r,function(t){var r=getOwn(s,t);r&&(r.error=e,r.events.error&&(n=!0,r.emit("error",e)))}),n||req.onError(e))}function S(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(n.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function P(e){delete s[e],delete u[e]}function C(e,t,r){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,each(e.depMaps,function(n,i){var o=n.id,a=getOwn(s,o);!a||e.depMatched[i]||r[o]||(getOwn(t,o)?(e.defineDep(i,d[o]),e.check()):C(a,t,r))}),r[n]=!0)}function A(){var e,r,i=1e3*a.waitSeconds,s=i&&n.startTime+i<(new Date).getTime(),c=[],l=[],d=!1,f=!0;if(!t){if(t=!0,eachProp(u,function(e){var t=e.map,n=t.id;if(e.enabled&&(t.isDefine||l.push(e),!e.error))if(!e.inited&&s)_(n)?(r=!0,d=!0):(c.push(n),g(n));else if(!e.inited&&e.fetched&&t.isDefine&&(d=!0,!t.prefix))return f=!1}),s&&c.length)return(e=makeError("timeout","Load timeout for modules: "+c,null,c)).contextName=n.contextName,w(e);f&&each(l,function(e){C(e,{},{})}),s&&!r||!d||!isBrowser&&!isWebWorker||o||(o=setTimeout(function(){o=0,A()},50)),t=!1}}function q(e){hasProp(d,e[0])||k(b(e[0],null,!0)).init(e[1],e[2])}function j(e,t,r,n){e.detachEvent&&!isOpera?n&&e.detachEvent(n,t):e.removeEventListener(r,t,!1)}function E(e){var t=e.currentTarget||e.srcElement;return j(t,n.onScriptLoad,"load","onreadystatechange"),j(t,n.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function O(){var e;for(S();l.length;){if(null===(e=l.shift())[0])return w(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));q(e)}n.defQueueMap={}}return i={require:function(e){return e.require?e.require:e.require=n.makeRequire(e.map)},exports:function(e){e.usingExports=!0,e.map.isDefine&&(e.exports?d[e.map.id]=e.exports:e.exports=d[e.map.id]={})},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(a.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},(r=function(e){this.events=getOwn(c,e.id)||{},this.map=e,this.shim=getOwn(a.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,r,n){n=n||{},this.inited||(this.factory=t,r?this.on("error",r):this.events.error&&(r=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=r,this.inited=!0,this.ignore=n.ignore,n.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,n.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();n.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;f[e]||(f[e]=!0,n.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,r=this.map.id,i=this.depExports,o=this.exports,a=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(a)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{o=n.execCb(r,a,i,o)}catch(t){e=t}else o=n.execCb(r,a,i,o);if(this.map.isDefine&&void 0===o&&((t=this.module)?o=t.exports:this.usingExports&&(o=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",w(this.error=e)}else o=a;if(this.exports=o,this.map.isDefine&&!this.ignore&&(d[r]=o,req.onResourceLoad)){var s=[];each(this.depMaps,function(e){s.push(e.normalizedMap||e)}),req.onResourceLoad(n,this.map,s)}P(r),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(n.defQueueMap,r)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=b(e.prefix);this.depMaps.push(r),x(r,"defined",bind(this,function(r){var i,o,u,c=getOwn(h,this.map.id),l=this.map.name,d=this.map.parentMap?this.map.parentMap.name:null,f=n.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return y(e,d,!0)})||""),x(o=b(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((u=getOwn(s,o.id))&&(this.depMaps.push(o),this.events.error&&u.on("error",bind(this,function(e){this.emit("error",e)})),u.enable()))):c?(this.map.url=n.nameToUrl(c),void this.load()):((i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(s,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&P(e.map.id)}),w(e)}),i.fromText=bind(this,function(r,o){var s=e.name,u=b(s),c=useInteractive;o&&(r=o),c&&(useInteractive=!1),k(u),hasProp(a.config,t)&&(a.config[s]=a.config[t]);try{req.exec(r)}catch(e){return w(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}c&&(useInteractive=!0),this.depMaps.push(u),n.completeLoad(s),f([s],i)}),void r.load(e.name,f,i,a))})),n.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){u[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var r,o,a;if("string"==typeof e){if(e=b(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,a=getOwn(i,e.id))return void(this.depExports[t]=a(this));this.depCount+=1,x(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?x(e,"error",bind(this,this.errback)):this.events.error&&x(e,"error",bind(this,function(e){this.emit("error",e)}))}r=e.id,o=s[r],hasProp(i,r)||!o||o.enabled||n.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(s,e.id);t&&!t.enabled&&n.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var r=this.events[e];r||(r=this.events[e]=[]),r.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},n={config:a,contextName:e,registry:s,defined:d,urlFetched:f,defQueue:l,defQueueMap:{},Module:r,makeModuleMap:b,nextTick:req.nextTick,onError:w,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,r){return(-1===r.indexOf("?")?"?":"&")+t}}var r=a.shim,i={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?(a[t]||(a[t]={}),mixin(a[t],e,!0,!0)):a[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(h[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=n.makeShimExports(e)),r[t]=e}),a.shim=r),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(a.paths[t]=e.location),a.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(s,function(e,t){e.inited||e.map.unnormalized||(e.map=b(t,null,!0))}),(e.deps||e.callback)&&n.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,r){function o(a,u,c){var l,f;return r.enableBuildCallback&&u&&isFunction(u)&&(u.__requireJsBuild=!0),"string"==typeof a?isFunction(u)?w(makeError("requireargs","Invalid require call"),c):t&&hasProp(i,a)?i[a](s[t.id]):req.get?req.get(n,a,t,o):(l=b(a,t,!1,!0).id,hasProp(d,l)?d[l]:w(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(O(),n.nextTick(function(){O(),(f=k(b(null,t))).skipMap=r.skipMap,f.init(a,u,c,{enabled:!0}),A()}),o)}return r=r||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),o=e.split("/")[0];return-1!==i&&(!("."===o||".."===o)||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),n.nameToUrl(y(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(d,b(e,t,!1,!0).id)},specified:function(e){return e=b(e,t,!1,!0).id,hasProp(d,e)||hasProp(s,e)}}),t||(o.undef=function(e){S();var r=b(e,t,!0),i=getOwn(s,e);i.undefed=!0,g(e),delete d[e],delete f[r.url],delete c[e],eachReverse(l,function(t,r){t[0]===e&&l.splice(r,1)}),delete n.defQueueMap[e],i&&(i.events.defined&&(c[e]=i.events),P(e))}),o},enable:function(e){getOwn(s,e.id)&&k(e).enable()},completeLoad:function(e){var t,r,i,o=getOwn(a.shim,e)||{},u=o.exports;for(S();l.length;){if(null===(r=l.shift())[0]){if(r[0]=e,t)break;t=!0}else r[0]===e&&(t=!0);q(r)}if(n.defQueueMap={},i=getOwn(s,e),!t&&!hasProp(d,e)&&i&&!i.inited){if(!(!a.enforceDefine||u&&getGlobal(u)))return _(e)?void 0:w(makeError("nodefine","No define call for "+e,null,[e]));q([e,o.deps||[],o.exportsFn])}A()},nameToUrl:function(e,t,r){var i,o,s,u,c,l,d=getOwn(a.pkgs,e);if(d&&(e=d),l=getOwn(h,e))return n.nameToUrl(l,t,r);if(req.jsExtRegExp.test(e))u=e+(t||"");else{for(i=a.paths,s=(o=e.split("/")).length;s>0;s-=1)if(c=getOwn(i,o.slice(0,s).join("/"))){isArray(c)&&(c=c[0]),o.splice(0,s,c);break}u=o.join("/"),u=("/"===(u+=t||(/^data:|^blob:|\?/.test(u)||r?"":".js")).charAt(0)||u.match(/^[\w+.-]+:/)?"":a.baseUrl)+u}return a.urlArgs&&!/^blob:/.test(u)?u+a.urlArgs(e,u):u},load:function(e,t){req.load(n,e,t)},execCb:function(e,t,r,n){return t.apply(n,r)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=E(e);n.completeLoad(t.id)}},onScriptError:function(e){var t=E(e);if(!_(t.id)){var r=[];return eachProp(s,function(e,n){0!==n.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return r.push(n),!0})}),w(makeError("scripterror",'Script error for "'+t.id+(r.length?'", needed by: '+r.join(", "):'"'),e,[t.id]))}}},n.require=n.makeRequire(),n}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}}(commonjsGlobal,"undefined"==typeof setTimeout?void 0:setTimeout),function(e){if(!__devfab_requirejs.__requirejsAdapterApplied){__devfab_requirejs.__requirejsAdapterApplied=!0;var t=__devfab_requirejs.require,r=__devfab_requirejs.define,n=function(e,r,n,i){var o=e,a=r,s=n,u=i;if(Array.isArray(e)&&"function"==typeof r)t(a=e,s=r,u=n);else{!e&&Array.isArray(a)&&(o=[]),Array.isArray(o)&&Array.isArray(a)&&(o=o.join("/"));var c=o?[]:a;"string"==typeof o&&o&&Array.isArray(a)&&a.forEach(function(e){c.push("".concat(o).concat("/"===e.substr(0,1)?"":"/").concat(e))}),console.debug("[devfab][requirejs]: %c requireInner, Parameter[newdeps] is %o","color:fuchsia",c),t(c,s,u)}};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&void 0===n[i]&&(n[i]=t[i]);__devfab_requirejs._require=t,__devfab_requirejs._define=r,__devfab_requirejs.require=n,__devfab_requirejs.define=function(e,t,n){var i=e,o=t,a=n;if(Array.isArray(e)&&"function"==typeof t)r(o=e,a=t);else{!e&&Array.isArray(o)&&(i=[]),Array.isArray(i)&&Array.isArray(o)&&(i=i.join("/"));var s=i?[]:o;"string"==typeof i&&i&&Array.isArray(o)&&o.forEach(function(e){s.push("".concat(i).concat("/"===e.substr(0,1)?"":"/").concat(e))}),r(s,a)}}}}();var CODE_POLICY=403;function normalizePath(e){return String(null==e?"":e).replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"")}function isAbsoluteUrl(e){return/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(e)||/^(?:blob|data):/i.test(e)}function toHex(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n++)r+=t[n].toString(16).padStart(2,"0");return r}var LoadPolicy=function(){return _createClass(function e(t){_classCallCheck(this,e),this.manifest=null,this.origins=null,this.lockVersion=null,this.verifyHash=!0,this.fetch=null,this._index=null,this.configure(t)},[{key:"configure",value:function(e){var t=e||{};return void 0!==t.manifest&&(this.manifest=t.manifest||null),void 0!==t.origins&&(this.origins=t.origins?[].concat(t.origins).map(function(e){return String(e).trim().replace(/\/+$/,"")}):null),void 0!==t.lockVersion&&(this.lockVersion=t.lockVersion||null),void 0!==t.verifyHash&&(this.verifyHash=!!t.verifyHash),void 0!==t.fetch?this.fetch=t.fetch||null:this.fetch||"function"!=typeof fetch||(this.fetch=function(){return fetch.apply(void 0,arguments)}),this._index=null,this}},{key:"enabled",get:function(){return!!this.manifest}},{key:"_moduleIndex",value:function(){if(this._index)return this._index;var e={},t=this.manifest&&this.manifest.modules;return Array.isArray(t)?t.forEach(function(t){t&&t.path&&(e[normalizePath(t.path)]=t)}):t&&"object"===_typeof(t)&&Object.keys(t).forEach(function(r){e[normalizePath(r)]=t[r]||{}}),this._index=e,e}},{key:"entryOf",value:function(e){return this.manifest&&this._moduleIndex()[normalizePath(e)]||null}},{key:"checkVersion",value:function(){if(!this.lockVersion||!this.manifest)return null;var e=String(this.manifest.version||"");return e===String(this.lockVersion)?null:{code:CODE_POLICY,message:"清单版本 ".concat(e||"(未声明)"," 与锁定版本 ").concat(this.lockVersion," 不一致,拒绝加载")}}},{key:"checkModules",value:function(e){var t=this.checkVersion();if(t)return t;if(!this.manifest)return null;for(var r=0;r<e.length;r++){var n=normalizePath(e[r]);if(!this._moduleIndex()[n])return{code:CODE_POLICY,message:"Module ".concat(n," not registered in the list, loading denied.")}}return null}},{key:"checkOrigin",value:function(e){if(!this.origins)return null;if(!isAbsoluteUrl(e))return null;var t;try{t=new URL(e).origin}catch(t){return{code:CODE_POLICY,message:"无法解析的地址:".concat(e)}}return-1===this.origins.indexOf(t)?{code:CODE_POLICY,message:"来源 ".concat(t," 不在白名单内(允许:").concat(this.origins.join(", "),")")}:null}},{key:"verify",value:function(e,t){var r=this;if(!this.verifyHash)return Promise.resolve({ok:!0,skipped:"disabled"});if(!t)return Promise.resolve({ok:!0});var n="undefined"!=typeof globalThis&&globalThis.crypto&&globalThis.crypto.subtle;return n?this.fetch?Promise.resolve().then(function(){return r.fetch(e)}).then(function(e){return e&&e.ok?e.arrayBuffer().then(function(e){return n.digest("SHA-256",e)}):{ok:!1,message:"完整性预检请求失败:HTTP ".concat(e&&e.status||"unknown")}}).then(function(e){if(!e||!1===e.ok)return e;var r=toHex(e),n=String(t).toLowerCase();return r!==n?{ok:!1,message:"sha256 不匹配:期望 ".concat(n,",实际 ").concat(r)}:{ok:!0}}).catch(function(e){return{ok:!1,message:"完整性预检异常:".concat(e&&e.message||e),error:e}}):Promise.resolve({ok:!0,skipped:"fetch unavailable"}):Promise.resolve({ok:!0,skipped:"crypto.subtle unavailable(需要 https / localhost)"})}},{key:"describe",value:function(){return{manifest:this.enabled?this.manifest.name||"(unnamed)":null,version:this.manifest&&this.manifest.version||null,lockVersion:this.lockVersion,modules:this.enabled?Object.keys(this._moduleIndex()).length:0,origins:this.origins?this.origins.slice():null,verifyHash:this.verifyHash}}}])}(),DEFAULT_WATCH=["$","jQuery","define","require","requirejs","devfab","__devfab","__devfab_requirejs"],GlobalGuard=function(){return _createClass(function e(t){_classCallCheck(this,e);var r=t||{};this.maxPollution=void 0===r.maxPollution?3:Number(r.maxPollution),this.watch=[].concat(r.watch||DEFAULT_WATCH),this.target=r.target||("undefined"!=typeof window?window:null),this.enabled=void 0===r.enabled||!!r.enabled,this._pending=0,this._before=null,this.lastWarnings=[]},[{key:"_snapshot",value:function(){var e=new Map,t=this.target;return t?(Object.keys(t).forEach(function(r){e.set(r,t[r])}),e):e}},{key:"_diff",value:function(){var e=this,t=this._before,r=this._snapshot(),n=[];if(!t)return n;r.forEach(function(r,i){var o=-1!==e.watch.indexOf(i);t.has(i)?t.get(i)!==r&&n.push({type:"overwritten",key:i,watched:o}):n.push({type:"added",key:i,watched:o})});var i=n.filter(function(e){return e.watched}).length,o=n.filter(function(e){return"added"===e.type}).length;return!i&&o<=this.maxPollution?[]:n}},{key:"begin",value:function(){var e=this;if(!this.enabled||!this.target)return{end:function(){return[]}};this._pending++,1===this._pending&&(this._before=this._snapshot());var t=!1;return{end:function(){if(t)return[];if(t=!0,e._pending--,e._pending>0)return[];var r=e._diff();return e._before=null,e.lastWarnings=r,r}}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.enabled&&(this.enabled=!!t.enabled),void 0!==t.maxPollution&&(this.maxPollution=Number(t.maxPollution)),void 0!==t.watch&&(this.watch=[].concat(t.watch||[])),void 0!==t.target&&(this.target=t.target||null),this}}])}(),CODE_TIMEOUT=504,nativeImport=null;try{nativeImport=new Function("s","return import(s)")}catch(e){nativeImport=null}function parseArgs(e,t,r,n){var i=e,o=t,a=r;Array.isArray(e)&&!Array.isArray(t)&&(i=null==n?void 0:n.path,o=e,a="function"==typeof t?t:r);var s=(o=Array.isArray(o)?o:[]).join(","),u={code:0,message:"",data:[],warnings:[]};return("require"===n.type&&"function"!=typeof n.require||"define"===n.type&&"function"!=typeof n.define)&&(u.code=404,u.message="requirejs is undefined, the fiels: ".concat(s)),{path:i,files:o,callback:a,filesStr:s,result:u}}function toModuleIds(e,t){var r="";return Array.isArray(e)?r=e.filter(Boolean).join("/"):"string"==typeof e&&(r=e.replace(/\/+$/,"")),t.map(function(e){var t=String(e).replace(/^\/+/,"");return r?"".concat(r,"/").concat(t):t})}function toNumber(e,t){var r=Number(e);return Number.isFinite(r)?r:t}var DEFAULT_OPTIONS={version:"",timeout:15e3,retry:0,strict:!1,baseUrl:""},BaseFileRequire=function(){return _createClass(function e(t){var r,n,i,o;_classCallCheck(this,e);var a=t||{};this.__debug=null!==(r=a.__debug)&&void 0!==r&&r,this.__rootPath=void 0,this.__define=a.define||(null===(n=window.__devfab_requirejs)||void 0===n?void 0:n.define),this.__require=a.require||(null===(i=window.__devfab_requirejs)||void 0===i?void 0:i.require),this.__undef=a.undef||("function"==typeof(null===(o=this.__require)||void 0===o?void 0:o.undef)?this.__require.undef:null),this.__requireConfig=a.requireConfig||this._pickRequireConfig(this.__require),this.__import=a.importer||null,this._setTimer=a.setTimeout||function(e,t){return setTimeout(e,t)},this._clearTimer=a.clearTimeout||function(e){return clearTimeout(e)},this.options={version:a.version?String(a.version):DEFAULT_OPTIONS.version,timeout:void 0===a.timeout?DEFAULT_OPTIONS.timeout:Math.max(0,toNumber(a.timeout,0)),retry:void 0===a.retry?DEFAULT_OPTIONS.retry:Math.max(0,toNumber(a.retry,0)),strict:!!a.strict,baseUrl:a.baseUrl||DEFAULT_OPTIONS.baseUrl},this.policy=new LoadPolicy(a),this.guard=new GlobalGuard(this._guardOptions(a)),this.options.version&&this._applyUrlArgs()},[{key:"_pickRequireConfig",value:function(e){var t,r=e&&"function"==typeof e.config?e:null===(t=window.__devfab_requirejs)||void 0===t?void 0:t.require;return r&&"function"==typeof r.config?r.config.bind(r):null}},{key:"_guardOptions",value:function(e){return!1===e.pollution?{enabled:!1,target:e.target}:e.pollution&&"object"===_typeof(e.pollution)?Object.assign({target:e.target},e.pollution):{target:e.target,watch:e.watch,maxPollution:e.maxPollution,enabled:void 0===e.pollution||!!e.pollution}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.debug&&(this.__debug=!!t.debug),void 0!==t.version&&this.setVersion(t.version),void 0!==t.timeout&&(this.options.timeout=Math.max(0,toNumber(t.timeout,this.options.timeout))),void 0!==t.retry&&(this.options.retry=Math.max(0,toNumber(t.retry,this.options.retry))),void 0!==t.strict&&(this.options.strict=!!t.strict),void 0!==t.baseUrl&&(this.options.baseUrl=t.baseUrl||""),void 0===t.manifest&&void 0===t.origins&&void 0===t.lockVersion&&void 0===t.verifyHash&&void 0===t.fetch||this.policy.configure(t),void 0!==t.pollution?this.guard.configure(this._guardOptions(t)):void 0===t.watch&&void 0===t.maxPollution&&void 0===t.target||this.guard.configure(t),this}},{key:"setVersion",value:function(e){return this.options.version=e?String(e):"",this._applyUrlArgs(),this}},{key:"_applyUrlArgs",value:function(){if("function"!=typeof this.__requireConfig)return!1;try{return this.__requireConfig({urlArgs:this.options.version?"v=".concat(encodeURIComponent(this.options.version)):""}),!0}catch(e){return!1}}},{key:"getVersion",value:function(){return this.options.version}},{key:"_snapshotConfig",value:function(){return{__debug:this.__debug,version:this.options.version,timeout:this.options.timeout,retry:this.options.retry,strict:this.options.strict,baseUrl:this.options.baseUrl,manifest:this.policy.manifest,origins:this.policy.origins,lockVersion:this.policy.lockVersion,verifyHash:this.policy.verifyHash,fetch:this.policy.fetch,pollution:this.guard.enabled,watch:this.guard.watch,maxPollution:this.guard.maxPollution,target:this.guard.target}}},{key:"describe",value:function(){return Object.assign({},this.options,{debug:this.__debug,policy:this.policy.describe(),pollutionGuard:this.guard.enabled,canUndef:"function"==typeof this.__undef,canNativeImport:"function"==typeof(this.__import||nativeImport)})}},{key:"_define",value:function(e,t,r){var n=parseArgs(e,t,r,{path:this.__rootPath,define:this.__define,type:"define"}),i=n.path,o=n.files,a=n.callback,s=n.result;404!==s.code?this.__define(i,o,a):null==a||a(s)}},{key:"_mergeWarnings",value:function(e,t){var r=(e||[]).slice();return(t||[]).forEach(function(e){r.some(function(t){return t.type===e.type&&t.key===e.key})||r.push(e)}),r}},{key:"_undefModules",value:function(e){var t=this;"function"==typeof this.__undef&&e.forEach(function(e){try{t.__undef(e)}catch(e){}})}},{key:"_load",value:function(e,t,r){var n=this,i=this.options,o=parseArgs(e,t,r,{path:this.__rootPath,require:this.__require,type:"require"}),a=o.path,s=o.files,u=o.callback,c=o.result,l=o.filesStr;if(404!==c.code){var d=toModuleIds(a,s),f=this.policy.checkModules(d);if(f)return c.code=f.code,c.message=f.message,void(null==u||u(c));var h=!1,p=0,v=null,y=null,g=function(){y&&(c.warnings=n._mergeWarnings(c.warnings,y.end()),y=null)},_=function(){h||(h=!0,null!==v&&(n._clearTimer(v),v=null),g(),i.strict&&c.warnings.length&&(c.code=500,c.message="Global pollution detection failed:".concat(c.warnings.map(function(e){return"".concat(e.type,":").concat(e.key)}).join(", "))),null==u||u(c))},m=function(){p++,y=n.guard.begin(),i.timeout>0&&(v=n._setTimer(function(){if(!h){var e=new Error("load timeout after ".concat(i.timeout,"ms: ").concat(l));e.__devfabTimeout=!0,b(e,"files load timeout after ".concat(i.timeout,"ms, the files: ").concat(l))}},i.timeout)),n.__require(a,s,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];c.data=t,_()},function(e){b(e)})},b=function(e,t){if(!h){if(null!==v&&(n._clearTimer(v),v=null),p<=i.retry)return g(),n._undefModules(d),void m();c.code=e&&e.__devfabTimeout?CODE_TIMEOUT:500,c.message=t||"files load error, the files: ".concat(l),c.error=e,_()}};m()}else null==u||u(c)}},{key:"load",value:function(e,t,r){this._load(e,t,r)}},{key:"resolveUrl",value:function(e){var t=String(null==e?"":e);if(/^[a-z][a-z0-9+.-]*:/i.test(t)||/^\/\//.test(t))return t;var r=this.options.baseUrl||("undefined"!=typeof document&&document.baseURI?document.baseURI:"");if(!r)return t;try{return new URL(t,r).href}catch(e){return t}}},{key:"_importOne",value:function(e){var t=this,r=this.resolveUrl(e),n=this.policy.checkOrigin(r);if(n)return Promise.resolve({ok:!1,code:n.code,message:n.message});var i=this.policy.entryOf(e),o=i&&i.sha256,a=function(){var e=t.__import||nativeImport;return"function"!=typeof e?Promise.resolve({ok:!1,code:500,message:"native import() is unavailable(CSP 是否禁用了 unsafe-eval?)"}):Promise.resolve().then(function(){return e(r)}).then(function(e){return{ok:!0,module:e}},function(e){return{ok:!1,code:500,message:"module load error: ".concat(r),error:e}})};return o?this.policy.verify(r,o).then(function(e){return e.ok?a():{ok:!1,code:CODE_POLICY,message:"".concat(e.message,"(").concat(r,")")}}):a()}},{key:"loadModules",value:function(e,t,r){var n=this,i=parseArgs(e,t,r,{path:this.__rootPath,type:"module"}),o=i.path,a=i.files,s=i.callback,u=i.result,c=i.filesStr,l=toModuleIds(o,a),d=function(e){return null==s||s(e),e},f=this.policy.checkModules(l);if(f)return u.code=f.code,u.message=f.message,Promise.resolve(d(u));if(!a.length)return Promise.resolve(d(u));var h=this.guard.begin();return Promise.all(l.map(function(e){return n._importOne(e)})).then(function(e){u.warnings=h.end();var t=e.filter(function(e){return!e.ok});return t.length?(u.code=t[0].code||500,u.message="".concat(t.map(function(e){return e.message}).join("; "),"(the files: ").concat(c,")"),u.error=t[0].error):u.data=e.map(function(e){return e.module}),d(u)})}},{key:"loadModule",value:function(e,t){return this.loadModules([e],t)}}])}(),FileRequireClass=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BaseFileRequire),_createClass(t,[{key:"define",value:function(e,t,r){this._define(e,t,r)}},{key:"defineScript",value:function(e){this.provideScript(e)}},{key:"provideScript",value:function(e){var t=e;"function"!=typeof e&&(t=function(){return e}),this.define([],t)}},{key:"require",value:function(e,t,r){this._load(e,t,r)}},{key:"injectScript",value:function(e,t,r,n){var i=this,o=e,a=t,s=r,u=n;Array.isArray(e)&&"function"==typeof t&&(o=void 0,a=e,s=t,u=r),this._load(o,a,function(e){if(0==e.code&&Array.isArray(e.data))for(var t=0,r=e.data.length;t<r;t++){var n,o=e.data[t];null===(n=s)||void 0===n||n(o,t)}else"function"==typeof u?u(e):i.__debug&&console.error("[devfab][FileRequire][injectScript] error: ",e)})}},{key:"requireScript",value:function(e,t,r){this.injectScript(e,t,r)}}])}(),FileRequire=new FileRequireClass;function isDebug(e){return e||window.devfab&&window.devfab.debug}function QueryString(e){this.pathname="",this.query={};var t=e;this.init=function(){t||(t=location.search);var e=t.indexOf("?"),r=t.indexOf("#");if(e>=0){if(this.pathname=t.substr(0,e),(t=r<0?t.substr(e+1):t.substring(e+1,r)).length>0)for(var n=(t=t.replace(/\+/g," ")).split("&"),i=0,o=n.length;i<o;i++){var a=n[i]||"";if(a){var s=a.indexOf("="),u="",c="";s<0?c=u=window.decode(a):(u=window.decode(a.substr(0,s)),c=window.decode(a.substr(s+1))),this.query[u]=c}}}else this.pathname=t},this.set=function(e,t){this.query[e]=t},this.get=function(e){return this.query[e]},this.del=function(e){delete this.query[e]},this.has=function(e){return null!=this.query[e]},this.toStr=function(){var e=["?"];for(var t in this.query)e.push(encodeURIComponent(t)),e.push("="),e.push(encodeURIComponent(this.query[t])),e.push("&");return 1===e.length?"":(e.splice(e.length-1,1),e.join(""))},this.init()}function _appendUrl(e,t){if(!t)return e;var r=[],n=new QueryString(e);for(var i in t)n.get(i)||r.push("".concat(i,"=").concat(t[i]));if(!r.length)return e;var o=r.join("&");return e.indexOf("?")>=0?"".concat(e,"&").concat(o):"".concat(e,"?").concat(o)}FileRequire.create=function(e){return new FileRequireClass(_objectSpread2(_objectSpread2({},this._snapshotConfig()),e))},window.__devfab=Object.assign({},window.__devfab),window.__devfab.FileRequire=FileRequire,window.__devfab.filePolicy={LoadPolicy:LoadPolicy,GlobalGuard:GlobalGuard,CODE_POLICY:CODE_POLICY,CODE_TIMEOUT:CODE_TIMEOUT},String.prototype.equalsIgnoreCase=function(e){return null!=e&&this.toLowerCase()===e.toLowerCase()};var hasValue=function(e){return null!=e&&""!==e};function pick(e,t,r){if(e){var n=r;"string"==typeof t&&Array.isArray(n)&&(n=_defineProperty({},t,r));var i=n&&n[t];if(!i)return hasValue(e[t])?e[t]:void 0;for(var o=0;o<i.length;o++){var a=e[i[o]];if(hasValue(a))return a}}}var _excluded=["children","render"],BaseBuilder=function(){return _createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"_config",{componentField:["component"]}),_defineProperty(this,"_components",{}),_defineProperty(this,"_renderFactory",null)},[{key:"init",value:function(e,t,r){this._initConfig(e),this._initComponent(t),this._initRenderFactory(r)}},{key:"_initConfig",value:function(e){this._config=Object.assign(this._config,e)}},{key:"_initComponent",value:function(e,t){if(e)if("string"==typeof e){if(this._components[e])return void console.log("[warning] Component ".concat(e," is exist!"));this._components[e]=t}else"function"==typeof e?Object.assign(this._components,null==e?void 0:e()):"object"===_typeof(e)&&Object.assign(this._components,e)}},{key:"_getComponent",value:function(e){return this._components[e]}},{key:"_clearComponents",value:function(){this._components={}}},{key:"_initRenderFactory",value:function(e){this._renderFactory=e}},{key:"_renderComponent",value:function(e,t){var r=this;if(Array.isArray(e)){var n=[];return e.forEach(function(e,i){var o=_objectSpread2({},e),a=pick(o,"component",r._config.componentField),s=o.children,u=o.render,c=_objectWithoutProperties(o,_excluded),l=r._getComponent(a);l||"function"==typeof u||console.log("[warning] Component ".concat(a," is not registered!"));var d={component:l,children:r._renderComponent(s,t)};c.index=i;var f=Object.assign({},null==t?void 0:t.props,{meta:c});"function"==typeof u?n.push(u({node:d,props:f})):"function"==typeof r._renderFactory?n.push(r._renderFactory({node:d,props:f})):(Object.assign(d,f),n.push(d))}),n}}},{key:"clear",value:function(){this._clearComponents(),this._renderFactory=null}}])}(),Builder=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BaseBuilder),_createClass(t,[{key:"initComponent",value:function(e,t){this._initComponent(e,t)}},{key:"getComponents",value:function(){return _objectSpread2({},this._components)}},{key:"getComponent",value:function(e){return this._getComponent(e)}},{key:"hasComponent",value:function(e){return!!this._getComponent(e)}},{key:"initRenderFactory",value:function(e){this._initRenderFactory(e)}},{key:"render",value:function(e,t){return this._renderComponent(e,t)}}])}();function _getUrl(e,t){return e}function getAllResponseHeaders(e){var t=e.xhr.getAllResponseHeaders(),r={};return t.split("\r\n").map(function(e){var t=_slicedToArray(e.split(": "),2),n=t[0],i=t[1];r[n]=i}),r}Builder.create=function(e){return new Builder(e)};var AjaxUtil={_xhrs:[],_jsonps:{index:0},doRequest:function(e){var t,r=e.method||"GET",n=_getUrl(e.url);try{null!=e&&e.requestHeaders&&(t=e.requestHeaders,e.requestHeaders=void 0,delete e.requestHeaders)}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options["requestHeaders"] ERR : ',e)}try{e.params&&e.params.requestHeaders&&(t=e.params.requestHeaders,e.params.requestHeaders=void 0,delete e.params.requestHeaders)}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options.params["requestHeaders"] ERR : ',e)}var i=null;if(r.equalsIgnoreCase("get")||r.equalsIgnoreCase("delete")?n=_appendUrl(n,e.params):(r.equalsIgnoreCase("post")||r.equalsIgnoreCase("put"))&&(i=JSON.stringify(e.params)),e.jsonp)return this.getJsonp(n,e.callback);var o=this.getXMLHttpRequest();if(o){var a;if(o.open(r,n,!1!==e.async),e.timeout&&(o.timeout=e.timeout,o.setRequestHeader("timeout",e.timeout),o.ontimeout=function(){AjaxUtil.onerror(this,e,"timeout")}),e.contentType){if(o.setRequestHeader("Content-Type",e.contentType),e.contentType.indexOf("x-www-form-urlencoded")>=0)i=null===(a=new URLSearchParams(e.params))||void 0===a?void 0:a.toString()}else e.dateType?i=e.params:o.setRequestHeader("Content-Type","application/json;charset=utf-8");try{if(t&&"[object Object]"===Object.prototype.toString.call(t))for(var s in t)o.setRequestHeader(s,t[s])}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options.params["requestHeaders"] ERR : ',e)}o.withCredentials=null==e||!e.hasOwnProperty("withCredentials")||e.withCredentials,e.onBeforeRequest&&e.onBeforeRequest(o,i);try{o.send(i)}catch(t){return{error:"NetWorkError",options:e}}if(!1===e.async)return this.onreadystatechange(o,e);o.onreadystatechange=function(){AjaxUtil.onreadystatechange(this,e)}}},onreadystatechange:function(e,t){if(4===e.readyState){if(200===e.status){var r;try{if("blob"===t.responseType){var n=getAllResponseHeaders({xhr:e});r={code:e.status,data:{data:e.response,headers:n}}}else r=JSON.parse(e.responseText)}catch(r){AjaxUtil.onerror(e,t,e.responseText)}if(!1===t.async)return e.isBusy=!1,t.onAfterRequest&&t.onAfterRequest(r),AjaxUtil.parseAjaxResult(r,!1,null,null,t,e);AjaxUtil.parseAjaxResult(r,t.async,t.callback,t.context,t,e),t.onAfterRequest&&t.onAfterRequest(r)}else if(0===e.status)AjaxUtil.onerror(e,t,"The network connection has been disconnected. Please check the network status of the device and try.");else if(502===e.status||504===e.status)AjaxUtil.onerror(e,t,"An error has occurred with the service. Please try again later.");else{if(401!==e.status){var i={};try{i=JSON.parse(e.responseText)}catch(t){i={code:e.status,message:e.responseText}}return AjaxUtil.onerror(e,t,i)}AjaxUtil.onerror(e,t,"Login information has expired. Please log in again or contact technical staff.")}e.isBusy=!1}},onerror:function(e,t,r){var n="[devfab][ajax]: [onerror]: api error \n [code]: ".concat(e.status," \n [error]: ").concat(("object"===_typeof(r)?JSON.stringify(r):r)||"空"," \n [url]: ").concat(t.url," \n [token]: ").concat(document.cookie);isDebug()&&console.log(n);var i="object"===_typeof(r)?r:{code:500,message:r};t.onAfterRequest&&t.onAfterRequest(i)},getXMLHttpRequest:function(){return this.createXMLHttpRequest()},createXMLHttpRequest:function(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):null},getJsonp:function(e,t){var r=e,n="callback"+this._jsonps.index++,i=document.createElement("script");this._jsonps[n]=function(e){try{t(e)}finally{document.body.removeChild(i)}},r+=-1===r.indexOf("?")?"?":"&callback=cb.rest.AjaxUtil._jsonps."+n,i.src=r,document.body.appendChild(i)},parseAjaxResult:function(e,t,r,n,i,o){if(e){if(!e.code)return!1===t?e:void(r&&r.call(n,null,e));if(200==e.code){if(!1===t)return{result:e.data};r&&r.call(n,null,e.data,e.message,e.errorDetail,e.code,e.displayCode&&e)}else{if(!1===t)return{error:e};r&&r.call(n,e)}}}};function ajax(e,t){return t.url=e,AjaxUtil.doRequest(t)}function DynamicProxy(e,t){this.init&&this.init(e),this.queryParams=t}DynamicProxy.create=function(e,t){return new DynamicProxy(e,t)},DynamicProxy.prototype.init=function(e){if(e)for(var t in this.config=e,this.config)this[t]=function(e){return function(t,r,n){return this.Do(e,t,r,null,n)}}(t),this["".concat(t,"Sync")]=function(e){return function(t){return this.Do(e,t,null,!1)}}(t)},DynamicProxy.prototype.Do=function(e,t,r,n,i){var o,a,s;if(this.config&&this.config[e]&&this.config[e].url){var u=this.config[e],c=u.url;this.queryParams||(this.queryParams={}),null!==(o=u.options)&&void 0!==o&&o.proxyServiceCode&&(this.queryParams.serviceCode=u.options.proxyServiceCode),null!==(a=u.options)&&void 0!==a&&a.billnum&&(this.queryParams.billnum=u.options.billnum),null!==(s=this.queryParams)&&void 0!==s&&s.serviceCode&&(c=_appendUrl(c,this.queryParams));var l=c,d=Object.assign({},u.options);return d.method=u.method||"GET","function"==typeof t?(d.callback=t,d.context=i||d.context||this):d.params=t,r&&(d.callback=r,d.context=i||d.context||this),!1===n&&(d.async=!1),this.ajax(l,d)}},DynamicProxy.prototype.ajax=function(e,t){return ajax(e,t)};var Event=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){var t;this.__ASYNC_EXECUTE__=null===(t=null==e?void 0:e.__ASYNC_EXECUTE__)||void 0===t||t,this._events=new Map,this._firstevents=new Map}},{key:"on",value:function(e,t,r){var n=this._events.get(e);Array.isArray(n)||(n=[]),n.push({callback:t,context:r}),this._events.set(e,n)}},{key:"onFirst",value:function(e,t,r){var n=this._firstevents.get(e);Array.isArray(n)||(n=[]),n.splice(0,0,{callback:t,context:r}),this._firstevents.set(e,n)}},{key:"execute",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=this._events.get(e),o=this._firstevents.get(e);if(!i&&!o)return!0;var a=!0;return[].concat(_toConsumableArray(o||[]),_toConsumableArray(i||[])).forEach(function(e){if(!1!==a){var t=e.callback.apply(e.context||void 0,r);a=!1!==t&&a}}),a}},{key:"un",value:function(e,t){this._unEvents(e,t,this._events),this._unEvents(e,t,this._firstevents)}},{key:"_unEvents",value:function(e,t,r){if(e&&r.has(e))if(t){var n=r.get(e),i=null==n?void 0:n.findIndex(function(e){return e.callback===t});-1!==i&&(null==n||n.splice(i,1))}else r.delete(e)}},{key:"hasEvent",value:function(e){var t,r;return e?((null===(t=this._events.get(e))||void 0===t?void 0:t.length)||0)+((null===(r=this._firstevents.get(e))||void 0===r?void 0:r.length)||0):0}},{key:"fireEvent",value:function(e,t){this.execute("before".concat(e),t)&&(this.execute(e,t),this.execute("after".concat(e),t))}},{key:"_asyncExecute",value:function(e,t,r){for(var n,i=this,o=r.resolve,a=r.reject,s=r.args,u=!0,c=t||[],l=!1,d=function(t){var r,n=c[t];if(!1===u)return 0;if(l)return{v:void 0};if("development"===process.env.nodeEnv)r=n.callback.apply(n.context||i,s);else try{r=n.callback.apply(n.context||i,s)}catch(e){throw e.isAddedMsg||(e.message="(领域扩展事件执行失败,请打开控制台查看详细错误信息并修复):".concat(e.message)),e.isAddedMsg=!0,e}r instanceof Promise?(l=!0,(u=r).callbacks&&u.callbacks.push({reject:function(){u.reject(),t===c.length-1&&(null==a||a())},resolve:function(r){t===c.length-1?(s.length>1&&(s[0]=r),null==o||o(s)):i._asyncExecute(e,c.slice(t+1),{resolve:o,reject:a,args:s})}})):(u=!1!==r&&u,t===c.length-1&&(u?null==o||o(s):null==a||a()))},f=0;f<c.length&&0!==(n=d(f));f++)if(n)return n.v;return u}},{key:"_asyncPromiseExecute",value:function(e,t,r,n){var i=this._events.get(e),o=this._firstevents.get(e);if(!((Array.isArray(i)?i.length:i)||(Array.isArray(o)?o.length:o)))return null==t?void 0:t();var a=[].concat(_toConsumableArray(o||[]),_toConsumableArray(i||[]));return this._asyncExecute(e,a,{resolve:t,reject:r,args:n})}},{key:"promiseExecute",value:function(e,t){var r=this,n=e,i=1;if("boolean"==typeof e&&(n=t,i=2),n){for(var o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];var u=2===i?a:[t].concat(a);if(u.length){var c,l=u.length-1,d=u[l];if("function"!=typeof d){if("object"!==_typeof(d)||!d[0]||"function"!=typeof d[0]||!d[1]||"function"!=typeof d[1])return;c=d[1],d=d[0]}if(this.__ASYNC_EXECUTE__)return this._asyncPromiseExecute(n,function(e){d.apply(r,e)},function(){c&&"function"==typeof c&&c()},u);u.splice(l,1),u.unshift(n);var f=this.execute.apply(this,u);if(f instanceof Promise){var h=this;f.then(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];d.apply(h,t)},function(){c&&"function"==typeof c&&c()})}else if(!f)return void(c&&"function"==typeof c&&c())}}}},{key:"clear",value:function(){this._events.clear(),this._firstevents.clear()}}])}();Event.create=function(e){return new Event(e)};var Cache=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){this._data=Object.assign({},e)}},{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){var t;return null===(t=this._data)||void 0===t?void 0:t[e]}},{key:"delete",value:function(e){delete this._data[e]}},{key:"clear",value:function(){this._data={}}}])}();Cache.create=function(e){return new Cache};var BaseModel$1=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){this._data={};var t=[];if(e)for(var r in e)t.push(r);Object.assign(this._data,{components:[],propertyNames:t},e),this._data.cache=new Cache,this._data.events=new Event}},{key:"_del_data",value:function(e){e&&delete this._data[e]}},{key:"_cls_data",value:function(){this._data.cache.clear(),this._data.events.clear(),this._data={components:[],propertyNames:[],cache:new Cache,events:new Event}}},{key:"_set_data",value:function(e,t,r){if(e){if(r){var n=this._data.propertyNames||[];n.indexOf(e)<0&&n.push(e)}this._data[e]=t}}},{key:"_get_data",value:function(e){if(e)return this._data[e]}},{key:"getData",value:function(){return this._get_data("value")}},{key:"getState",value:function(e,t){var r;if(!t)return this._get_data(e);var n=(this._get_data("components")||[]).find(function(e){return e.ctrlName===t});return n?null===(r=n.getState)||void 0===r?void 0:r.call(n,e):this._get_data(e)}},{key:"setState",value:function(e,t,r){r||this._set_data(e,t,!0);var n={};n[e]=t,this.doPropertyChange("setState",n,r)}},{key:"doPropertyChange",value:function(e,t,r){var n=this,i=this._get_data("components")||[];if(!i.length)return i;var o=[];if(r){var a=i.find(function(e){return e.ctrlName===r});a&&!this.notifyComponent(a,e,t)&&o.push(a)}else i.forEach(function(r){n.notifyComponent(r,e,t)||o.push(r)});return o.length?o:void 0}},{key:"notifyComponent",value:function(e,t,r){return"function"==typeof e[t]&&(this.viewUpdater(e,t,r),!0)}},{key:"viewUpdater",value:function(e,t,r){if("setState"===t)e[t](r);else{var n=this.getCache("name");e[t](r,n)}}},{key:"get",value:function(e){return this._get_data(e)}},{key:"addComponent",value:function(e,t){if(e){t&&!e.ctrlName&&(e.ctrlName=t);var r=this._get_data("components")||[];r.indexOf(e)>=0||r.push(e)}}},{key:"removeComponent",value:function(e){var t=this._get_data("components")||[],r=t.indexOf(e);r<0||t.splice(r,1)}},{key:"_applyState",value:function(e,t,r){var n=this;r||this._set_data(e,t,!0);var i="set".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),o=this.doPropertyChange(i,t,r);if(o){var a={};a[e]=t,o.forEach(function(e){n.notifyComponent(e,"setState",a)})}}},{key:"getVisible",value:function(e){return this.getState("visible",e)}},{key:"setVisible",value:function(e,t){this._applyState("visible",e,t)}},{key:"getValue",value:function(){return this.getData()}},{key:"setValue",value:function(e,t,r){var n=this,i=this.getValue();if(e!==i){var o={value:e,oldValue:i},a=this._get_data("forceFireEvent");t||a?this.promiseExecute("beforeValueChange",o,[function(){n._set_data("value",e,!0),n._applyState("value",e,r),n.execute("afterValueChange",o)},function(){n._set_data("value",i,!0),n._applyState("value",i,r)}]):(this._set_data("value",e,!0),this._applyState("value",e,r))}}},{key:"getDisabled",value:function(e){return this.getState("disabled",e)}},{key:"setDisabled",value:function(e,t){this._applyState("disabled",e,t)}},{key:"setParent",value:function(e){this.setCache("parent",e)}},{key:"getParent",value:function(){return this.getCache("parent")}},{key:"getRootParent",value:function(){for(var e=this.getParent();null!==(t=e)&&void 0!==t&&t.getParent();){var t;e=e.getParent()}return e}},{key:"setName",value:function(e){this.setCache("name",e)}},{key:"getName",value:function(){return this.getCache("name")}},{key:"setDirty",value:function(e){e?this._set_data("isDirty",!0):(this._del_data("isDirty"),this._set_data("originalData",this.getData()))}},{key:"getDirtyData",value:function(e){var t=this.getData();return!1!==e&&this._get_data("isDirty")||t!==this._get_data("originalData")?t:void 0}},{key:"clear",value:function(e){void 0===e?this._set_data("value",this._get_data("cDefaultValue")):e||this._set_data("value",void 0),this._del_data("isDirty"),this._del_data("checking"),this._del_data("checkMsg")}},{key:"on",value:function(e,t,r){this._get_data("events").on(e,t,r)}},{key:"onFirst",value:function(e,t,r){this._get_data("events").onFirst(e,t,r)}},{key:"execute",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return(t=this._get_data("events")).execute.apply(t,[e].concat(n))}},{key:"un",value:function(e,t){this._get_data("events").un(e,t)}},{key:"hasEvent",value:function(e){return this._get_data("events").hasEvent(e)}},{key:"fireEvent",value:function(e,t){this._get_data("events").fireEvent(e,t)}},{key:"promiseExecute",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];(r=this._get_data("events")).promiseExecute.apply(r,[e,t].concat(i))}},{key:"setCache",value:function(e,t){this._get_data("cache").set(e,t)}},{key:"getCache",value:function(e){return this._get_data("cache").get(e)}},{key:"clearCache",value:function(e){this._get_data("cache").delete(e)}},{key:"setProxy",value:function(e){if(!(e instanceof DynamicProxy)){var t,r=this._get_data("__requestHeaders__");for(var n in e){var i,o,a;if(r&&(null===(i=e[n])||void 0===i||null===(i=i.options)||void 0===i||!i.requestHeaders))null!==(a=e[n])&&void 0!==a&&a.options||(e[n].options={}),e[n].options.requestHeaders=r;null!==(o=this.getProxy())&&void 0!==o&&o[n]&&window.devfab.debug&&console.warn("[devfab][baseModel.prototype.setProxy]: Proxy ".concat(n," already exists on the model. Please change the name of ").concat(n," and try again"))}return this._set_data("proxy",DynamicProxy.create(_objectSpread2(_objectSpread2({},(null===(t=this.getProxy())||void 0===t?void 0:t.config)||{}),e))),this.getProxy()}this._set_data("proxy",e)}},{key:"getProxy",value:function(){return this._get_data("proxy")}}])}(),SimpleModel$1=function(e){function t(){var e;_classCallCheck(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return _defineProperty(e=_callSuper(this,t,[].concat(n)),"modelType","SimpleModel"),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"getDisabled",value:function(){return this.getState("disabled")}},{key:"setDisabled",value:function(e,t){this._applyState("disabled",e,t)}},{key:"getReadonly",value:function(){return this.getState("readonly")}},{key:"setReadonly",value:function(e,t){this._applyState("readonly",e,t)}}])}(),DEFAULT_PAGE_SIZE=20,isArray=Array.isArray;function cloneDeep(e){if(isArray(e))return e.map(cloneDeep);if(e instanceof Date)return new Date(e.getTime());if(e&&"object"===_typeof(e)){var t={};for(var r in e)t[r]=cloneDeep(e[r]);return t}return e}function normalizeColumns(e){var t={};return(isArray(e)?e:Object.keys(e||{}).map(function(t){var r;return _objectSpread2(_objectSpread2({},e[t]||{}),{},{field:(null===(r=e[t])||void 0===r?void 0:r.field)||t})})).forEach(function(e,r){if(e){var n=e.field||e.cFieldName||e.cName||"col_".concat(r);t[n]=_objectSpread2(_objectSpread2({},e),{},{field:n,label:e.label||e.title||e.cCaption||n,index:void 0===e.index?r:e.index})}}),t}function resolveRowsData(e){if(!e)return[];if(isArray(e))return e;if(isArray(e.data))return e.data;if(isArray(e.records))return e.records;if(isArray(e.list))return e.list;if(isArray(e.rows))return e.rows;var t=e.data&&"object"===_typeof(e.data)?e.data:e.result;return isArray(t)?t:t&&"object"===_typeof(t)&&(t.records||t.list||t.rows||t.data)||[]}function createDefaultProps(){var e={id:"_id",selected:"_selected",status:"_status",pageIndex:"pageNo",pageSize:"pageSize",pageCount:"total"};return{columns:{},dataSource:[],rows:[],readOnly:!0,dataSourceMode:"local",columnMode:"local",editMode:"cell",rowKeyField:"id",cellState:{},rowState:{},showCheckBox:!1,multiple:!0,showRowNo:!0,pagination:!0,pageInfo:_defineProperty(_defineProperty(_defineProperty({},e.pageIndex,1),e.pageSize,DEFAULT_PAGE_SIZE),e.pageCount,0),innerUsedAttrs:e,multiRowModel:!1,editRowModels:{},loading:!1,params:{},originalKeyMap:{},defaultRowDatas:new Map}}function resolveProxyConfig(){return _objectSpread2({},(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).proxyConfig||{})}function _getData(e,t,r){var n=this;this.promiseExecute("beforeQuery",{proxyConfig:e,queryParams:t},function(){var i=n,o=n.setProxy({queryData:e}),a=n._get_data("innerUsedAttrs").pageIndex,s={page:_defineProperty(_defineProperty({},n._get_data("innerUsedAttrs").pageSize,n.getPageSize()),a,n.getPageIndex())},u=Object.assign(t,s);n.setCache("proxyCache",{proxyConfig:e,params:u,callback:r});if(!1!==n.execute("beforeQueryData",u)){var c=cloneDeep(u);o.queryData(c,function(e,t,n,i){if(!e){var o=t;this._set_data("dataSourceMode","remote");var a=resolveRowsData(o=Object.assign({},o));this.execute("afterQueryData",o),null==r||r.call(this,a)}},i)}})}function _setData(e){if(this.execute("beforeSetDataSource",e)){var t=this.getRowKeyField(),r={};e.forEach(function(e){r[e[t]]=e}),this._set_data("keyMap",r),this._set_data("dataSource",e,!0),this.doPropertyChange("setDataSource"),this.execute("afterSetDataSource",e)}}var GridModel$1=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t);var n=_objectSpread2(_objectSpread2({},createDefaultProps()),r);isArray(n.dataSource)||(n.dataSource=[]),isArray(n.rows)||(n.rows=[]);var i=resolveProxyConfig(r);return n.proxyConfig=i,n.dataSourceMode=r.dataSourceMode||n.dataSourceMode,_defineProperty(e=_callSuper(this,t,[n]),"modelType","GridModel"),e.initColumns(n.columns),e.initPageInfo(r.cPage||r.page),e.afterInit(),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"afterInit",value:function(){this.execute("afterInit")}},{key:"initColumns",value:function(e){var t=normalizeColumns(e);return this._set_data("columns",t,!0),t}},{key:"initPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread2({},this.getPageInfo()),r=this._get_data("innerUsedAttrs").pageIndex,n=this._get_data("innerUsedAttrs").pageSize;t[r]=e.pageNo||e.pageIndex||t.pageIndex||1,t[n]=e.pageSize||t.pageSize||DEFAULT_PAGE_SIZE,!1===this.get("pagination")&&(t[r]=-1),this._set_data("pageInfo",t)}},{key:"getRowKeyField",value:function(){return this._get_data("rowKeyField")}},{key:"isRemote",value:function(){return"remote"===this._get_data("dataSourceMode")}},{key:"getReadOnly",value:function(){return!!this._get_data("readOnly")}},{key:"setReadOnly",value:function(e){this._applyState("readOnly",!!e)}},{key:"setShowCheckbox",value:function(e){this._applyState("showCheckBox",!!e)}},{key:"setShowRowNo",value:function(e){this._applyState("showRowNo",!!e)}},{key:"getParams",value:function(){return _objectSpread2(_objectSpread2({},this.get("cParams")||{}),this._get_data("params")||{})}},{key:"setParams",value:function(e){this._set_data("params",e||{})}},{key:"getInnerUsedAttrs",value:function(e){var t=this._get_data("innerUsedAttrs");return e?t[e]:t}},{key:"getId",value:function(){return this.getInnerUsedAttrs("id")}},{key:"setDataSource",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("local"===this._get_data("dataSourceMode")){_setData(isArray(e)?e:[])}else{if(!this.execute("beforeProxyLoad",r))return;this.setPageIndex(1),_getData.call(this,e,r,function(e){_setData.call(t,e),null==n||n.call(t)})}}},{key:"reloadData",value:function(){var e=this,t=this.getCache("proxyCache");if(t){var r=t.proxyConfig,n=t.params,i=t.callback;_getData.call(this,r,n,function(t){null==i||i.call(e,t)})}else isDebug()&&console.log("[devfab][GridModel] proxyConfig is null")}},{key:"getDataSource",value:function(){return this._get_data("dataSource")||[]}},{key:"getData",value:function(e){return e?this._get_data("rows"):this._get_data("dataSource")}},{key:"getAllData",value:function(){return this.getData(!0)}},{key:"clear",value:function(){this._set_data("dataSource",[],!0),this._set_data("rows",[],!0)}},{key:"getPageInfo",value:function(){return this._get_data("pageInfo")}},{key:"getPageIndex",value:function(){var e=this._get_data("innerUsedAttrs").pageIndex;return this.getPageInfo()[e]}},{key:"getPageSize",value:function(){var e=this._get_data("innerUsedAttrs").pageSize;return this.getPageInfo()[e]}},{key:"getTotalCount",value:function(){var e=this._get_data("innerUsedAttrs").pageCount;return this.getPageInfo()[e]}},{key:"setPageInfo",value:function(e){var t=this.getPageInfo();this._set_data("pageInfo",_objectSpread2(_objectSpread2({},t),e)),this.reloadData()}},{key:"setPageIndex",value:function(e){if("number"==typeof e){var t=this._get_data("innerUsedAttrs").pageIndex;this._set_data("pageInfo",_objectSpread2(_objectSpread2({},this.getPageInfo()),{},_defineProperty({},t,Math.max(1,e))))}}},{key:"setPageSize",value:function(e){if("number"==typeof e){var t=this._get_data("innerUsedAttrs").pageIndex,r=this._get_data("innerUsedAttrs").pageSize;this._set_data("pageInfo",_objectSpread2(_objectSpread2({},this.getPageInfo()),{},_defineProperty(_defineProperty({},r,Math.max(-1,e)),t,1)))}}},{key:"setTotalCount",value:function(e){var t=this._get_data("innerUsedAttrs").pageCount;this.getPageInfo()[t]=e}}])}(),ViewModel$1=function(e){function t(){var e;_classCallCheck(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return _defineProperty(e=_callSuper(this,t,[].concat(n)),"modelType","ViewModel"),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"getParams",value:function(){return this._get_data("params")}},{key:"setParams",value:function(e){this._set_data("params",e,!0)}},{key:"set",value:function(e,t){t instanceof BaseModel$1&&(t.setParent(this),t.setName(e)),this._set_data(e,t,!0)}},{key:"setData",value:function(e){for(var t in e)this.addProperty(t,e[t])}},{key:"addProperty",value:function(e,t){var r=this.get(e);null!=r&&r.setData?r.setData(t):this.set(e,t)}},{key:"getData",value:function(){var e=this,t=this._get_data("propertyNames")||[],r={};return t.forEach(function(t){var n,i=e.get(t);i instanceof BaseModel$1&&!1!==i._get_data("needCollect")&&(r[t]=null===(n=i.getData)||void 0===n?void 0:n.call(i))}),r}},{key:"getAllData",value:function(e){var t=this,r=this._get_data("propertyNames")||[],n={};return r.forEach(function(r){var i,o=t.get(r);if(o instanceof BaseModel$1&&!1!==o._get_data("needCollect")&&(!e||!o._get_data("isGrid"))){var a=null===(i=o.getData)||void 0===i?void 0:i.call(o);void 0!==a&&(n[r]=a)}}),n}},{key:"removeProperty",value:function(e){var t=this._get_data("propertyNames")||[],r=t.indexOf(e);-1!==r&&t.splice(r,1),this._del_data(e)}},{key:"loadData",value:function(e){this.setCache("isLoadData",!0),this.clear(),this.setData(e),this.setDirty(!1),this.setCache("isLoadData",!1)}},{key:"clear",value:function(e){var t=this;(this._get_data("propertyNames")||[]).forEach(function(r){var n,i=t.get(r);i instanceof BaseModel$1&&!1!==i._get_data("needClear")&&(null===(n=i.clear)||void 0===n||n.call(i,e))})}},{key:"setDirty",value:function(e){e?this._set_data("isDirty",!0):(this._del_data("isDirty"),this._set_data("originalData",this.getData()))}},{key:"getGridModel",value:function(e){var t;if(e)return this.get(e);var r=this._get_data("gridModel");if(r)return r;var n=null===(t=this.getParams())||void 0===t?void 0:t.masterGridModelName;if(n)return this.get(n);for(var i=this._get_data("propertyNames"),o=0,a=i.length;o<a;o++){if((r=this.get(i[o]))instanceof GridModel$1||"GridModel"==r.modelType)return this._set_data("gridModel",r),r}}},{key:"getGridModels",value:function(){for(var e=this._get_data("propertyNames"),t=[],r=0,n=e.length;r<n;r++){var i=this.get(e[r]);(i instanceof GridModel$1||"GridModel"==i.modelType)&&t.push(i)}return t}},{key:"getGridFilterModel",value:function(e){return this.getGridModel(e).getCache("FilterViewModel")}}])}();function loadScripts(e,t,r,n,i){var o,a=t,s=r,u=n,c=i;Array.isArray(t)&&"function"==typeof r&&(a=void 0,s=t,u=r,c=n);var l=(null===(o=c)||void 0===o?void 0:o.viewModel)||this,d=(s=Array.isArray(s)?s:[]).join(",");return FileRequire.create({require:e}).require(a,s,function(e){var t;if(0==e.code&&Array.isArray(e.data))for(var r=0,n=e.data.length;r<n;r++){var i=e.data[r];if(i&&i.doAction)try{i.doAction("init",l)}catch(t){e.code=500,e.message="".concat(d," script execute error"),e.error=t;break}else try{var o;"function"==typeof(null===(o=c)||void 0===o?void 0:o.onFileBack)&&c.onFileBack(i,r)}catch(t){e.code=500,e.message="".concat(d," script customize execute error");break}}0!=e.code&&window.__devfab.debug&&console.info("[devfab][models][extend][loadScripts] ".concat(d," \n [message]: ").concat(e.message," \n").concat(e.error?" \n [error]: ":""),e.error),null===(t=u)||void 0===t||t(e)})}function initExtendScripts(e){var t=this;window.__devfab&&window.__devfab.__debugger_initExtendJs;var r=e.requirejs,n=e.extendScriptParams,i=e.readyEventName,o=void 0===i?"extendReady":i,a=n||{},s=a.enableJs,u=void 0!==s&&s,c=a.filepath,l=a.scriptUrl;if(!u)return window.__devfab.debug&&console.info("[devfab][extend][js] not enable extend script"),void t.execute(o,t);if(!l)return window.__devfab.debug&&console.info("[devfab][extend][js] extend script is not defined"),void t.execute(o,t);var d=c,f=[l];t.getEnv&&t.getEnv("everyCommonExtend")&&f.push(t.getEnv("everyCommonExtend")),loadScripts.call(t,null==r?void 0:r.require,d,f,function(e){t.execute(o,t,e)})}var initExtScripts=function(){var e=_asyncToGenerator(_regenerator().m(function e(t,r,n){var i,o,a,s,u,c,l,d,f,h,p;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(window.__devfab&&window.__devfab.__debugger_initExtJs,a=n.requirejs,s=n.extendScriptParams,c=(u=s||{}).enableExtJs,l=void 0!==c&&c,d=u.exturlsField,f=void 0===d?"extscripturls":d,l){e.n=1;break}return window.__devfab.debug&&console.info("[devfab][extend][exturls] ext script is not enable"),e.a(2,Promise.resolve(!0));case 1:if(t){e.n=2;break}return window.__devfab.debug&&console.info("[devfab][extend][exturls] script data is null"),e.a(2,Promise.resolve(!0));case 2:if(h=null==t?void 0:t[f],p=Array.isArray(h)?h:[],p=(p=(r.getCache("localScripts")||[]).concat(p)).concat(window.__devfab__GLOBAL_EXT_SCRIPTS__||[]),null!==(i=r.getParams())&&void 0!==i&&i.selfExtUrls&&(p=p.concat([r.getParams().selfExtUrls])),null===(o=p)||void 0===o||!o.length){e.n=4;break}return p=_toConsumableArray(new Set(p)),e.n=3,Promise.all(p.map(function(){var e=_asyncToGenerator(_regenerator().m(function e(t){return _regenerator().w(function(e){for(;;)if(0===e.n)return e.a(2,t)},e)}));return function(t){return e.apply(this,arguments)}}()));case 3:p=e.v;case 4:return t[f]=p,e.a(2,new Promise(function(e,t){loadScripts.call(r,null==a?void 0:a.require,p,function(t){e(t)})}))}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),BaseModel=BaseModel$1,SimpleModel=SimpleModel$1,ViewModel=ViewModel$1,GridModel=GridModel$1;function createModelFactory(e,t){var r=(null==t?void 0:t.SimpleModel)||SimpleModel$1,n=e.cControlType||e.component||e.controlType||e.ctrlType;return n=n.toLowerCase(),new r(e)}function _createViewModel(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.modelNameField,i=void 0===n?"cName":n,o=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"init",value:function(e,t){var r=this.createModels(e,t);this.setData(r),this.setDirty(!1)}},{key:"createModels",value:function(e,t){var n={};return(Array.isArray(e)?e:[]).forEach(function(e){var t,o,a={model:createModelFactory(e,r),meta:e,childModel:!0,modelName:e[i]};null==r||null===(t=r.onBeforeInitModel)||void 0===t||t.call(r,a),n[a.modelName]=a.model,null==r||null===(o=r.onAfterInitModel)||void 0===o||o.call(r,a)}),n}},{key:"initData",value:function(){initExtendScripts.call(this,r)}}])}((null==r||null===(t=r.models)||void 0===t?void 0:t.ViewModel)||ViewModel$1);return o.prototype.modelType="ViewModel",o}function _initViewModel(e,t){var r,n,i,o=new(_createViewModel(e,t)),a={model:o,meta:e};return null==t||null===(r=t.onBeforeInitModel)||void 0===r||r.call(t,a),a.model=o,null==o||null===(n=o.init)||void 0===n||n.call(o,e.models,e),null==t||null===(i=t.onAfterInitModel)||void 0===i||i.call(t,a),o}function initViewModel(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=_initViewModel(e,t);return n.on("destroyVM",function(){var e,t;null===(e=n)||void 0===e||null===(t=e.destroyVM)||void 0===t||t.call(e),n=null,window.devfab.debug&&console.info("[devfab][models][initVM]: destory vm ".concat((new Date).toString()))}),n.on("extendReady",_asyncToGenerator(_regenerator().m(function i(){var o;return _regenerator().w(function(i){for(;;)switch(i.n){case 0:return(o=[]).push(initExtScripts(e,n,t)),i.n=1,Promise.all(o);case 1:window.devfab.debug&&console.info("[devfab][models][initVM]: after vm init ".concat((new Date).toString())),null==r||r(n,e);case 2:return i.a(2)}},i)}))),n.initData(),n}var models=Object.freeze({__proto__:null,BaseModel:BaseModel,SimpleModel:SimpleModel,GridModel:GridModel,ViewModel:ViewModel,initViewModel:initViewModel,loadScripts:loadScripts}),utils={models:models,Builder:Builder,Cache:Cache,Event:Event,Ajax:DynamicProxy},devfab={debug:!1,FileRequire:FileRequire,define:function(){FileRequire.define.apply(FileRequire,arguments)},require:function(){FileRequire.require.apply(FileRequire,arguments)},provideScript:function(){FileRequire.provideScript.apply(FileRequire,arguments)},injectScript:function(){FileRequire.injectScript.apply(FileRequire,arguments)},utils:_objectSpread2(_objectSpread2({},utils),{},{builder:utils.Builder.create(),cache:utils.Cache.create(),event:utils.Event.create()})};window.__devfab=Object.assign({},window.__devfab,devfab),exports.default=devfab;
7
+ */Object.defineProperty(exports,"__esModule",{value:!0});var __requirejs={};(function(global,setTimeout){var requirejs,require,define,req,s,head,baseElement,dataMain,src,body,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var r;if(e)for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}function eachReverse(e,t){var r;if(e)for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,n){return t&&eachProp(t,function(t,i){!r&&hasProp(e,i)||(!n||"object"!==_typeof(t)||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[i]=t:(e[i]||(e[i]={}),mixin(e[i],t,r,n)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,r,n){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=n,r&&(i.originalError=r),i}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,r,n){var i,a,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=defContextName;return isArray(e)||"string"==typeof e||(a=e,isArray(t)?(e=t,t=r,r=n):e=[]),a&&a.context&&(s=a.context),o.name&&(s=o.name),(i=getOwn(contexts,s))||(i=contexts[s]=req.s.newContext(s,o)),a&&i.configure(a),i.require(e,t,r)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$|\.css$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],body=s.body=document.getElementsByTagName("body")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,r){var n,i="";try{r.split("?")[0].endsWith(".css")&&(i="css")}catch(e){}return"css"===i?((n=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:link"):document.createElement("link")).href=r,n.rel="stylesheet",n.type=e.linkType||"text/css",n):((n=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script")).type=e.scriptType||"text/javascript",n.charset="utf-8",n.async=!1,n)},req.load=function(e,t,r){var n,i=e&&e.config||{};if(isBrowser)return(n=req.createNode(i,t,r)).setAttribute("data-requirecontext",e.contextName),n.setAttribute("data-requiremodule",t),!n.attachEvent||n.attachEvent.toString&&n.attachEvent.toString().indexOf("[native code")<0||isOpera?(n.addEventListener("load",e.onScriptLoad,!1),n.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,n.attachEvent("onreadystatechange",e.onScriptLoad)),n.src=r,i.onNodeCreated&&i.onNodeCreated(n,i,t,r),currentlyAddingScript=n,baseElement?head.insertBefore(n,baseElement):body?body.appendChild(n):head.appendChild(n),currentlyAddingScript=null,n;if(isWebWorker)try{setTimeout(function(){},0),importScripts(r),e.completeLoad(t)}catch(n){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+r,n,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,r){var n,i;"string"!=typeof e&&(r=t,t=e,e=null),isArray(t)||(r=t,t=null),!t&&isFunction(r)&&(t=[],r.length&&(r.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,r){t.push(r)}),t=(1===r.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(n=currentlyAddingScript||getInteractiveScript())&&(e||(e=n.getAttribute("data-requiremodule")),i=contexts[n.getAttribute("data-requirecontext")]),i?(i.defQueue.push([e,t,r]),i.defQueueMap[e]=!0):globalDefQueue.push([e,t,r])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},__requirejs.require=require,__requirejs.define=define,req(cfg)}function newContext(e){var t,r,n,i,a,o={waitSeconds:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).waitSeconds||30,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},s={},u={},c={},l=[],d={},f={},p={},h=1,v=1;function y(e,t,r){var n,i,a,s,u,c,l,d,f,p,h=t&&t.split("/"),v=o.map,y=v&&v["*"];if(e&&(c=(e=e.split("/")).length-1,o.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),function(e){var t,r;for(t=0;t<e.length;t++)if("."===(r=e[t]))e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(h||y)){for(a=(i=e.split("/")).length;a>0;a-=1){if(u=i.slice(0,a).join("/"),h){var g=!1;for(s=h.length;s>0;s-=1)if((n=getOwn(v,h.slice(0,s).join("/")))&&(n=getOwn(n,u))){l=n,d=a,g=!0;break}if(g)break}!f&&y&&getOwn(y,u)&&(f=getOwn(y,u),p=a)}!l&&f&&(l=f,d=p),l&&(i.splice(0,d,l),e=i.join("/"))}return getOwn(o.pkgs,e)||e}function g(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===n.contextName)return t.parentNode.removeChild(t),!0})}function _(e){var t=getOwn(o.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),n.require.undef(e),n.makeRequire(null,{skipMap:!0})([e]),!0}function m(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function b(e,t,r,i){var a,o,s,u,c=null,l=t?t.name:null,f=e,p=!0,g="";return e||(p=!1,e="_@r"+(h+=1)),c=(u=m(e))[0],e=u[1],c&&(c=y(c,l,i),o=getOwn(d,c)),e&&(c?g=o&&o.normalize?o.normalize(e,function(e){return y(e,l,i)}):-1===e.indexOf("!")?y(e,l,i):e:(c=(u=m(g=y(e,l,i)))[0],g=u[1],r=!0,a=n.nameToUrl(g))),{prefix:c,name:g,parentMap:t,unnormalized:!!(s=!c||o||r?"":"_unnormalized"+(v+=1)),url:a,originalName:f,isDefine:p,id:(c?c+"!"+g:g)+s}}function x(e){var t=e.id,r=getOwn(s,t);return r||(r=s[t]=new n.Module(e)),r}function k(e,t,r){var n=e.id,i=getOwn(s,n);!hasProp(d,n)||i&&!i.defineEmitComplete?(i=x(e)).error&&"error"===t?r(i.error):i.on(t,r):"defined"===t&&r(d[n])}function w(e,t){var r=e.requireModules,n=!1;t?t(e):(each(r,function(t){var r=getOwn(s,t);r&&(r.error=e,r.events.error&&(n=!0,r.emit("error",e)))}),n||req.onError(e))}function S(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(n.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function P(e){delete s[e],delete u[e]}function A(e,t,r){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,each(e.depMaps,function(n,i){var a=n.id,o=getOwn(s,a);!o||e.depMatched[i]||r[a]||(getOwn(t,a)?(e.defineDep(i,d[a]),e.check()):A(o,t,r))}),r[n]=!0)}function C(){var e,r,i=1e3*o.waitSeconds,s=i&&n.startTime+i<(new Date).getTime(),c=[],l=[],d=!1,f=!0;if(!t){if(t=!0,eachProp(u,function(e){var t=e.map,n=t.id;if(e.enabled&&(t.isDefine||l.push(e),!e.error))if(!e.inited&&s)_(n)?(r=!0,d=!0):(c.push(n),g(n));else if(!e.inited&&e.fetched&&t.isDefine&&(d=!0,!t.prefix))return f=!1}),s&&c.length)return(e=makeError("timeout","Load timeout for modules: "+c,null,c)).contextName=n.contextName,w(e);f&&each(l,function(e){A(e,{},{})}),s&&!r||!d||!isBrowser&&!isWebWorker||a||(a=setTimeout(function(){a=0,C()},50)),t=!1}}function j(e){hasProp(d,e[0])||x(b(e[0],null,!0)).init(e[1],e[2])}function q(e,t,r,n){e.detachEvent&&!isOpera?n&&e.detachEvent(n,t):e.removeEventListener(r,t,!1)}function E(e){var t=e.currentTarget||e.srcElement;return q(t,n.onScriptLoad,"load","onreadystatechange"),q(t,n.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function O(){var e;for(S();l.length;){if(null===(e=l.shift())[0])return w(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));j(e)}n.defQueueMap={}}return i={require:function(e){return e.require?e.require:e.require=n.makeRequire(e.map)},exports:function(e){e.usingExports=!0,e.map.isDefine&&(e.exports?d[e.map.id]=e.exports:e.exports=d[e.map.id]={})},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(o.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},(r=function(e){this.events=getOwn(c,e.id)||{},this.map=e,this.shim=getOwn(o.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,r,n){n=n||{},this.inited||(this.factory=t,r?this.on("error",r):this.events.error&&(r=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=r,this.inited=!0,this.ignore=n.ignore,n.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,n.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();n.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;f[e]||(f[e]=!0,n.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,r=this.map.id,i=this.depExports,a=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{a=n.execCb(r,o,i,a)}catch(t){e=t}else a=n.execCb(r,o,i,a);if(this.map.isDefine&&void 0===a&&((t=this.module)?a=t.exports:this.usingExports&&(a=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",w(this.error=e)}else a=o;if(this.exports=a,this.map.isDefine&&!this.ignore&&(d[r]=a,req.onResourceLoad)){var s=[];each(this.depMaps,function(e){s.push(e.normalizedMap||e)}),req.onResourceLoad(n,this.map,s)}P(r),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(n.defQueueMap,r)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=b(e.prefix);this.depMaps.push(r),k(r,"defined",bind(this,function(r){var i,a,u,c=getOwn(p,this.map.id),l=this.map.name,d=this.map.parentMap?this.map.parentMap.name:null,f=n.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return y(e,d,!0)})||""),k(a=b(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,function(e){this.map.normalizedMap=a,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((u=getOwn(s,a.id))&&(this.depMaps.push(a),this.events.error&&u.on("error",bind(this,function(e){this.emit("error",e)})),u.enable()))):c?(this.map.url=n.nameToUrl(c),void this.load()):((i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(s,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&P(e.map.id)}),w(e)}),i.fromText=bind(this,function(r,a){var s=e.name,u=b(s),c=useInteractive;a&&(r=a),c&&(useInteractive=!1),x(u),hasProp(o.config,t)&&(o.config[s]=o.config[t]);try{req.exec(r)}catch(e){return w(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}c&&(useInteractive=!0),this.depMaps.push(u),n.completeLoad(s),f([s],i)}),void r.load(e.name,f,i,o))})),n.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){u[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var r,a,o;if("string"==typeof e){if(e=b(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,o=getOwn(i,e.id))return void(this.depExports[t]=o(this));this.depCount+=1,k(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?k(e,"error",bind(this,this.errback)):this.events.error&&k(e,"error",bind(this,function(e){this.emit("error",e)}))}r=e.id,a=s[r],hasProp(i,r)||!a||a.enabled||n.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(s,e.id);t&&!t.enabled&&n.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var r=this.events[e];r||(r=this.events[e]=[]),r.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},n={config:o,contextName:e,registry:s,defined:d,urlFetched:f,defQueue:l,defQueueMap:{},Module:r,makeModuleMap:b,nextTick:req.nextTick,onError:w,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,r){return(-1===r.indexOf("?")?"?":"&")+t}}var r=o.shim,i={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?(o[t]||(o[t]={}),mixin(o[t],e,!0,!0)):o[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(p[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=n.makeShimExports(e)),r[t]=e}),o.shim=r),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(o.paths[t]=e.location),o.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(s,function(e,t){e.inited||e.map.unnormalized||(e.map=b(t,null,!0))}),(e.deps||e.callback)&&n.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,r){function a(o,u,c){var l,f;return r.enableBuildCallback&&u&&isFunction(u)&&(u.__requireJsBuild=!0),"string"==typeof o?isFunction(u)?w(makeError("requireargs","Invalid require call"),c):t&&hasProp(i,o)?i[o](s[t.id]):req.get?req.get(n,o,t,a):(l=b(o,t,!1,!0).id,hasProp(d,l)?d[l]:w(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(O(),n.nextTick(function(){O(),(f=x(b(null,t))).skipMap=r.skipMap,f.init(o,u,c,{enabled:!0}),C()}),a)}return r=r||{},mixin(a,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),a=e.split("/")[0];return-1!==i&&(!("."===a||".."===a)||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),n.nameToUrl(y(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(d,b(e,t,!1,!0).id)},specified:function(e){return e=b(e,t,!1,!0).id,hasProp(d,e)||hasProp(s,e)}}),t||(a.undef=function(e){S();var r=b(e,t,!0),i=getOwn(s,e);i.undefed=!0,g(e),delete d[e],delete f[r.url],delete c[e],eachReverse(l,function(t,r){t[0]===e&&l.splice(r,1)}),delete n.defQueueMap[e],i&&(i.events.defined&&(c[e]=i.events),P(e))}),a},enable:function(e){getOwn(s,e.id)&&x(e).enable()},completeLoad:function(e){var t,r,i,a=getOwn(o.shim,e)||{},u=a.exports;for(S();l.length;){if(null===(r=l.shift())[0]){if(r[0]=e,t)break;t=!0}else r[0]===e&&(t=!0);j(r)}if(n.defQueueMap={},i=getOwn(s,e),!t&&!hasProp(d,e)&&i&&!i.inited){if(!(!o.enforceDefine||u&&getGlobal(u)))return _(e)?void 0:w(makeError("nodefine","No define call for "+e,null,[e]));j([e,a.deps||[],a.exportsFn])}C()},nameToUrl:function(e,t,r){var i,a,s,u,c,l,d=getOwn(o.pkgs,e);if(d&&(e=d),l=getOwn(p,e))return n.nameToUrl(l,t,r);if(req.jsExtRegExp.test(e))u=e+(t||"");else{for(i=o.paths,s=(a=e.split("/")).length;s>0;s-=1)if(c=getOwn(i,a.slice(0,s).join("/"))){isArray(c)&&(c=c[0]),a.splice(0,s,c);break}u=a.join("/"),u=("/"===(u+=t||(/^data:|^blob:|\?/.test(u)||r?"":".js")).charAt(0)||u.match(/^[\w+.-]+:/)?"":o.baseUrl)+u}return o.urlArgs&&!/^blob:/.test(u)?u+o.urlArgs(e,u):u},load:function(e,t){req.load(n,e,t)},execCb:function(e,t,r,n){return t.apply(n,r)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=E(e);n.completeLoad(t.id)}},onScriptError:function(e){var t=E(e);if(!_(t.id)){var r=[];return eachProp(s,function(e,n){0!==n.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return r.push(n),!0})}),w(makeError("scripterror",'Script error for "'+t.id+(r.length?'", needed by: '+r.join(", "):'"'),e,[t.id]))}}},n.require=n.makeRequire(),n}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}})("undefined"!=typeof window?window:globalThis,"undefined"==typeof setTimeout?void 0:setTimeout),function(e){if(!__requirejs.__requirejsAdapterApplied){__requirejs.__requirejsAdapterApplied=!0;var t=__requirejs.require,r=__requirejs.define,n=function(e,r,n,i){var a=e,o=r,s=n,u=i;if(Array.isArray(e)&&"function"==typeof r)t(o=e,s=r,u=n);else{!e&&Array.isArray(o)&&(a=[]),Array.isArray(a)&&Array.isArray(o)&&(a=a.join("/"));var c=a?[]:o;"string"==typeof a&&a&&Array.isArray(o)&&o.forEach(function(e){c.push("".concat(a).concat("/"===e.substr(0,1)?"":"/").concat(e))}),console.debug("[devfab][requirejs]: %c requireInner, Parameter[newdeps] is %o","color:fuchsia",c),t(c,s,u)}},i=function(e,t,n){var i=e,a=t,o=n;if(Array.isArray(e)&&"function"==typeof t)r(a=e,o=t);else{!e&&Array.isArray(a)&&(i=[]),Array.isArray(i)&&Array.isArray(a)&&(i=i.join("/"));var s=i?[]:a;"string"==typeof i&&i&&Array.isArray(a)&&a.forEach(function(e){s.push("".concat(i).concat("/"===e.substr(0,1)?"":"/").concat(e))}),r(s,o)}};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&void 0===n[a]&&(n[a]=t[a]);n.__devfabAdapterApplied=!0,i.__devfabAdapterApplied=!0,__requirejs._require=t,__requirejs._define=r,__requirejs.require=n,__requirejs.define=i}}();var CODE_POLICY=403;function normalizePath(e){return String(null==e?"":e).replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"")}function isAbsoluteUrl(e){return/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(e)||/^(?:blob|data):/i.test(e)}function toHex(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n++)r+=t[n].toString(16).padStart(2,"0");return r}var LoadPolicy=function(){return _createClass(function e(t){_classCallCheck(this,e),this.manifest=null,this.origins=null,this.lockVersion=null,this.verifyHash=!0,this.fetch=null,this._index=null,this.configure(t)},[{key:"configure",value:function(e){var t=e||{};return void 0!==t.manifest&&(this.manifest=t.manifest||null),void 0!==t.origins&&(this.origins=t.origins?[].concat(t.origins).map(function(e){return String(e).trim().replace(/\/+$/,"")}):null),void 0!==t.lockVersion&&(this.lockVersion=t.lockVersion||null),void 0!==t.verifyHash&&(this.verifyHash=!!t.verifyHash),void 0!==t.fetch?this.fetch=t.fetch||null:this.fetch||"function"!=typeof fetch||(this.fetch=function(){return fetch.apply(void 0,arguments)}),this._index=null,this}},{key:"enabled",get:function(){return!!this.manifest}},{key:"_moduleIndex",value:function(){if(this._index)return this._index;var e={},t=this.manifest&&this.manifest.modules;return Array.isArray(t)?t.forEach(function(t){t&&t.path&&(e[normalizePath(t.path)]=t)}):t&&"object"===_typeof(t)&&Object.keys(t).forEach(function(r){e[normalizePath(r)]=t[r]||{}}),this._index=e,e}},{key:"entryOf",value:function(e){return this.manifest&&this._moduleIndex()[normalizePath(e)]||null}},{key:"checkVersion",value:function(){if(!this.lockVersion||!this.manifest)return null;var e=String(this.manifest.version||"");return e===String(this.lockVersion)?null:{code:CODE_POLICY,message:"清单版本 ".concat(e||"(未声明)"," 与锁定版本 ").concat(this.lockVersion," 不一致,拒绝加载")}}},{key:"checkModules",value:function(e){var t=this.checkVersion();if(t)return t;if(!this.manifest)return null;for(var r=0;r<e.length;r++){var n=normalizePath(e[r]);if(!this._moduleIndex()[n])return{code:CODE_POLICY,message:"Module ".concat(n," not registered in the list, loading denied.")}}return null}},{key:"checkOrigin",value:function(e){if(!this.origins)return null;if(!isAbsoluteUrl(e))return null;var t;try{t=new URL(e).origin}catch(t){return{code:CODE_POLICY,message:"无法解析的地址:".concat(e)}}return-1===this.origins.indexOf(t)?{code:CODE_POLICY,message:"来源 ".concat(t," 不在白名单内(允许:").concat(this.origins.join(", "),")")}:null}},{key:"verify",value:function(e,t){var r=this;if(!this.verifyHash)return Promise.resolve({ok:!0,skipped:"disabled"});if(!t)return Promise.resolve({ok:!0});var n="undefined"!=typeof globalThis&&globalThis.crypto&&globalThis.crypto.subtle;return n?this.fetch?Promise.resolve().then(function(){return r.fetch(e)}).then(function(e){return e&&e.ok?e.arrayBuffer().then(function(e){return n.digest("SHA-256",e)}):{ok:!1,message:"完整性预检请求失败:HTTP ".concat(e&&e.status||"unknown")}}).then(function(e){if(!e||!1===e.ok)return e;var r=toHex(e),n=String(t).toLowerCase();return r!==n?{ok:!1,message:"sha256 不匹配:期望 ".concat(n,",实际 ").concat(r)}:{ok:!0}}).catch(function(e){return{ok:!1,message:"完整性预检异常:".concat(e&&e.message||e),error:e}}):Promise.resolve({ok:!0,skipped:"fetch unavailable"}):Promise.resolve({ok:!0,skipped:"crypto.subtle unavailable(需要 https / localhost)"})}},{key:"describe",value:function(){return{manifest:this.enabled?this.manifest.name||"(unnamed)":null,version:this.manifest&&this.manifest.version||null,lockVersion:this.lockVersion,modules:this.enabled?Object.keys(this._moduleIndex()).length:0,origins:this.origins?this.origins.slice():null,verifyHash:this.verifyHash}}}])}(),CODE_TIMEOUT=504,nativeImport=null;try{nativeImport=new Function("s","return import(s)")}catch(e){nativeImport=null}function parseArgs(e,t,r,n){var i=e,a=t,o=r;Array.isArray(e)&&!Array.isArray(t)&&(i=void 0,a=e,o="function"==typeof t?t:r);var s=(a=Array.isArray(a)?a:[]).join(","),u={code:0,message:"",data:[]};return("require"===n.type&&"function"!=typeof n.require||"define"===n.type&&"function"!=typeof n.define)&&(u.code=404,u.message="requirejs is undefined, the fiels: ".concat(s)),{path:i,files:a,callback:o,filesStr:s,result:u}}function toModuleIds(e,t){var r="";return Array.isArray(e)?r=e.filter(Boolean).join("/"):"string"==typeof e&&(r=e.replace(/\/+$/,"")),t.map(function(e){var t=String(e).replace(/^\/+/,"");return r?"".concat(r,"/").concat(t):t})}function toNumber(e,t){var r=Number(e);return Number.isFinite(r)?r:t}var DEFAULT_OPTIONS={version:"",timeout:15e3,retry:0,baseUrl:""},BaseFileRequire=function(){return _createClass(function e(t){_classCallCheck(this,e),this.__init(t)},[{key:"__init",value:function(e){var t=e||{};void 0!==t.debug&&(this.debug=!!t.debug);var r=__requirejs.require;this.__data={define:__requirejs.define,require:r,undef:"function"==typeof(null==r?void 0:r.undef)?r.undef:null,requireConfig:this._pickRequireConfig(r),importImpl:t.importer||null,setTimer:t.setTimeout||function(e,t){return setTimeout(e,t)},clearTimer:t.clearTimeout||function(e){return clearTimeout(e)},options:{version:t.version?String(t.version):DEFAULT_OPTIONS.version,timeout:void 0===t.timeout?DEFAULT_OPTIONS.timeout:Math.max(0,toNumber(t.timeout,0)),retry:void 0===t.retry?DEFAULT_OPTIONS.retry:Math.max(0,toNumber(t.retry,0)),baseUrl:t.baseUrl||DEFAULT_OPTIONS.baseUrl},policy:new LoadPolicy(t)},this.__data.options.version&&this._applyUrlArgs()}},{key:"debug",get:function(){var e="undefined"!=typeof window?window.__devfab:null;return!(!e||!e.debug)},set:function(e){"undefined"!=typeof window&&(window.__devfab=window.__devfab||{},window.__devfab.debug=!!e)}},{key:"_pickRequireConfig",value:function(e){return e&&"function"==typeof e.config?e.config.bind(e):null}},{key:"configure",value:function(e){var t=e||{},r=this.__data,n=r.options,i=r.policy;return void 0!==t.debug&&(this.debug=!!t.debug),void 0!==t.version&&this.setVersion(t.version),void 0!==t.timeout&&(n.timeout=Math.max(0,toNumber(t.timeout,n.timeout))),void 0!==t.retry&&(n.retry=Math.max(0,toNumber(t.retry,n.retry))),void 0!==t.baseUrl&&(n.baseUrl=t.baseUrl||""),void 0===t.manifest&&void 0===t.origins&&void 0===t.lockVersion&&void 0===t.verifyHash&&void 0===t.fetch||i.configure(t),this}},{key:"setVersion",value:function(e){return this.__data.options.version=e?String(e):"",this._applyUrlArgs(),this}},{key:"_applyUrlArgs",value:function(){var e=this.__data,t=e.requireConfig,r=e.options;if("function"!=typeof t)return!1;try{return t({urlArgs:r.version?"v=".concat(encodeURIComponent(r.version)):""}),!0}catch(e){return!1}}},{key:"getVersion",value:function(){return this.__data.options.version}},{key:"describe",value:function(){var e=this.__data,t=e.options,r=e.policy,n=e.undef,i=e.importImpl;return Object.assign({},t,{debug:this.debug,policy:r.describe(),canUndef:"function"==typeof n,canNativeImport:"function"==typeof(i||nativeImport)})}},{key:"_define",value:function(e,t,r){var n=parseArgs(e,t,r,{define:this.__data.define,type:"define"}),i=n.path,a=n.files,o=n.callback,s=n.result;404!==s.code?this.__data.define(i,a,o):null==o||o(s)}},{key:"_undefModules",value:function(e){var t=this.__data.undef;"function"==typeof t&&e.forEach(function(e){try{t(e)}catch(e){}})}},{key:"_load",value:function(e,t,r){var n=this,i=this.__data,a=i.options,o=i.policy,s=i.require,u=i.setTimer,c=i.clearTimer,l=parseArgs(e,t,r,{require:s,type:"require"}),d=l.path,f=l.files,p=l.callback,h=l.result,v=l.filesStr;if(404!==h.code){var y=toModuleIds(d,f),g=o.checkModules(y);if(g)return h.code=g.code,h.message=g.message,void(null==p||p(h));var _=!1,m=0,b=null,x=function(){_||(_=!0,null!==b&&(c(b),b=null),null==p||p(h))},k=function(){m++,a.timeout>0&&(b=u(function(){if(!_){var e=new Error("load timeout after ".concat(a.timeout,"ms: ").concat(v));e.__devfabTimeout=!0,w(e,"files load timeout after ".concat(a.timeout,"ms, the files: ").concat(v))}},a.timeout)),s(d,f,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];h.data=t,x()},function(e){w(e)})},w=function(e,t){if(!_){if(null!==b&&(c(b),b=null),m<=a.retry)return n._undefModules(y),void k();h.code=e&&e.__devfabTimeout?CODE_TIMEOUT:500,h.message=t||"files load error, the files: ".concat(v),h.error=e,x()}};k()}else null==p||p(h)}},{key:"load",value:function(e,t,r){this._load(e,t,r)}},{key:"resolveUrl",value:function(e){var t=String(null==e?"":e);if(/^[a-z][a-z0-9+.-]*:/i.test(t)||/^\/\//.test(t))return t;var r=this.__data.options.baseUrl||("undefined"!=typeof document&&document.baseURI?document.baseURI:"");if(!r)return t;try{return new URL(t,r).href}catch(e){return t}}},{key:"_importOne",value:function(e){var t=this.__data,r=t.policy,n=t.importImpl,i=this.resolveUrl(e),a=r.checkOrigin(i);if(a)return Promise.resolve({ok:!1,code:a.code,message:a.message});var o=r.entryOf(e),s=o&&o.sha256,u=function(){var e=n||nativeImport;return"function"!=typeof e?Promise.resolve({ok:!1,code:500,message:"native import() is unavailable(CSP 是否禁用了 unsafe-eval?)"}):Promise.resolve().then(function(){return e(i)}).then(function(e){return{ok:!0,module:e}},function(e){return{ok:!1,code:500,message:"module load error: ".concat(i),error:e}})};return s?r.verify(i,s).then(function(e){return e.ok?u():{ok:!1,code:CODE_POLICY,message:"".concat(e.message,"(").concat(i,")")}}):u()}},{key:"loadModules",value:function(e,t,r){var n=this,i=this.__data.policy,a=parseArgs(e,t,r,{type:"module"}),o=a.path,s=a.files,u=a.callback,c=a.result,l=a.filesStr,d=toModuleIds(o,s),f=function(e){return null==u||u(e),e},p=i.checkModules(d);return p?(c.code=p.code,c.message=p.message,Promise.resolve(f(c))):s.length?Promise.all(d.map(function(e){return n._importOne(e)})).then(function(e){var t=e.filter(function(e){return!e.ok});return t.length?(c.code=t[0].code||500,c.message="".concat(t.map(function(e){return e.message}).join("; "),"(the files: ").concat(l,")"),c.error=t[0].error):c.data=e.map(function(e){return e.module}),f(c)}):Promise.resolve(f(c))}},{key:"loadModule",value:function(e,t){return this.loadModules([e],t)}}])}(),FileRequireClass=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BaseFileRequire),_createClass(t,[{key:"provide",value:function(e,t,r){this._define(e,t,r)}},{key:"provideScript",value:function(e){var t=e;"function"!=typeof e&&(t=function(){return e}),this.provide([],t)}},{key:"inject",value:function(e,t,r){this._load(e,t,r)}},{key:"injectScript",value:function(e,t,r,n){var i=this,a=e,o=t,s=r,u=n;Array.isArray(e)&&"function"==typeof t&&(a=void 0,o=e,s=t,u=r),this.inject(a,o,function(e){if(0==e.code&&Array.isArray(e.data))for(var t=0,r=e.data.length;t<r;t++){var n,a=e.data[t];null===(n=s)||void 0===n||n(a,t)}else"function"==typeof u?u(e):i.debug&&console.error("[devfab][FileRequire][injectScript] error: ",e)})}}])}(),FileRequire=new FileRequireClass;function isDebug(e){return e||!("undefined"==typeof window||!window.__devfab||!window.__devfab.debug)}function QueryString(e){this.pathname="",this.query={};var t=e;this.init=function(){t||(t=location.search);var e=t.indexOf("?"),r=t.indexOf("#");if(e>=0){if(this.pathname=t.substr(0,e),(t=r<0?t.substr(e+1):t.substring(e+1,r)).length>0)for(var n=(t=t.replace(/\+/g," ")).split("&"),i=0,a=n.length;i<a;i++){var o=n[i]||"";if(o){var s=o.indexOf("="),u="",c="";s<0?c=u=window.decode(o):(u=window.decode(o.substr(0,s)),c=window.decode(o.substr(s+1))),this.query[u]=c}}}else this.pathname=t},this.set=function(e,t){this.query[e]=t},this.get=function(e){return this.query[e]},this.del=function(e){delete this.query[e]},this.has=function(e){return null!=this.query[e]},this.toStr=function(){var e=["?"];for(var t in this.query)e.push(encodeURIComponent(t)),e.push("="),e.push(encodeURIComponent(this.query[t])),e.push("&");return 1===e.length?"":(e.splice(e.length-1,1),e.join(""))},this.init()}function equalsIgnoreCase(e,t){return!(!e||!t)&&e.toLowerCase()===t.toLowerCase()}function _appendUrl(e,t){if(!t)return e;var r=[],n=new QueryString(e);for(var i in t)n.get(i)||r.push("".concat(i,"=").concat(t[i]));if(!r.length)return e;var a=r.join("&");return e.indexOf("?")>=0?"".concat(e,"&").concat(a):"".concat(e,"?").concat(a)}var hasValue=function(e){return null!=e&&""!==e};function pick(e,t,r){if(e){var n=r;"string"==typeof t&&Array.isArray(n)&&(n=_defineProperty({},t,r));var i=n&&n[t];if(!i)return hasValue(e[t])?e[t]:void 0;for(var a=0;a<i.length;a++){var o=e[i[a]];if(hasValue(o))return o}}}var _excluded=["children","render"],BaseBuilder=function(){return _createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"_config",{componentField:["component"]}),_defineProperty(this,"_components",{}),_defineProperty(this,"_renderFactory",null)},[{key:"init",value:function(e,t,r){this._initConfig(e),this._initComponent(t),this._initRenderFactory(r)}},{key:"_initConfig",value:function(e){this._config=Object.assign(this._config,e)}},{key:"_initComponent",value:function(e,t){if(e)if("string"==typeof e){if(this._components[e])return void console.log("[warning] Component ".concat(e," is exist!"));this._components[e]=t}else"function"==typeof e?Object.assign(this._components,null==e?void 0:e()):"object"===_typeof(e)&&Object.assign(this._components,e)}},{key:"_getComponent",value:function(e){return this._components[e]}},{key:"_clearComponents",value:function(){this._components={}}},{key:"_initRenderFactory",value:function(e){this._renderFactory=e}},{key:"_renderComponent",value:function(e,t){var r=this;if(Array.isArray(e)){var n=[];return e.forEach(function(e,i){var a=_objectSpread2({},e),o=pick(a,"component",r._config.componentField),s=a.children,u=a.render,c=_objectWithoutProperties(a,_excluded),l=r._getComponent(o);l||"function"==typeof u||console.log("[warning] Component ".concat(o," is not registered!"));var d={component:l,children:r._renderComponent(s,t)};c.index=i;var f=Object.assign({},null==t?void 0:t.props,{meta:c});"function"==typeof u?n.push(u({node:d,props:f})):"function"==typeof r._renderFactory?n.push(r._renderFactory({node:d,props:f})):(Object.assign(d,f),n.push(d))}),n}}},{key:"clear",value:function(){this._clearComponents(),this._renderFactory=null}}])}(),Builder=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,BaseBuilder),_createClass(t,[{key:"initComponent",value:function(e,t){this._initComponent(e,t)}},{key:"getComponents",value:function(){return _objectSpread2({},this._components)}},{key:"getComponent",value:function(e){return this._getComponent(e)}},{key:"hasComponent",value:function(e){return!!this._getComponent(e)}},{key:"initRenderFactory",value:function(e){this._initRenderFactory(e)}},{key:"render",value:function(e,t){return this._renderComponent(e,t)}}])}();function _getUrl(e,t){return e}function getAllResponseHeaders(e){var t=e.xhr.getAllResponseHeaders(),r={};return t.split("\r\n").map(function(e){var t=_slicedToArray(e.split(": "),2),n=t[0],i=t[1];r[n]=i}),r}Builder.create=function(e){return new Builder(e)};var AjaxUtil={_xhrs:[],_jsonps:{index:0},doRequest:function(e){var t,r=e.method||"GET",n=_getUrl(e.url);try{null!=e&&e.requestHeaders&&(t=e.requestHeaders,e.requestHeaders=void 0,delete e.requestHeaders)}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options["requestHeaders"] ERR : ',e)}try{e.params&&e.params.requestHeaders&&(t=e.params.requestHeaders,e.params.requestHeaders=void 0,delete e.params.requestHeaders)}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options.params["requestHeaders"] ERR : ',e)}var i=null;if(equalsIgnoreCase(r,"get")||equalsIgnoreCase(r,"delete")?n=_appendUrl(n,e.params):(equalsIgnoreCase(r,"post")||equalsIgnoreCase(r,"put"))&&(i=JSON.stringify(e.params)),e.jsonp)return this.getJsonp(n,e.callback);var a=this.getXMLHttpRequest();if(a){var o;if(a.open(r,n,!1!==e.async),e.timeout&&(a.timeout=e.timeout,a.setRequestHeader("timeout",e.timeout),a.ontimeout=function(){AjaxUtil.onerror(this,e,"timeout")}),e.contentType){if(a.setRequestHeader("Content-Type",e.contentType),e.contentType.indexOf("x-www-form-urlencoded")>=0)i=null===(o=new URLSearchParams(e.params))||void 0===o?void 0:o.toString()}else e.dateType?i=e.params:a.setRequestHeader("Content-Type","application/json;charset=utf-8");try{if(t&&"[object Object]"===Object.prototype.toString.call(t))for(var s in t)a.setRequestHeader(s,t[s])}catch(e){isDebug()&&console.log('[devfab][ajax]: [doRequest]: options.params["requestHeaders"] ERR : ',e)}a.withCredentials=null==e||!e.hasOwnProperty("withCredentials")||e.withCredentials,e.onBeforeRequest&&e.onBeforeRequest(a,i);try{a.send(i)}catch(t){return{error:"NetWorkError",options:e}}if(!1===e.async)return this.onreadystatechange(a,e);a.onreadystatechange=function(){AjaxUtil.onreadystatechange(this,e)}}},onreadystatechange:function(e,t){if(4===e.readyState){if(200===e.status){var r;try{if("blob"===t.responseType){var n=getAllResponseHeaders({xhr:e});r={code:e.status,data:{data:e.response,headers:n}}}else r=JSON.parse(e.responseText)}catch(r){AjaxUtil.onerror(e,t,e.responseText)}if(!1===t.async)return e.isBusy=!1,t.onAfterRequest&&t.onAfterRequest(r),AjaxUtil.parseAjaxResult(r,!1,null,null,t,e);AjaxUtil.parseAjaxResult(r,t.async,t.callback,t.context,t,e),t.onAfterRequest&&t.onAfterRequest(r)}else if(0===e.status)AjaxUtil.onerror(e,t,"The network connection has been disconnected. Please check the network status of the device and try.");else if(502===e.status||504===e.status)AjaxUtil.onerror(e,t,"An error has occurred with the service. Please try again later.");else{if(401!==e.status){var i={};try{i=JSON.parse(e.responseText)}catch(t){i={code:e.status,message:e.responseText}}return AjaxUtil.onerror(e,t,i)}AjaxUtil.onerror(e,t,"Login information has expired. Please log in again or contact technical staff.")}e.isBusy=!1}},onerror:function(e,t,r){var n="[devfab][ajax]: [onerror]: api error \n [code]: ".concat(e.status," \n [error]: ").concat(("object"===_typeof(r)?JSON.stringify(r):r)||"空"," \n [url]: ").concat(t.url," \n [token]: ").concat(document.cookie);isDebug()&&console.log(n);var i="object"===_typeof(r)?r:{code:500,message:r};t.onAfterRequest&&t.onAfterRequest(i)},getXMLHttpRequest:function(){return this.createXMLHttpRequest()},createXMLHttpRequest:function(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):null},getJsonp:function(e,t){var r=e,n="callback"+this._jsonps.index++,i=document.createElement("script");this._jsonps[n]=function(e){try{t(e)}finally{document.body.removeChild(i)}},r+=-1===r.indexOf("?")?"?":"&callback=cb.rest.AjaxUtil._jsonps."+n,i.src=r,document.body.appendChild(i)},parseAjaxResult:function(e,t,r,n,i,a){if(e){if(!e.code)return!1===t?e:void(r&&r.call(n,null,e));if(200==e.code){if(!1===t)return{result:e.data};r&&r.call(n,null,e.data,e.message,e.errorDetail,e.code,e.displayCode&&e)}else{if(!1===t)return{error:e};r&&r.call(n,e)}}}};function ajax(e,t){return t.url=e,AjaxUtil.doRequest(t)}function DynamicProxy(e,t){this.init&&this.init(e),this.queryParams=t}DynamicProxy.create=function(e,t){return new DynamicProxy(e,t)},DynamicProxy.prototype.init=function(e){if(e)for(var t in this.config=e,this.config)this[t]=function(e){return function(t,r,n){return this.Do(e,t,r,null,n)}}(t),this["".concat(t,"Sync")]=function(e){return function(t){return this.Do(e,t,null,!1)}}(t)},DynamicProxy.prototype.Do=function(e,t,r,n,i){var a,o,s;if(this.config&&this.config[e]&&this.config[e].url){var u=this.config[e],c=u.url;this.queryParams||(this.queryParams={}),null!==(a=u.options)&&void 0!==a&&a.proxyServiceCode&&(this.queryParams.serviceCode=u.options.proxyServiceCode),null!==(o=u.options)&&void 0!==o&&o.billnum&&(this.queryParams.billnum=u.options.billnum),null!==(s=this.queryParams)&&void 0!==s&&s.serviceCode&&(c=_appendUrl(c,this.queryParams));var l=c,d=Object.assign({},u.options);return d.method=u.method||"GET","function"==typeof t?(d.callback=t,d.context=i||d.context||this):d.params=t,r&&(d.callback=r,d.context=i||d.context||this),!1===n&&(d.async=!1),this.ajax(l,d)}},DynamicProxy.prototype.ajax=function(e,t){return ajax(e,t)};var Event=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){var t;this.__ASYNC_EXECUTE__=null===(t=null==e?void 0:e.__ASYNC_EXECUTE__)||void 0===t||t,this._events=new Map,this._firstevents=new Map}},{key:"on",value:function(e,t,r){var n=this._events.get(e);Array.isArray(n)||(n=[]),n.push({callback:t,context:r}),this._events.set(e,n)}},{key:"onFirst",value:function(e,t,r){var n=this._firstevents.get(e);Array.isArray(n)||(n=[]),n.splice(0,0,{callback:t,context:r}),this._firstevents.set(e,n)}},{key:"execute",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=this._events.get(e),a=this._firstevents.get(e);if(!i&&!a)return!0;var o=!0;return[].concat(_toConsumableArray(a||[]),_toConsumableArray(i||[])).forEach(function(e){if(!1!==o){var t=e.callback.apply(e.context||void 0,r);o=!1!==t&&o}}),o}},{key:"un",value:function(e,t){this._unEvents(e,t,this._events),this._unEvents(e,t,this._firstevents)}},{key:"_unEvents",value:function(e,t,r){if(e&&r.has(e))if(t){var n=r.get(e),i=null==n?void 0:n.findIndex(function(e){return e.callback===t});-1!==i&&(null==n||n.splice(i,1))}else r.delete(e)}},{key:"hasEvent",value:function(e){var t,r;return e?((null===(t=this._events.get(e))||void 0===t?void 0:t.length)||0)+((null===(r=this._firstevents.get(e))||void 0===r?void 0:r.length)||0):0}},{key:"fireEvent",value:function(e,t){this.execute("before".concat(e),t)&&(this.execute(e,t),this.execute("after".concat(e),t))}},{key:"_asyncExecute",value:function(e,t,r){for(var n,i=this,a=r.resolve,o=r.reject,s=r.args,u=!0,c=t||[],l=!1,d=function(t){var r,n=c[t];if(!1===u)return 0;if(l)return{v:void 0};if("development"===process.env.nodeEnv)r=n.callback.apply(n.context||i,s);else try{r=n.callback.apply(n.context||i,s)}catch(e){throw e.isAddedMsg||(e.message="(领域扩展事件执行失败,请打开控制台查看详细错误信息并修复):".concat(e.message)),e.isAddedMsg=!0,e}r instanceof Promise?(l=!0,(u=r).callbacks&&u.callbacks.push({reject:function(){u.reject(),t===c.length-1&&(null==o||o())},resolve:function(r){t===c.length-1?(s.length>1&&(s[0]=r),null==a||a(s)):i._asyncExecute(e,c.slice(t+1),{resolve:a,reject:o,args:s})}})):(u=!1!==r&&u,t===c.length-1&&(u?null==a||a(s):null==o||o()))},f=0;f<c.length&&0!==(n=d(f));f++)if(n)return n.v;return u}},{key:"_asyncPromiseExecute",value:function(e,t,r,n){var i=this._events.get(e),a=this._firstevents.get(e);if(!((Array.isArray(i)?i.length:i)||(Array.isArray(a)?a.length:a)))return null==t?void 0:t();var o=[].concat(_toConsumableArray(a||[]),_toConsumableArray(i||[]));return this._asyncExecute(e,o,{resolve:t,reject:r,args:n})}},{key:"promiseExecute",value:function(e,t){var r=this,n=e,i=1;if("boolean"==typeof e&&(n=t,i=2),n){for(var a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];var u=2===i?o:[t].concat(o);if(u.length){var c,l=u.length-1,d=u[l];if("function"!=typeof d){if("object"!==_typeof(d)||!d[0]||"function"!=typeof d[0]||!d[1]||"function"!=typeof d[1])return;c=d[1],d=d[0]}if(this.__ASYNC_EXECUTE__)return this._asyncPromiseExecute(n,function(e){d.apply(r,e)},function(){c&&"function"==typeof c&&c()},u);u.splice(l,1),u.unshift(n);var f=this.execute.apply(this,u);if(f instanceof Promise){var p=this;f.then(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];d.apply(p,t)},function(){c&&"function"==typeof c&&c()})}else if(!f)return void(c&&"function"==typeof c&&c())}}}},{key:"clear",value:function(){this._events.clear(),this._firstevents.clear()}}])}();Event.create=function(e){return new Event(e)};var Cache=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){this._data=Object.assign({},e)}},{key:"set",value:function(e,t){this._data[e]=t}},{key:"get",value:function(e){var t;return null===(t=this._data)||void 0===t?void 0:t[e]}},{key:"delete",value:function(e){delete this._data[e]}},{key:"clear",value:function(){this._data={}}}])}();Cache.create=function(e){return new Cache};var BaseModel$1=function(){return _createClass(function e(t){_classCallCheck(this,e),this._init(t)},[{key:"_init",value:function(e){this._data={};var t=[];if(e)for(var r in e)t.push(r);Object.assign(this._data,{components:[],propertyNames:t},e),this._data.cache=new Cache,this._data.events=new Event}},{key:"_del_data",value:function(e){e&&delete this._data[e]}},{key:"_cls_data",value:function(){this._data.cache.clear(),this._data.events.clear(),this._data={components:[],propertyNames:[],cache:new Cache,events:new Event}}},{key:"_set_data",value:function(e,t,r){if(e){if(r){var n=this._data.propertyNames||[];n.indexOf(e)<0&&n.push(e)}this._data[e]=t}}},{key:"_get_data",value:function(e){if(e)return this._data[e]}},{key:"getData",value:function(){return this._get_data("value")}},{key:"getState",value:function(e,t){var r;if(!t)return this._get_data(e);var n=(this._get_data("components")||[]).find(function(e){return e.ctrlName===t});return n?null===(r=n.getState)||void 0===r?void 0:r.call(n,e):this._get_data(e)}},{key:"setState",value:function(e,t,r){r||this._set_data(e,t,!0);var n={};n[e]=t,this.doPropertyChange("setState",n,r)}},{key:"doPropertyChange",value:function(e,t,r){var n=this,i=this._get_data("components")||[];if(!i.length)return i;var a=[];if(r){var o=i.find(function(e){return e.ctrlName===r});o&&!this.notifyComponent(o,e,t)&&a.push(o)}else i.forEach(function(r){n.notifyComponent(r,e,t)||a.push(r)});return a.length?a:void 0}},{key:"notifyComponent",value:function(e,t,r){return"function"==typeof e[t]&&(this.viewUpdater(e,t,r),!0)}},{key:"viewUpdater",value:function(e,t,r){if("setState"===t)e[t](r);else{var n=this.getCache("name");e[t](r,n)}}},{key:"get",value:function(e){return this._get_data(e)}},{key:"addComponent",value:function(e,t){if(e){t&&!e.ctrlName&&(e.ctrlName=t);var r=this._get_data("components")||[];r.indexOf(e)>=0||r.push(e)}}},{key:"removeComponent",value:function(e){var t=this._get_data("components")||[],r=t.indexOf(e);r<0||t.splice(r,1)}},{key:"_applyState",value:function(e,t,r){var n=this;r||this._set_data(e,t,!0);var i="set".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),a=this.doPropertyChange(i,t,r);if(a){var o={};o[e]=t,a.forEach(function(e){n.notifyComponent(e,"setState",o)})}}},{key:"getVisible",value:function(e){return this.getState("visible",e)}},{key:"setVisible",value:function(e,t){this._applyState("visible",e,t)}},{key:"getValue",value:function(){return this.getData()}},{key:"setValue",value:function(e,t,r){var n=this,i=this.getValue();if(e!==i){var a={value:e,oldValue:i},o=this._get_data("forceFireEvent");t||o?this.promiseExecute("beforeValueChange",a,[function(){n._set_data("value",e,!0),n._applyState("value",e,r),n.execute("afterValueChange",a)},function(){n._set_data("value",i,!0),n._applyState("value",i,r)}]):(this._set_data("value",e,!0),this._applyState("value",e,r))}}},{key:"getDisabled",value:function(e){return this.getState("disabled",e)}},{key:"setDisabled",value:function(e,t){this._applyState("disabled",e,t)}},{key:"setParent",value:function(e){this.setCache("parent",e)}},{key:"getParent",value:function(){return this.getCache("parent")}},{key:"getRootParent",value:function(){for(var e=this.getParent();null!==(t=e)&&void 0!==t&&t.getParent();){var t;e=e.getParent()}return e}},{key:"setName",value:function(e){this.setCache("name",e)}},{key:"getName",value:function(){return this.getCache("name")}},{key:"setDirty",value:function(e){e?this._set_data("isDirty",!0):(this._del_data("isDirty"),this._set_data("originalData",this.getData()))}},{key:"getDirtyData",value:function(e){var t=this.getData();return!1!==e&&this._get_data("isDirty")||t!==this._get_data("originalData")?t:void 0}},{key:"clear",value:function(e){void 0===e?this._set_data("value",this._get_data("cDefaultValue")):e||this._set_data("value",void 0),this._del_data("isDirty"),this._del_data("checking"),this._del_data("checkMsg")}},{key:"on",value:function(e,t,r){this._get_data("events").on(e,t,r)}},{key:"onFirst",value:function(e,t,r){this._get_data("events").onFirst(e,t,r)}},{key:"execute",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return(t=this._get_data("events")).execute.apply(t,[e].concat(n))}},{key:"un",value:function(e,t){this._get_data("events").un(e,t)}},{key:"hasEvent",value:function(e){return this._get_data("events").hasEvent(e)}},{key:"fireEvent",value:function(e,t){this._get_data("events").fireEvent(e,t)}},{key:"promiseExecute",value:function(e,t){for(var r,n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];(r=this._get_data("events")).promiseExecute.apply(r,[e,t].concat(i))}},{key:"setCache",value:function(e,t){this._get_data("cache").set(e,t)}},{key:"getCache",value:function(e){return this._get_data("cache").get(e)}},{key:"clearCache",value:function(e){this._get_data("cache").delete(e)}},{key:"setProxy",value:function(e){if(!(e instanceof DynamicProxy)){var t,r=this._get_data("__requestHeaders__");for(var n in e){var i,a,o;if(r&&(null===(i=e[n])||void 0===i||null===(i=i.options)||void 0===i||!i.requestHeaders))null!==(o=e[n])&&void 0!==o&&o.options||(e[n].options={}),e[n].options.requestHeaders=r;null!==(a=this.getProxy())&&void 0!==a&&a[n]&&isDebug()&&console.warn("[devfab][baseModel.prototype.setProxy]: Proxy ".concat(n," already exists on the model. Please change the name of ").concat(n," and try again"))}return this._set_data("proxy",DynamicProxy.create(_objectSpread2(_objectSpread2({},(null===(t=this.getProxy())||void 0===t?void 0:t.config)||{}),e))),this.getProxy()}this._set_data("proxy",e)}},{key:"getProxy",value:function(){return this._get_data("proxy")}}])}(),SimpleModel$1=function(e){function t(){var e;_classCallCheck(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return _defineProperty(e=_callSuper(this,t,[].concat(n)),"modelType","SimpleModel"),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"getDisabled",value:function(){return this.getState("disabled")}},{key:"setDisabled",value:function(e,t){this._applyState("disabled",e,t)}},{key:"getReadonly",value:function(){return this.getState("readonly")}},{key:"setReadonly",value:function(e,t){this._applyState("readonly",e,t)}}])}(),DEFAULT_PAGE_SIZE=20,isArray=Array.isArray;function cloneDeep(e){if(isArray(e))return e.map(cloneDeep);if(e instanceof Date)return new Date(e.getTime());if(e&&"object"===_typeof(e)){var t={};for(var r in e)t[r]=cloneDeep(e[r]);return t}return e}function normalizeColumns(e){var t={};return(isArray(e)?e:Object.keys(e||{}).map(function(t){var r;return _objectSpread2(_objectSpread2({},e[t]||{}),{},{field:(null===(r=e[t])||void 0===r?void 0:r.field)||t})})).forEach(function(e,r){if(e){var n=e.field||e.cFieldName||e.cName||"col_".concat(r);t[n]=_objectSpread2(_objectSpread2({},e),{},{field:n,label:e.label||e.title||e.cCaption||n,index:void 0===e.index?r:e.index})}}),t}function resolveRowsData(e){if(!e)return[];if(isArray(e))return e;if(isArray(e.data))return e.data;if(isArray(e.records))return e.records;if(isArray(e.list))return e.list;if(isArray(e.rows))return e.rows;var t=e.data&&"object"===_typeof(e.data)?e.data:e.result;return isArray(t)?t:t&&"object"===_typeof(t)&&(t.records||t.list||t.rows||t.data)||[]}function createDefaultProps(){var e={id:"_id",selected:"_selected",status:"_status",pageIndex:"pageNo",pageSize:"pageSize",pageCount:"total"};return{columns:{},dataSource:[],rows:[],readOnly:!0,dataSourceMode:"local",columnMode:"local",editMode:"cell",rowKeyField:"id",cellState:{},rowState:{},showCheckBox:!1,multiple:!0,showRowNo:!0,pagination:!0,pageInfo:_defineProperty(_defineProperty(_defineProperty({},e.pageIndex,1),e.pageSize,DEFAULT_PAGE_SIZE),e.pageCount,0),innerUsedAttrs:e,multiRowModel:!1,editRowModels:{},loading:!1,params:{},originalKeyMap:{},defaultRowDatas:new Map}}function resolveProxyConfig(){return _objectSpread2({},(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).proxyConfig||{})}function _getData(e,t,r){var n=this;this.promiseExecute("beforeQuery",{proxyConfig:e,queryParams:t},function(){var i=n,a=n.setProxy({queryData:e}),o=n._get_data("innerUsedAttrs").pageIndex,s={page:_defineProperty(_defineProperty({},n._get_data("innerUsedAttrs").pageSize,n.getPageSize()),o,n.getPageIndex())},u=Object.assign(t,s);n.setCache("proxyCache",{proxyConfig:e,params:u,callback:r});if(!1!==n.execute("beforeQueryData",u)){var c=cloneDeep(u);a.queryData(c,function(e,t,n,i){if(!e){var a=t;this._set_data("dataSourceMode","remote");var o=resolveRowsData(a=Object.assign({},a));this.execute("afterQueryData",a),null==r||r.call(this,o)}},i)}})}function _setData(e){if(this.execute("beforeSetDataSource",e)){var t=this.getRowKeyField(),r={};e.forEach(function(e){r[e[t]]=e}),this._set_data("keyMap",r),this._set_data("dataSource",e,!0),this.doPropertyChange("setDataSource"),this.execute("afterSetDataSource",e)}}var GridModel$1=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t);var n=_objectSpread2(_objectSpread2({},createDefaultProps()),r);isArray(n.dataSource)||(n.dataSource=[]),isArray(n.rows)||(n.rows=[]);var i=resolveProxyConfig(r);return n.proxyConfig=i,n.dataSourceMode=r.dataSourceMode||n.dataSourceMode,_defineProperty(e=_callSuper(this,t,[n]),"modelType","GridModel"),e.initColumns(n.columns),e.initPageInfo(r.cPage||r.page),e.afterInit(),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"afterInit",value:function(){this.execute("afterInit")}},{key:"initColumns",value:function(e){var t=normalizeColumns(e);return this._set_data("columns",t,!0),t}},{key:"initPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread2({},this.getPageInfo()),r=this._get_data("innerUsedAttrs").pageIndex,n=this._get_data("innerUsedAttrs").pageSize;t[r]=e.pageNo||e.pageIndex||t.pageIndex||1,t[n]=e.pageSize||t.pageSize||DEFAULT_PAGE_SIZE,!1===this.get("pagination")&&(t[r]=-1),this._set_data("pageInfo",t)}},{key:"getRowKeyField",value:function(){return this._get_data("rowKeyField")}},{key:"isRemote",value:function(){return"remote"===this._get_data("dataSourceMode")}},{key:"getReadOnly",value:function(){return!!this._get_data("readOnly")}},{key:"setReadOnly",value:function(e){this._applyState("readOnly",!!e)}},{key:"setShowCheckbox",value:function(e){this._applyState("showCheckBox",!!e)}},{key:"setShowRowNo",value:function(e){this._applyState("showRowNo",!!e)}},{key:"getParams",value:function(){return _objectSpread2(_objectSpread2({},this.get("cParams")||{}),this._get_data("params")||{})}},{key:"setParams",value:function(e){this._set_data("params",e||{})}},{key:"getInnerUsedAttrs",value:function(e){var t=this._get_data("innerUsedAttrs");return e?t[e]:t}},{key:"getId",value:function(){return this.getInnerUsedAttrs("id")}},{key:"setDataSource",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("local"===this._get_data("dataSourceMode")){_setData(isArray(e)?e:[])}else{if(!this.execute("beforeProxyLoad",r))return;this.setPageIndex(1),_getData.call(this,e,r,function(e){_setData.call(t,e),null==n||n.call(t)})}}},{key:"reloadData",value:function(){var e=this,t=this.getCache("proxyCache");if(t){var r=t.proxyConfig,n=t.params,i=t.callback;_getData.call(this,r,n,function(t){null==i||i.call(e,t)})}else isDebug()&&console.log("[devfab][GridModel] proxyConfig is null")}},{key:"getDataSource",value:function(){return this._get_data("dataSource")||[]}},{key:"getData",value:function(e){return e?this._get_data("rows"):this._get_data("dataSource")}},{key:"getAllData",value:function(){return this.getData(!0)}},{key:"clear",value:function(){this._set_data("dataSource",[],!0),this._set_data("rows",[],!0)}},{key:"getPageInfo",value:function(){return this._get_data("pageInfo")}},{key:"getPageIndex",value:function(){var e=this._get_data("innerUsedAttrs").pageIndex;return this.getPageInfo()[e]}},{key:"getPageSize",value:function(){var e=this._get_data("innerUsedAttrs").pageSize;return this.getPageInfo()[e]}},{key:"getTotalCount",value:function(){var e=this._get_data("innerUsedAttrs").pageCount;return this.getPageInfo()[e]}},{key:"setPageInfo",value:function(e){var t=this.getPageInfo();this._set_data("pageInfo",_objectSpread2(_objectSpread2({},t),e)),this.reloadData()}},{key:"setPageIndex",value:function(e){if("number"==typeof e){var t=this._get_data("innerUsedAttrs").pageIndex;this._set_data("pageInfo",_objectSpread2(_objectSpread2({},this.getPageInfo()),{},_defineProperty({},t,Math.max(1,e))))}}},{key:"setPageSize",value:function(e){if("number"==typeof e){var t=this._get_data("innerUsedAttrs").pageIndex,r=this._get_data("innerUsedAttrs").pageSize;this._set_data("pageInfo",_objectSpread2(_objectSpread2({},this.getPageInfo()),{},_defineProperty(_defineProperty({},r,Math.max(-1,e)),t,1)))}}},{key:"setTotalCount",value:function(e){var t=this._get_data("innerUsedAttrs").pageCount;this.getPageInfo()[t]=e}}])}(),ViewModel$1=function(e){function t(){var e;_classCallCheck(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return _defineProperty(e=_callSuper(this,t,[].concat(n)),"modelType","ViewModel"),e}return _inherits(t,BaseModel$1),_createClass(t,[{key:"getParams",value:function(){return this._get_data("params")}},{key:"setParams",value:function(e){this._set_data("params",e,!0)}},{key:"set",value:function(e,t){t instanceof BaseModel$1&&(t.setParent(this),t.setName(e)),this._set_data(e,t,!0)}},{key:"setData",value:function(e){for(var t in e)this.addProperty(t,e[t])}},{key:"addProperty",value:function(e,t){var r=this.get(e);null!=r&&r.setData?r.setData(t):this.set(e,t)}},{key:"getData",value:function(){var e=this,t=this._get_data("propertyNames")||[],r={};return t.forEach(function(t){var n,i=e.get(t);i instanceof BaseModel$1&&!1!==i._get_data("needCollect")&&(r[t]=null===(n=i.getData)||void 0===n?void 0:n.call(i))}),r}},{key:"getAllData",value:function(e){var t=this,r=this._get_data("propertyNames")||[],n={};return r.forEach(function(r){var i,a=t.get(r);if(a instanceof BaseModel$1&&!1!==a._get_data("needCollect")&&(!e||!a._get_data("isGrid"))){var o=null===(i=a.getData)||void 0===i?void 0:i.call(a);void 0!==o&&(n[r]=o)}}),n}},{key:"removeProperty",value:function(e){var t=this._get_data("propertyNames")||[],r=t.indexOf(e);-1!==r&&t.splice(r,1),this._del_data(e)}},{key:"loadData",value:function(e){this.setCache("isLoadData",!0),this.clear(),this.setData(e),this.setDirty(!1),this.setCache("isLoadData",!1)}},{key:"clear",value:function(e){var t=this;(this._get_data("propertyNames")||[]).forEach(function(r){var n,i=t.get(r);i instanceof BaseModel$1&&!1!==i._get_data("needClear")&&(null===(n=i.clear)||void 0===n||n.call(i,e))})}},{key:"setDirty",value:function(e){e?this._set_data("isDirty",!0):(this._del_data("isDirty"),this._set_data("originalData",this.getData()))}},{key:"getGridModel",value:function(e){var t;if(e)return this.get(e);var r=this._get_data("gridModel");if(r)return r;var n=null===(t=this.getParams())||void 0===t?void 0:t.masterGridModelName;if(n)return this.get(n);for(var i=this._get_data("propertyNames"),a=0,o=i.length;a<o;a++){if((r=this.get(i[a]))instanceof GridModel$1||"GridModel"==r.modelType)return this._set_data("gridModel",r),r}}},{key:"getGridModels",value:function(){for(var e=this._get_data("propertyNames"),t=[],r=0,n=e.length;r<n;r++){var i=this.get(e[r]);(i instanceof GridModel$1||"GridModel"==i.modelType)&&t.push(i)}return t}},{key:"getGridFilterModel",value:function(e){return this.getGridModel(e).getCache("FilterViewModel")}}])}();function missingLoaderResult(e){return{code:404,message:"params.fileRequire is required, the files: ".concat(e),data:[],warnings:[]}}function loadScripts(e,t,r,n,i){var a,o=t,s=r,u=n,c=i;Array.isArray(t)&&"function"==typeof r&&(o=void 0,s=t,u=r,c=n);var l=(null===(a=c)||void 0===a?void 0:a.viewModel)||this,d=(s=Array.isArray(s)?s:[]).join(",");if(!e||"function"!=typeof e.inject){var f,p=missingLoaderResult(d);return isDebug()&&console.error("[devfab][models][extend][loadScripts] ".concat(p.message)),null===(f=u)||void 0===f||f(p),p}return e.inject(o,s,function(e){var t;if(0==e.code&&Array.isArray(e.data))for(var r=0,n=e.data.length;r<n;r++){var i=e.data[r];if(i&&i.doAction)try{i.doAction("init",l)}catch(t){e.code=500,e.message="".concat(d," script execute error"),e.error=t;break}else try{var a;"function"==typeof(null===(a=c)||void 0===a?void 0:a.onFileBack)&&c.onFileBack(i,r)}catch(t){e.code=500,e.message="".concat(d," script customize execute error");break}}0!=e.code&&isDebug()&&console.info("[devfab][models][extend][loadScripts] ".concat(d," \n [message]: ").concat(e.message," \n").concat(e.error?" \n [error]: ":""),e.error),null===(t=u)||void 0===t||t(e)})}function initExtendScripts(e){var t=this;window.__devfab&&window.__devfab.__debugger_initExtendJs;var r=e.fileRequire,n=e.extendScriptParams,i=e.readyEventName,a=void 0===i?"extendReady":i,o=n||{},s=o.enableJs,u=void 0!==s&&s,c=o.filepath,l=o.scriptUrl;if(!u)return isDebug()&&console.info("[devfab][extend][js] not enable extend script"),void t.execute(a,t);if(!l)return isDebug()&&console.info("[devfab][extend][js] extend script is not defined"),void t.execute(a,t);var d=c,f=[l];t.getEnv&&t.getEnv("everyCommonExtend")&&f.push(t.getEnv("everyCommonExtend")),loadScripts.call(t,r,d,f,function(e){t.execute(a,t,e)})}var initExtScripts=function(){var e=_asyncToGenerator(_regenerator().m(function e(t,r,n){var i,a,o,s,u,c,l,d,f,p,h;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(window.__devfab&&window.__devfab.__debugger_initExtJs,o=n.fileRequire,s=n.extendScriptParams,c=(u=s||{}).enableExtJs,l=void 0!==c&&c,d=u.exturlsField,f=void 0===d?"extscripturls":d,l){e.n=1;break}return isDebug()&&console.info("[devfab][extend][exturls] ext script is not enable"),e.a(2,Promise.resolve(!0));case 1:if(t){e.n=2;break}return isDebug()&&console.info("[devfab][extend][exturls] script data is null"),e.a(2,Promise.resolve(!0));case 2:if(p=null==t?void 0:t[f],h=Array.isArray(p)?p:[],h=(h=(r.getCache("localScripts")||[]).concat(h)).concat(window.__devfab__GLOBAL_EXT_SCRIPTS__||[]),null!==(i=r.getParams())&&void 0!==i&&i.selfExtUrls&&(h=h.concat([r.getParams().selfExtUrls])),null===(a=h)||void 0===a||!a.length){e.n=4;break}return h=_toConsumableArray(new Set(h)),e.n=3,Promise.all(h.map(function(){var e=_asyncToGenerator(_regenerator().m(function e(t){return _regenerator().w(function(e){for(;;)if(0===e.n)return e.a(2,t)},e)}));return function(t){return e.apply(this,arguments)}}()));case 3:h=e.v;case 4:return t[f]=h,e.a(2,new Promise(function(e,t){loadScripts.call(r,o,h,function(t){e(t)})}))}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),BaseModel=BaseModel$1,SimpleModel=SimpleModel$1,ViewModel=ViewModel$1,GridModel=GridModel$1;function createModelFactory(e,t){var r=(null==t?void 0:t.SimpleModel)||SimpleModel$1,n=e.cControlType||e.component||e.controlType||e.ctrlType;return n=n.toLowerCase(),new r(e)}function _createViewModel(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.modelNameField,i=void 0===n?"cName":n,a=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"init",value:function(e,t){var r=this.createModels(e,t);this.setData(r),this.setDirty(!1)}},{key:"createModels",value:function(e,t){var n={};return(Array.isArray(e)?e:[]).forEach(function(e){var t,a,o={model:createModelFactory(e,r),meta:e,childModel:!0,modelName:e[i]};null==r||null===(t=r.onBeforeInitModel)||void 0===t||t.call(r,o),n[o.modelName]=o.model,null==r||null===(a=r.onAfterInitModel)||void 0===a||a.call(r,o)}),n}},{key:"initData",value:function(){initExtendScripts.call(this,r)}}])}((null==r||null===(t=r.models)||void 0===t?void 0:t.ViewModel)||ViewModel$1);return a.prototype.modelType="ViewModel",a}function _initViewModel(e,t){var r,n,i,a=new(_createViewModel(e,t)),o={model:a,meta:e};return null==t||null===(r=t.onBeforeInitModel)||void 0===r||r.call(t,o),o.model=a,null==a||null===(n=a.init)||void 0===n||n.call(a,e.models,e),null==t||null===(i=t.onAfterInitModel)||void 0===i||i.call(t,o),a}function initViewModel(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=_initViewModel(e,t);return n.on("destroyVM",function(){var e,t;null===(e=n)||void 0===e||null===(t=e.destroyVM)||void 0===t||t.call(e),n=null,isDebug()&&console.info("[devfab][models][initVM]: destory vm ".concat((new Date).toString()))}),n.on("extendReady",_asyncToGenerator(_regenerator().m(function i(){var a;return _regenerator().w(function(i){for(;;)switch(i.n){case 0:return(a=[]).push(initExtScripts(e,n,t)),i.n=1,Promise.all(a);case 1:isDebug()&&console.info("[devfab][models][initVM]: after vm init ".concat((new Date).toString())),null==r||r(n,e);case 2:return i.a(2)}},i)}))),n.initData(),n}var models=Object.freeze({__proto__:null,BaseModel:BaseModel,SimpleModel:SimpleModel,GridModel:GridModel,ViewModel:ViewModel,initViewModel:initViewModel,loadScripts:loadScripts}),utils={models:models,Builder:Builder,Cache:Cache,Event:Event,Ajax:DynamicProxy},devfab={get debug(){return!(!window.__devfab||!window.__devfab.debug)},set debug(e){window.__devfab=window.__devfab||{},window.__devfab.debug=!!e},define:function(){FileRequire.provide.apply(FileRequire,arguments)},require:function(){FileRequire.inject.apply(FileRequire,arguments)},provide:function(){FileRequire.provide.apply(FileRequire,arguments)},inject:function(){FileRequire.inject.apply(FileRequire,arguments)},provideScript:function(){FileRequire.provideScript.apply(FileRequire,arguments)},injectScript:function(){FileRequire.injectScript.apply(FileRequire,arguments)},FileRequire:FileRequire,utils:_objectSpread2(_objectSpread2({},utils),{},{builder:utils.Builder.create(),cache:utils.Cache.create(),event:utils.Event.create()})};window.__devfab=Object.assign({},window.__devfab,devfab),exports.default=devfab;