go-core 0.2.30-beta → 0.2.32
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/code.es5.js +8 -8
- package/dist/code.umd.js +2 -2
- package/package.json +2 -2
package/dist/code.umd.js
CHANGED
|
@@ -41,7 +41,7 @@ function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,
|
|
|
41
41
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
42
42
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
43
43
|
PERFORMANCE OF THIS SOFTWARE.
|
|
44
|
-
***************************************************************************** */function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __spreadArray(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var _global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,keys=Object.keys,isArray=Array.isArray;function extend(e,t){return"object"!=typeof t||keys(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||_global.Promise||(_global.Promise=Promise);var getProto=Object.getPrototypeOf,_hasOwn={}.hasOwnProperty;function hasOwn(e,t){return _hasOwn.call(e,t)}function props(e,t){"function"==typeof t&&(t=t(getProto(e))),("undefined"==typeof Reflect?keys:Reflect.ownKeys)(t).forEach((function(r){setProp(e,r,t[r])}))}var defineProperty=Object.defineProperty;function setProp(e,t,r,n){defineProperty(e,t,extend(r&&hasOwn(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function derive(e){return{from:function(t){return e.prototype=Object.create(t.prototype),setProp(e.prototype,"constructor",e),{extend:props.bind(null,e.prototype)}}}}var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(e,t){var r;return getOwnPropertyDescriptor(e,t)||(r=getProto(e))&&getPropertyDescriptor(r,t)}var _slice$1=[].slice;function slice(e,t,r){return _slice$1.call(e,t,r)}function override(e,t){return t(e)}function assert(e){if(!e)throw new Error("Assertion Failed")}function asap$1(e){_global.setImmediate?setImmediate(e):setTimeout(e,0)}function arrayToObject(e,t){return e.reduce((function(e,r,n){var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function getByKeyPath(e,t){if("string"==typeof t&&hasOwn(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=getByKeyPath(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:getByKeyPath(s,t.substr(a+1))}}function setByKeyPath(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){assert("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)setByKeyPath(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?isArray(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var c=e[a];c&&hasOwn(e,a)||(c=e[a]={}),setByKeyPath(c,s,r)}}else void 0===r?isArray(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function delByKeyPath(e,t){"string"==typeof t?setByKeyPath(e,t,void 0):"length"in t&&[].map.call(t,(function(t){setByKeyPath(e,t,void 0)}))}function shallowClone(e){var t={};for(var r in e)hasOwn(e,r)&&(t[r]=e[r]);return t}var concat=[].concat;function flatten(e){return concat.apply([],e)}var intrinsicTypeNames="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(flatten([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return _global[e]})),intrinsicTypes=new Set(intrinsicTypeNames.map((function(e){return _global[e]})));function cloneSimpleObjectTree(e){var t={};for(var r in e)if(hasOwn(e,r)){var n=e[r];t[r]=!n||"object"!=typeof n||intrinsicTypes.has(n.constructor)?n:cloneSimpleObjectTree(n)}return t}function objectIsEmpty(e){for(var t in e)if(hasOwn(e,t))return!1;return!0}var circularRefs=null;function deepClone(e){circularRefs=new WeakMap;var t=innerDeepClone(e);return circularRefs=null,t}function innerDeepClone(e){if(!e||"object"!=typeof e)return e;var t=circularRefs.get(e);if(t)return t;if(isArray(e)){t=[],circularRefs.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(innerDeepClone(e[r]))}else if(intrinsicTypes.has(e.constructor))t=e;else{var i=getProto(e);for(var o in t=i===Object.prototype?{}:Object.create(i),circularRefs.set(e,t),e)hasOwn(e,o)&&(t[o]=innerDeepClone(e[o]))}return t}var toString={}.toString;function toStringTag(e){return toString.call(e).slice(8,-1)}var iteratorSymbol="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",getIteratorOf="symbol"==typeof iteratorSymbol?function(e){var t;return null!=e&&(t=e[iteratorSymbol])&&t.apply(e)}:function(){return null};function delArrayItem(e,t){var r=e.indexOf(t);return r>=0&&e.splice(r,1),r>=0}var NO_CHAR_ARRAY={};function getArrayOf(e){var t,r,n,i;if(1===arguments.length){if(isArray(e))return e.slice();if(this===NO_CHAR_ARRAY&&"string"==typeof e)return[e];if(i=getIteratorOf(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}var isAsyncFunction="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},dexieErrorNames=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],idbDomErrorNames=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],errorList=dexieErrorNames.concat(idbDomErrorNames),defaultTexts={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function DexieError(e,t){this.name=e,this.message=t}function getMultiErrorMessage(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,r){return r.indexOf(e)===t})).join("\n")}function ModifyError(e,t,r,n){this.failures=t,this.failedKeys=n,this.successCount=r,this.message=getMultiErrorMessage(e,t)}function BulkError(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=getMultiErrorMessage(e,this.failures)}derive(DexieError).from(Error).extend({toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var errnames=errorList.reduce((function(e,t){return e[t]=t+"Error",e}),{}),BaseException=DexieError,exceptions=errorList.reduce((function(e,t){var r=t+"Error";function n(e,n){this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=defaultTexts[t]||r,this.inner=null)}return derive(n).from(BaseException),e[t]=n,e}),{});exceptions.Syntax=SyntaxError,exceptions.Type=TypeError,exceptions.Range=RangeError;var exceptionMap=idbDomErrorNames.reduce((function(e,t){return e[t+"Error"]=exceptions[t],e}),{});function mapError(e,t){if(!e||e instanceof DexieError||e instanceof TypeError||e instanceof SyntaxError||!e.name||!exceptionMap[e.name])return e;var r=new exceptionMap[e.name](t||e.message,e);return"stack"in e&&setProp(r,"stack",{get:function(){return this.inner.stack}}),r}var fullNameExceptions=errorList.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=exceptions[t]),e}),{});function nop(){}function mirror(e){return e}function pureFunctionChain(e,t){return null==e||e===mirror?t:function(r){return t(e(r))}}function callBoth(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function hookCreatingChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?callBoth(n,this.onsuccess):n),i&&(this.onerror=this.onerror?callBoth(i,this.onerror):i),void 0!==o?o:r}}function hookDeletingChain(e,t){return e===nop?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?callBoth(r,this.onsuccess):r),n&&(this.onerror=this.onerror?callBoth(n,this.onerror):n)}}function hookUpdatingChain(e,t){return e===nop?t:function(r){var n=e.apply(this,arguments);extend(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?callBoth(i,this.onsuccess):i),o&&(this.onerror=this.onerror?callBoth(o,this.onerror):o),void 0===n?void 0===a?void 0:a:extend(n,a)}}function reverseStoppableEventChain(e,t){return e===nop?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function promisableChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then((function(){return t.apply(n,o)}))}return t.apply(this,arguments)}}fullNameExceptions.ModifyError=ModifyError,fullNameExceptions.DexieError=DexieError,fullNameExceptions.BulkError=BulkError;var debug="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function setDebug(e,t){debug=e}var INTERNAL={},ZONE_ECHO_LIMIT=100,_a$1="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,getProto(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,getProto(t),e]}(),resolvedNativePromise=_a$1[0],nativePromiseProto=_a$1[1],resolvedGlobalPromise=_a$1[2],nativePromiseThen=nativePromiseProto&&nativePromiseProto.then,NativePromise=resolvedNativePromise&&resolvedNativePromise.constructor,patchGlobalPromise=!!resolvedGlobalPromise;function schedulePhysicalTick(){queueMicrotask(physicalTick)}var asap=function(e,t){microtickQueue.push([e,t]),needsNewPhysicalTick&&(schedulePhysicalTick(),needsNewPhysicalTick=!1)},isOutsideMicroTick=!0,needsNewPhysicalTick=!0,unhandledErrors=[],rejectingErrors=[],rejectionMapper=mirror,globalPSD={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:nop,pgp:!1,env:{},finalize:nop},PSD=globalPSD,microtickQueue=[],numScheduledCalls=0,tickFinalizers=[];function DexiePromise(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=PSD;if("function"!=typeof e){if(e!==INTERNAL)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++t.ref,executePromiseTask(this,e)}var thenProp={get:function(){var e=PSD,t=totalEchoes;function r(r,n){var i=this,o=!e.global&&(e!==PSD||t!==totalEchoes),a=o&&!decrementExpectedAwaits(),s=new DexiePromise((function(t,s){propagateToListener(i,new Listener(nativeAwaitCompatibleWrap(r,e,o,a),nativeAwaitCompatibleWrap(n,e,o,a),t,s,e))}));return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return r.prototype=INTERNAL,r},set:function(e){setProp(this,"then",e&&e.prototype===INTERNAL?thenProp:{get:function(){return e},set:thenProp.set})}};function Listener(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function executePromiseTask(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&beginMicroTickScope();t&&"function"==typeof t.then?executePromiseTask(e,(function(e,r){t instanceof DexiePromise?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,propagateAllListeners(e)),r&&endMicroTickScope()}}),handleRejection.bind(null,e))}catch(t){handleRejection(e,t)}}function handleRejection(e,t){if(rejectingErrors.push(t),null===e._state){var r=e._lib&&beginMicroTickScope();t=rejectionMapper(t),e._state=!1,e._value=t,addPossiblyUnhandledError(e),propagateAllListeners(e),r&&endMicroTickScope()}}function propagateAllListeners(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)propagateToListener(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===numScheduledCalls&&(++numScheduledCalls,asap((function(){0==--numScheduledCalls&&finalizePhysicalTick()}),[]))}function propagateToListener(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++numScheduledCalls,asap(callListener,[r,e,t])}else e._listeners.push(t)}function callListener(e,t,r){try{var n,i=t._value;!t._state&&rejectingErrors.length&&(rejectingErrors=[]),n=debug&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==rejectingErrors.indexOf(i)||markErrorAsHandled(t),r.resolve(n)}catch(e){r.reject(e)}finally{0==--numScheduledCalls&&finalizePhysicalTick(),--r.psd.ref||r.psd.finalize()}}function physicalTick(){usePSD(globalPSD,(function(){beginMicroTickScope()&&endMicroTickScope()}))}function beginMicroTickScope(){var e=isOutsideMicroTick;return isOutsideMicroTick=!1,needsNewPhysicalTick=!1,e}function endMicroTickScope(){var e,t,r;do{for(;microtickQueue.length>0;)for(e=microtickQueue,microtickQueue=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(microtickQueue.length>0);isOutsideMicroTick=!0,needsNewPhysicalTick=!0}function finalizePhysicalTick(){var e=unhandledErrors;unhandledErrors=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=tickFinalizers.slice(0),r=t.length;r;)t[--r]()}function run_at_end_of_this_or_next_physical_tick(e){tickFinalizers.push((function t(){e(),tickFinalizers.splice(tickFinalizers.indexOf(t),1)})),++numScheduledCalls,asap((function(){0==--numScheduledCalls&&finalizePhysicalTick()}),[])}function addPossiblyUnhandledError(e){unhandledErrors.some((function(t){return t._value===e._value}))||unhandledErrors.push(e)}function markErrorAsHandled(e){for(var t=unhandledErrors.length;t;)if(unhandledErrors[--t]._value===e._value)return void unhandledErrors.splice(t,1)}function PromiseReject(e){return new DexiePromise(INTERNAL,!1,e)}function wrap$1(e,t){var r=PSD;return function(){var n=beginMicroTickScope(),i=PSD;try{return switchToZone(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{switchToZone(i,!1),n&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:thenProp,_then:function(e,t){propagateToListener(this,new Listener(null,null,e,t,PSD))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?r(e):PromiseReject(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):PromiseReject(e)}))},finally:function(e){return this.then((function(t){return DexiePromise.resolve(e()).then((function(){return t}))}),(function(t){return DexiePromise.resolve(e()).then((function(){return PromiseReject(t)}))}))},timeout:function(e,t){var r=this;return e<1/0?new DexiePromise((function(n,i){var o=setTimeout((function(){return i(new exceptions.Timeout(t))}),e);r.then(n,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),globalPSD.env=snapShot(),props(DexiePromise,{all:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(i,o){return DexiePromise.resolve(i).then((function(r){e[o]=r,--n||t(e)}),r)}))}))},resolve:function(e){return e instanceof DexiePromise?e:e&&"function"==typeof e.then?new DexiePromise((function(t,r){e.then(t,r)})):new DexiePromise(INTERNAL,!0,e)},reject:PromiseReject,race:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){e.map((function(e){return DexiePromise.resolve(e).then(t,r)}))}))},PSD:{get:function(){return PSD},set:function(e){return PSD=e}},totalEchoes:{get:function(){return totalEchoes}},newPSD:newScope,usePSD:usePSD,scheduler:{get:function(){return asap},set:function(e){asap=e}},rejectionMapper:{get:function(){return rejectionMapper},set:function(e){rejectionMapper=e}},follow:function(e,t){return new DexiePromise((function(r,n){return newScope((function(t,r){var n=PSD;n.unhandleds=[],n.onunhandled=r,n.finalize=callBoth((function(){var e=this;run_at_end_of_this_or_next_physical_tick((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),NativePromise&&(NativePromise.allSettled&&setProp(DexiePromise,"allSettled",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,i){return DexiePromise.resolve(e).then((function(e){return n[i]={status:"fulfilled",value:e}}),(function(e){return n[i]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),NativePromise.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,i=new Array(n);e.forEach((function(e,o){return DexiePromise.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--n||r(new AggregateError(i))}))}))}))})));var task={awaits:0,echoes:0,id:0},taskCounter=0,zoneStack=[],zoneEchoes=0,totalEchoes=0,zone_id_counter=0;function newScope(e,t,r,n){var i=PSD,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++zone_id_counter,globalPSD.env,o.env=patchGlobalPromise?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject}:{},t&&extend(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=usePSD(o,e,r,n);return 0===o.ref&&o.finalize(),a}function incrementExpectedAwaits(){return task.id||(task.id=++taskCounter),++task.awaits,task.echoes+=ZONE_ECHO_LIMIT,task.id}function decrementExpectedAwaits(){return!!task.awaits&&(0==--task.awaits&&(task.id=0),task.echoes=task.awaits*ZONE_ECHO_LIMIT,!0)}function onPossibleParallellAsync(e){return task.echoes&&e&&e.constructor===NativePromise?(incrementExpectedAwaits(),e.then((function(e){return decrementExpectedAwaits(),e}),(function(e){return decrementExpectedAwaits(),rejection(e)}))):e}function zoneEnterEcho(e){++totalEchoes,task.echoes&&0!=--task.echoes||(task.echoes=task.awaits=task.id=0),zoneStack.push(PSD),switchToZone(e,!0)}function zoneLeaveEcho(){var e=zoneStack[zoneStack.length-1];zoneStack.pop(),switchToZone(e,!1)}function switchToZone(e,t){var r=PSD;if((t?!task.echoes||zoneEchoes++&&e===PSD:!zoneEchoes||--zoneEchoes&&e===PSD)||queueMicrotask(t?zoneEnterEcho.bind(null,e):zoneLeaveEcho),e!==PSD&&(PSD=e,r===globalPSD&&(globalPSD.env=snapShot()),patchGlobalPromise)){var n=globalPSD.env.Promise,i=e.env;(r.global||e.global)&&(Object.defineProperty(_global,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any&&(n.any=i.any))}}function snapShot(){var e=_global.Promise;return patchGlobalPromise?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(_global,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function usePSD(e,t,r,n,i){var o=PSD;try{return switchToZone(e,!0),t(r,n,i)}finally{switchToZone(o,!1)}}function nativeAwaitCompatibleWrap(e,t,r,n){return"function"!=typeof e?e:function(){var i=PSD;r&&incrementExpectedAwaits(),switchToZone(t,!0);try{return e.apply(this,arguments)}finally{switchToZone(i,!1),n&&queueMicrotask(decrementExpectedAwaits)}}}function execInGlobalContext(e){Promise===NativePromise&&0===task.echoes?0===zoneEchoes?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+nativePromiseThen).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var rejection=DexiePromise.reject;function tempTransaction(e,t,r,n){if(e.idbdb&&(e._state.openComplete||PSD.letThrough||e._vip)){var i=e._createTransaction(t,r,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===errnames.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e.close({disableAutoOpen:!1}),e.open().then((function(){return tempTransaction(e,t,r,n)}))):rejection(i)}return i._promise(t,(function(e,t){return newScope((function(){return PSD.trans=i,n(e,t,i)}))})).then((function(e){if("readwrite"===t)try{i.idbtrans.commit()}catch(e){}return"readonly"===t?e:i._completion.then((function(){return e}))}))}if(e._state.openComplete)return rejection(new exceptions.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._state.autoOpen)return rejection(new exceptions.DatabaseClosed);e.open().catch(nop)}return e._state.dbReadyPromise.then((function(){return tempTransaction(e,t,r,n)}))}var DEXIE_VERSION="4.0.4",maxString=String.fromCharCode(65535),minKey=-1/0,INVALID_KEY_ARGUMENT="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",STRING_EXPECTED="String expected.",connections=[],DBNAMES_DB="__dbnames",READONLY="readonly",READWRITE="readwrite";function combine(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var AnyRange={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=deepClone(t))[e],t}}function Entity(){throw exceptions.Type()}function cmp(e,t){try{var r=type(e),n=type(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return compareUint8Arrays(getUint8Array(e),getUint8Array(t));case"Array":return compareArrays(e,t)}}catch(e){}return NaN}function compareArrays(e,t){for(var r=e.length,n=t.length,i=r<n?r:n,o=0;o<i;++o){var a=cmp(e[o],t[o]);if(0!==a)return a}return r===n?0:r<n?-1:1}function compareUint8Arrays(e,t){for(var r=e.length,n=t.length,i=r<n?r:n,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return r===n?0:r<n?-1:1}function type(e){var t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var r=toStringTag(e);return"ArrayBuffer"===r?"binary":r}function getUint8Array(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var Table=function(){function e(){}return e.prototype._trans=function(e,t,r){var n=this._tx||PSD.trans,i=this.name,o=debug&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function a(e,r,n){if(!n.schema[i])throw new exceptions.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}var s=beginMicroTickScope();try{var c=n&&n.db._novip===this.db._novip?n===PSD.trans?n._promise(e,a,r):newScope((function(){return n._promise(e,a,r)}),{trans:n,transless:PSD.transless||PSD}):tempTransaction(this.db,e,[this.name],a);return o&&(c._consoleTask=o,c=c.catch((function(e){return console.trace(e),rejection(e)}))),c}finally{s&&endMicroTickScope()}},e.prototype.get=function(e,t){var r=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?rejection(new exceptions.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return r.core.get({trans:t,key:e}).then((function(e){return r.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(isArray(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=keys(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))){for(var r=0;r<t.length;++r)if(-1===t.indexOf(e.keyPath[r]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(r&&this.db._maxKey!==maxString){var n=r.keyPath.slice(0,t.length);return this.where(n).equals(n.map((function(t){return e[t]})))}!r&&debug&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName,o=this.db._deps.indexedDB;function a(e,t){return 0===o.cmp(e,t)}var s=t.reduce((function(t,r){var n=t[0],o=t[1],s=i[r],c=e[r];return[n||s,n||!s?combine(o,s&&s.multi?function(e){var t=getByKeyPath(e,r);return isArray(t)&&t.some((function(e){return a(c,e)}))}:function(e){return a(c,getByKeyPath(e,r))}):o]}),[null,null]),c=s[0],u=s[1];return c?this.where(c.name).equals(e[c.keyPath]).filter(u):r?this.filter(u):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,isArray(e)?"[".concat(e.join("+"),"]"):e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){var t=this.db,r=this.name;this.schema.mappedClass=e,e.prototype instanceof Entity&&(e=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return __extends(n,e),Object.defineProperty(n.prototype,"db",{get:function(){return t},enumerable:!1,configurable:!0}),n.prototype.table=function(){return r},n}(e));for(var n=new Set,i=e.prototype;i;i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(e){return n.add(e)}));var o=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var i in t)if(!n.has(i))try{r[i]=t[i]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=o,this.hook("reading",o),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){extend(this,e)}))},e.prototype.add=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=workaroundForUndefinedPrimKey(o)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{setByKeyPath(e,o,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof e||isArray(e))return this.where(":id").equals(e).modify(t);var r=getByKeyPath(e,this.schema.primKey.keyPath);return void 0===r?rejection(new exceptions.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(t)},e.prototype.put=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=workaroundForUndefinedPrimKey(o)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{setByKeyPath(e,o,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:AnyRange})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(r){return t.core.getMany({keys:e,trans:r}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},e.prototype.bulkAdd=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new exceptions.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(workaroundForUndefinedPrimKey(s)):e;return n.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new BulkError("".concat(n.name,".bulkAdd(): ").concat(t," of ").concat(c," operations failed"),a)}))}))},e.prototype.bulkPut=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new exceptions.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(workaroundForUndefinedPrimKey(s)):e;return n.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new BulkError("".concat(n.name,".bulkPut(): ").concat(t," of ").concat(c," operations failed"),a)}))}))},e.prototype.bulkUpdate=function(e){var t=this,r=this.core,n=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(a){return r.getMany({trans:a,keys:n,cache:"clone"}).then((function(s){var c=[],u=[];e.forEach((function(e,r){var n=e.key,i=e.changes,a=s[r];if(a){for(var l=0,d=Object.keys(i);l<d.length;l++){var h=d[l],f=i[h];if(h===t.schema.primKey.keyPath){if(0!==cmp(f,n))throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()")}else setByKeyPath(a,h,f)}o.push(r),c.push(n),u.push(a)}}));var l=c.length;return r.mutate({trans:a,type:"put",keys:c,values:u,updates:{keys:n,changeSpecs:i}}).then((function(e){var r=e.numFailures,n=e.failures;if(0===r)return l;for(var i=0,a=Object.keys(n);i<a.length;i++){var s=a[i],c=o[Number(s)];if(null!=c){var u=n[s];delete n[s],n[c]=u}}throw new BulkError("".concat(t.name,".bulkUpdate(): ").concat(r," of ").concat(l," operations failed"),n)}))}))}))},e.prototype.bulkDelete=function(e){var t=this,r=e.length;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:e})})).then((function(e){var n=e.numFailures,i=e.lastResult,o=e.failures;if(0===n)return i;throw new BulkError("".concat(t.name,".bulkDelete(): ").concat(n," of ").concat(r," operations failed"),o)}))},e}();function Events(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){var a;n||(n=reverseStoppableEventChain),i||(i=nop);var s={subscribers:[],fire:i,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=n(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter((function(t){return t!==e})),s.fire=s.subscribers.reduce(n,i)}};return t[e]=r[e]=s,s}keys(a=e).forEach((function(e){var t=a[e];if(isArray(t))o(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new exceptions.InvalidArgument("Invalid event config");var r=o(e,mirror,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){asap$1((function(){e.apply(null,t)}))}))}))}}))}}function makeClassConstructor(e,t){return derive(t).from({prototype:e}),t}function createTableConstructor(e){return makeClassConstructor(Table.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}function isPlainKeyRange(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function addFilter(e,t){e.filter=combine(e.filter,t)}function addReplayFilter(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return combine(n(),t())}:t,e.justLimit=r&&!n}function addMatchFilter(e,t){e.isMatch=combine(e.isMatch,t)}function getIndexOrStore(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new exceptions.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function openCursor(e,t,r){var n=getIndexOrStore(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function iter(e,t,r,n){var i=e.replayFilter?combine(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,r,n){if(!i||i(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),hasOwn(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),iterate(openCursor(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return iterate(openCursor(e,n,r),combine(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function iterate(e,t,r,n){var i=n?function(e,t,i){return r(n(e),t,i)}:r,o=wrap$1(i);return e.then((function(e){if(e)return e.start((function(){var r=function(){return e.continue()};t&&!t(e,(function(e){return r=e}),(function(t){e.stop(t),r=nop}),(function(t){e.fail(t),r=nop}))||o(e.value,e,(function(e){return r=e})),r()}))}))}var PropModification=function(){function e(e){Object.assign(this,e)}return e.prototype.execute=function(e){var t,r=null===(t=this.replacePrefix)||void 0===t?void 0:t[0];return r&&"string"==typeof e&&e.startsWith(r)?this.replacePrefix[1]+e.substring(r.length):e},e}(),Collection=function(){function e(){}return e.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,rejection.bind(null,r.error)):r.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,rejection.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=combine(t.algorithm,e)},e.prototype._iterate=function(e,t){return iter(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&extend(r,e),t._ctx=r,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return iter(t,e,r,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(isPlainKeyRange(r,!0))return n.count({trans:e,query:{index:getIndexOrStore(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var i=0;return iter(r,(function(){return++i,!1}),e,n).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&isPlainKeyRange(r,!0)&&r.limit>0){var n=r.valueMapper,i=getIndexOrStore(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var o=[];return iter(r,(function(e){return o.push(e)}),e,r.table.core).then((function(){return o}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,isPlainKeyRange(t)?addReplayFilter(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):addReplayFilter(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),addReplayFilter(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},e.prototype.until=function(e,t){return addFilter(this._ctx,(function(r,n,i){return!e(r.value)||(n(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return addFilter(this._ctx,(function(t){return e(t.value)})),addMatchFilter(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&isPlainKeyRange(t,!0)&&t.limit>0)return this._read((function(e){var r=getIndexOrStore(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return addFilter(this._ctx,(function(e){var t=e.primaryKey.toString(),n=hasOwn(r,t);return r[t]=!0,!n})),this},e.prototype.modify=function(e){var t=this,r=this._ctx;return this._write((function(n){var i;if("function"==typeof e)i=e;else{var o=keys(e),a=o.length;i=function(t){for(var r=!1,n=0;n<a;++n){var i=o[n],s=e[i],c=getByKeyPath(t,i);s instanceof PropModification?(setByKeyPath(t,i,s.execute(c)),r=!0):c!==s&&(setByKeyPath(t,i,s),r=!0)}return r}}var s=r.table.core,c=s.schema.primaryKey,u=c.outbound,l=c.extractKey,d=t.db._options.modifyChunkSize||200,h=[],f=0,p=[],m=function(e,t){var r=t.failures,n=t.numFailures;f+=e-n;for(var i=0,o=keys(r);i<o.length;i++){var a=o[i];h.push(r[a])}};return t.clone().primaryKeys().then((function(t){var o=function(a){var c=Math.min(d,t.length-a);return s.getMany({trans:n,keys:t.slice(a,a+c),cache:"immutable"}).then((function(h){for(var f=[],p=[],g=u?[]:null,v=[],y=0;y<c;++y){var _=h[y],b={value:deepClone(_),primKey:t[a+y]};!1!==i.call(b,b.value,b)&&(null==b.value?v.push(t[a+y]):u||0===cmp(l(_),l(b.value))?(p.push(b.value),u&&g.push(t[a+y])):(v.push(t[a+y]),f.push(b.value)))}var w=isPlainKeyRange(r)&&r.limit===1/0&&("function"!=typeof e||e===deleteCallback)&&{index:r.index,range:r.range};return Promise.resolve(f.length>0&&s.mutate({trans:n,type:"add",values:f}).then((function(e){for(var t in e.failures)v.splice(parseInt(t),1);m(f.length,e)}))).then((function(){return(p.length>0||w&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:p,criteria:w,changeSpec:"function"!=typeof e&&e}).then((function(e){return m(p.length,e)}))})).then((function(){return(v.length>0||w&&e===deleteCallback)&&s.mutate({trans:n,type:"delete",keys:v,criteria:w}).then((function(e){return m(v.length,e)}))})).then((function(){return t.length>a+c&&o(a+d)}))}))};return o(0).then((function(){if(h.length>0)throw new ModifyError("Error modifying one or more objects",h,f,p);return t.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return isPlainKeyRange(e)&&(e.isPrimKey||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:r,query:{index:n,range:i}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then((function(e){var r=e.failures;e.lastResult,e.results;var n=e.numFailures;if(n)throw new ModifyError("Could not delete some values",Object.keys(r).map((function(e){return r[e]})),t-n);return t-n}))}))})):this.modify(deleteCallback)},e}(),deleteCallback=function(e,t){return t.value=null};function createCollectionConstructor(e){return makeClassConstructor(Collection.prototype,(function(t,r){this.db=e;var n=AnyRange,i=null;if(r)try{n=r()}catch(e){i=e}var o=t._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==mirror?s:null}}))}function simpleCompare(e,t){return e<t?-1:e===t?0:1}function simpleCompareReverse(e,t){return e>t?-1:e===t?0:1}function fail(e,t,r){var n=e instanceof WhereClause?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function emptyCollection(e){return new e.Collection(e,(function(){return rangeEqual("")})).limit(0)}function upperFactory(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}function lowerFactory(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}function nextCasing(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==n[c])return i(e[c],r[c])<0?e.substr(0,c)+r[c]+r.substr(c+1):i(e[c],n[c])<0?e.substr(0,c)+n[c]+r.substr(c+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}function addIgnoreCaseAlgorithm(e,t,r,n){var i,o,a,s,c,u,l,d=r.length;if(!r.every((function(e){return"string"==typeof e})))return fail(e,STRING_EXPECTED);function h(e){i=upperFactory(e),o=lowerFactory(e),a="next"===e?simpleCompare:simpleCompareReverse;var t=r.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":n}h("next");var f=new e.Collection(e,(function(){return createRange(s[0],c[d-1]+n)}));f._ondirectionchange=function(e){h(e)};var p=0;return f._addAlgorithm((function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var h=o(i);if(t(h,c,p))return!0;for(var f=null,m=p;m<d;++m){var g=nextCasing(i,h,s[m],c[m],a,u);null===g&&null===f?p=m+1:(null===f||a(f,g)>0)&&(f=g)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function createRange(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function rangeEqual(e){return{type:1,lower:e,upper:e}}var WhereClause=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?emptyCollection(this):new this.Collection(this,(function(){return createRange(e,t,!r,!n)}))}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}},e.prototype.equals=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return rangeEqual(e)}))},e.prototype.above=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?fail(this,STRING_EXPECTED):this.between(e,e+maxString,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):addIgnoreCaseAlgorithm(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],maxString)},e.prototype.equalsIgnoreCase=function(e){return addIgnoreCaseAlgorithm(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,maxString)},e.prototype.anyOf=function(){var e=this,t=getArrayOf.apply(NO_CHAR_ARRAY,arguments),r=this._cmp;try{t.sort(r)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}if(0===t.length)return emptyCollection(this);var n=new this.Collection(this,(function(){return createRange(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var i=0;return n._addAlgorithm((function(e,n,o){for(var a=e.key;r(a,t[i])>0;)if(++i===t.length)return n(o),!1;return 0===r(a,t[i])||(n((function(){e.continue(t[i])})),!1)})),n},e.prototype.notEqual=function(e){return this.inAnyRange([[minKey,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[minKey,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return emptyCollection(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",exceptions.InvalidArgument);var c=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;var l,d=i;function h(e,t){return d(e[0],t[0])}try{l=e.reduce((function(e,t){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(h)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}var f=0,p=u?function(e){return i(e,l[f][1])>0}:function(e){return i(e,l[f][1])>=0},m=c?function(e){return o(e,l[f][0])>0}:function(e){return o(e,l[f][0])>=0};var g=p,v=new this.Collection(this,(function(){return createRange(l[0][0],l[l.length-1][1],!c,!u)}));return v._ondirectionchange=function(e){"next"===e?(g=p,d=i):(g=m,d=o),l.sort(h)},v._addAlgorithm((function(e,t,n){for(var o=e.key;g(o);)if(++f===l.length)return t(n),!1;return!!function(e){return!p(e)&&!m(e)}(o)||(0===r._cmp(o,l[f][1])||0===r._cmp(o,l[f][0])||t((function(){d===i?e.continue(l[f][0]):e.continue(l[f][1])})),!1)})),v},e.prototype.startsWithAnyOf=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?emptyCollection(this):this.inAnyRange(e.map((function(e){return[e,e+maxString]}))):fail(this,"startsWithAnyOf() only works with strings")},e}();function createWhereClauseConstructor(e){return makeClassConstructor(WhereClause.prototype,(function(t,r,n){if(this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n},this._cmp=this._ascending=cmp,this._descending=function(e,t){return cmp(t,e)},this._max=function(e,t){return cmp(e,t)>0?e:t},this._min=function(e,t){return cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange,!this._IDBKeyRange)throw new exceptions.MissingAPI}))}function eventRejectHandler(e){return wrap$1((function(t){return preventDefault(t),e(t.target.error),!1}))}function preventDefault(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var DEXIE_STORAGE_MUTATED_EVENT_NAME="storagemutated",STORAGE_MUTATED_DOM_EVENT_NAME="x-storagemutated-1",globalEvents=Events(null,DEXIE_STORAGE_MUTATED_EVENT_NAME),Transaction=function(){function e(){}return e.prototype._lock=function(){return assert(!PSD.global),++this._reculock,1!==this._reculock||PSD.global||(PSD.lockOwnerFor=this),this},e.prototype._unlock=function(){if(assert(!PSD.global),0==--this._reculock)for(PSD.global||(PSD.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{usePSD(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&PSD.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(assert(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new exceptions.DatabaseClosed(n);case"MissingAPIError":throw new exceptions.MissingAPI(n.message,n);default:throw new exceptions.OpenFailed(n)}if(!this.active)throw new exceptions.TransactionInactive;return assert(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):r.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=wrap$1((function(r){preventDefault(r),t._reject(e.error)})),e.onabort=wrap$1((function(r){preventDefault(r),t.active&&t._reject(new exceptions.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=wrap$1((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&globalEvents.storagemutated.fire(e.mutatedParts)})),this},e.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return rejection(new exceptions.ReadOnly("Transaction is readonly"));if(!this.active)return rejection(new exceptions.TransactionInactive);if(this._locked())return new DexiePromise((function(i,o){n._blockedFuncs.push([function(){n._promise(e,t,r).then(i,o)},PSD])}));if(r)return newScope((function(){var e=new DexiePromise((function(e,r){n._lock();var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var i=new DexiePromise((function(e,r){var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),r=DexiePromise.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return r}));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new DexiePromise((function(e,n){r.then((function(r){return t._waitingQueue.push(wrap$1(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(wrap$1(n.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new exceptions.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(hasOwn(t,e))return t[e];var r=this.schema[e];if(!r)throw new exceptions.NotFound("Table "+e+" not part of transaction");var n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n},e}();function createTransactionConstructor(e){return makeClassConstructor(Transaction.prototype,(function(t,r,n,i,o){var a=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),rejection(e)}))}))}function createIndexSpec(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+nameFromKeyPath(t)}}function nameFromKeyPath(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function createTableSchema(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:arrayToObject(r,(function(e){return[e.name,e]}))}}function safariMultiStoreFix(e){return 1===e.length?e[0]:e}var getMaxKey=function(e){try{return e.only([[]]),getMaxKey=function(){return[[]]},[[]]}catch(e){return getMaxKey=function(){return maxString},maxString}};function getKeyExtractor(e){return null==e?function(){}:"string"==typeof e?getSinglePathKeyExtractor(e):function(t){return getByKeyPath(t,e)}}function getSinglePathKeyExtractor(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return getByKeyPath(t,e)}}function arrayify(e){return[].slice.call(e)}var _id_counter=0;function getKeyPathAlias(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function createDBCore(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var r=e.lower,n=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}var i=function(e,t){var r=arrayify(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,r=e.autoIncrement,n=isArray(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:getKeyExtractor(t)},indexes:arrayify(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,n=e.multiEntry,i=e.keyPath,a={name:t,compound:isArray(i),keyPath:i,unique:r,multiEntry:n,extractKey:getKeyExtractor(i)};return o[getKeyPathAlias(i)]=a,a})),getIndexByKeyPath:function(e){return o[getKeyPathAlias(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[getKeyPathAlias(t)]=a.primaryKey),a}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=i.schema,a=i.hasGetAll,s=o.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var r=e.trans,i=e.type,o=e.keys,a=e.values,s=e.range;return new Promise((function(e,c){e=wrap$1(e);var u=r.objectStore(t),l=null==u.keyPath,d="put"===i||"add"===i;if(!d&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var h,f=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var p=[],m=[],g=0,v=function(e){++g,preventDefault(e)};if("deleteRange"===i){if(4===s.type)return e({numFailures:g,failures:m,results:[],lastResult:void 0});3===s.type?p.push(h=u.clear()):p.push(h=u.delete(n(s)))}else{var y=d?l?[a,o]:[a,null]:[o,null],_=y[0],b=y[1];if(d)for(var w=0;w<f;++w)p.push(h=b&&void 0!==b[w]?u[i](_[w],b[w]):u[i](_[w])),h.onerror=v;else for(w=0;w<f;++w)p.push(h=u[i](_[w])),h.onerror=v}var D=function(t){var r=t.target.result;p.forEach((function(e,t){return null!=e.error&&(m[t]=e.error)})),e({numFailures:g,failures:m,results:"delete"===i?o:p.map((function(e){return e.result})),lastResult:r})};h.onerror=function(e){v(e),D(e)},h.onsuccess=D}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,i){e=wrap$1(e);for(var o,a=r.objectStore(t),s=n.length,c=new Array(s),u=0,l=0,d=function(t){var r=t.target;c[r._pos]=r.result,++l===u&&e(c)},h=eventRejectHandler(i),f=0;f<s;++f)null!=n[f]&&((o=a.get(n[f]))._pos=f,o.onsuccess=d,o.onerror=h,++u);0===u&&e(c)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,i){e=wrap$1(e);var o=r.objectStore(t).get(n);o.onsuccess=function(t){return e(t.target.result)},o.onerror=eventRejectHandler(i)}))},query:function(e){return function(r){return new Promise((function(i,o){i=wrap$1(i);var a=r.trans,s=r.values,c=r.limit,u=r.query,l=c===1/0?void 0:c,d=u.index,h=u.range,f=a.objectStore(t),p=d.isPrimaryKey?f:f.index(d.name),m=n(h);if(0===c)return i({result:[]});if(e){var g=s?p.getAll(m,l):p.getAllKeys(m,l);g.onsuccess=function(e){return i({result:e.target.result})},g.onerror=eventRejectHandler(o)}else{var v=0,y=s||!("openKeyCursor"in p)?p.openCursor(m):p.openKeyCursor(m),_=[];y.onsuccess=function(e){var t=y.result;return t?(_.push(s?t.value:t.primaryKey),++v===c?i({result:_}):void t.continue()):i({result:_})},y.onerror=eventRejectHandler(o)}}))}}(a),openCursor:function(e){var r=e.trans,i=e.values,o=e.query,a=e.reverse,s=e.unique;return new Promise((function(e,c){e=wrap$1(e);var u=o.index,l=o.range,d=r.objectStore(t),h=u.isPrimaryKey?d:d.index(u.name),f=a?s?"prevunique":"prev":s?"nextunique":"next",p=i||!("openKeyCursor"in h)?h.openCursor(n(l),f):h.openKeyCursor(n(l),f);p.onerror=eventRejectHandler(c),p.onsuccess=wrap$1((function(t){var n=p.result;if(n){n.___id=++_id_counter,n.done=!1;var i=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));var a=n.advance.bind(n),s=function(){throw new Error("Cursor not stopped")};n.trans=r,n.stop=n.continue=n.continuePrimaryKey=n.advance=function(){throw new Error("Cursor not started")},n.fail=wrap$1(c),n.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},n.start=function(e){var t=new Promise((function(e,t){e=wrap$1(e),p.onerror=eventRejectHandler(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),r=function(){if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=function(){throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=wrap$1((function(e){p.onsuccess=r,r()})),n.continue=i,n.continuePrimaryKey=o,n.advance=a,r(),t},e(n)}else e(null)}),c)}))},count:function(e){var r=e.query,i=e.trans,o=r.index,a=r.range;return new Promise((function(e,r){var s=i.objectStore(t),c=o.isPrimaryKey?s:s.index(o.name),u=n(a),l=u?c.count(u):c.count();l.onsuccess=wrap$1((function(t){return e(t.target.result)})),l.onerror=eventRejectHandler(r)}))}}}(e)})),c={};return s.forEach((function(e){return c[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!c[e])throw new Error("Table '".concat(e,"' not found"));return c[e]},MIN_KEY:-1/0,MAX_KEY:getMaxKey(t),schema:o}}function createMiddlewareStack(e,t){return t.reduce((function(e,t){var r=t.create;return __assign(__assign({},e),r(e))}),e)}function createMiddlewareStacks(e,t,r,n){var i=r.IDBKeyRange;return r.indexedDB,{dbcore:createMiddlewareStack(createDBCore(t,i,n),e.dbcore)}}function generateMiddlewareStacks(e,t){var r=t.db,n=createMiddlewareStacks(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((function(t){var r=t.name;e.core.schema.tables.some((function(e){return e.name===r}))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function setApiOnPlace(e,t,r,n){r.forEach((function(r){var i=n[r];t.forEach((function(t){var n=getPropertyDescriptor(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?setProp(t,r,{get:function(){return this.table(r)},set:function(e){defineProperty(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))}))}))}function removeTablesApi(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function lowerVersionFirst(e,t){return e._cfg.version-t._cfg.version}function runUpgraders(e,t,r,n){var i=e._dbSchema;r.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=createTableSchema("$meta",parseIndexSyntax("")[0],[]),e._storeNames.push("$meta"));var o=e._createTransaction("readwrite",e._storeNames,i);o.create(r),o._completion.catch(n);var a=o._reject.bind(o),s=PSD.transless||PSD;newScope((function(){if(PSD.trans=o,PSD.transless=s,0!==t)return generateMiddlewareStacks(e,r),getExistingVersion(e,o,t).then((function(t){return updateTablesAndIndexes(e,t,o,r)})).catch(a);keys(i).forEach((function(e){createTable(r,e,i[e].primKey,i[e].indexes)})),generateMiddlewareStacks(e,r),DexiePromise.follow((function(){return e.on.populate.fire(o)})).catch(a)}))}function patchCurrentVersion(e,t){createMissingTables(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var r=buildGlobalSchema(e,e.idbdb,t);adjustToExistingIndexNames(e,e._dbSchema,t);for(var n=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var r=t.objectStore(e.name);e.add.forEach((function(t){debug&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),addIndex(r,t)}))},i=0,o=getSchemaDiff(r,e._dbSchema).change;i<o.length;i++){var a=n(o[i]);if("object"==typeof a)return a.value}}function getExistingVersion(e,t,r){return t.storeNames.includes("$meta")?t.table("$meta").get("version").then((function(e){return null!=e?e:r})):DexiePromise.resolve(r)}function updateTablesAndIndexes(e,t,r,n){var i=[],o=e._versions,a=e._dbSchema=buildGlobalSchema(e,e.idbdb,n),s=o.filter((function(e){return e._cfg.version>=t}));if(0===s.length)return DexiePromise.resolve();return s.forEach((function(o){i.push((function(){var i=a,s=o._cfg.dbschema;adjustToExistingIndexNames(e,i,n),adjustToExistingIndexNames(e,s,n),a=e._dbSchema=s;var c=getSchemaDiff(i,s);c.add.forEach((function(e){createTable(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new exceptions.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){return addIndex(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),addIndex(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var u=o._cfg.contentUpgrade;if(u&&o._cfg.version>t){generateMiddlewareStacks(e,n),r._memoizedTables={};var l=shallowClone(s);c.del.forEach((function(e){l[e]=i[e]})),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],keys(l),l),r.schema=l;var d,h=isAsyncFunction(u);h&&incrementExpectedAwaits();var f=DexiePromise.follow((function(){if((d=u(r))&&h){var e=decrementExpectedAwaits.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?DexiePromise.resolve(d):f.then((function(){return d}))}})),i.push((function(t){deleteRemovedTables(o._cfg.dbschema,t),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})),i.push((function(t){e.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(e.idbdb.version/10)===o._cfg.version?(e.idbdb.deleteObjectStore("$meta"),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(o._cfg.version,"version"))}))})),function e(){return i.length?DexiePromise.resolve(i.shift()(r.idbtrans)).then(e):DexiePromise.resolve()}().then((function(){createMissingTables(a,n)}))}function getSchemaDiff(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName,u=void 0;for(u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],d=c[u];l?l.src!==d.src&&a.change.push(d):a.add.push(d)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}function createTable(e,t,r,n){var i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return addIndex(i,e)})),i}function createMissingTables(e,t){keys(e).forEach((function(r){t.db.objectStoreNames.contains(r)||(debug&&console.debug("Dexie: Creating missing table",r),createTable(t,r,e[r].primKey,e[r].indexes))}))}function deleteRemovedTables(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(r){return null==e[r]&&t.db.deleteObjectStore(r)}))}function addIndex(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function buildGlobalSchema(e,t,r){var n={};return slice(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),i=t.keyPath,o=createIndexSpec(nameFromKeyPath(i),i||"",!0,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var u=createIndexSpec(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(u)}n[e]=createTableSchema(e,o,a)})),n}function readGlobalSchema(e,t,r){e.verno=t.version/10;var n=e._dbSchema=buildGlobalSchema(e,t,r);e._storeNames=slice(t.objectStoreNames,0),setApiOnPlace(e,[e._allTables],keys(n),n)}function verifyInstalledSchema(e,t){var r=getSchemaDiff(buildGlobalSchema(e,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}function adjustToExistingIndexNames(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+slice(u).join("+")+"]";if(t[o]){var d=t[o].idxByName[l];d&&(d.name=c,delete t[o].idxByName[l],t[o].idxByName[c]=d)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&_global.WorkerGlobalScope&&_global instanceof _global.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function parseIndexSyntax(e){return e.split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return createIndexSpec(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),isArray(n),0===t)}))}var Version=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){keys(e).forEach((function(r){if(null!==e[r]){var n=parseIndexSyntax(e[r]),i=n.shift();if(i.unique=!0,i.multi)throw new exceptions.Schema("Primary key cannot be multi-valued");n.forEach((function(e){if(e.auto)throw new exceptions.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new exceptions.Schema("Index must have a name and cannot be an empty string")})),t[r]=createTableSchema(r,i,n)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,e):e;var r=t._versions,n={},i={};return r.forEach((function(e){extend(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)})),t._dbSchema=i,removeTablesApi(t,[t._allTables,t,t.Transaction.prototype]),setApiOnPlace(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],keys(i),i),t._storeNames=keys(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=promisableChain(this._cfg.contentUpgrade||nop,e),this},e}(),_a;function createVersionConstructor(e){return makeClassConstructor(Version.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}function getDbNamesTable(e,t){var r=e._dbNamesDB;return r||(r=e._dbNamesDB=new Dexie$1(DBNAMES_DB,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function hasDatabasesNative(e){return e&&"function"==typeof e.databases}function getDatabaseNames(e){var t=e.indexedDB,r=e.IDBKeyRange;return hasDatabasesNative(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==DBNAMES_DB}))})):getDbNamesTable(t,r).toCollection().primaryKeys()}function _onDatabaseCreated(e,t){var r=e.indexedDB,n=e.IDBKeyRange;!hasDatabasesNative(r)&&t!==DBNAMES_DB&&getDbNamesTable(r,n).put({name:t}).catch(nop)}function _onDatabaseDeleted(e,t){var r=e.indexedDB,n=e.IDBKeyRange;!hasDatabasesNative(r)&&t!==DBNAMES_DB&&getDbNamesTable(r,n).delete(t).catch(nop)}function vip(e){return newScope((function(){return PSD.letThrough=!0,e()}))}function idbReady(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function isEmptyRange(e){return!("from"in e)}var RangeSet=function(e,t){if(!this){var r=new RangeSet;return e&&"d"in e&&extend(r,e),r}extend(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function addRange(e,t,r){var n=cmp(t,r);if(!isNaN(n)){if(n>0)throw RangeError();if(isEmptyRange(e))return extend(e,{from:t,to:r,d:1});var i=e.l,o=e.r;if(cmp(r,e.from)<0)return i?addRange(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},rebalance(e);if(cmp(t,e.to)>0)return o?addRange(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},rebalance(e);cmp(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),cmp(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&mergeRanges(e,i),o&&a&&mergeRanges(e,o)}}function mergeRanges(e,t){isEmptyRange(t)||function e(t,r){var n=r.from,i=r.to,o=r.l,a=r.r;addRange(t,n,i),o&&e(t,o),a&&e(t,a)}(e,t)}function rangesOverlap(e,t){var r=getRangeSetIterator(t),n=r.next();if(n.done)return!1;for(var i=n.value,o=getRangeSetIterator(e),a=o.next(i.from),s=a.value;!n.done&&!a.done;){if(cmp(s.from,i.to)<=0&&cmp(s.to,i.from)>=0)return!0;cmp(i.from,s.from)<0?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function getRangeSetIterator(e){var t=isEmptyRange(e)?null:{s:0,n:e};return{next:function(e){for(var r=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&cmp(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||cmp(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function rebalance(e){var t,r,n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){var o="r"===i?"l":"r",a=__assign({},e),s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],a[i]=s[o],e[o]=a,a.d=computeDepth(a)}e.d=computeDepth(e)}function computeDepth(e){var t=e.r,r=e.l;return(t?r?Math.max(t.d,r.d):t.d:r?r.d:0)+1}function extendObservabilitySet(e,t){return keys(t).forEach((function(r){e[r]?mergeRanges(e[r],t[r]):e[r]=cloneSimpleObjectTree(t[r])})),e}function obsSetsOverlap(e,t){return e.all||t.all||Object.keys(e).some((function(r){return t[r]&&rangesOverlap(t[r],e[r])}))}props(RangeSet.prototype,(_a={add:function(e){return mergeRanges(this,e),this},addKey:function(e){return addRange(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return addRange(t,e,e)})),this}},_a[iteratorSymbol]=function(){return getRangeSetIterator(this)},_a));var cache={},unsignaledParts={},isTaskEnqueued=!1;function signalSubscribersLazily(e,t){extendObservabilitySet(unsignaledParts,e),isTaskEnqueued||(isTaskEnqueued=!0,setTimeout((function(){isTaskEnqueued=!1;var e=unsignaledParts;unsignaledParts={},signalSubscribersNow(e,!1)}),0))}function signalSubscribersNow(e,t){void 0===t&&(t=!1);var r=new Set;if(e.all)for(var n=0,i=Object.values(cache);n<i.length;n++){collectTableSubscribers(s=i[n],e,r,t)}else for(var o in e){var a=/^idb\:\/\/(.*)\/(.*)\//.exec(o);if(a){var s,c=a[1],u=a[2];(s=cache["idb://".concat(c,"/").concat(u)])&&collectTableSubscribers(s,e,r,t)}}r.forEach((function(e){return e()}))}function collectTableSubscribers(e,t,r,n){for(var i=[],o=0,a=Object.entries(e.queries.query);o<a.length;o++){for(var s=a[o],c=s[0],u=[],l=0,d=s[1];l<d.length;l++){var h=d[l];obsSetsOverlap(t,h.obsSet)?h.subscribers.forEach((function(e){return r.add(e)})):n&&u.push(h)}n&&i.push([c,u])}if(n)for(var f=0,p=i;f<p.length;f++){var m=p[f];c=m[0],u=m[1];e.queries.query[c]=u}}function dexieOpen(e){var t=e._state,r=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?rejection(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var n=t.openCanceller,i=Math.round(10*e.verno),o=!1;function a(){if(t.openCanceller!==n)throw new exceptions.DatabaseClosed("db.open() was cancelled")}var s=t.dbReadyResolve,c=null,u=!1,l=function(){return new DexiePromise((function(n,s){if(a(),!r)throw new exceptions.MissingAPI;var d=e.name,h=t.autoSchema||!i?r.open(d):r.open(d,i);if(!h)throw new exceptions.MissingAPI;h.onerror=eventRejectHandler(s),h.onblocked=wrap$1(e._fireOnBlocked),h.onupgradeneeded=wrap$1((function(n){if(c=h.transaction,t.autoSchema&&!e._options.allowEmptyDB){h.onerror=preventDefault,c.abort(),h.result.close();var i=r.deleteDatabase(d);i.onsuccess=i.onerror=wrap$1((function(){s(new exceptions.NoSuchDatabase("Database ".concat(d," doesnt exist")))}))}else{c.onerror=eventRejectHandler(s);var a=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;u=a<1,e.idbdb=h.result,o&&patchCurrentVersion(e,c),runUpgraders(e,a/10,c,s)}}),s),h.onsuccess=wrap$1((function(){c=null;var r=e.idbdb=h.result,a=slice(r.objectStoreNames);if(a.length>0)try{var s=r.transaction(safariMultiStoreFix(a),"readonly");if(t.autoSchema)readGlobalSchema(e,r,s);else if(adjustToExistingIndexNames(e,e._dbSchema,s),!verifyInstalledSchema(e,s)&&!o)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),r.close(),i=r.version+1,o=!0,n(l());generateMiddlewareStacks(e,s)}catch(e){}connections.push(e),r.onversionchange=wrap$1((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=wrap$1((function(t){e.on("close").fire(t)})),u&&_onDatabaseCreated(e._deps,d),n()}),s)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(t.PR1398_maxLoop>0)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l();break;case"VersionError":if(i>0)return i=0,l()}return DexiePromise.reject(e)}))};return DexiePromise.race([n,("undefined"==typeof navigator?DexiePromise.resolve():idbReady()).then(l)]).then((function(){return a(),t.onReadyBeingFired=[],DexiePromise.resolve(vip((function(){return e.on.ready.fire(e.vip)}))).then((function r(){if(t.onReadyBeingFired.length>0){var n=t.onReadyBeingFired.reduce(promisableChain,nop);return t.onReadyBeingFired=[],DexiePromise.resolve(vip((function(){return n(e.vip)}))).then(r)}}))})).finally((function(){t.openCanceller===n&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(r){t.dbOpenError=r;try{c&&c.abort()}catch(e){}return n===t.openCanceller&&e._close(),rejection(r)})).finally((function(){t.openComplete=!0,s()})).then((function(){if(u){var t={};e.tables.forEach((function(r){r.schema.indexes.forEach((function(n){n.name&&(t["idb://".concat(e.name,"/").concat(r.name,"/").concat(n.name)]=new RangeSet(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(r.name,"/")]=t["idb://".concat(e.name,"/").concat(r.name,"/:dels")]=new RangeSet(-1/0,[[[]]])})),globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME).fire(t),signalSubscribersNow(t,!0)}return e}))}function awaitIterator(e){var t=function(t){return e.next(t)},r=i(t),n=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):isArray(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function extractTransactionArgs(e,t,r){var n=arguments.length;if(n<2)throw new exceptions.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,flatten(i),r]}function enterTransactionScope(e,t,r,n,i){return DexiePromise.resolve().then((function(){var o=PSD.transless||PSD,a=e._createTransaction(t,r,e._dbSchema,n);a.explicit=!0;var s={trans:a,transless:o};if(n)a.idbtrans=n.idbtrans;else try{a.create(),a.idbtrans._explicit=!0,e._state.PR1398_maxLoop=3}catch(n){return n.name===errnames.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e.close({disableAutoOpen:!1}),e.open().then((function(){return enterTransactionScope(e,t,r,null,i)}))):rejection(n)}var c,u=isAsyncFunction(i);u&&incrementExpectedAwaits();var l=DexiePromise.follow((function(){if(c=i.call(a,a))if(u){var e=decrementExpectedAwaits.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=awaitIterator(c))}),s);return(c&&"function"==typeof c.then?DexiePromise.resolve(c).then((function(e){return a.active?e:rejection(new exceptions.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),rejection(e)}))}))}function pad(e,t,r){for(var n=isArray(e)?e.slice():[e],i=0;i<r;++i)n.push(t);return n}function createVirtualIndexMiddleware(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema,i={},o=[];function a(e,t,r){var n=getKeyPathAlias(e),s=i[n]=i[n]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l=__assign(__assign({},r),{name:u?"".concat(n,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:u,keyTail:t,keyLength:c,extractKey:getKeyExtractor(e),unique:!u&&r.unique});(s.push(l),l.isPrimaryKey||o.push(l),c>1)&&a(2===c?e[0]:e.slice(0,c-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}var s=a(n.primaryKey.keyPath,0,n.primaryKey);i[":id"]=[s];for(var c=0,u=n.indexes;c<u.length;c++){var l=u[c];a(l.keyPath,0,l)}function d(t){var r,n,i=t.query.index;return i.isVirtual?__assign(__assign({},t),{query:{index:i.lowLevelIndex,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:pad(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:pad(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var h=__assign(__assign({},r),{schema:__assign(__assign({},n),{primaryKey:s,indexes:o,getIndexByKeyPath:function(e){var t=i[getKeyPathAlias(e)];return t&&t[0]}}),count:function(e){return r.count(d(e))},query:function(e){return r.query(d(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;if(!o)return r.openCursor(t);return r.openCursor(d(t)).then((function(r){return r&&function(r){var n=Object.create(r,{continue:{value:function(n){null!=n?r.continue(pad(n,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?r.continue(r.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(pad(t,e.MAX_KEY,i),n)}},primaryKey:{get:function(){return r.primaryKey}},key:{get:function(){var e=r.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return r.value}}});return n}(r)}))}});return h}})}var virtualIndexMiddleware={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:createVirtualIndexMiddleware};function getObjectDiff(e,t,r,n){return r=r||{},n=n||"",keys(e).forEach((function(i){if(hasOwn(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){var s=toStringTag(o);s!==toStringTag(a)?r[n+i]=t[i]:"Object"===s?getObjectDiff(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0})),keys(t).forEach((function(i){hasOwn(e,i)||(r[n+i]=t[i])})),r}function getEffectiveKeys(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var hooksMiddleware={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,i=__assign(__assign({},r),{mutate:function(e){var i=PSD.trans,o=i.table(t).hook,a=o.deleting,s=o.creating,c=o.updating;switch(e.type){case"add":if(s.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"put":if(s.fire===nop&&c.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"delete":if(a.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"deleteRange":if(a.fire===nop)break;return i._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function u(e){var t=PSD.trans,i=e.keys||getEffectiveKeys(n,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?__assign(__assign({},e),{keys:i}):__assign({},e)).type&&(e.values=__spreadArray([],e.values,!0)),e.keys&&(e.keys=__spreadArray([],e.keys,!0)),getExistingValues(r,e,i).then((function(o){var u=i.map((function(r,i){var u=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,r,u,t);else if("add"===e.type||void 0===u){var d=s.fire.call(l,r,e.values[i],t);null==r&&null!=d&&(r=d,e.keys[i]=r,n.outbound||setByKeyPath(e.values[i],n.keyPath,r))}else{var h=getObjectDiff(u,e.values[i]),f=c.fire.call(l,h,r,u,t);if(f){var p=e.values[i];Object.keys(f).forEach((function(e){hasOwn(p,e)?p[e]=f[e]:setByKeyPath(p,e,f[e])}))}}return l}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,s=t.lastResult,c=0;c<i.length;++c){var l=n?n[c]:i[c],d=u[c];null==l?d.onerror&&d.onerror(r[c]):d.onsuccess&&d.onsuccess("put"===e.type&&o[c]?e.values[c]:l)}return{failures:r,results:n,numFailures:a,lastResult:s}})).catch((function(e){return u.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,i){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:i}).then((function(r){var n=r.result;return u({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,__assign(__assign({},t),{lower:n[n.length-1],lowerOpen:!0}),i)}))}))}}});return i}})}};function getExistingValues(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}function getFromTransactionCache(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var n=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===cmp(t.keys[i],e[o])&&(n.push(r?deepClone(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}var cacheExistingValuesMiddleware={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var r=e.table(t);return __assign(__assign({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=getFromTransactionCache(e.keys,e.trans._cache,"clone"===e.cache);return t?DexiePromise.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?deepClone(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function isCachableContext(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function isCachableRequest(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var observabilityMiddleware={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,r=new RangeSet(e.MIN_KEY,e.MAX_KEY);return __assign(__assign({},e),{transaction:function(t,r,n){if(PSD.subscr&&"readonly"!==r)throw new exceptions.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(PSD.querier));return e.transaction(t,r,n)},table:function(n){var i=e.table(n),o=i.schema,a=o.primaryKey,s=o.indexes,c=a.extractKey,u=a.outbound,l=a.autoIncrement&&s.filter((function(e){return e.compound&&e.keyPath.includes(a.keyPath)})),d=__assign(__assign({},i),{mutate:function(e){var s=e.trans,c=e.mutatedParts||(e.mutatedParts={}),u=function(e){var r="idb://".concat(t,"/").concat(n,"/").concat(e);return c[r]||(c[r]=new RangeSet)},d=u(""),h=u(":dels"),f=e.type,p="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[getEffectiveKeys(a,e).filter((function(e){return e})),e.values]:[],m=p[0],g=p[1],v=e.trans._cache;if(isArray(m)){d.addKeys(m);var y="delete"===f||m.length===g.length?getFromTransactionCache(m,v):null;y||h.addKeys(m),(y||g)&&trackAffectedIndexes(u,o,y,g)}else if(m){var _={from:m.lower,to:m.upper};h.add(_),d.add(_)}else d.add(r),h.add(r),o.indexes.forEach((function(e){return u(e.name).add(r)}));return i.mutate(e).then((function(t){return!m||"add"!==e.type&&"put"!==e.type||(d.addKeys(t.results),l&&l.forEach((function(r){var n=e.values.map((function(e){return r.extractKey(e)})),i=r.keyPath.findIndex((function(e){return e===a.keyPath}));t.results.forEach((function(e){return n[i]=e})),u(r.name).addKeys(n)}))),s.mutatedParts=extendObservabilitySet(s.mutatedParts||{},c),t}))}}),h=function(t){var r,n,i=t.query,o=i.index,a=i.range;return[o,new RangeSet(null!==(r=a.lower)&&void 0!==r?r:e.MIN_KEY,null!==(n=a.upper)&&void 0!==n?n:e.MAX_KEY)]},f={get:function(e){return[a,new RangeSet(e.key)]},getMany:function(e){return[a,(new RangeSet).addKeys(e.keys)]},count:h,query:h,openCursor:h};return keys(f).forEach((function(e){d[e]=function(o){var a=PSD.subscr,s=!!a,l=isCachableContext(PSD,i)&&isCachableRequest(e,o)?o.obsSet={}:a;if(s){var d=function(e){var r="idb://".concat(t,"/").concat(n,"/").concat(e);return l[r]||(l[r]=new RangeSet)},h=d(""),p=d(":dels"),m=f[e](o),g=m[0],v=m[1];if("query"===e&&g.isPrimaryKey&&!o.values?p.add(v):d(g.name||"").add(v),!g.isPrimaryKey){if("count"!==e){var y="query"===e&&u&&o.values&&i.query(__assign(__assign({},o),{values:!1}));return i[e].apply(this,arguments).then((function(t){if("query"===e){if(u&&o.values)return y.then((function(e){var r=e.result;return h.addKeys(r),t}));var r=o.values?t.result.map(c):t.result;o.values?h.addKeys(r):p.addKeys(r)}else if("openCursor"===e){var n=t,i=o.values;return n&&Object.create(n,{key:{get:function(){return p.addKey(n.primaryKey),n.key}},primaryKey:{get:function(){var e=n.primaryKey;return p.addKey(e),e}},value:{get:function(){return i&&h.addKey(n.primaryKey),n.value}}})}return t}))}p.add(r)}}return i[e].apply(this,arguments)}})),d}})}};function trackAffectedIndexes(e,t,r,n){t.indexes.forEach((function(t){var i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&isArray(e)?e.forEach((function(e){return i.addKey(e)})):i.addKey(e)};(r||n).forEach((function(e,t){var i=r&&o(r[t]),s=n&&o(n[t]);0!==cmp(i,s)&&(null!=i&&a(i),null!=s&&a(s))}))}))}function adjustOptimisticFromFailures(e,t,r){if(0===r.numFailures)return t;if("deleteRange"===t.type)return null;var n=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;if(r.numFailures===n)return null;var i=__assign({},t);return isArray(i.keys)&&(i.keys=i.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in i&&isArray(i.values)&&(i.values=i.values.filter((function(e,t){return!(t in r.failures)}))),i}function isAboveLower(e,t){return void 0===t.lower||(t.lowerOpen?cmp(e,t.lower)>0:cmp(e,t.lower)>=0)}function isBelowUpper(e,t){return void 0===t.upper||(t.upperOpen?cmp(e,t.upper)<0:cmp(e,t.upper)<=0)}function isWithinRange(e,t){return isAboveLower(e,t)&&isBelowUpper(e,t)}function applyOptimisticOps(e,t,r,n,i,o){if(!r||0===r.length)return e;var a=t.query.index,s=a.multiEntry,c=t.query.range,u=n.schema.primaryKey.extractKey,l=a.extractKey,d=(a.lowLevelIndex||a).extractKey,h=r.reduce((function(e,r){var n=e,i="add"===r.type||"put"===r.type?r.values.filter((function(e){var t=l(e);return s&&isArray(t)?t.some((function(e){return isWithinRange(e,c)})):isWithinRange(t,c)})).map((function(e){return e=deepClone(e),o&&Object.freeze(e),e})):[];switch(r.type){case"add":n=e.concat(t.values?i:i.map((function(e){return u(e)})));break;case"put":var a=(new RangeSet).addKeys(r.values.map((function(e){return u(e)})));n=e.filter((function(e){var r=t.values?u(e):e;return!rangesOverlap(new RangeSet(r),a)})).concat(t.values?i:i.map((function(e){return u(e)})));break;case"delete":var d=(new RangeSet).addKeys(r.keys);n=e.filter((function(e){var r=t.values?u(e):e;return!rangesOverlap(new RangeSet(r),d)}));break;case"deleteRange":var h=r.range;n=e.filter((function(e){return!isWithinRange(u(e),h)}))}return n}),e);return h===e?e:(h.sort((function(e,t){return cmp(d(e),d(t))||cmp(u(e),u(t))})),t.limit&&t.limit<1/0&&(h.length>t.limit?h.length=t.limit:e.length===t.limit&&h.length<t.limit&&(i.dirty=!0)),o?Object.freeze(h):h)}function areRangesEqual(e,t){return 0===cmp(e.lower,t.lower)&&0===cmp(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function compareLowers(e,t,r,n){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;var i=cmp(e,t);if(0===i){if(r&&n)return 0;if(r)return 1;if(n)return-1}return i}function compareUppers(e,t,r,n){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;var i=cmp(e,t);if(0===i){if(r&&n)return 0;if(r)return-1;if(n)return 1}return i}function isSuperRange(e,t){return compareLowers(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&compareUppers(e.upper,t.upper,e.upperOpen,t.upperOpen)>=0}function findCompatibleQuery(e,t,r,n){var i=cache["idb://".concat(e,"/").concat(t)];if(!i)return[];var o=i.queries[r];if(!o)return[null,!1,i,null];var a=o[(n.query?n.query.index.name:null)||""];if(!a)return[null,!1,i,null];switch(r){case"query":var s=a.find((function(e){return e.req.limit===n.limit&&e.req.values===n.values&&areRangesEqual(e.req.query.range,n.query.range)}));return s?[s,!0,i,a]:[a.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=n.limit&&(!n.values||e.req.values)&&isSuperRange(e.req.query.range,n.query.range)})),!1,i,a];case"count":var c=a.find((function(e){return areRangesEqual(e.req.query.range,n.query.range)}));return[c,!!c,i,a]}}function subscribeToCacheEntry(e,t,r,n){e.subscribers.add(r),n.addEventListener("abort",(function(){e.subscribers.delete(r),0===e.subscribers.size&&enqueForDeletion(e,t)}))}function enqueForDeletion(e,t){setTimeout((function(){0===e.subscribers.size&&delArrayItem(t,e)}),3e3)}var cacheMiddleware={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name,r=__assign(__assign({},e),{transaction:function(r,n,i){var o=e.transaction(r,n,i);if("readwrite"===n){var a=new AbortController,s=a.signal,c=function(i){return function(){if(a.abort(),"readwrite"===n){for(var s=new Set,c=0,u=r;c<u.length;c++){var l=u[c],d=cache["idb://".concat(t,"/").concat(l)];if(d){var h=e.table(l),f=d.optimisticOps.filter((function(e){return e.trans===o}));if(o._explicit&&i&&o.mutatedParts)for(var p=0,m=Object.values(d.queries.query);p<m.length;p++)for(var g=0,v=(b=m[p]).slice();g<v.length;g++){obsSetsOverlap((S=v[g]).obsSet,o.mutatedParts)&&(delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)})))}else if(f.length>0){d.optimisticOps=d.optimisticOps.filter((function(e){return e.trans!==o}));for(var y=0,_=Object.values(d.queries.query);y<_.length;y++)for(var b,w=0,D=(b=_[y]).slice();w<D.length;w++){var S;if(null!=(S=D[w]).res&&o.mutatedParts)if(i&&!S.dirty){var x=Object.isFrozen(S.res),T=applyOptimisticOps(S.res,S.req,f,h,S,x);S.dirty?(delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)}))):T!==S.res&&(S.res=T,S.promise=DexiePromise.resolve({result:T}))}else S.dirty&&delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)}))}}}}s.forEach((function(e){return e()}))}}};o.addEventListener("abort",c(!1),{signal:s}),o.addEventListener("error",c(!1),{signal:s}),o.addEventListener("complete",c(!0),{signal:s})}return o},table:function(r){var n=e.table(r),i=n.schema.primaryKey,o=__assign(__assign({},n),{mutate:function(e){var o=PSD.trans;if(i.outbound||"disabled"===o.db._options.cache||o.explicit)return n.mutate(e);var a=cache["idb://".concat(t,"/").concat(r)];if(!a)return n.mutate(e);var s=n.mutate(e);return"add"!==e.type&&"put"!==e.type||!(e.values.length>=50||getEffectiveKeys(i,e).some((function(e){return null==e})))?(a.optimisticOps.push(e),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts),s.then((function(t){if(t.numFailures>0){delArrayItem(a.optimisticOps,e);var r=adjustOptimisticFromFailures(a,e,t);r&&a.optimisticOps.push(r),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}})),s.catch((function(){delArrayItem(a.optimisticOps,e),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}))):s.then((function(t){var r=__assign(__assign({},e),{values:e.values.map((function(e,r){var n,o=(null===(n=i.keyPath)||void 0===n?void 0:n.includes("."))?deepClone(e):__assign({},e);return setByKeyPath(o,i.keyPath,t.results[r]),o}))}),n=adjustOptimisticFromFailures(a,r,t);a.optimisticOps.push(n),queueMicrotask((function(){return e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}))})),s},query:function(e){var i;if(!isCachableContext(PSD,n)||!isCachableRequest("query",e))return n.query(e);var o="immutable"===(null===(i=PSD.trans)||void 0===i?void 0:i.db._options.cache),a=PSD,s=a.requery,c=a.signal,u=findCompatibleQuery(t,r,"query",e),l=u[0],d=u[1],h=u[2],f=u[3];if(l&&d)l.obsSet=e.obsSet;else{var p=n.query(e).then((function(e){var t=e.result;if(l&&(l.res=t),o){for(var r=0,n=t.length;r<n;++r)Object.freeze(t[r]);Object.freeze(t)}else e.result=deepClone(t);return e})).catch((function(e){return f&&l&&delArrayItem(f,l),Promise.reject(e)}));l={obsSet:e.obsSet,promise:p,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(l):(f=[l],h||(h=cache["idb://".concat(t,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}}),h.queries.query[e.query.index.name||""]=f)}return subscribeToCacheEntry(l,f,s,c),l.promise.then((function(t){return{result:applyOptimisticOps(t.result,e,null==h?void 0:h.optimisticOps,n,l,o)}}))}});return o}});return r}};function vipify(e,t){return new Proxy(e,{get:function(e,r,n){return"db"===r?t:Reflect.get(e,r,n)}})}var Dexie$1=function(){function e(t,r){var n=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=r=__assign({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:r.autoOpen};a.dbReadyPromise=new DexiePromise((function(e){a.dbReadyResolve=e})),a.openCanceller=new DexiePromise((function(e,t){a.cancelOpen=t})),this._state=a,this.name=t,this.on=Events(this,"populate","blocked","versionchange","close",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(t){return function(r,i){e.vip((function(){var e=n._state;if(e.openComplete)e.dbOpenError||DexiePromise.resolve().then(r),i&&t(r);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(r),i&&t(r);else{t(r);var o=n;i||t((function e(){o.on.ready.unsubscribe(r),o.on.ready.unsubscribe(e)}))}}))}})),this.Collection=createCollectionConstructor(this),this.Table=createTableConstructor(this),this.Transaction=createTransactionConstructor(this),this.Version=createVersionConstructor(this),this.WhereClause=createWhereClauseConstructor(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=getMaxKey(r.IDBKeyRange),this._createTransaction=function(e,t,r,i){return new n.Transaction(e,t,r,n._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){n.on("blocked").fire(e),connections.filter((function(e){return e.name===n.name&&e!==n&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(cacheExistingValuesMiddleware),this.use(cacheMiddleware),this.use(observabilityMiddleware),this.use(virtualIndexMiddleware),this.use(hooksMiddleware);var s=new Proxy(this,{get:function(e,t,r){if("_vip"===t)return!0;if("table"===t)return function(e){return vipify(n.table(e),s)};var i=Reflect.get(e,t,r);return i instanceof Table?vipify(i,s):"tables"===t?i.map((function(e){return vipify(e,s)})):"_createTransaction"===t?function(){return vipify(i.apply(this,arguments),s)}:i}});this.vip=s,o.forEach((function(e){return e(n)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new exceptions.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new exceptions.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,r=t.filter((function(t){return t._cfg.version===e}))[0];return r||(r=new this.Version(e),t.push(r),t.sort(lowerVersionFirst),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||PSD.letThrough||this._vip)?e():new DexiePromise((function(e,r){if(t._state.openComplete)return r(new exceptions.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new exceptions.DatabaseClosed);t.open().catch(nop)}t._state.dbReadyPromise.then(e,r)})).then(e)},e.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:r,level:null==n?10:n,name:i}),o.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,r=e.name,n=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return n?e.create!==n:!!r&&e.name!==r}))),this},e.prototype.open=function(){var e=this;return usePSD(globalPSD,(function(){return dexieOpen(e)}))},e.prototype._close=function(){var e=this._state,t=connections.indexOf(this);if(t>=0&&connections.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new DexiePromise((function(t){e.dbReadyResolve=t})),e.openCanceller=new DexiePromise((function(t,r){e.cancelOpen=r})))},e.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen,r=this._state;t?(r.isBeingOpened&&r.cancelOpen(new exceptions.DatabaseClosed),this._close(),r.autoOpen=!1,r.dbOpenError=new exceptions.DatabaseClosed):(this._close(),r.autoOpen=this._options.autoOpen||r.isBeingOpened,r.openComplete=!1,r.dbOpenError=null)},e.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var r=arguments.length>0&&"object"!=typeof arguments[0],n=this._state;return new DexiePromise((function(i,o){var a=function(){t.close(e);var r=t._deps.indexedDB.deleteDatabase(t.name);r.onsuccess=wrap$1((function(){_onDatabaseDeleted(t._deps,t.name),i()})),r.onerror=eventRejectHandler(o),r.onblocked=t._fireOnBlocked};if(r)throw new exceptions.InvalidArgument("Invalid closeOptions argument to db.delete()");n.isBeingOpened?n.dbReadyPromise.then(a):a()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return keys(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,r){var n=this,i=PSD.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof n.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===READONLY)o=READONLY;else{if("rw"!=e&&e!=READWRITE)throw new exceptions.InvalidArgument("Invalid transaction mode: "+e);o=READWRITE}if(i){if(i.mode===READONLY&&o===READWRITE){if(!s)throw new exceptions.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new exceptions.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),s&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(function(t,r){r(e)})):rejection(e)}var c=enterTransactionScope.bind(null,this,o,a,i,r);return i?i._promise(o,c,"lock"):PSD.trans?usePSD(PSD.transless,(function(){return n._whenReady(c)})):this._whenReady(c)},e.prototype.table=function(e){if(!hasOwn(this._allTables,e))throw new exceptions.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},e}(),symbolObservable="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Observable=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})},e.prototype[symbolObservable]=function(){return this},e}(),domDeps;try{domDeps={indexedDB:_global.indexedDB||_global.mozIndexedDB||_global.webkitIndexedDB||_global.msIndexedDB,IDBKeyRange:_global.IDBKeyRange||_global.webkitIDBKeyRange}}catch(e){domDeps={indexedDB:null,IDBKeyRange:null}}function liveQuery(e){var t,r=!1,n=new Observable((function(n){var i=isAsyncFunction(e);var o,a=!1,s={},c={},u={get closed(){return a},unsubscribe:function(){a||(a=!0,o&&o.abort(),l&&globalEvents.storagemutated.unsubscribe(h))}};n.start&&n.start(u);var l=!1,d=function(){return execInGlobalContext(f)};var h=function(e){extendObservabilitySet(s,e),obsSetsOverlap(c,s)&&d()},f=function(){if(!a&&domDeps.indexedDB){s={};var u={};o&&o.abort(),o=new AbortController;var f={subscr:u,signal:o.signal,requery:d,querier:e,trans:null},p=function(t){var r=beginMicroTickScope();try{i&&incrementExpectedAwaits();var n=newScope(e,t);return i&&(n=n.finally(decrementExpectedAwaits)),n}finally{r&&endMicroTickScope()}}(f);Promise.resolve(p).then((function(e){r=!0,t=e,a||f.signal.aborted||(s={},objectIsEmpty(c=u)||l||(globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,h),l=!0),execInGlobalContext((function(){return!a&&n.next&&n.next(e)})))}),(function(e){r=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||a||execInGlobalContext((function(){a||n.error&&n.error(e)}))}))}};return setTimeout(d,0),u}));return n.hasValue=function(){return r},n.getValue=function(){return t},n}var Dexie=Dexie$1;function propagateLocally(e){var t=propagatingLocally;try{propagatingLocally=!0,globalEvents.storagemutated.fire(e),signalSubscribersNow(e,!0)}finally{propagatingLocally=t}}props(Dexie,__assign(__assign({},fullNameExceptions),{delete:function(e){return new Dexie(e,{addons:[]}).delete()},exists:function(e){return new Dexie(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return getDatabaseNames(Dexie.dependencies).then(e)}catch(e){return rejection(new exceptions.MissingAPI)}},defineClass:function(){return function(e){extend(this,e)}},ignoreTransaction:function(e){return PSD.trans?usePSD(PSD.transless,e):e()},vip:vip,async:function(e){return function(){try{var t=awaitIterator(e.apply(this,arguments));return t&&"function"==typeof t.then?t:DexiePromise.resolve(t)}catch(e){return rejection(e)}}},spawn:function(e,t,r){try{var n=awaitIterator(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:DexiePromise.resolve(n)}catch(e){return rejection(e)}},currentTransaction:{get:function(){return PSD.trans||null}},waitFor:function(e,t){var r=DexiePromise.resolve("function"==typeof e?Dexie.ignoreTransaction(e):e).timeout(t||6e4);return PSD.trans?PSD.trans.waitFor(r):r},Promise:DexiePromise,debug:{get:function(){return debug},set:function(e){setDebug(e)}},derive:derive,extend:extend,props:props,override:override,Events:Events,on:globalEvents,liveQuery:liveQuery,extendObservabilitySet:extendObservabilitySet,getByKeyPath:getByKeyPath,setByKeyPath:setByKeyPath,delByKeyPath:delByKeyPath,shallowClone:shallowClone,deepClone:deepClone,getObjectDiff:getObjectDiff,cmp:cmp,asap:asap$1,minKey:minKey,addons:[],connections:connections,errnames:errnames,dependencies:domDeps,cache:cache,semVer:DEXIE_VERSION,version:DEXIE_VERSION.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)}))})),Dexie.maxKey=getMaxKey(Dexie.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,(function(e){var t;propagatingLocally||(t=new CustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME,{detail:e}),propagatingLocally=!0,dispatchEvent(t),propagatingLocally=!1)})),addEventListener(STORAGE_MUTATED_DOM_EVENT_NAME,(function(e){var t=e.detail;propagatingLocally||propagateLocally(t)})));var propagatingLocally=!1,bc,createBC=function(){};"undefined"!=typeof BroadcastChannel&&(createBC=function(){(bc=new BroadcastChannel(STORAGE_MUTATED_DOM_EVENT_NAME)).onmessage=function(e){return e.data&&propagateLocally(e.data)}},createBC(),"function"==typeof bc.unref&&bc.unref(),globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,(function(e){propagatingLocally||bc.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!Dexie$1.disableBfCache&&e.persisted){debug&&console.debug("Dexie: handling persisted pagehide"),null==bc||bc.close();for(var t=0,r=connections;t<r.length;t++){r[t].close({disableAutoOpen:!1})}}})),addEventListener("pageshow",(function(e){!Dexie$1.disableBfCache&&e.persisted&&(debug&&console.debug("Dexie: handling persisted pageshow"),createBC(),propagateLocally({all:new RangeSet(-1/0,[[]])}))}))),DexiePromise.rejectionMapper=mapError,setDebug(debug);var requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),requireFoolWebpack_1=requireFoolWebpack,environment=createCommonjsModule((function(e){var t=function(e){return void 0!==e&&null!=e.versions&&null!=e.versions.node};e.exports.isNode=t,e.exports.platform=void 0!==process$1&&t(process$1)?"node":"browser";var r=function(e){try{return requireFoolWebpack_1(e)}catch(e){return null}}("worker_threads");e.exports.isMainThread="node"===e.exports.platform?(!r||r.isMainThread)&&!process$1.connected:"undefined"!=typeof Window,e.exports.cpus="browser"===e.exports.platform?self.navigator.hardwareConcurrency:requireFoolWebpack_1("os").cpus().length}));function Promise$2(e,t){var r=this;if(!(this instanceof Promise$2))throw new SyntaxError("Constructor must be called with the new operator");if("function"!=typeof e)throw new SyntaxError("Function parameter handler(resolve, reject) missing");var n=[],i=[];this.resolved=!1,this.rejected=!1,this.pending=!0;var o=function(e,t){n.push(e),i.push(t)};this.then=function(e,t){return new Promise$2((function(r,n){var i=e?_then(e,r,n):r,a=t?_then(t,r,n):n;o(i,a)}),r)};var a=function(e){return r.resolved=!0,r.rejected=!1,r.pending=!1,n.forEach((function(t){t(e)})),o=function(t,r){t(e)},a=s=function(){},r},s=function(e){return r.resolved=!1,r.rejected=!0,r.pending=!1,i.forEach((function(t){t(e)})),o=function(t,r){r(e)},a=s=function(){},r};this.cancel=function(){return t?t.cancel():s(new CancellationError),r},this.timeout=function(e){if(t)t.timeout(e);else{var n=setTimeout((function(){s(new TimeoutError("Promise timed out after "+e+" ms"))}),e);r.always((function(){clearTimeout(n)}))}return r},e((function(e){a(e)}),(function(e){s(e)}))}function _then(e,t,r){return function(n){try{var i=e(n);i&&"function"==typeof i.then&&"function"==typeof i.catch?i.then(t,r):t(i)}catch(e){r(e)}}}function CancellationError(e){this.message=e||"promise cancelled",this.stack=(new Error).stack}function TimeoutError(e){this.message=e||"timeout exceeded",this.stack=(new Error).stack}environment.isNode,environment.platform,environment.isMainThread,environment.cpus,Promise$2.prototype.catch=function(e){return this.then(null,e)},Promise$2.prototype.always=function(e){return this.then(e,e)},Promise$2.all=function(e){return new Promise$2((function(t,r){var n=e.length,i=[];n?e.forEach((function(e,o){e.then((function(e){i[o]=e,0==--n&&t(i)}),(function(e){n=0,r(e)}))})):t(i)}))},Promise$2.defer=function(){var e={};return e.promise=new Promise$2((function(t,r){e.resolve=t,e.reject=r})),e},CancellationError.prototype=new Error,CancellationError.prototype.constructor=Error,CancellationError.prototype.name="CancellationError",Promise$2.CancellationError=CancellationError,TimeoutError.prototype=new Error,TimeoutError.prototype.constructor=Error,TimeoutError.prototype.name="TimeoutError",Promise$2.TimeoutError=TimeoutError;var _Promise=Promise$2,__dirname="/Users/wangshuai/workspace/web-design/go-design/node_modules/.pnpm/workerpool@6.4.0/node_modules/workerpool/src",embeddedWorker='!function(){var __webpack_modules__={577:function(e){e.exports=function(e,r){this.message=e,this.transfer=r}}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];return void 0!==r||(r=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e](r,r.exports,__webpack_require__)),r.exports}var __webpack_exports__={};!function(){var exports=__webpack_exports__,__webpack_unused_export__;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})(e)}var Transfer=__webpack_require__(577),requireFoolWebpack=eval("typeof require !== \'undefined\' ? require : function (module) { throw new Error(\'Module \\" + module + \\" not found.\') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}},WorkerThreads,parentPort;if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,r){addEventListener(e,function(e){r(e.data)})},worker.send=function(e){postMessage(e)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(error){if("object"!==_typeof(error)||null===error||"MODULE_NOT_FOUND"!==error.code)throw error}WorkerThreads&&null!==WorkerThreads.parentPort?(parentPort=WorkerThreads.parentPort,worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort)):(worker.on=process.on.bind(process),worker.send=function(e){process.send(e)},worker.on("disconnect",function(){process.exit(1)})),worker.exit=process.exit.bind(process)}function convertError(o){return Object.getOwnPropertyNames(o).reduce(function(e,r){return Object.defineProperty(e,r,{value:o[r],enumerable:!0})},{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,r){e=new Function("return ("+e+").apply(null, arguments);");return e.apply(e,r)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){function r(){worker.exit(e)}if(!worker.terminationHandler)return r();var o=worker.terminationHandler(e);isPromise(o)?o.then(r,r):r()};var currentRequestId=null;worker.on("message",function(r){if(r===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var e=worker.methods[r.method];if(!e)throw new Error(\'Unknown method "\'+r.method+\'"\');currentRequestId=r.id;var o=e.apply(e,r.params);isPromise(o)?o.then(function(e){e instanceof Transfer?worker.send({id:r.id,result:e.message,error:null},e.transfer):worker.send({id:r.id,result:e,error:null}),currentRequestId=null}).catch(function(e){worker.send({id:r.id,result:null,error:convertError(e)}),currentRequestId=null}):(o instanceof Transfer?worker.send({id:r.id,result:o.message,error:null},o.transfer):worker.send({id:r.id,result:o,error:null}),currentRequestId=null)}catch(e){worker.send({id:r.id,result:null,error:convertError(e)})}}),worker.register=function(e,r){if(e)for(var o in e)e.hasOwnProperty(o)&&(worker.methods[o]=e[o]);r&&(worker.terminationHandler=r.onTerminate),worker.send("ready")},worker.emit=function(e){currentRequestId&&(e instanceof Transfer?worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer):worker.send({id:currentRequestId,isEvent:!0,payload:e}))},__webpack_unused_export__=worker.register,worker.emit}()}();',TERMINATE_METHOD_ID="__workerpool-terminate__";function ensureWorkerThreads(){var e=tryRequireWorkerThreads();if(!e)throw new Error("WorkerPool: workerType = 'thread' is not supported, Node >= 11.7.0 required");return e}function ensureWebWorker(){if("function"!=typeof Worker&&("object"!=typeof Worker||"function"!=typeof Worker.prototype.constructor))throw new Error("WorkerPool: Web Workers not supported")}function tryRequireWorkerThreads(){try{return requireFoolWebpack_1("worker_threads")}catch(e){if("object"==typeof e&&null!==e&&"MODULE_NOT_FOUND"===e.code)return null;throw e}}function getDefaultWorker(){if("browser"===environment.platform){if("undefined"==typeof Blob)throw new Error("Blob not supported by the browser");if(!window.URL||"function"!=typeof window.URL.createObjectURL)throw new Error("URL.createObjectURL not supported by the browser");var e=new Blob([embeddedWorker],{type:"text/javascript"});return window.URL.createObjectURL(e)}return __dirname+"/worker.js"}function setupWorker(e,t){if("web"===t.workerType)return ensureWebWorker(),setupBrowserWorker(e,Worker);if("thread"===t.workerType)return setupWorkerThreadWorker(e,r=ensureWorkerThreads(),t.workerThreadOpts);if("process"!==t.workerType&&t.workerType){if("browser"===environment.platform)return ensureWebWorker(),setupBrowserWorker(e,Worker);var r=tryRequireWorkerThreads();return r?setupWorkerThreadWorker(e,r):setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack_1("child_process"))}return setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack_1("child_process"))}function setupBrowserWorker(e,t){var r=new t(e);return r.isBrowserWorker=!0,r.on=function(e,t){this.addEventListener(e,(function(e){t(e.data)}))},r.send=function(e,t){this.postMessage(e,t)},r}function setupWorkerThreadWorker(e,t,r){var n=new t.Worker(e,{stdout:!1,stderr:!1,...r});return n.isWorkerThread=!0,n.send=function(e,t){this.postMessage(e,t)},n.kill=function(){return this.terminate(),!0},n.disconnect=function(){this.terminate()},n}function setupProcessWorker(e,t,r){var n=r.fork(e,t.forkArgs,t.forkOpts),i=n.send;return n.send=function(e){return i.call(n,e)},n.isChildProcess=!0,n}function resolveForkOptions(e){e=e||{};var t=process$1.execArgv.join(" "),r=-1!==t.indexOf("--inspect"),n=-1!==t.indexOf("--debug-brk"),i=[];return r&&(i.push("--inspect="+e.debugPort),n&&i.push("--debug-brk")),process$1.execArgv.forEach((function(e){e.indexOf("--max-old-space-size")>-1&&i.push(e)})),Object.assign({},e,{forkArgs:e.forkArgs,forkOpts:Object.assign({},e.forkOpts,{execArgv:(e.forkOpts&&e.forkOpts.execArgv||[]).concat(i)})})}function objectToError(e){for(var t=new Error(""),r=Object.keys(e),n=0;n<r.length;n++)t[r[n]]=e[r[n]];return t}function WorkerHandler(e,t){var r=this,n=t||{};function i(e){for(var t in r.terminated=!0,r.processing)void 0!==r.processing[t]&&r.processing[t].resolver.reject(e);r.processing=Object.create(null)}this.script=e||getDefaultWorker(),this.worker=setupWorker(this.script,n),this.debugPort=n.debugPort,this.forkOpts=n.forkOpts,this.forkArgs=n.forkArgs,this.workerThreadOpts=n.workerThreadOpts,this.workerTerminateTimeout=n.workerTerminateTimeout,e||(this.worker.ready=!0),this.requestQueue=[],this.worker.on("message",(function(e){if(!r.terminated)if("string"==typeof e&&"ready"===e)r.worker.ready=!0,function(){for(const e of r.requestQueue.splice(0))r.worker.send(e.message,e.transfer)}();else{var t=e.id,n=r.processing[t];void 0!==n&&(e.isEvent?n.options&&"function"==typeof n.options.on&&n.options.on(e.payload):(delete r.processing[t],!0===r.terminating&&r.terminate(),e.error?n.resolver.reject(objectToError(e.error)):n.resolver.resolve(e.result)))}}));var o=this.worker;this.worker.on("error",i),this.worker.on("exit",(function(e,t){var n="Workerpool Worker terminated Unexpectedly\n";n+=" exitCode: `"+e+"`\n",n+=" signalCode: `"+t+"`\n",n+=" workerpool.script: `"+r.script+"`\n",n+=" spawnArgs: `"+o.spawnargs+"`\n",n+=" spawnfile: `"+o.spawnfile+"`\n",n+=" stdout: `"+o.stdout+"`\n",n+=" stderr: `"+o.stderr+"`\n",i(new Error(n))})),this.processing=Object.create(null),this.terminating=!1,this.terminated=!1,this.cleaning=!1,this.terminationHandler=null,this.lastId=0}WorkerHandler.prototype.methods=function(){return this.exec("methods")},WorkerHandler.prototype.exec=function(e,t,r,n){r||(r=_Promise.defer());var i=++this.lastId;this.processing[i]={id:i,resolver:r,options:n};var o={message:{id:i,method:e,params:t},transfer:n&&n.transfer};this.terminated?r.reject(new Error("Worker is terminated")):this.worker.ready?this.worker.send(o.message,o.transfer):this.requestQueue.push(o);var a=this;return r.promise.catch((function(e){if(e instanceof _Promise.CancellationError||e instanceof _Promise.TimeoutError)return delete a.processing[i],a.terminateAndNotify(!0).then((function(){throw e}),(function(e){throw e}));throw e}))},WorkerHandler.prototype.busy=function(){return this.cleaning||Object.keys(this.processing).length>0},WorkerHandler.prototype.terminate=function(e,t){var r=this;if(e){for(var n in this.processing)void 0!==this.processing[n]&&this.processing[n].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}if("function"==typeof t&&(this.terminationHandler=t),this.busy())this.terminating=!0;else{var i=function(e){if(r.terminated=!0,r.cleaning=!1,null!=r.worker&&r.worker.removeAllListeners&&r.worker.removeAllListeners("message"),r.worker=null,r.terminating=!1,r.terminationHandler)r.terminationHandler(e,r);else if(e)throw e};if(this.worker){if("function"==typeof this.worker.kill){if(this.worker.killed)return void i(new Error("worker already killed!"));var o=setTimeout((function(){r.worker&&r.worker.kill()}),this.workerTerminateTimeout);return this.worker.once("exit",(function(){clearTimeout(o),r.worker&&(r.worker.killed=!0),i()})),this.worker.ready?this.worker.send(TERMINATE_METHOD_ID):this.requestQueue.push(TERMINATE_METHOD_ID),void(this.cleaning=!0)}if("function"!=typeof this.worker.terminate)throw new Error("Failed to terminate worker");this.worker.terminate(),this.worker.killed=!0}i()}},WorkerHandler.prototype.terminateAndNotify=function(e,t){var r=_Promise.defer();return t&&(r.promise.timeout=t),this.terminate(e,(function(e,t){e?r.reject(e):r.resolve(t)})),r.promise};var WorkerHandler_1=WorkerHandler,_tryRequireWorkerThreads=tryRequireWorkerThreads,_setupProcessWorker=setupProcessWorker,_setupBrowserWorker=setupBrowserWorker,_setupWorkerThreadWorker=setupWorkerThreadWorker,ensureWorkerThreads_1=ensureWorkerThreads;WorkerHandler_1._tryRequireWorkerThreads=_tryRequireWorkerThreads,WorkerHandler_1._setupProcessWorker=_setupProcessWorker,WorkerHandler_1._setupBrowserWorker=_setupBrowserWorker,WorkerHandler_1._setupWorkerThreadWorker=_setupWorkerThreadWorker,WorkerHandler_1.ensureWorkerThreads=ensureWorkerThreads_1;var MAX_PORTS=65535,debugPortAllocator=DebugPortAllocator;function DebugPortAllocator(){this.ports=Object.create(null),this.length=0}DebugPortAllocator.prototype.nextAvailableStartingAt=function(e){for(;!0===this.ports[e];)e++;if(e>=MAX_PORTS)throw new Error("WorkerPool debug port limit reached: "+e+">= "+MAX_PORTS);return this.ports[e]=!0,this.length++,e},DebugPortAllocator.prototype.releasePort=function(e){delete this.ports[e],this.length--};var DEBUG_PORT_ALLOCATOR=new debugPortAllocator;function Pool(e,t){"string"==typeof e?this.script=e||null:(this.script=null,t=e),this.workers=[],this.tasks=[],t=t||{},this.forkArgs=Object.freeze(t.forkArgs||[]),this.forkOpts=Object.freeze(t.forkOpts||{}),this.workerThreadOpts=Object.freeze(t.workerThreadOpts||{}),this.debugPortStart=t.debugPortStart||43210,this.nodeWorker=t.nodeWorker,this.workerType=t.workerType||t.nodeWorker||"auto",this.maxQueueSize=t.maxQueueSize||1/0,this.workerTerminateTimeout=t.workerTerminateTimeout||1e3,this.onCreateWorker=t.onCreateWorker||(()=>null),this.onTerminateWorker=t.onTerminateWorker||(()=>null),t&&"maxWorkers"in t?(validateMaxWorkers(t.maxWorkers),this.maxWorkers=t.maxWorkers):this.maxWorkers=Math.max((environment.cpus||4)-1,1),t&&"minWorkers"in t&&("max"===t.minWorkers?this.minWorkers=this.maxWorkers:(validateMinWorkers(t.minWorkers),this.minWorkers=t.minWorkers,this.maxWorkers=Math.max(this.minWorkers,this.maxWorkers)),this._ensureMinWorkers()),this._boundNext=this._next.bind(this),"thread"===this.workerType&&WorkerHandler_1.ensureWorkerThreads()}function validateMaxWorkers(e){if(!isNumber(e)||!isInteger(e)||e<1)throw new TypeError("Option maxWorkers must be an integer number >= 1")}function validateMinWorkers(e){if(!isNumber(e)||!isInteger(e)||e<0)throw new TypeError("Option minWorkers must be an integer number >= 0")}function isNumber(e){return"number"==typeof e}function isInteger(e){return Math.round(e)==e}Pool.prototype.exec=function(e,t,r){if(t&&!Array.isArray(t))throw new TypeError('Array expected as argument "params"');if("string"==typeof e){var n=_Promise.defer();if(this.tasks.length>=this.maxQueueSize)throw new Error("Max queue size of "+this.maxQueueSize+" reached");var i=this.tasks,o={method:e,params:t,resolver:n,timeout:null,options:r};i.push(o);var a=n.promise.timeout;return n.promise.timeout=function(e){return-1!==i.indexOf(o)?(o.timeout=e,n.promise):a.call(n.promise,e)},this._next(),n.promise}if("function"==typeof e)return this.exec("run",[String(e),t]);throw new TypeError('Function or string expected as argument "method"')},Pool.prototype.proxy=function(){if(arguments.length>0)throw new Error("No arguments expected");var e=this;return this.exec("methods").then((function(t){var r={};return t.forEach((function(t){r[t]=function(){return e.exec(t,Array.prototype.slice.call(arguments))}})),r}))},Pool.prototype._next=function(){if(this.tasks.length>0){var e=this._getWorker();if(e){var t=this,r=this.tasks.shift();if(r.resolver.promise.pending){var n=e.exec(r.method,r.params,r.resolver,r.options).then(t._boundNext).catch((function(){if(e.terminated)return t._removeWorker(e)})).then((function(){t._next()}));"number"==typeof r.timeout&&n.timeout(r.timeout)}else t._next()}}},Pool.prototype._getWorker=function(){for(var e=this.workers,t=0;t<e.length;t++){var r=e[t];if(!1===r.busy())return r}return e.length<this.maxWorkers?(r=this._createWorkerHandler(),e.push(r),r):null},Pool.prototype._removeWorker=function(e){var t=this;return DEBUG_PORT_ALLOCATOR.releasePort(e.debugPort),this._removeWorkerFromList(e),this._ensureMinWorkers(),new _Promise((function(r,n){e.terminate(!1,(function(i){t.onTerminateWorker({forkArgs:e.forkArgs,forkOpts:e.forkOpts,workerThreadOpts:e.workerThreadOpts,script:e.script}),i?n(i):r(e)}))}))},Pool.prototype._removeWorkerFromList=function(e){var t=this.workers.indexOf(e);-1!==t&&this.workers.splice(t,1)},Pool.prototype.terminate=function(e,t){var r=this;this.tasks.forEach((function(e){e.resolver.reject(new Error("Pool terminated"))})),this.tasks.length=0;var n=function(e){DEBUG_PORT_ALLOCATOR.releasePort(e.debugPort),this._removeWorkerFromList(e)}.bind(this),i=[];return this.workers.slice().forEach((function(o){var a=o.terminateAndNotify(e,t).then(n).always((function(){r.onTerminateWorker({forkArgs:o.forkArgs,forkOpts:o.forkOpts,workerThreadOpts:o.workerThreadOpts,script:o.script})}));i.push(a)})),_Promise.all(i)},Pool.prototype.stats=function(){var e=this.workers.length,t=this.workers.filter((function(e){return e.busy()})).length;return{totalWorkers:e,busyWorkers:t,idleWorkers:e-t,pendingTasks:this.tasks.length,activeTasks:t}},Pool.prototype._ensureMinWorkers=function(){if(this.minWorkers)for(var e=this.workers.length;e<this.minWorkers;e++)this.workers.push(this._createWorkerHandler())},Pool.prototype._createWorkerHandler=function(){const e=this.onCreateWorker({forkArgs:this.forkArgs,forkOpts:this.forkOpts,workerThreadOpts:this.workerThreadOpts,script:this.script})||{};return new WorkerHandler_1(e.script||this.script,{forkArgs:e.forkArgs||this.forkArgs,forkOpts:e.forkOpts||this.forkOpts,workerThreadOpts:e.workerThreadOpts||this.workerThreadOpts,debugPort:DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart),workerType:this.workerType,workerTerminateTimeout:this.workerTerminateTimeout})};var Pool_1=Pool;function Transfer$1(e,t){this.message=e,this.transfer=t}var transfer=Transfer$1,worker_1=createCommonjsModule((function(module,exports){var requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}};if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,t){addEventListener(e,(function(e){t(e.data)}))},worker.send=function(e){postMessage(e)};else{if(void 0===process$1)throw new Error("Script must be executed as a worker");var WorkerThreads;try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(e){if("object"!=typeof e||null===e||"MODULE_NOT_FOUND"!==e.code)throw e}if(WorkerThreads&&null!==WorkerThreads.parentPort){var parentPort=WorkerThreads.parentPort;worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort),worker.exit=process$1.exit.bind(process$1)}else worker.on=process$1.on.bind(process$1),worker.send=function(e){process$1.send(e)},worker.on("disconnect",(function(){process$1.exit(1)})),worker.exit=process$1.exit.bind(process$1)}function convertError(e){return Object.getOwnPropertyNames(e).reduce((function(t,r){return Object.defineProperty(t,r,{value:e[r],enumerable:!0})}),{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,t){var r=new Function("return ("+e+").apply(null, arguments);");return r.apply(r,t)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){var t=function(){worker.exit(e)};if(!worker.terminationHandler)return t();var r=worker.terminationHandler(e);isPromise(r)?r.then(t,t):t()};var currentRequestId=null;worker.on("message",(function(e){if(e===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var t=worker.methods[e.method];if(!t)throw new Error('Unknown method "'+e.method+'"');currentRequestId=e.id;var r=t.apply(t,e.params);isPromise(r)?r.then((function(t){t instanceof transfer?worker.send({id:e.id,result:t.message,error:null},t.transfer):worker.send({id:e.id,result:t,error:null}),currentRequestId=null})).catch((function(t){worker.send({id:e.id,result:null,error:convertError(t)}),currentRequestId=null})):(r instanceof transfer?worker.send({id:e.id,result:r.message,error:null},r.transfer):worker.send({id:e.id,result:r,error:null}),currentRequestId=null)}catch(t){worker.send({id:e.id,result:null,error:convertError(t)})}})),worker.register=function(e,t){if(e)for(var r in e)e.hasOwnProperty(r)&&(worker.methods[r]=e[r]);t&&(worker.terminationHandler=t.onTerminate),worker.send("ready")},worker.emit=function(e){if(currentRequestId){if(e instanceof transfer)return void worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer);worker.send({id:currentRequestId,isEvent:!0,payload:e})}},exports.add=worker.register,exports.emit=worker.emit}));worker_1.add,worker_1.emit;var pool=function(e,t){return new Pool_1(e,t)},worker=function(e,t){var r=worker_1;r.add(e,t)},workerEmit=function(e){worker_1.emit(e)},Promise$1=_Promise,Transfer=transfer,platform=environment.platform,isMainThread=environment.isMainThread,cpus=environment.cpus,src={pool:pool,worker:worker,workerEmit:workerEmit,Promise:Promise$1,Transfer:Transfer,platform:platform,isMainThread:isMainThread,cpus:cpus};function s(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.requests=[],console.log("RequestTracker")}static getInstance(){return l.instance||(l.instance=new l),l.instance}addRequest(e){if(this.isDuplicateRequest(e)){let t=this.findRequest(e);this.cancelRequest(t)}this.requests.push(e)}findRequest(e){let t;for(const r of this.requests)if(this.areRequestsEqual(r,e)){t=r;break}return t}removeRequest(e){const t=this.requests.indexOf(e);-1!==t&&this.requests.splice(t,1)}cancelRequest(e){e.cancelToken.cancel("Request canceled"),this.removeRequest(e)}isDuplicateRequest(e){return this.requests.some((t=>this.areRequestsEqual(t,e)))}areRequestsEqual(e,t){var r,n;return e.url===t.url&&JSON.stringify(null===(r=e.headers)||void 0===r?void 0:r.sponsor)===JSON.stringify(null===(n=t.headers)||void 0===n?void 0:n.sponsor)&&JSON.stringify(e.data)===JSON.stringify(t.data)&&JSON.stringify(e.params)===JSON.stringify(t.params)&&e.method===t.method}}const d=l.getInstance(),c=3e4,u=3e4,h=(t="",r)=>{let n,i=e.create({baseURL:t,timeout:c,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}});return i.interceptors.request.use((function(t){let{url:r,params:i,headers:o,data:a,method:s}=t;const c=e.CancelToken.source();return n={url:r,params:i,headers:o,data:a,method:s,cancelToken:c},t.cancelToken=c.token,d.addRequest(n),sessionStorage.getItem("anov-go-token")&&"null"!=sessionStorage.getItem("anov-go-token")&&(t.headers["X-ANOV-ACCESS-TOKEN"]=sessionStorage.getItem("anov-go-token")),sessionStorage.getItem("unify-access-token")&&"null"!=sessionStorage.getItem("unify-access-token")&&(t.headers["X-UNIFY-ACCESS-TOKEN"]=sessionStorage.getItem("unify-access-token")),sessionStorage.getItem("dgcc_authorization")&&"null"!=sessionStorage.getItem("dgcc_authorization")&&(t.headers.dgcc_authorization=sessionStorage.getItem("dgcc_authorization")),"post"===t.method?(t.headers["Content-Type"]="application/json;",t):"get"===t.method?t:"put"===t.method?(t.headers["Content-Type"]="application/json; charset=UTF-8",t):"delete"===t.method?t:void 0}),(function(e){return Promise.reject(e)})),i.interceptors.response.use((function(e){return 200===e.status||e.data.code,r&&r(e),d.removeRequest(n),e.data}),(function(e){return r&&(d.removeRequest(n),r(null==e?void 0:e.response)),Promise.reject(e.response)})),i},p=(e,t)=>{try{let r=t||window.location.href;if(-1!=r.indexOf("?")){let t={};return r.slice(r.indexOf("?")+1).split("&").forEach((e=>{let r=e.split("=");t[r[0]]=r[1]})),e?t[e]?t[e]:null:t}return console.log("没有参数"),null}catch(e){console.error(e)}};function m(e,t=!1){try{return t?f(e)?e:JSON.stringify(e):f(e)?JSON.parse(e):e}catch(t){return console.log("转化JSON 发生错我!",e),e}}const f=e=>{if("string"==typeof e)try{const t=JSON.parse(e);return"object"==typeof t&&null!==t}catch(e){return!1}return!1},g=(e,t)=>{try{const r=JSON.stringify(t);sessionStorage.setItem(e,r)}catch(t){console.error(`Error setting session data for key ${e}:`,t)}},v=e=>{const t=sessionStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(t){console.error(`Error parsing session data for key ${e}:`,t)}return null},y=e=>{for(const t of e)t.code&&(t.code=t.code.replace(/>/g,">").replace(/</g,"<"))},b=(e,t)=>{e instanceof Map?e.forEach((e=>{t([e])})):Array.isArray(e)&&e.forEach((e=>{t(e.children)}))},w=(e,t)=>{const r=e=>{var n,i,o;if(e)for(const a of e){const e=null===(o=null===(i=null===(n=null==a?void 0:a.tmpData)||void 0===n?void 0:n.source)||void 0===i?void 0:i.converse)||void 0===o?void 0:o.data;(null==e?void 0:e.length)&&y(e),t(a),a.children?r(a.children):a.dynamicChildren?b(a.dynamicChildren,r):a.stateChildren&&r(a.stateChildren)}};r(e)},D=(e,t,r,n)=>{const i=e.match(/({{[\w]*}})|((@)[\w]*)/gm);if(i){const e=i.map((e=>e.replace(/{{|}}|@/gm,"")));for(const i of e)if(i&&t&&!(t.findIndex((e=>e.mapField===i))<0))return r&&n&&N(n,i,r.cid),!0}return!1},N=(e,t,r)=>{if(!e)throw new Error("Share variable tree is not defined");if("string"!=typeof t)throw new Error("Variable name should be a string");if(!r)throw new Error("ID is required");Array.isArray(e[t])||(e[t]=[]),e[t].includes(r)||e[t].push(r)},k=(e,t,r)=>{var n;let i=!1;const o=null==t?void 0:t.converse;if(o&&o.use&&o.data.length)for(const t of o.data)if((null==t?void 0:t.dependVars)&&t.dependVars.includes(e))return!0;const a=null==t?void 0:t[null==t?void 0:t.type];return((null==a?void 0:a.inputSql)||(null==a?void 0:a.url)||(null==a?void 0:a.headers)||(null==a?void 0:a.params))&&(i=D(a.inputSql||a.url||(null===(n=a.headers)||void 0===n?void 0:n.value)||a.params,r)),i},x=(e,t,r=!1)=>{let n=null;const i=e=>{for(const o of e){if(o.cid===t){n=o,r&&_$1.remove(e,(e=>e.cid===t));break}if(o.children&&i(o.children),o.dynamicChildren&&Array.isArray(o.dynamicChildren))for(const[,e]of Array.from(o.dynamicChildren))i(e);o.stateChildren&&i(o.stateChildren)}};return i(e),n},C=(e,t,r)=>{let n=!1;const i=e=>{for(let o=0;o<e.length;o++){if(e[o].cid==t){n=e[o],r&&_$1.remove(e,(e=>e.cid==t));break}if(e[o].children)i(e[o].children);else if(e[o].dynamicChildren){if(e[o].dynamicChildren instanceof Map){let t=Array.from(e[o].dynamicChildren);for(let e=0;e<t.length;e++)if(t[e]instanceof Array){let r=t[e][1];i(r)}}else if(e[o].dynamicChildren instanceof Array){let t=e[o].dynamicChildren;for(let e=0;e<t.length;e++)if(t[e]instanceof Array){let r=t[e][1];i(r)}}}else e[o].stateChildren&&i(e[o].stateChildren)}};return i(e),n||!1};function S(e,t,r){const n={};r&&r.forEach((e=>{(null==e?void 0:e.name)&&(n[e.name]=e.value||e.originvalue)}));try{return new Function("data","vars",e)(t,n)}catch(e){return console.error(e),t}}function A(e,t,r){let n=_$1.cloneDeep(t);const i={};r&&r.forEach((e=>{(null==e?void 0:e.name)&&(i[e.name]=e.value||e.originvalue)}));try{return new Function("data","vars",e)(n,i)}catch(e){return console.error(e),n}}const O=e=>{let t=window.goFetchList;return t||(window.goFetchList={},t=window.goFetchList),t[e]?!t[e]&&void 0:(t[e]={id:e,time:(new Date).getTime()},!0)},I=e=>{let t=window.goFetchList;t&&t[e]&&delete t[e]},T="anov@2019:helloX",V="anov@2020:helloX";function F(e){let t=cryptoJs.enc.Utf8.parse(T),r=cryptoJs.enc.Utf8.parse(V);return cryptoJs.AES.encrypt(e,t,{iv:r,mode:cryptoJs.mode.CBC,padding:cryptoJs.pad.Pkcs7}).toString()}function E(e,t){if(0===e.length)throw new Error("Array is empty.");if(!t)return e[Math.floor(Math.random()*e.length)];if(t.length!==e.length)throw new Error("Length of probabilities array must match length of array.");const r=t.reduce(((e,t)=>e+t),0),n=Math.random()*r;let i=0;for(let r=0;r<e.length;r++)if(i+=t[r],n<i)return e[r];return e[0]}const P=new Blob(["\nfunction proxyObj(originObj) {\n const exposeObj = new Proxy(originObj, {\n has: (target, key) => {\n if (['fetch', 'XMLHttpRequest', 'postMessage'].indexOf(key) >= 0) {\n throw new Error('Illegal operation for key'+key)\n } else {\n return target[key]\n }\n },\n })\n return exposeObj\n}\nfunction compileCode(src) {\n src = 'with (exposeObj) {'+src+'}'\n //console.log(src)\n return new Function('exposeObj', src)\n}\nfunction run(code) {\n let proxy = proxyObj({})\n let result = compileCode(code)(proxy)\n return result\n}\n\nonmessage = (e) => {\n try {\n let result = run(e.data.code)\n postMessage({\n code: 1,\n result,\n })\n } catch (err) {\n postMessage({\n code: -1,\n err,\n })\n }\n}\n"]),j=URL.createObjectURL(P);function R(e,t,r={},n="worker"){return s(this,void 0,void 0,(function*(){try{if("window"==n){let[n,i]=[["data"],[t]];"object"==typeof r&&Object.keys(r).forEach((e=>{n.push(e),i.push(r[e])}));return{success:!0,data:new Function(...n,e)(...i)}}{let[n,i,o]=[t,r,""];"object"==typeof n&&(n=JSON.stringify(t)),"object"==typeof r&&(i=JSON.stringify(r)),Object.keys(r).forEach((e=>o+=`${e},`));let a=`let data=eval(${n}); \n let app=${JSON.stringify({})};`;a+=o?`let {${o}} = eval(${i}); `:"",a+=`${e}`;let c=yield function(e,t=5e3){return s(this,void 0,void 0,(function*(){let r=new Worker(j);return new Promise(((n,i)=>{const o=()=>{clearTimeout(s),r.removeEventListener("message",a),r.terminate(),r=null},a=e=>{let{code:t,result:r,err:a}=e.data;o(),1===t?n(r):i(a)};r.postMessage({code:e}),r.addEventListener("message",a);let s=setTimeout((()=>{o(),i("timeout")}),t)}))}))}(a);return{success:!0,data:c}}}catch(e){return{success:!1,error:e,data:t}}}))}var $,q,M,U;!function(e){e.StaticFile="staticFile",e.DataSource="datasource"}($||($={})),function(e){e.json="application/json;charset=UTF-8",e.form="application/x-www-form-urlencoded; charset=UTF-8"}(q||(q={})),function(e){e.get="GET",e.post="POST",e.put="PUT",e.patch="PATCH",e.delete="DELETE"}(M||(M={}));class L{constructor(e){this.db=null,this.dbName=e.databaseName,this.tableName=e.tableName,this.keyPath=e.keyPath}static getInstance(e){return L.instance||(L.instance=new L(e)),L.instance}init(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,1);r.onerror=e=>{t(e.target.error)},r.onupgradeneeded=e=>{this.db=e.target.result,this.db.objectStoreNames.contains(this.tableName)||this.db.createObjectStore(this.tableName,{keyPath:this.keyPath})},r.onsuccess=t=>{this.db=t.target.result,e()}}))}))}addRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).add(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}deleteRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}updateRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}getRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.onsuccess=()=>{t(n.result)},n.onerror=e=>{r(e.target.error)}}))}))}getAllRecords(){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((e,t)=>{const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAll();r.onsuccess=()=>{e(r.result)},r.onerror=e=>{t(e.target.error)}}))}))}}L.instance=null,function(e){e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e[e.TRACE=5]="TRACE"}(U||(U={}));const H={databaseName:"GODB",tableName:"go-log",keyPath:"time"};class B{constructor(){this.logLevel=U.INFO,this.indexedDBInstance=L.getInstance(H);try{this.indexedDBInstance.init(),console.log("IndexedDB 初始化成功。")}catch(e){console.error("初始化 IndexedDB 时出错:",e)}}static getInstance(){return B.instance||(B.instance=new B),B.instance}setLogLevel(e){this.logLevel=e}getColor(e){switch(e){case U.FATAL:return"[31;1m";case U.ERROR:return"[31m";case U.WARN:return"[33m";case U.INFO:return"[32m";case U.DEBUG:return"[36m";case U.TRACE:return"[34m";default:return"[0m"}}log(e,t){if(t<=this.logLevel){const r=(new Date).toISOString(),n=`[${r}] [${U[t]}]`,i=this.getColor(t);if(null===window||void 0===window?void 0:window.goDev)console.log(`${i}${n} ${e}[0m`);else{let t=v("anov-go-userInfo"),o=v("anov-go-proid"),a=` [操作人:${null==t?void 0:t.userName} 项目ID:${o}] `;const s={time:r,value:`${e}`};try{this.indexedDBInstance.addRecord(s)}catch(e){console.error("添加记录时出错:",e)}console.log(`${i}${n} ${a} ${e}[0m`)}}}fatal(e){this.log(e,U.FATAL)}error(e){this.log(e,U.ERROR)}warn(e){this.log(e,U.WARN)}info(e){this.log(e,U.INFO)}debug(e){this.log(e,U.DEBUG)}trace(e){this.log(e,U.TRACE)}}const z=B.getInstance(),J=(e,t)=>"string"!=typeof e?Promise.reject(new Error("URL should be a string")):h(e,t),G$1=h();let _=h();function W(e,t="get",r={},n={},i){return s(this,void 0,void 0,(function*(){try{const o={method:M[t],url:e,headers:n,timeout:u};return["post","put"].includes(t.toLowerCase())?o.data=_$1.cloneDeep(r):o.params=_$1.cloneDeep(r),i&&(o.headers.sponsor=i),/.json$/.test(e)?function(e){return s(this,void 0,void 0,(function*(){try{return(yield G$1({method:"get",url:e})).data}catch(e){throw console.error("JSON 数据请求:",e),e}}))}(e):function(e){return s(this,void 0,void 0,(function*(){try{return{code:2e4,data:(yield G$1(e)).data}}catch(e){throw console.error("请求数据发生错误-Error:",e),e}}))}(o)}catch(e){throw console.error("获取数据:Error:",e),e}}))}function X(e,t,r,n,i){return s(this,void 0,void 0,(function*(){try{const o=(window.anUrl||"")+(window.agentPath||"/ds/v1/api-proxy/v1/query"),a=m(r,!0);return yield G$1({url:o,method:"post",headers:{"Content-Type":"application/json;charset=UTF-8",sponsor:i||""},data:{body:"post"===e?a:void 0,headers:f(n)?m(n,!0):n,method:e,url:t}})}catch(e){throw console.error("代理请求数据:Error1:",e),e}}))}function K(e,t,r,n,i,o){return s(this,void 0,void 0,(function*(){return i?X(t,e,r,n,o):W(e,t,r,n,o)}))}function Q(e,t="",r){var n,i,o,a;const s=`${null!==(i=null===(n=null===window||void 0===window?void 0:window.BaseUrl)||void 0===n?void 0:n.replace("/management",""))&&void 0!==i?i:""}/ds/data-engine/v1/${e}/zb-query?token=${(null===(o=le("YZH_EXCHANGE_TOKEN"))||void 0===o?void 0:o.YZH_EXCHANGE_TOKEN)||(null===(a=null===window||void 0===window?void 0:window.yzhAuth)||void 0===a?void 0:a.getToken())}&passid=${null===window||void 0===window?void 0:window.gdPassid}${(null===window||void 0===window?void 0:window.BASE_RELEASE)?"&preview=1":""}`;let u={};try{u=t?JSON.parse(t):{}}catch(e){u=t||{}}return G$1({method:"POST",url:s,data:{headers:r,param:u},timeout:c})}const Y=(e,t)=>s(void 0,void 0,void 0,(function*(){const r=window.BaseUrl,{dateType:n="",endPeriod:i="",metricsName:o=e,startPeriod:a=""}=t;return _({method:"GET",url:`${r}ds/v1/metrics/v1/data-alarm?dateType=${n}&endPeriod=${i}&metricsName=${o}&startPeriod=${a}`,timeout:c})})),Z=(e,t,r)=>s(void 0,void 0,void 0,(function*(){var n;const i=(null===(n=window.BaseUrl)||void 0===n?void 0:n.replace("/management",""))||"";t.newEncryption=!0;const o={staticFile:{method:"get",params:t,url:`${i}/ds/v1/file/v1/${e}/query`},datasource:{method:"post",url:`${i}/ds/v1/database/v1/${e}/query`,data:Object.assign({},t)}}[r];if(!o)throw new Error("Invalid data type provided");return G$1(Object.assign({timeout:c},o))})),ee=e=>new Promise(((t,r)=>{let n;n=e.originData&&Object.keys(e.originData).length?e.originData:e.data,void 0!==n?t({data:n}):r("Failed to retrieve cdata")})),te=(e,t,r)=>{try{switch(t){case"api":{let t=ue(e,r);return{requestType:t.requestType,url:t.url,params:t.params,headers:t.headers,agency:t.agency}}case"static":return{data:e};case"datasource":{const t=ce(e.inputSql,r);return{dsName:e.dsName,dsType:"1",sql:F(t),filter:e.sqlFilter}}case"staticFile":return{dsName:e.dsName,dsType:e.dsType,sql:""};case"indicator":return{zbId:e.zbId,params:ce(e.params,r),headers:ce(e.headers,r)};case"indicatorCQ":return{zbName:e.zbName,params:ce(e.params,r)};case"packData":return{};default:throw new Error("Invalid type")}}catch(t){console.log("准备请求数据发生错误",t,e)}},ie=(e,t,r)=>s(void 0,void 0,void 0,(function*(){try{switch(t){case"api":return yield K(e.url,e.requestType,e.params,e.headers,e.agency,r);case"static":return yield ee(e.data);case"datasource":return yield Z(e.dsName,{dsType:e.dsType,sql:e.sql,filter:e.filter},"datasource");case"staticFile":return yield Z(e.dsName,{dsType:e.dsType,sql:e.sql},"staticFile");case"indicator":return yield Q(e.zbId,e.params,e.headers);case"indicatorCQ":return yield Y(e.zbName,e.params);case"packData":return{};default:throw new Error("Invalid type")}}catch(e){return console.warn(e,"执行请求并获取数据发生错误"),yield new Promise(((e,t)=>{e({error:!0})}))}})),oe=(e,t,r,n=[],i=!1)=>s(void 0,void 0,void 0,(function*(){const o=t||e.tmpData.source.dataType,a=e.tmpData.source["indicatorCQ"==o?"indicator":o];if("globalData"===o){const e=n.find((e=>e.key===a.id||e.key===a.key)),t=v(a.id);if(t&&!i)return t.data;if(e){let t=yield re(e,r),n={key:a.id,data:t};return g(a.id,n),t}return}const s=te(a,o,r),c=yield ie(s,o,e.cid?e.cid:"");return(null==c?void 0:c.data)?c.data:c})),re=(e,t)=>s(void 0,void 0,void 0,(function*(){let r=Object.assign({},{tmpData:{source:e.value}});const n=r.tmpData.source.type,i=r.tmpData.source[n],o=te(i,n,t),a=yield ie(o,n);return yield ae(a.data,r,!0,t)})),ae=(e,t,r=!0,n)=>s(void 0,void 0,void 0,(function*(){try{const{converse:i,mapFields:o}=t.tmpData.source;return i&&i.use&&r?yield new Promise(((t,r)=>{const o=function(e,t,r,n,i){return s(this,void 0,void 0,(function*(){let r,i=e,{use:o,data:a}=_$1.cloneDeep(t);if(o)for(let e=0;e<a.length;e++)if(a[e].use){let t=a[e].dependVars,o={};n&&o&&t&&t.length&&t.map((e=>{let t=_$1.cloneDeep(n).filter((t=>{let r=t.mapField==e;return r&&(o[e]=t.value),r}));t&&0!=t.length||(o[e]="")})),r=yield R(a[e].code,i,o,a[e].mode?a[e].mode:"worker"),i=r.data}return i}))}(e,i,0,n);t(o)})):yield new Promise(((t,r)=>{t(e)}))}catch(t){return console.error("执行过滤器发生错误:"+t),yield new Promise(((t,r)=>{t(e)}))}})),ne=(e,t,r)=>{const{source:n}=e.tmpData,i=n.type;r?("static"===i&&n[i]&&(n[i].originData=r),"indicatorCQ"===i?n.indicator.data=t:n[i].data=t):"indicatorCQ"===i?n.indicator.data=t:n[i].data=t,e.source=t},se=(e,t,r=[],n,i,o)=>s(void 0,void 0,void 0,(function*(){try{let a=e.tmpData.source.type,s=yield oe(e,a,r,n,o||!1);if(null==s||!s)return i&&i({error:!0}),Promise.resolve({error:!0});let c=yield ae(s,e,t,r);return ne(e,c),i&&i(c),(null==e?void 0:e.cid)&&I(e.cid),Promise.resolve(c)}catch(e){return i&&i(e),z.error("Error in updateComData"),console.error("Error in updateComData:",e),Promise.reject(e)}})),le=e=>{const t={};if(e&&e.includes("?")){const r=e.split("?")[1].split("&");for(let e of r){const[r,n]=e.split("=").map(decodeURIComponent);t[r]=n}}return t},de=e=>{try{return(null==e?void 0:e.value)&&"string"==typeof e.value?JSON.parse(e.value):"string"==typeof e?JSON.parse(e):e}catch(t){return e}},ce=(e,t)=>{if(!t)return de(e);if("string"==typeof e){if(""===e.trim())return"";try{if("string"!=typeof JSON.parse(e))return ce(JSON.parse(e),t);{let r=e.replace(/@(\w+)|{{(\w+)}}/g,((e,r,n)=>{const i=r||n,o=t.find((e=>e.mapField===i));return o?o.value||o.originalValue||"":e}));return de(r)}}catch(r){let n=e.replace(/@(\w+)|{{(\w+)}}/g,((e,r,n)=>{const i=r||n,o=t.find((e=>e.mapField===i));return o?o.value:e}));return de(n)}}else{if(Array.isArray(e))return e.map((e=>ce(e,t)));if("object"==typeof e&&null!==e){const r={};for(let n in e)r[n]=ce(e[n],t);return de(r)}}return de(e)},ue=(e,t)=>{const r=e.agency,n=e,{url:i=null,headers:o,params:a,requestType:s}=n,c=i?ce(i,t):void 0,u=o&&o.use?ce(o.value,t):{};return{url:c,requestType:s,params:a?ce(a,t):{},headers:u,agency:r}},he=(e,t,r,n,i)=>s(void 0,void 0,void 0,(function*(){if(e&&e.length)for(const o of e)k(t,o.value,r)&&(yield se({tmpData:{source:{type:"globalData",globalData:{id:o.key}}}},!0,r,e,(e=>{console.log("数据更新成功-变量改变全局数据跟新")}),!0),w(n,(t=>{var n,a,s;"globalData"===(null===(a=null===(n=null==t?void 0:t.tmpData)||void 0===n?void 0:n.source)||void 0===a?void 0:a.type)&&(null===(s=null==t?void 0:t.tmpData)||void 0===s?void 0:s.source.globalData).id===o.key&&se(t,!0,r,e,(e=>{i(t,e)}),!1)})))})),pe=(e,t,r,n,i)=>s(void 0,void 0,void 0,(function*(){e&&(yield se({tmpData:{source:{type:"globalData",globalData:{id:e.key}}}},!0,t,r,(e=>{console.log("数据更新成功-数据源编辑")}),!0),w(n,(n=>{var o,a,s;"globalData"===(null===(a=null===(o=null==n?void 0:n.tmpData)||void 0===o?void 0:o.source)||void 0===a?void 0:a.type)&&(null===(s=null==n?void 0:n.tmpData)||void 0===s?void 0:s.source.globalData).id===e.key&&se(n,!0,t,r,(e=>{i(n,e)}),!1)})))}));class me{constructor(e,t){this.isUpdating=!1,this.des=e.des,this.field=e.field,this.id=e.id,this.key=e.key,this.mapping=e.mapping,this.mapField=e.mapField,this.type=e.type,this.originalValue=e.originalValue,this.model=(null==e?void 0:e.model)?null==e?void 0:e.model:1,this.converter=e.converter,this.converterCode=e.converterCode,this.fork=e.fork,this.delayUpdate=!!(null==e?void 0:e.delayUpdate),t&&(this.globalVariables=t),e.fork&&(this.model=5,this.forkValue=e.forkValue,this.originalValue=this.getForkedValue())}get value(){if(this.fork&&(this.originalValue=this.getForkedValue()),this.converter&&this.converterCode){let e=[];return A(this.converterCode,this.originalValue,e)}return this.originalValue}togglePropertyState(e){let t=Object.prototype.hasOwnProperty.call(this,e);this[e]=!t||!e}getForkedValue(){if(this.forkValue&&Array.isArray(this.forkValue))return this.forkValue.map((e=>{const t=this.globalVariables.get(e);return t?t.value:null}));if(this.forkValue){const e=this.globalVariables.get(this.forkValue);return e?e.value:null}return null}updateValue(e,t){var r;const n=Object.assign({},this,e);this.des=n.des,this.field=n.field,this.mapping=n.mapping,this.type=n.type,this.originalValue=n.originalValue,this.converter=n.converter,this.converterCode=n.converterCode,this.fork=n.fork,this.delayUpdate=null==n?void 0:n.delayUpdate,this.model=null==n?void 0:n.model,e.id&&(this.id?"string"==typeof this.id?e.id instanceof Array?this.id=_$1.uniq([this.id,...e.id]):this.id=[this.id,e.id]:this.id instanceof Array&&(e.id instanceof Array?this.id=_$1.uniq([...this.id,...e.id]):this.id=_$1.uniq([...this.id,e.id])):this.id=e.id),e.fork&&(this.model=5,this.forkValue=null!==(r=e.forkValue)&&void 0!==r?r:this.forkValue,this.originalValue=this.getForkedValue()),t&&t(this)}updateWidthOriginalValue(e,t){var r;this.originalValue=e,this.fork&&(this.forkValue=null!==(r=this.forkValue)&&void 0!==r?r:this.forkValue,this.originalValue=this.getForkedValue()),t&&t(this)}renew(e){e&&e(this)}static create(e,t){return new me(e,t)}}class fe{constructor(){this.variables=new Map,this.globalObservers=[],this.url=window.location.search,this.list=[]}clearVars(){this.list=[],this.variables.clear()}togglePropertyState(e,t,r){try{let n=this.getVariable(e);if(!n)throw new Error("没有找到相应的变量!");n.togglePropertyState(t),this.addToObjectArray(this.list,n),r&&r()}catch(e){console.error(e)}}static getInstance(){return fe.instance||(fe.instance=new fe),fe.instance}getFullUrl(){this.url=window.location.search}getAllUrlParams(){const e=new URLSearchParams(window.location.search),t={};for(const[r,n]of e.entries())t[r]=n;return t}delVariable(e,t){this.variables.delete(e),this.list=this.list.filter((t=>t.mapField!=e)),t&&t()}addUrlParamsToGlobalVars(){this.getFullUrl();let e=this.getAllUrlParams(),t=Object.keys(e),r=[];for(const n of t)r.push({mapField:n,originalValue:e[n],model:4});if(r.length)for(const e of r)this.addVariable(e)}addVariables(e){Array.isArray(e)?e.map(((e,t)=>{this.addVariable(e)})):this.addVariable(e),this.addUrlParamsToGlobalVars()}addVariable(e,t){if(!e||!(null==e?void 0:e.mapField))return console.error(e+"参数不合法!"),!1;if(this.isVariableNameExist(e.mapField)){let r=this.getVariable(e.mapField);return this.sameValue(r,e)?r:(this.editVariable(e,t),!1)}const r=me.create(e,this.variables);return this.variables.set(r.mapField,r),this.addToObjectArray(this.list,r),t&&t(r),this.notifyGlobalObservers(r),r}toJSON(e){try{return!!e&&JSON.stringify(e)}catch(e){return!1}}sameValue(e,t){if(e.mapfield!==t.mapfield)return!1;for(const r in t)if(!(["mapfield","field","key","value","name","globalVariables"].includes(r)||r in e&&e[r]==t[r]))return!1;return!0}creatVarJson(e){const{des:t,field:r,id:n,key:i,mapping:o,mapField:a,type:s,value:c,originalValue:u,model:l,converter:d,converterCode:h,fork:f,forkValue:p,update:m,delayUpdate:g}=e,v={};return void 0!==t&&(v.des=t),void 0!==r&&(v.field=r),void 0!==n&&(v.id=n),void 0!==i&&(v.key=i),void 0!==o&&(v.mapping=o),void 0!==a&&(v.mapField=a),void 0!==s&&(v.type=s),void 0!==c&&(v.value=c),void 0!==u&&(v.originalValue=u),void 0!==l&&(v.model=l),void 0!==d&&(v.converter=d),void 0!==h&&(v.converterCode=h),void 0!==f&&(v.fork=f),void 0!==p&&(v.forkValue=p),void 0!==m&&(v.update=m),void 0!==g&&(v.delayUpdate=g),v}addToObjectArray(e,t){let r=!1;for(let n=0;n<e.length;n++)if(e[n].mapField==t.mapField){e[n]=this.creatVarJson(t),r=!0;break}r||e.push(t)}editVariable(e,t){const r=this.getVariable(e.mapField);if(r&&this.isVariableNameExist(e.mapField)&&this.sameValue(r,e))return;const n=e=>{e.isUpdating||(e.isUpdating=!0,this.notifyGlobalObservers(e),this.isMapFieldInForkValues(e.mapField).forEach((e=>{let t=this.getVariable(e.mapField);t&&t.renew((e=>{this.addToObjectArray(this.list,e),this.notifyGlobalObservers(e)}))})),this.addToObjectArray(this.list,e),t&&t(e),e.isUpdating=!1)};r?r.updateValue(e,n):this.addVariable(e,n)}getForkList(e){return this.isMapFieldInForkValues(e)||[]}editVariableForValue(e,t,r){const n=this.getVariable(e);n&&n.updateWidthOriginalValue(t,(e=>{e.isUpdating||(e.isUpdating=!0,this.notifyGlobalObservers(e),this.isMapFieldInForkValues(e.mapField).forEach((e=>{let t=this.getVariable(e.mapField);t&&t.renew((e=>{this.addToObjectArray(this.list,e),this.notifyGlobalObservers(e)}))})),this.addToObjectArray(this.list,e),r&&r(e),e.isUpdating=!1)}))}isMapFieldInForkValues(e){return this.getAllVariables().filter((e=>e.fork&&e.forkValue)).filter((t=>t.forkValue==e||Array.from(t.forkValue).includes(e)))}isVariableNameExist(e){return this.variables.has(e)}checkExist(e,t){if("string"==typeof e&&this.isVariableNameExist(e)){let r=this.getVariable(e);return t==r.id&&!r.id.includes(t)&&[{key:e}]}if(Array.isArray(e)){const r=e.filter((e=>{let r=this.getVariable(e);return this.isVariableNameExist(e)&&t!=r.id&&!(r.id&&r.id.includes(t))})).map((e=>({key:e})));return!!r.length&&r}return!1}getVariable(e){return this.variables.get(e)}getVariableForId(e){var t;let r=[];for(const[,n]of this.variables)(n.id===e||(null===(t=n.id)||void 0===t?void 0:t.includes(e)))&&r.push(n);return _$1.uniq(r)}getAllVariables(e=!1){return this.addUrlParamsToGlobalVars(),e?(this.list=Array.from(this.variables.values()),this.list):[...this.list]}restoreVariables(e){e.forEach((e=>{this.addVariable(e)}))}registerGlobalObserver(e){this.globalObservers.push(e)}notifyGlobalObservers(e){this.globalObservers.forEach((t=>{t.update(e)}))}}fe.instance=null;const ge=fe.getInstance(),ve=(e,t)=>Array.isArray(t)?t.some((t=>e&&(void 0!==e[t]||e.hasOwnProperty(t)))):"string"==typeof t&&e&&(void 0!==e[t]||e.hasOwnProperty(t)),ye=(e,t,r,n)=>{const i=((e,t,r,n)=>{var i;let o;if(ve(e,null==t?void 0:t.field)||ve(e,null==t?void 0:t.forkValue))o=e[null==t?void 0:t.field]||"";else if(ve(e.data,null==t?void 0:t.field)||ve(e.data,null==t?void 0:t.forkValue))o=e.data[null==t?void 0:t.field]||"";else{const e=x(r,n),a=(null===(i=null==e?void 0:e.tmpData)||void 0===i?void 0:i.actions)||[];for(const e of a){const r=e.vars.find((e=>(null==e?void 0:e.mapField)===(null==t?void 0:t.mapField)));if(r){o=r.value;break}}}return o})(e,t,r,n);return void 0!==i?i:t.value},be=(e,t,r,n,i,o,a,s,c)=>{var u;switch(e.type){case"link":let l=ce(e.link,o);window.open(l,e.target);break;case"page":if(null===(u=null==e?void 0:e.params)||void 0===u?void 0:u.length)for(let t=0;t<e.params.length;t++){const r=e.params[t],n=o.find((e=>e.mapField==r.mapField));n&&(r.value=n.value)}c&&c(e);break;case"dynamic":((e,t,r,n,i)=>{const o=e.dynamic||[];for(const a of o){if(e.id!==t.cid)continue;const o=x(r,a.pid);o&&(o.activeDynamic=a.name,o.isShow=a.visible||!n||e.index===t.index-1,i({cid:o.cid,flag:a.visible}))}})(e,t,r,n,i);break;case"toggle":((e,t,r,n,i)=>{const o=e.children||[];for(const r of o){const o=r.visible&&(!n||e.index===t.index-1);i({cid:r.cid,flag:o})}})(e,t,0,n,i);break;case"update":((e,t,r,n,i)=>{const o=e.children||[];for(const e of o){const o=x(t,e.cid);o&&se(o,!0,r,n,(e=>{i({cid:o.cid,data:e})}))}})(e,r,o,a,s)}},we=(e,t,r,n,i,o,a,s,c,u)=>{const{cid:l,actions:d,index:h}=i,{eventName:f,mode:p}=d,m=2===p;((e,t,r,n,i,o)=>{let a=ge.getVariableForId(t.cid);if(null==a?void 0:a.length)for(const s of a)if(s.type==e){let e=ye(t,s,r,n);ge.editVariableForValue(s.mapField,e,(()=>{let e=i[s.mapField]||[],t=ge.getForkList(s.mapField);if(t)for(const r of t){let t=i[r.mapField];e=_$1.concat(e,t)}o&&o(s,_$1.uniq(e))}))}})(f,i,n,l,r,((e,t)=>{if(he(c,e.mapFile,ge.getAllVariables(),n,((e,t)=>{a({cid:e.cid,data:t})})),null==t?void 0:t.length)for(const r of t){e.eventSourceId=r;const t=x(n,r);!(null==e?void 0:e.delayUpdate)&&t&&se(t,!0,ge.getAllVariables(),c,(e=>{a({cid:t.cid,data:e})}))}}));const g=((e,t,r,n,i)=>e.filter((e=>e.id===t&&e.eventType===r&&(!i||parseInt(e.index||"0")+1===parseInt(n||"0")))))(e,l,f,h,m);for(const e of g)be(e,i,n,m,o,ge.getAllVariables(),c,a,s)},De=(e,t={})=>{let r={},n={type:"static",converse:{use:!1,data:[]},static:{data:e},api:{requestType:"get",url:"",headers:{use:!1,value:""},params:"",agency:!1,cookie:!0,autoUpdate:{open:!1,time:10},data:""}};return Object.assign(r,n,t),r},Ne=(e,t)=>{let{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}=((e,t)=>{let{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}=_$1.cloneDeep(t[e]);return{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}})(e,t);return{iconClass:null,isAssembly:null,source:i,cid:(Math.random().toString().substr(3,10)+Date.now()).toString(),isLock:!1,isShow:!0,tmpData:{option:r,source:De(i,s),actions:n},baseData:xe(),dynamic:null,filePath:"",origin:"anov-ui",name:"",componentType:"",viewComName:e,optionComName:"AnOptionPanel",dataComName:"AnSourcePanel",eventComName:"AnActionsPanel",assemblyDeveloper:"",devEmail:"",version:"",devDept:""}},ke=(e,t,r)=>{let n=Ne(e,t);return r?_$1.merge(n,r):n},xe=e=>{let t={left:0,top:0,width:100,height:100,angle:0,penetrate:0,opacity:100,perspective:100,rotateX:0,rotateY:0,rotateZ:0,transformOriginX:"center",transformOriginY:"center",transformSwitch:!1};return e?Object.assign(t,e):t};class Ce{constructor(e,t,r){this.theme=null,this.plant=null,this.list=[],this.titleHeqadeHeight=70,this.clearance=3,this.checkComponentIntersection=(e,t,r=10)=>{const n=e.left,i=e.left+e.width,o=e.top,a=e.top+e.height,s=t.left,c=t.left+t.width,u=t.top,l=t.top+t.height,d=n<c&&i>s&&o<l&&a>u,h=Math.abs(e.left+e.width/2-(t.left+t.width/2)),f=Math.abs(e.top+e.height/2-(t.top+t.height/2));return d||h<r&&f<r},this.calculateCombinedComponent=e=>{if(0===e.length)return{left:0,top:0,width:0,height:0};let t=e[0].left,r=e[0].top,n=e[0].left+e[0].width,i=e[0].top+e[0].height;for(let o=1;o<e.length;o++){const a=e[o];t=Math.min(t,a.left),r=Math.min(r,a.top),n=Math.max(n,a.left+a.width),i=Math.max(i,a.top+a.height)}return{left:t,top:r,width:n-t,height:i-r}},this.getAnTextNormaltText=e=>{var t,r;try{return null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.text}catch(e){return console.error("配置优化(ConfigOptimizer):",e),""}},this.initProp(e),this.upgradePlant(),this.staticComponentData=t,this.upgradeHeaderComponent(),r&&Object.assign(this,r)}isStringOrObject(e){return"string"==typeof e?"string":"object"==typeof e&&null!==e&&"object"}initProp(e){try{let t,r=this.isStringOrObject(e);if(r&&"string"===r)t=JSON.parse(e);else{if(!r||"object"!==r)throw new Error(`initProp fn error :-- 传入参数${e}不合法!`);t=e}if(t){this.originData=t;const{theme:e,plant:r,list:n}=t;this.theme=e,this.plant=r,this.list=n,this.filterFileGroup()}}catch(e){console.error("配置优化(ConfigOptimizer):",e)}}upgradePlant(){this.plant&&(this.plant.option.bg={type:1,code:"70942ec525344c96aa32b81b2c9155f6",path:"/anov-prod/resources/page/png/bg22 科技星球背景.png",thumb:"/anov-prod/resources/page/thumbnail/1e48f8fb26ec4edfb1a0f499627e84fc.png"})}areComponentsIntersecting(e,t){let r=e.baseData,n=t.baseData;const i=Math.max(0,Math.min(r.left+r.width,n.left+n.width)-Math.max(r.left,n.left)),o=Math.max(0,Math.min(r.top+r.height,n.top+n.height)-Math.max(r.top,n.top));return i>0&&o>0}filterFileGroup(){this.list=_$1.cloneDeep(this.list).map((e=>{var t,r;if(1===(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.children[0])||void 0===r?void 0:r.children)){const t=e.children[0],{left:r,top:n}=e.baseData;return t.baseData.left=r,t.baseData.top=n,t}return e}))}getText(e,t,r){const n=document.createElement("canvas").getContext("2d");if(!n)throw new Error("Failed to get 2D context from canvas.");return n.font=`${r}px ${t}`,n.measureText(e).width}calculateMaxWidths(e){const t=Math.min(...e.map((e=>e.width))),r=[];let n=[],i=e[0].width;for(const o of e){const e=o.width;Math.abs(e-i)<=t?n.push(e):(n.length>0&&r.push(n),n=[e]),i=e}n.length>0&&r.push(n);const o=[];for(const e of r){const t=Math.max(...e);o.push(t)}return o}findClosestValue(e,t){let r=t[0],n=Math.abs(e-r);for(const i of t){const t=Math.abs(e-i);t<n&&(n=t,r=i)}return r}adjustHeightAndTop(e,t){const r=t-e.height;return Object.assign(Object.assign({},e),{height:t,top:e.top-r/2})}findNearestComponent(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=_$1.cloneDeep(e).sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=_$1.cloneDeep(t).baseData;a.top,a.height;for(const e of o){const t=e.baseData;if(t.top,t.height,a.left<t.left+t.width&&a.left+a.width>t.left){const r=t.top-a.top;r<i&&r<100&&(i=r,n=e)}}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestComponentForPoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=this.getDistance(a.left,a.top+a.height,t.left,t.top);r<i&&r<a.width&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestComponentForTitlePoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=this.getDistance(a.left,a.top+a.height,t.left,t.top);r<i&&r<a.width&&t.top-a.top>100&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestTitleForPoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=t.top-a.top;r<i&&r<a.width&&t.top-a.top>100&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}getDistance(e,t,r,n){return Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2))}findNearestComponent2(e,t,r){let n=null,i=1/0,o=_$1.cloneDeep(e).sort(((e,t)=>e.baseData.top-t.baseData.top));try{const e=o.filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=_$1.cloneDeep(t).baseData,s=a.top+a.height;for(const t of e){const e=t.baseData,r=e.top+e.height;if(a.left<e.left+e.width&&a.left+a.width>e.left){const e=r-s;e>=0&&e<i&&(i=e,n=t)}}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}verticalDistance(e,t){e.left,e.width;const r=e.top+e.height,n=(t.left,t.width,t.top);return Math.abs(r-n)}extractAmount(e){const t=e.match(/(\d{1,3}(?:,\d{3})*)(\D+)/);if(t){const e=t[1].replace(/,/g,"");return[parseInt(e,10),t[2].trim()]}return[!1,!1]}getAnTextNormal(){return this.list.filter((e=>"AnTextNormal"==e.viewComName))}getAnDeckTitle3(){return this.list.filter((e=>"AnDeckTitle3"==e.viewComName)).sort(((e,t)=>e.baseData.left-t.baseData.left))}judgeAnOdometer(){let e=this.getAnTextNormal().sort(((e,t)=>e.baseData.left-t.baseData.left)),t=[],r=new Set;for(const n of e){if(r.has(n.cid))continue;let i=[];for(const t of e)r.has(t.cid)||n.cid==t.cid||this.checkComponentIntersection(n.baseData,t.baseData)&&(r.add(t.cid),r.add(n.cid),i.push(t));t.push([n,...i])}let n=[];for(const e of t)for(const t of e){let r=this.getAnTextNormaltText(t);this.extractAmount(r).every((e=>e))&&n.push(e)}return n}createAnOdometer(){var e,t;let r=this.judgeAnOdometer();for(const n of r){let r,i,o,a=this.calculateCombinedComponent(n.map((e=>e.baseData)));for(const e of n){let t=this.getAnTextNormaltText(e),n=this.extractAmount(t);n.every((e=>!e))&&(r=t),n.every((e=>e))&&(i=n[0],o=n[1]),_$1.remove(this.list,(t=>t.cid==e.cid))}let s=ke("AnIndicatorNormal",this.staticComponentData,_$1.cloneDeep({baseData:a}));(null===(t=null===(e=null==s?void 0:s.tmpData)||void 0===e?void 0:e.source)||void 0===t?void 0:t.static)&&(s.tmpData.source.static.data={text:r,num:i,unit:o},s.tmpData.source.static.originData={text:r,num:i,unit:o}),this.list.push(s)}}upgradeHeaderComponent(){for(let e=0;e<this.list.length;e++){const t=this.list[e];"AnDeckHeader3"==t.viewComName&&(t.baseData.left=0,t.baseData.top=0)}}upgradeTitleComponent(){let e=this.getAnDeckTitle3().map((e=>e.baseData)),t=this.calculateMaxWidths(e);for(let e=0;e<this.list.length;e++){const r=this.list[e];if("AnDeckTitle3"==r.viewComName){let e=this.findClosestValue(r.baseData.width,t);r.baseData.width=e>300?e:300,r.baseData=this.adjustHeightAndTop(r.baseData,this.titleHeqadeHeight)}}this.removeErroneousComponents()}containsFractionStructure(e){return/\b\d+\/\d+\b/.test(e)}removeErroneousComponents(){let e=this.getAnDeckTitle3(),t=[];for(let r=0;r<e.length;r++){const n=e[r];let i=n.tmpData.option.textNormal.text;if(this.containsFractionStructure(i))for(let r=0;r<e.length;r++){const i=e[r];n.cid!=i.cid&&this.areComponentsIntersecting(n,i)&&t.push(n.cid)}}this.list=this.list.filter((e=>!t.includes(e.cid)))}upgradeGroupComponent(){try{let e=this.getAnDeckTitle3(),t=this.list.filter((e=>"AnDeckTitle3"!=e.viewComName&&"AnDeckHeader3"!=e.viewComName&&"AnTextNormal"!=e.viewComName)),r=[],n=[];for(let i=0;i<e.length;i++){const o=e[i];let a=this.findNearestComponentForPoint(t,o,r);if(a&&a.cid&&r.push(a.cid),a){o.baseData.left=a.baseData.left;let t=this.upgradeComponentHeight(o,e,n);t&&t>=30&&(a.baseData=Object.assign({},a.baseData,{top:o.baseData.top+o.baseData.height+this.clearance}))}}}catch(e){console.error("配置优化(ConfigOptimizer):",e)}}upgradeComponentHeight(e,t,r=[]){const n=e;let i=this.findNearestTitleForPoint(_$1.cloneDeep(t),n);return i?i.baseData.top-n.baseData.top-this.titleHeqadeHeight:1080-n.baseData.top-this.titleHeqadeHeight}getData(){return this.originData.list=this.list,this.originData.plant=this.plant,this.originData}}const Se=new class{randomNum(e,t){return Math.floor(Math.random()*(t-e+1))+e}generateRandomIntArray(e,t,r,n){const i=[];for(let n=0;n<e;n++){const e=this.randomNum(t,r);i.push(e)}return n&&"asc"===n?i.sort(((e,t)=>e-t)):n&&"desc"===n?i.sort(((e,t)=>t-e)):i}randomString(e,t){const r=this.randomNum(e,t);let n="";for(let e=0;e<r;e++){const e=Math.floor(26*Math.random());n+="abcdefghijklmnopqrstuvwxyz".charAt(e)}return n}generateRandomNameArray(e,t,r){const n=[];for(let i=0;i<e;i++){const e=this.randomString(t,r);n.push(e)}return n}pick(e,t){const r=void 0!==t?e.filter((e=>e!==t)):e;return r[Math.floor(Math.random()*r.length)]}},Ae=()=>{const e=[],t=Se.pick([!0,!1]);let r=Se.randomNum(3,20);const n=Se.pick([null,null,null,{}]);let i=Se.pick(["asc","desc",void 0,void 0,void 0]);for(let o=0;o<Se.randomNum(1,9);o++)e.push({data:Se.generateRandomIntArray(r,0,300,i),type:"line",smooth:t,symbolSize:Se.randomNum(1,10),lineStyle:{width:Se.randomNum(1,4)},areaStyle:n});return{xAxis:{type:"category",show:!1,boundaryGap:!1,data:Se.generateRandomNameArray(r,3,6)},grid:{left:0,top:0,bottom:0,right:0},yAxis:{show:!1,type:"value"},series:e}},Oe=(e,t)=>{let r={type:e,show:!1};return"category"===e&&(r.data=Se.generateRandomNameArray(t,3,6)),r},Ie=()=>{const e=[],t=Se.pick([!0,!1]);let r=Se.randomNum(3,20);const n=Se.pick([null,null,null,{}]);let i=Se.pick(["asc","desc",void 0,void 0,void 0]),o=Se.randomNum(1,9),a=Se.pick([!0,!1]);for(let s=0;s<o;s++){let o={data:Se.generateRandomIntArray(r,0,300,i),type:"bar",smooth:t,stack:a,areaStyle:n};e.push(o)}let s=Se.pick(["value","category"]),c=Se.pick(["value","category"],s);return{xAxis:Oe(s,r),grid:{left:0,top:0,bottom:0,right:0},yAxis:Oe(c,r),series:e}},Te=()=>{const e=[];let t=Se.randomNum(3,20);Se.pick([null,null,null,{}]);let r=Se.pick(["asc","desc",void 0,void 0,void 0]),n=Se.pick([1,2]),i=[Se.pick(["10%","20%","30%","40%","50%","60%","70%","80%"]),Se.pick(["90%","100%"])];return e.push({data:Se.generateRandomIntArray(t,3,20,r),type:"pie",radius:1==n?"100%":i,roseType:1==n?Se.pick(["area",null,null]):null,padAngle:1==n?0:Se.randomNum(1,5),startAngle:1==n?Se.pick([0,180]):0,endAngle:360,label:{show:!1},itemStyle:{borderRadius:3}}),{grid:{left:0,top:0,bottom:0,right:0},series:e}},Ve=()=>{const e=[];Se.pick([!0,!1]),Se.randomNum(3,20),Se.pick([null,null,null,{}]),Se.pick(["asc","desc",void 0,void 0,void 0]);for(let t=0;t<Se.randomNum(1,20);t++){let t=Se.randomNum(3,Se.randomNum(3,20)),r=[];for(let e=0;e<t;e++){let e=[];for(let t=0;t<2;t++)e.push(Se.randomNum(1,30));r.push(e)}e.push({type:"scatter",symbolSize:Se.randomNum(3,30),data:r})}return{xAxis:{show:!1},grid:{left:0,top:0,bottom:0,right:0},yAxis:{show:!1,type:"value"},series:e}},Fe=()=>{const e=[],t=Se.pick(["polygon","circle"]);let r=Se.randomNum(1e4,99999),n=Se.randomNum(3,10),i=[];for(let e=0;e<n;e++)i.push({name:Se.randomString(4,8),max:r});for(let t=0;t<Se.randomNum(2,10);t++)e.push({value:Se.generateRandomIntArray(n,1e4,r),name:Se.randomString(4,8)});return{radar:{shape:t,indicator:i,axisName:{show:!1},radius:"100%"},grid:{left:0,top:0,bottom:0,right:0},series:[{type:"radar",symbol:"none",lineStyle:{width:1},data:e}]}},Ee=()=>{const e=[];for(let t=0;t<Se.randomNum(4,15);t++)e.push({value:Se.randomNum(1,100),name:Se.randomString(4,8)});return{grid:{left:0,top:0,bottom:0,right:0},series:[{type:"funnel",left:"0%",top:0,bottom:0,width:"100%",min:0,minSize:"0%",maxSize:"100%",label:{show:!1,position:"inside"},sort:Se.pick(["descending","ascending"]),gap:2,lineStyle:{width:1},data:e}]}};let Pe=Se.randomNum(5,20);const je={width:Pe};Se.pick([!0,!1])&&(je.color=[[.3,"#67e0e3"],[.7,"#37a2da"],[1,"#fd666d"]]);class Re{constructor(){this.names=["line","bar","pie","scatter","radar","funnel","gauge"]}static getInstance(){return Re.instance||(Re.instance=new Re),Re.instance}createLine(){switch(Se.pick(this.names)){case"line":return{type:"line",typeNum:1,option:Ae()};case"bar":return{type:"bar",typeNum:2,option:Ie()};case"pie":return{type:"pie",typeNum:3,option:Te()};case"scatter":return{type:"scatter",typeNum:4,option:Ve()};case"radar":return{type:"radar",typeNum:5,option:Fe()};case"funnel":return{type:"funnel",typeNum:6,option:Ee()};case"gauge":return{type:"gauge",typeNum:7,option:{grid:{left:0,top:0,bottom:0,right:0},series:[{type:"gauge",radius:"100%",detail:{formatter:"{value}"},progress:{show:Se.pick([!0,!1]),width:Pe},axisLine:{lineStyle:je},data:[{value:Se.randomNum(1,100),name:"SCORE"}]}]}}}}}Re.instance=null;const $e=Re.getInstance(),qe=new class{constructor(){this.directions=["row","row"],this.direction="column",this.splitNumbers=24,this.margin=[0,0]}baseLayout(e){const t=(null==e?void 0:e.maRrows)?null==e?void 0:e.maRrows:this.splitNumbers,r=(null==e?void 0:e.colNum)?null==e?void 0:e.colNum:this.splitNumbers,n=e.wrapWidth/r,i=e.wrapHeight/t;let o=E(this.directions);o&&(this.direction=o);let a=[];if("row"===this.direction){let e=E([3,4]);a=this.simulateRandomSegments(24,4,12,e)}else{let e=E([2,3]);a=this.simulateRandomSegments(24,4,6,e)}let s=[],c=[];if("row"===this.direction){for(let e=0;e<a.length;e++)if(0==e)s.push({x:0,y:0,w:a[e],h:24,i:e,wStep:n,hStep:i});else{let t=s[e-1].x;s.push({x:a[e-1]+t,y:0,w:a[e],h:24,i:e,wStep:n,hStep:i})}let e=E([2,3]),t=this.simulateRandomSegments(24,6,12,e);for(let e=0;e<s.length;e++){const r=s[e];for(let o=0;o<t.length;o++){const a=t[o];c.push({x:r.x,y:a,w:r.w,h:a,i:10*e+o,wStep:n,hStep:i})}}}else{for(let e=0;e<a.length;e++)if(0==e)s.push({x:0,y:0,w:24,h:a[e],i:e,wStep:n,hStep:i});else{let t=s[e-1].y;s.push({x:0,y:a[e-1]+t,w:24,h:a[e],i:e,wStep:n,hStep:i})}for(let e=0;e<s.length;e++){const t=s[e];let r=E([1,2,3,4]),o=this.simulateRandomSegments(24,5,12,r),a=[];for(let r=0;r<o.length;r++){const s=o[r];if(0==r)a.push({x:0,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i}),c.push({x:0,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i});else{let u=a[r-1].x;a.push({x:o[r-1]+u,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i}),c.push({x:o[r-1]+u,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i})}}}}return{layouts:c.map((t=>{let{option:r,typeNum:n}=$e.createLine(),i=t.x*t.wStep+t.w*t.wStep/2,o=t.y*t.hStep+t.h*t.hStep/2,a=t.w*t.wStep,s=t.h*t.hStep;if(3==n||5==n||7==n){let e=Math.min(a,s);a=e,s=e}let c=e.wrapWidth,u=e.wrapHeight;return t.chartsOption=r,t.typeNum=n,t.txt=n+" "+i/c+" "+o/u+" "+a/c+" "+s/u,console.log(t.txt),t})),option:{colNum:r,margin:(null==e?void 0:e.margin)?null==e?void 0:e.margin:this.margin,isDraggable:!!(null==e?void 0:e.isDraggable)&&(null==e?void 0:e.isDraggable),isResizable:!!(null==e?void 0:e.isResizable)&&(null==e?void 0:e.isResizable),verticalCompact:!(null==e?void 0:e.verticalCompact)||(null==e?void 0:e.verticalCompact),useCssTransforms:!(null==e?void 0:e.useCssTransforms)||(null==e?void 0:e.useCssTransforms),rowHeight:e.wrapHeight/t,maRrows:t}}}simulateRandomSegments(e,t,r,n){const i=[];let o=e,a=n;for(;a>0;)if(1===a)i.push(o),a--;else{const e=Math.min(r,o-t*(a-1)),n=Math.floor(Math.random()*(e-t+1))+t;i.push(n),o-=n,a--}return i}simulateRandomSegments2(e,t,r,n){const i=[];let o=e,a=n;for(;a>0;)if(1==a){const t=e-i.reduce(((e,t)=>e+t),0);i.push(t),a--}else{let e=Math.floor(Math.random()*r),n=Math.max(t,e),s=o-t*a;const c=Math.min(n,s);i.push(c),o-=c,a--}return i}},Me=src.pool(),Ue=e=>{try{return JSON.parse(e)}catch(t){return e}},Le=new class{constructor(){this.requested=new Set,this.db=new Dexie$1("go-db"),this.init()}init(){return s(this,void 0,void 0,(function*(){this.db.version(1).stores({store:"key, value"})}))}pushCaseIdToRequested(e){this.requested.add(e)}add(e,t){return s(this,void 0,void 0,(function*(){try{(yield this.isExist(e))||(t.caseDetailData&&(t.caseDetailData="string"==typeof t.caseDetailData?Ue(t.caseDetailData):t.caseDetailData),this.pushCaseIdToRequested(e),yield this.db.table("store").add({key:e,value:t}))}catch(e){console.error(e)}}))}bulkPut(e){return s(this,void 0,void 0,(function*(){let t=yield Promise.all(e.map((e=>s(this,void 0,void 0,(function*(){const{caseId:t,id:r}=e,n=`${t}_${r}`;if(yield this.isExist(n))return null;if(e.caseDetailData){const t=yield Me.exec(Ue,[e.caseDetailData]);e.caseDetailData=t,Me.terminate()}return e})))));t=t.filter((e=>null!==e));const r=t.map((e=>{const{caseId:t,id:r}=e,n=`${t}_${r}`;return this.pushCaseIdToRequested(n),{key:n,value:e}}));this.db.table("store").bulkPut(r).then((()=>{})).catch((e=>console.error(e)))}))}get(e){return s(this,void 0,void 0,(function*(){if(!(yield this.isExist(e)))return null;const t=yield this.db.table("store").where("key").equals(e).first();return t?t.value:null}))}getAllData(){return s(this,void 0,void 0,(function*(){return yield this.db.table("store").toArray()}))}update(e,t){return s(this,void 0,void 0,(function*(){if(yield this.isExist(e)){const r=yield this.get(e),n=yield Me.exec(Ue,[t]);Me.terminate(),yield this.db.table("store").update(e,{value:Object.assign(Object.assign({},r),{caseDetailData:n})})}else console.error("update indexdb error")}))}delete(e){this.requested.delete(e),this.db.table("store").delete(e)}isExist(e){return s(this,void 0,void 0,(function*(){return(yield this.db.table("store").where("key").equals(e).count())>0}))}reset(){this.requested.clear(),this.db.table("store").clear()}clear(){return s(this,void 0,void 0,(function*(){yield this.db.table("store").clear()}))}isExistStore(){return s(this,void 0,void 0,(function*(){try{return yield this.db.open(),!0}catch(e){return!1}}))}},He=function(e){return s(this,void 0,void 0,(function*(){try{let{fontUrl:t,fontName:r}=e;const n="__custom_font__";let i=document.getElementById(n);if(!i){i=document.createElement("style"),i.id=n;const e=document.head||document.getElementsByTagName("head")[0];yield e.appendChild(i)}i.innerText+=`@font-face{font-family:'${r}';src:url(${t});}`}catch(e){console.warn(e)}}))},Be=(e,t="jspaths",r)=>s(void 0,void 0,void 0,(function*(){const n="csspaths"===t?"link":"script",i=document.createElement(n);"jspaths"===t?i.defer=!0:i.rel="stylesheet",i.className=t,i.src=e,(r||document.head||document.getElementsByTagName("head")[0]).appendChild(i),yield new Promise(((e,t)=>{i.addEventListener("load",e),i.addEventListener("error",e)}))})),ze=(e,t="jspaths")=>s(void 0,void 0,void 0,(function*(){const r="fonts"===t?He:Be;yield Promise.all(e.map((e=>r(e))))}));function Je(e){!function(e,t){e.depends?optionTheme_js.setOptionColorByTheme(e):Ge(e,!1)}(e)}function Ge(e,t=!0){let{theme:r,option:n,optionDes:i}=e;n&&i&&r&&Object.keys(i).forEach((o=>{"conditionSeries"!==i[o].type&&"tabs"!==i[o].type||!n[o]?i[o].theme?n.hasOwnProperty(o)&&function({theme:e,option:t,optionDes:r},n,i){let o;if("color"!=r[n].type||!i&&t[n]){if("bgcolor"==r[n].type&&(i||!t[n]||!t[n].style)){t[n]||(t[n]={});let{key:i,points:a,degree:s,type:c,opacity:u}=r[n].theme;if(a){s||(s=90),c||(c="linear");let r=`${c}-gradient(${s}deg`,i=100/(a.length-1),l=[];a.forEach(((t,n)=>{o=_e(e,t),r+=`,${We(o,t.opacity)} ${i*n}%`;let{red:a,green:s,blue:c,alpha:d}=Xe(o,u);l.push({red:a,green:s,blue:c,alpha:d,left:i*n})})),r+=")",t[n].style=r,t[n].degree=s,t[n].flag=a.length?3:2,t[n].points=l,t[n].type=c}else i&&(o=_e(e,r[n].theme),t[n]=Object.assign(Object.assign({},Xe(o,u)),{style:We(o,u)}))}}else{let{opacity:i}=r[n].theme;o=_e(e,r[n].theme),t[n]=We(o,i)}}(e,o,t):i[o].hasOwnProperty("type")&&"slot"!=i[o].type&&"textStyle"!=i[o].type&&"sheet"!=i[o].type||i[o].constructor!=Object||Ge({option:n[o],optionDes:i[o],theme:r},t):function(e,t,r,n,i,o){let a=t.form,s=e;if(Array.isArray(a))for(let e=0;e<a.length;e++){let t,r=a[e];t=o?s[e].form:s[e],Ge({option:t,optionDes:r,theme:n},i)}else{let e=s.length;for(let t=0;t<e;t++){let e;e=o?s[t].form:s[t],Ge({option:e,optionDes:a,theme:n},i)}}}(n[o],i[o],0,r,t,"conditionSeries"===i[o].type)}))}function _e(e,t){return e[t.key]?e[t.key]||e.color:t.key.indexOf(".")>-1?[e,...t.key.split(".")].reduce(((t,r)=>"object"==typeof t&&r in t?t[r]:(Ke(`属性${r}不存在,获取主题颜色错误,将使用默认主题色`),e.color))):(Ke(`属性${t.key}不存在,获取主题颜色错误,将使用默认主题色`),e.color)}function We(e,t){let{red:r,green:n,blue:i,alpha:o}=Xe(e,t);return`rgba(${r},${n},${i},${o})`}function Xe(e,t){return-1!=e.indexOf("#")&&(e=e.substr(1)),null==t&&(t=1),{red:parseInt("0x"+e.slice(0,2)),green:parseInt("0x"+e.slice(2,4)),blue:parseInt("0x"+e.slice(4,6)),alpha:t}}function Ke(e){console.warn(e)}class Qe{constructor(e){this.processedIds=new Set,e?(e.caseId&&(this.caseId=e.caseId),e.pageId&&(this.pageId=e.pageId),e.mode&&(this.mode=e.mode),e.environment&&(this.environment=e.environment),e.xhr&&(this.xhr=e.xhr),e.staticComponentData&&(this.staticComponentData=e.staticComponentData),e.theme&&(this.theme=e.theme)):console.log("初始化错误!"),this.defaultTheme={name:"科技蓝",color:"#006aee",background:"#00000033",pageBackground:"#051836",text:"#F0F0F0",groups:["#006aee","#00eae9","#00a9ec","#00ec80","#edc700","#9913ee"]}}checkHardware(){return s(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{e("Hardware is not available")}))}))}initBefore(){return new Promise(((e,t)=>{let r=p("secretFree");r?sessionStorage.setItem("secret-free",r):sessionStorage.setItem("secret-free",null),console.log("运行免登录设置完成!"),e(!0)}))}fetchCaseId(e,t){return s(this,void 0,void 0,(function*(){try{const r=yield this.getKey(e,t);return 2e4===(null==r?void 0:r.code)&&(null==r?void 0:r.data)?r.data:e}catch(t){return console.error("Error fetching caseId:",t),e}}))}getDataForPublish(){return new Promise(((e,t)=>{e("data")}))}onProjectLoaded(e){try{if(e)return void e(this.caseData)}catch(e){return console.error(e),caseData}return caseData}detectEnvironment(){return"localhost"===window.location.hostname?"preview":"publish"}authenticate(){return s(this,void 0,void 0,(function*(){this.environment}))}getShareForRelease(e){return this.xhr.get(`/go/v1/go-share/v1/${e}/config`)}findById(e,t="",r=0,n=""){return"publish"===this.environment?this.xhr.get(`/go/v1/go-share/v1/${e}?pwd=${t}&mode=${r}`):this.xhr.get(`/go/v1/go-cases/v1/${e}?mode=${r}`)}getKey(e,t=0){return this.xhr.get(`/go/v1/go-cases/v1/key/${e}?caseMode=${t}`)}getPageData(e,t){return s(this,void 0,void 0,(function*(){const r=yield Le.get(e+"_"+t);return r?{data:r}:"publish"===this.environment?this.xhr.get(`/go/v1/go-share/v1/${e}/pages/${t}`):this.xhr.get(`/go/v1/go-cases/v1/${e}/pages/${t}`)}))}getPageId(e,t){if(null==t?void 0:t.length){if(t.find((t=>t.id==e)))return e;let r=t.find((t=>t.caseDetailPath==e||t.caseDetailName==e));return r?r.id:e}return e}fetchProjectForId(e,t="",r=0,n=""){return s(this,void 0,void 0,(function*(){return yield this.findById(e,t,r,n)}))}updataPageData(e,t){return s(this,void 0,void 0,(function*(){let r=yield this.getPageDataForID(e,t);(null==r?void 0:r.data)?this.lifecycleHooks.onPageDataReady(r.data.caseDetailData):console.error("请求数据发生错误!")}))}getPageDataForID(e,t,r){return s(this,void 0,void 0,(function*(){const n=this.getPageId(t,this.projectInfo.details);if(this.processedIds.has(n)){console.log(`ID ${n} has already been processed.`);const t=yield Le.get(e+"_"+n);if(t)return{data:t}}const i=this.getPageData(e,n);this.processedIds.add(n),r&&r.length&&r.map((t=>s(this,void 0,void 0,(function*(){try{if(this.processedIds.has(t))return void console.log(`ID ${n} has already been processed.`);const r=yield this.getPageData(e,t);Le.add(e+"_"+t,r.data),this.processedIds.add(t)}catch(e){console.error(`Error processing ID ${t}: ${e}`)}}))));const o=yield i;return Le.add(e+"_"+n,o.data),yield i}))}fetchPageDataForId(e,t="",r=0,n=""){return s(this,void 0,void 0,(function*(){return yield this.findById(e,t,r,n)}))}setTheme(){console.log("设置主题")}setBackground(){console.log("设置背景信息")}updateVariables(){console.log("更新变量信息")}beforeRender(e){}renderComponents(){return s(this,void 0,void 0,(function*(){}))}setGlobalThemeVars(e){document.body.style.cssText=`\n --theme-background: ${e.background};\n --theme-color: ${e.color};\n --theme-pageBackground: ${e.pageBackground};\n --theme-text: ${e.text};\n ${e.groups.map(((e,t)=>`--theme-groups-${t}: ${e};`)).join("\n")}\n `}listenForRenderCompletion(){}showAnimation(){console.log("所有组件渲染完成,显示动画。")}setComTheme(e,t){var r,n;let i=null===(r=this.staticComponentData[t.viewComName])||void 0===r?void 0:r.optionDes,o=null===(n=this.staticComponentData[t.viewComName])||void 0===n?void 0:n.theme;return Je({theme:e,option:t.tmpData.option,optionDes:i,depends:o}),t}getComData(e,t,r,n){return s(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{if(e.tmpData&&e.tmpData.source){this.setComTheme(n,e);try{se(e,!0,t,r).then((t=>{t&&(e.source=t)})),i(1)}catch(e){i(e)}}else i("")}))}))}pageInit(e){var t;return s(this,void 0,void 0,(function*(){try{let r=null==e?void 0:e.caseDetailData,n=this.defaultTheme;if((null==r?void 0:r.theme)&&(n=r.theme),this.setGlobalThemeVars(n),r.resource){let e=(null===(t=null===window||void 0===window?void 0:window.anovuiConfig)||void 0===t?void 0:t.fonts)||[],n=_$1.concat(r.resource.fonts,e),i=_$1.cloneDeep(r.resource);i.fonts=n,yield(({jspaths:e=[],csspaths:t=[],fonts:r=[]})=>s(void 0,void 0,void 0,(function*(){const n=_$1.uniqBy(r,"fontName");yield Promise.all([ze(e,"jspaths"),ze(t,"csspaths"),ze(n,"fonts")])})))(i)}ge.clearVars(),ge.addVariables(r.globalVars);let i=ge.getAllVariables();return w(r.list,(e=>s(this,void 0,void 0,(function*(){yield this.getComData(e,i,r.globalSource,n)})))),r}catch(t){return console.warn("页面初始化发生错误:",t),(null==e?void 0:e.data)?e.data:e}}))}init(e){var t;return s(this,void 0,void 0,(function*(){try{this.lifecycleHooks=e;let r=yield this.fetchCaseId(this.caseId,this.mode);const n=yield this.fetchProjectForId(r);if(!n||2e4!=n.code||!n.data)return{error:!0};this.projectInfo=n.data,e.onCaseReady(n.data);let i=(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.details).map((e=>e.id)),o=this.getPageId(this.pageId,this.projectInfo.details);console.log(o,this.pageId,"this.pageId");let a=yield this.getPageDataForID(r,o||i[0],i);const s=yield this.pageInit(a.data);return e.onPageDataReady(s),{currentData:n.data,currentPageData:s}}catch(e){console.error("加载页面时出错:",e)}}))}}var index$3=Object.freeze({__proto__:null,ConfigOptimizer:Ce,GlobalVariables:fe,Http:J,Log:z,PageLoader:Qe,agentData:X,delFetchStatus:I,displayGenerator:qe,editItem:ne,emitEvent:we,fetchDataByGlobal:re,fetchDataByType:oe,filterData:ae,findItemDeep:x,findItemDeep2:C,getData:W,getDataForApi:K,getDataForSource:Z,getDataForStatic:ee,getDataForZb:Q,getDataForZbCQ:Y,getSessionData:v,getStandardData:m,getStringVars:D,getUrlParams:p,getVarDefaultVal:ye,globalVars:ge,hasVar:k,isJSON:f,recursion:w,replaceVariable:ce,safeEval:S,safeEvalForCode:A,setFetchStatus:O,setSessionData:g,updataGlobalDataSourceForVar:he,updateComData:se,updateGlobalDataSource:pe}),getInteractive=function(e,t,r,n,i){var o;try{var a={},s=[],c=[],u=[],l=_$1.cloneDeep(e);return(null===(o=null===window||void 0===window?void 0:window.go)||void 0===o?void 0:o.dev)&&recursion(e,(function(e){var t,r,n;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length)for(var i=0,o=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions;i<o.length;i++){var a=o[i];if("toggle"==a.behave){var s=a.toggle;if(null==s?void 0:s.length)for(var c=0,u=s;c<u.length;c++){var l=u[c],d=l.value;(null==d?void 0:d.length)&&(l.value=l.value.map((function(e){return{cid:e.cid,viewComName:e.viewComName,name:e.name,visible:e.visible}})))}}}})),recursion(l,(function(e){var t,r;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length){var n=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:n,element:e,actions:s,events:c,eventsComs:u,filter:i})}})),ge.addVariables(s),s=ge.getAllVariables(),recursion(l,(function(e){var t,r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.source;getShareVariableTree(r,s,e,a)})),{shareVariableTree:a,globalVars:ge.getAllVariables(),globalEvents:c.filter((function(e){return e})),eventsComs:u}}catch(e){return console.error("error",e),{}}},getInteractive2=function(e,t,r,n,i){var o;try{var a={},s=[],c=[],u=[],l=_$1.cloneDeep(e);return(null===(o=null===window||void 0===window?void 0:window.go)||void 0===o?void 0:o.dev)&&recursion(e,(function(e){var t,r,n;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length)for(var i=0,o=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions;i<o.length;i++){var a=o[i];if("toggle"==a.behave){var s=a.toggle;if(null==s?void 0:s.length)for(var c=0,u=s;c<u.length;c++){var l=u[c],d=l.value;(null==d?void 0:d.length)&&(l.value=l.value.map((function(e){return{cid:e.cid,viewComName:e.viewComName,name:e.name,visible:e.visible}})))}}}})),recursion(l,(function(e){var t,r;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length){var n=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:n,element:e,actions:s,events:c,eventsComs:u})}})),t&&t.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),t,!0)),r&&r.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),r,!0)),n&&n.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),n,!0)),recursion(l,(function(e){var t,r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.source;getShareVariableTree(r,s,e,a)})),s.filter((function(e){if(e.fork){var t=s.find((function(t){return t.mapField==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(t.mapField)}));(i?i==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(i):!!t)&&(Array.isArray(e.forkValue)?e.originalValue=e.forkValue.map((function(e){var t=s.find((function(t){return t.mapField==e}));if(t)return t.value})):e.originalValue=t.value)}})),{shareVariableTree:a,globalVars:s.filter((function(e){return i?(i==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(i))&&(e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue):(e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue),e})),globalEvents:c.filter((function(e){return e})),eventsComs:u}}catch(e){return console.error("error",e),{}}},checkVar=function(e,t){var r,n,i,o=!1,a=e.type,s=e.converse,c=e[a];if((null==s?void 0:s.use)&&(null===(r=null==s?void 0:s.data)||void 0===r?void 0:r.length))for(var u=0,l=s.data;u<l.length;u++){if((null==(v=l[u])?void 0:v.use)&&v.dependVars.includes(t)){o=!0;break}}if(o)return o;var d="",h="",f="";"api"==a&&(d=c.url,(null===(n=c.headers)||void 0===n?void 0:n.use)&&(h=c.headers.value),f=c.params),"datasource"==a&&(d=c.inputSql),"indicator"==a&&((null===(i=c.headers)||void 0===i?void 0:i.use)&&(h=c.headers.value),f=c.params);for(var p=/({{[\w]*}})|((@)[\w]*)/gm,m=0,g=[d,h,f];m<g.length;m++){var v,y=(v=g[m]).match(p);if((null==y?void 0:y.length)&&y.find((function(e){return e=="{{".concat(t,"}}")||e=="@".concat(t)}))){o=!0;break}}return o},executeFilter=function(e){return e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue,e},getShareTree=function(e,t){try{var r={},n=[],i=[];return recursion(e,(function(e){var o,a,s,c=null===(o=null==e?void 0:e.tmpData)||void 0===o?void 0:o.source;if(getShareVariableTree(c,t,e,r),null===(s=null===(a=null==e?void 0:e.tmpData)||void 0===a?void 0:a.actions)||void 0===s?void 0:s.length){var u=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:u,element:e,actions:n,events:i})}})),r}catch(e){return console.error(e),{}}},hasVar=function(e,t,r){var n,i,o,a,s=t[null==t?void 0:t.type],c=null==t?void 0:t.converse,u=!1;if(c&&c.use&&c.data.length)for(var l=0,d=c.data;l<d.length;l++){var h=d[l];if((null==h?void 0:h.dependVars)&&(null===(n=null==h?void 0:h.dependVars)||void 0===n?void 0:n.length)&&(null==h?void 0:h.dependVars.includes(e)))return u=!0}return(null==s?void 0:s.inputSql)&&(u=getStringVars(null==s?void 0:s.inputSql,r)),(null==s?void 0:s.url)&&(u=getStringVars(s.url,r)),(null==s?void 0:s.headers)&&(null===(i=null==s?void 0:s.headers)||void 0===i?void 0:i.use)&&(null===(o=null==s?void 0:s.headers)||void 0===o?void 0:o.value)&&(u=getStringVars(null===(a=null==s?void 0:s.headers)||void 0===a?void 0:a.value,r)),(null==s?void 0:s.params)&&(u=getStringVars(null==s?void 0:s.params,r)),u},getShareVariableTree=function(e,t,r,n){var i,o,a;if(e){var s=e[null==e?void 0:e.type],c=null==e?void 0:e.converse;c&&c.use&&c.data.length&&c.data.map((function(e){var t;(null==e?void 0:e.dependVars)&&(null===(t=null==e?void 0:e.dependVars)||void 0===t?void 0:t.length)&&e.dependVars.map((function(e){setShareVariableTreeData(n,e,r.cid)}))})),(null==s?void 0:s.inputSql)&&getStringVars(null==s?void 0:s.inputSql,t,r,n),(null==s?void 0:s.url)&&getStringVars(s.url,t,r,n),(null==s?void 0:s.headers)&&(null===(i=null==s?void 0:s.headers)||void 0===i?void 0:i.use)&&(null===(o=null==s?void 0:s.headers)||void 0===o?void 0:o.value)&&getStringVars(null===(a=null==s?void 0:s.headers)||void 0===a?void 0:a.value,t,r,n),(null==s?void 0:s.params)&&getStringVars(null==s?void 0:s.params,t,r,n)}},getStringVars=function(e,t,r,n){"string"!=typeof e&&(e=JSON.stringify(e));var i=e.match(/({{[\w]*}})|((@)[\w]*)/gm);if(i){var o=i.map((function(e){return e.replace(/{{|}}|@/gm,"")}));if(r)for(var a=function(e){var i=o[e];if(!i||!t||t.findIndex((function(e){return e.mapField===i}))<0)return"continue";r&&n&&setShareVariableTreeData(n,i,r.cid)},s=0;s<o.length;s++)a(s);else{var c=function(e){var i=o[e];return!i||!t||t.findIndex((function(e){return e.mapField===i}))<0?"continue":(r&&n&&setShareVariableTreeData(n,i,r.cid),{value:!0})};for(s=0;s<o.length;s++){var u=c(s);if("object"==typeof u)return u.value}}}return!1},setShareVariableTreeData=function(e,t,r){if(e[t]&&_$1.isArray(e[t])){e[t].push(r);var n=e[t];e[t]=_$1.uniq(n)}else e[t]=[],e[t].push(r)},isJSON=function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(e){return!1}return!1};function getStandardData(e,t){return void 0===t&&(t=!1),t?isJSON(e)?e:JSON.stringify(e):isJSON(e)?JSON.parse(e):e}var rightMenuMutaitons={delListItem:function(e,t){var r=_$1.cloneDeep(e.list);"string"==typeof t?findItemDeep$1(r,t,!0):t.forEach((function(e){findItemDeep$1(r,e,!0)})),e.list=r,e.globalVars=getInteractive(e.list,e.globalConstant,e.sysConst).globalVars},editCloneCache:function(e,t){var r=_$1.cloneDeep(e.cloneCache);r.length&&r.map((function(e){e.baseData=Object.assign({},e.baseData,t)})),e.cloneCache=r},cloneItem:function(e){if(e.selectd.length>0){e.cloneCache=[];for(var t=function(t){var r=findItemDeep$1(e.list,e.selectd[t]);if("boolean"!=typeof r){var n=_$1.cloneDeep(r);if(n.pid="",(null==n?void 0:n.stateChildren)||(null==n?void 0:n.children))((null==n?void 0:n.stateChildren)?null==n?void 0:n.stateChildren:null==n?void 0:n.children).forEach((function(e){var t,r,i,o,a=e.cid;if(e.cid=genID(),e.pid=n.cid,(null==n?void 0:n.stateChildren)&&(null===(r=null===(t=null==n?void 0:n.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.children)){var s=null===(o=null===(i=null==n?void 0:n.tmpData)||void 0===i?void 0:i.option)||void 0===o?void 0:o.children.find((function(e){return e.cid==a}));s&&(s.cid=e.cid)}}));e.cloneCache.push(n),window.localStorage.setItem("cloneCache",JSON.stringify(e.cloneCache))}},r=0;r<e.selectd.length;r++)t(r)}},shearItem:function(e,t){if(e.selectd.length>0){e.cloneCache=[];for(var r=0;r<e.selectd.length;r++){var n=findItemDeep$1(e.list,e.selectd[r],!0);if("boolean"!=typeof n){var i=_$1.cloneDeep(n);e.cloneCache.push(i)}}e.selectd=[]}},pasteItem:function(e){var t,r;try{var n=(null===(r=_$1.cloneDeep(e.cloneCache))||void 0===r?void 0:r.length)?_$1.cloneDeep(e.cloneCache):JSON.parse(window.localStorage.getItem("cloneCache"));if(n.length>0){var i=[],o={};recursion(n,(function(e){var t=genID();if(o[e.cid]=t,e.cid=t,e&&e.children)for(var r=0,n=e.children;r<n.length;r++){n[r].pid=e.cid}else if(e.stateChildren)for(var a=0,s=e.stateChildren;a<s.length;a++){s[a].pid=e.cid}if("dynamicComponent"==e.componentType){var c=void 0;e.dynamicChildren instanceof Map?c=e.dynamicChildren.get(e.activeDynamic):e.dynamicChildren instanceof Array&&(c=e.dynamicChildren.find((function(t){return t[0]==e.activeDynamic}))),c.length>1&&(Array.isArray(c[1])?c[1].forEach((function(t){t.pid=e.cid})):c.forEach((function(t){t.pid=e.cid}))),1==c.length&&c.forEach((function(t){t.pid=e.cid}))}i.push(e.cid)})),e.selectd.length>0?selectdArea(e.selectd,e.list):getPosition(n),n.forEach((function(e){var t,r,n,i;if(e.baseData.top=e.baseData.top+20,e.baseData.left=e.baseData.left+20,e&&e.hasOwnProperty("stateChildren")&&(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.children))for(var o=function(t){t.pid=e.cid;var r=null===(i=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.option)||void 0===i?void 0:i.children.find((function(e){return e.disName==t.name}));r&&(r.cid=t.cid)},a=0,s=e.stateChildren;a<s.length;a++){o(s[a])}}));try{var a=Object.keys(o),s=JSON.stringify(n);(null==a?void 0:a.length)&&a.forEach((function(e){var t=o[e];-1!==s.indexOf(e)&&(s=s.replaceAll(null==e?void 0:e.toString(),null==t?void 0:t.toString()))})),n=JSON.parse(s)}catch(e){}(t=e.list).unshift.apply(t,_$1.cloneDeep(n)),e.selectd=i}}catch(e){console.warn(e)}},updataShow:function(e,t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=!r.isShow;updataAttribute(r,"isShow",n,"")}},changeShow:function(e,t){var r=t.cid,n=t.flag,i=findItemDeep$1(e.list,r);i&&updataAttribute(i,"isShow",n,"")},comToggle:function(e,t){var r=findItemDeep$1(e.list,t);r&&comToggle(r)},updataLock:function(e,t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=!r.isLock;updataAttribute(r,"isLock",n,"")}},breakUp:function(e,t){var r,n;try{if(!t)throw"Please pass in the component CID correctly!";var i=findParentDeep(e.list,t),o=findItemDeep$1(e.list,t),a=o.baseData;if(isNaN(a.left)||isNaN(a.top))throw new Error("top or left is NAN");var s=breakUp(o,e.list);if(s.map((function(e){return e.pid=""})),i){var c=i.children.findIndex((function(e){return e.cid==t}));i.children.splice(c,1),(r=i.children).push.apply(r,s.reverse())}else{c=e.list.findIndex((function(e){return e.cid==t}));e.list.splice(c,1),(n=e.list).push.apply(n,s.reverse())}}catch(e){console.error(e)}},editGroup:function(e,t){var r,n=t.groupId;t.status;try{if(!n)throw"Please pass in the component CID correctly!";var i=e.list.findIndex((function(e){return e.cid===n})),o=e.list[i],a=breakUp(o);a.map((function(e){return e.pid=""})),e.list.splice(i,1),(r=e.list).push.apply(r,a)}catch(e){console.error(e)}},combination:function(e){_$1.cloneDeep(e.list);var t,r,n=[],i=[],o=genID(),a=findItemDeep$1(e.list,e.selectd[0]);a.pid?console.info("Sorry, only level 2 is supported group"):a.children&&1===e.selectd.length?console.info("Sorry, only level 2 is supported group"):(e.selectd.forEach((function(t){var r=e.list.findIndex((function(e){return e.cid===t}));if(r>-1){n.push(r);var a=e.list.splice(r,1)[0];a.pid=o,i.push(a)}})),t=n.sort((function(e,t){return e-t}))[0],r=1===i.length?_$1.cloneDeep(i[0].baseData):e.currentArea,Object.assign(r,{angle:0,opacity:100,rotate:0,rotateY:0}),setPositionForGroup(r,i),e.list.splice(t,0,{cid:o,pid:"",isShow:!0,isLock:!1,editer:!1,baseData:r,z:0,toggle:!0,name:"群组",type:"folder",origin:"anov-ui",tmpData:{actions:null,option:null,source:globalSourceTemp},children:i}),setIndex(e.list),e.selectd=[o])},moveUp:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>=1?arraySwap(e.list,r-1,r):arraySwapDeep(e.list,"up",t)}catch(e){console.error(e)}},moveDown:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>-1&&r<=e.list.length-2?arraySwap(e.list,r+1,r):arraySwapDeep(e.list,"down",t)}catch(e){console.error(e)}},moveTop:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>-1&&0!==r?arraySwap(e.list,0,r):arraySwapDeep(e.list,"top",t)}catch(e){console.error(e)}},moveBottom:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t})),n=e.list.length-1;r>-1&&r!==n?arraySwap(e.list,n,r):arraySwapDeep(e.list,"bottom",t)}catch(e){console.error(e)}}};function setComActions(e){var t=[],r=[];recursion(_$1.cloneDeep(e),(function(e){var n,i;if(null===(i=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions)||void 0===i?void 0:i.length){var o=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:o,element:e,actions:t,events:r})}}));var n=r.filter((function(e){return e}));return{actions:t,events:n}}var eventMutations={addGlobalSource:function(e,t){var r=t.name,n=t.value,i=genID();e.globalSource.push({key:i,name:r,value:n}),pe({key:i,name:r,value:n},e.globalVars,e.globalSource,e.list,(function(e){}))},editGlobalSource:function(e,t){var r=this,n=t.key,i=t.value,o=e.globalSource.find((function(e){return e.key==n}));o&&(o.name=t.name,o.value=i,pe(o,e.globalVars,e.globalSource,e.list,(function(e,t){r.commit("GoCom/updataSourceForComponent",{cid:e.cid,data:t})})))},delGlobalSource:function(e,t){try{var r=e.globalSource.findIndex((function(e){return e.key===t}));-1!==r&&e.globalSource.splice(r,1)}catch(e){console.error("删除错误",e)}},setSyncFlag:function(e,t){e.syncFlag=t},goUpShareVar:function(e,t){e.shareVariable[t.key]=__assign$1({},t)},addGoRunVar:function(e,t){try{var r=getInteractive(e.list,e.globalConstant,e.sysConst);e.globalVars=r.globalVars,e.eventsComs=r.eventsComs}catch(e){console.warn(e)}},copyGoVar:function(e,t){try{for(var r=t.mapField,n=(r.toString().trim(),e.globalConstant.filter((function(e){return e.mapField.includes(r)}))),i=1,o=0;o<n.length;o++)i++;var a="".concat(r," (").concat(i,")"),s=e.globalConstant.find((function(e){return e.mapField==r}));if(r&&s){var c=_$1.cloneDeep(s);c.mapField=a,e.globalConstant.push(c);var u=getInteractive(e.list,e.globalConstant,e.sysConst);e.globalVars=u.globalVars,e.eventsComs=u.eventsComs}}catch(e){console.warn(e)}},goDelShareVar:function(e,t){delete e.shareVariable[t]},signal:function(e,t){},goSynchroDataAll:function(e,t){e.list=_$1.cloneDeep(t)},goSynchroDataForOption:function(e,t){if(e){var r=t.cid,n=t.value,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&i&&updataAttributeForOption(i,n)}this.commit("GoCom/execute")},goSynchroData:function(e,t){if(e){var r=t.cid,n=t.attr,i=t.value,o=t.attrModel,a=findItemDeep$1(e.list,r);if("boolean"!=typeof a){if(a&&updataAttribute(a,n,i,o),"actions"===n.toLowerCase()){var s=e.list,c=_$1.uniqWith(_$1.concat(setComActions(s).actions,setComActions(e.caseList).actions),_$1.isEqual),u=_$1.uniqWith(_$1.concat(setComActions(s).events,setComActions(e.caseList).events),_$1.isEqual);ge.addVariables(c),e.globalVars=ge.getAllVariables(),e.globalEvents=u,e.pages[e.pageIndex]&&(e.pages[e.pageIndex].globalVars=c),e.pages[e.pageIndex]&&(e.pages[e.pageIndex].globalEvents=u)}if("source"===n){if(!a.tmpData.source)return!1;var l=a.tmpData.source,d=l.type;if("api"===d){var h=l[d].url.match(/{{[\w]*}}|(@)[\w]*/gm);if(h)for(var f=h.map((function(e){return e.replace(/{{|}}|@/gm,"")})),p=function(t){var r=f[t];if(!r||!e.globalVars||e.globalVars.findIndex((function(e){return e.mapField===r}))<0)return"continue";if(e.shareVariableTree||(e.shareVariableTree={}),e.shareVariableTree[r]&&_$1.isArray(e.shareVariableTree[r])){e.shareVariableTree[r].push(a.cid);var n=e.shareVariableTree[r];e.shareVariableTree[r]=_$1.uniq(n)}else e.shareVariableTree[r]=[],e.shareVariableTree[r].push(a.cid)},m=0;m<f.length;m++)p(m)}}}}this.commit("GoCom/execute")},goUpdataSysVars:function(e,t){var r={U_CITY:"cityCode",U_COUNTY:"countyCode",U_PROVINCE:"provinceCode",U_PHONE:"userPhone"},n=e.sysConst,i=Object.keys(r);n.map((function(e){if(e.originalValue=e.value,(null==e?void 0:e.name)&&(null==i?void 0:i.includes(e.name))){var n=r[e.name];e.value=t[n],e.originalValue=t[n]}return e})),ge.addVariables(n)},resetGlobalData:function(e){e.globalVars=e.sysConst,e.globalConstant=[],e.globalSource=[]},updateGlobalRelatedVars:function(e,t){var r=t.run,n=t.gvData;return r.length&&r.forEach((function(e){var t=n.filter((function(t){return t.mapField==e.mapField||t.fork&&t.forkValue==e.mapField}));if(t.length)for(var r=0,i=t;r<i.length;r++){var o=i[r],a=e.value;o.mapField==e.mapField?o.value=a:o.fork&&e.mapField==o.forkValue?(o.converter&&o.converterCode,o.originalValue=a):n.push(e)}})),n}},comTreeMutations={updataList:function(e,t){var r=t.cid,n=produceWithImmer(t.list,(function(e){var t=findItemDeep$1(e,r),n=t.pid,i=getAncestorsNodes(e,r),o=function(e){for(var t=0;t<e.length;t++){var r=e[t];upDataGroup(r,r.baseData,null,!0)}},a=function(e){return e.reduce((function(e,t){return{left:e.left+t.baseData.left,top:e.top+t.baseData.top}}),{left:0,top:0})},s=function(e,t){void 0===t&&(t=e);for(var r=0;r<e.length;r++){var n=e[r];if(n.children&&Array.isArray(n.children))return 0===n.children.length?(t.splice(r,1),!0):(s(n.children,n.children)&&0===n.children.length&&t.splice(r,1),!0)}};if(i.length>0)if(t.pid=i[0].cid,n){var c=__spreadArray$1([findItemDeep$1(e,n)],getAncestorsNodes(e,n),!0),u=a(c),l=a(i);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,u)),t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,l,1)),o(c),o(i)}else{l=a(i);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,l,1)),o(i)}n&&0==i.length&&(t.pid="",function(t,r){var n=getAncestorsNodes(e,r),i=findItemDeep$1(e,r);if(0===n.length)t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,i.baseData));else{n=__spreadArray$1([i],n,!0);var s=a(n);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,s))}o(__spreadArray$1([i],n,!0))}(t,n)),s(e),setIndex(e)}));e.list=n},updataListForContrast:function(e,t){var r=t.cid,n=t.list,i=findItemDeep$1(n,r);findParentDeep(n,r);var o=findParentDeep(e.list,r);if(!i.pid){i.pid=o.cid;var a=_$1.cloneDeep(i.baseData),s=transformPosition(i.baseData,o.baseData,1);Object.assign(i.baseData,s),upDataGroup(o,a)}setIndex(e.list)},updateTree:function(e){for(var t=e.list,r=0;r<t.length;r++){var n=t[r];if(n.pid)(a=findItemDeep$1(t,n.pid))&&Object.assign(n.baseData,transformPosition(n.baseData,a.baseData));if(n.children)for(var i=0;i<n.children.length;i++){var o=n.children[i];if(o.pid!=n.cid){var a=findItemDeep$1(t,o.pid);if(_$1.cloneDeep(o.baseData),a){Object.assign(o.baseData,transformPosition(o.baseData,a.baseData));var s=transformPosition(o.baseData,n.baseData,1);Object.assign(o.baseData,s),upDataGroup(n,n.baseData)}o.pid=n.cid}}}setIndex(t)}},ERR_OK=200,ERR_OK2=2e4,TIMEOUT=3e4,STATUS="status",xhr=function(t,r){void 0===t&&(t="");var n=e.create({baseURL:t,timeout:TIMEOUT,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}});return n.interceptors.request.use((function(e){return sessionStorage.getItem("anov-go-token")&&"null"!=sessionStorage.getItem("anov-go-token")&&(e.headers["X-ANOV-ACCESS-TOKEN"]=sessionStorage.getItem("anov-go-token")),sessionStorage.getItem("unify-access-token")&&"null"!=sessionStorage.getItem("unify-access-token")&&(e.headers["X-UNIFY-ACCESS-TOKEN"]=sessionStorage.getItem("unify-access-token")),sessionStorage.getItem("dgcc_authorization")&&"null"!=sessionStorage.getItem("dgcc_authorization")&&(e.headers.dgcc_authorization=sessionStorage.getItem("dgcc_authorization")),"post"===e.method?(e.headers["Content-Type"]="application/json;",e):"get"===e.method?e:"put"===e.method?(e.headers["Content-Type"]="application/json; charset=UTF-8",e):"delete"===e.method?e:void 0}),(function(e){return Promise.reject(e)})),n.interceptors.response.use((function(e){return e[STATUS]===ERR_OK||e.data.code,r&&r(e),e.data}),(function(e){return r&&r(null==e?void 0:e.response),Promise.reject(e.response)})),n},Http=function(e,t){return xhr(e,t)},filterData=ae,parseSource=function(e,t,r,n,i,o,a,s){void 0===n&&(n=!0);console.log(t,r,n,i,"callback"),se(t,n,r,[],(function(e){i(e),("AnContainer"===(null==t?void 0:t.viewComName)&&n||"AnGridLayout"===(null==t?void 0:t.viewComName)&&n)&&UpdataForContainer(t)}),s)},updateComData=function(e,t,r,n,i,o,a){return void 0===r&&(r=!0),__awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,se(e,r,t,i,(function(e){n&&n(e)}),a)];case 1:return[2,s.sent()];case 2:return o=s.sent(),n&&n(o),console.log("error:11"+o),[3,3];case 3:return[2]}}))}))},autoUpdateComData=function(e,t,r){var n,i,o,a,s,c=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.source,u=null===(o=null===(i=c[null==c?void 0:c.type])||void 0===i?void 0:i.autoUpdate)||void 0===o?void 0:o.open,l=null===(s=null===(a=c[null==c?void 0:c.type])||void 0===a?void 0:a.autoUpdate)||void 0===s?void 0:s.time;u&&_$1.isNumber(l)&&l>0&&setInterval((function(){updateComData(e,t,!0,(function(t){r({cid:e.cid,data:t})}))}),1e3*l)},refreshData=function(e,t,r,n,i,o){void 0===o&&(o=!0),e&&se(e,o,t,[],(function(t){r({cid:e.clientWidth,data:t})}))},index$2=Object.freeze({__proto__:null,Http:Http,autoUpdateComData:autoUpdateComData,axios:e,filterData:filterData,getDataForEvaluator:getDataForEvaluator,parseSource:parseSource,refreshData:refreshData,updateComData:updateComData}),loadFontResource=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=e.fontUrl,r=e.fontName,n="__custom_font__",(i=document.getElementById(n))?[3,2]:((i=document.createElement("style")).id=n,[4,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)]);case 1:a.sent(),a.label=2;case 2:return i.innerText+="@font-face{font-family:'".concat(r,"';src:url(").concat(t,");}"),[3,4];case 3:return o=a.sent(),console.warn(o),[3,4];case 4:return[2]}}))}))},loadScript=function(e,t,r){return void 0===t&&(t="jspaths"),__awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n="csspaths"===t?"link":"script",i=document.createElement(n),"jspaths"===t?i.defer=!0:i.rel="stylesheet",i.className=t,i.src=e,(r||document.head||document.getElementsByTagName("head")[0]).appendChild(i),[4,new Promise((function(e,t){i.addEventListener("load",e),i.addEventListener("error",e)}))];case 1:return o.sent(),[2]}}))}))},addTag=function(e,t){return void 0===t&&(t="jspaths"),__awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r="fonts"===t?loadFontResource:loadScript,[4,Promise.all(e.map((function(e){return r(e)})))];case 1:return n.sent(),[2]}}))}))},loadFont=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return e.fonts&&e.fonts.length?[4,addTag(e.fonts,"fonts")]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},loadTag=function(e){var t=e.jspaths,r=void 0===t?[]:t,n=e.csspaths,i=void 0===n?[]:n,o=e.fonts,a=void 0===o?[]:o;return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=_$1.uniqBy(a,"fontName"),[4,Promise.all([addTag(r,"jspaths"),addTag(i,"csspaths"),addTag(e,"fonts")])];case 1:return t.sent(),[2]}}))}))},removeTag=function(){removeFont(),Array.from(document.getElementsByTagName("script")).filter((function(e){return"jspaths"==e.className})).forEach((function(e){removeScript(e.src)})),Array.from(document.getElementsByTagName("link")).filter((function(e){return"csspaths"==e.className})).forEach((function(e){removeCss(e.href)}))};function removeScript(e){for(var t,r=Array.from(document.getElementsByTagName("script")),n=0;n<r.length;n++)r[n]&&r[n].src&&-1!=r[n].src.indexOf(e)&&(null===(t=r[n])||void 0===t?void 0:t.parentNode)&&r[n].parentNode.removeChild(r[n])}function removeCss(e){for(var t,r=Array.from(document.getElementsByTagName("link")),n=0;n<r.length;n++)r[n].href,r[n]&&r[n].href&&-1!=r[n].href.indexOf(e)&&(null===(t=r[n])||void 0===t?void 0:t.parentNode)&&r[n].parentNode.removeChild(r[n])}function removeFont(){var e=document.getElementById("__custom_font__");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)}var toolMutations={reset:function(e){e.selectd=[],e.list=[],e.plant=null,e.tw=null,e.watermark=null,e.endnotes=null,e.globalConstant=[]},setFonts:function(e,t){e.resource.fonts.push({fontName:t.name,fontUrl:t.src}),loadFont(e.resource)},setCaseInfo:function(e,t){e.caseInfo=t},setPageId:function(e,t){e.pageId=t},pagePush:function(e,t){try{var r=t.type,n=t.value,i=t.option,o=["name","path","id"];if(!o.includes(r))throw new Error("页面跳转错误!".concat(r," 不是一个正确的参数 请填以下参数 ").concat(o.join(",")));if(!n)throw new Error("页面跳转错误!".concat(r," 不是一个正确的参数 请填正确的页面路径或者页面名称"));e.toPage=i?{type:r,value:n,option:i}:{type:r,value:n}}catch(e){console.warn(e)}},updatComs:function(e,t){var r=this,n=findItemDeep$1(e.list,t);if("boolean"!=typeof n){(null==n?void 0:n.children)&&(null==n||n.children),updateComData(n,e.globalVars,!0,(function(e){r.commit("GoCom/updataSourceForComponent",{cid:n.cid,data:e})}),e.globalSource)}},updatComsForVar:function(e,t){var r=e.globalVars.map((function(e){var r,n;if((null===(r=null==e?void 0:e.forkValue)||void 0===r?void 0:r.length)&&(null===(n=null==e?void 0:e.forkValue)||void 0===n?void 0:n.includes(t))||e.forkValue==t)return e.mapField})).filter((function(e){return e})),n=[t];(null==r?void 0:r.length)&&(n=_$1.uniq(__spreadArray$1([t],r,!0)));for(var i=[],o=0,a=n;o<a.length;o++){var s=a[o];e.shareVariableTree[s]&&i.push.apply(i,e.shareVariableTree[s])}if(null==i?void 0:i.length)for(var c=0,u=i;c<u.length;c++){var l=u[c];this.commit("GoCom/updatComs",l)}},addConstant:function(e,t){var r=_$1.find(e.constant,{name:t.name});r?Object.assign(r,t):e.constant.push(t)},editConstant:function(e,t){var r=_$1.find(e.constant,{name:t.name});r&&Object.assign(r,t)},delConstant:function(e,t){_$1.remove(e.constant,(function(e){return e.name==t}))},setResource:function(e,t){var r=t.type,n=t.value;e.resource[r]=n,removeTag(),loadTag(e.resource)},updataResource:function(e){removeTag(),loadTag(e.resource)},resetResource:function(e){e.resource={jspaths:[],csspaths:[],otherpaths:[]}},setData:function(e,t){e.selectd=t.selectd},setList:function(e,t){e.list=t,setIndex(e.list)},saveDynamicChildren:function(e,t){var r=t.cid,n=t.data,i=t.name,o=e.pages[e.pageIndex].list,a=findItemDeep$1(o,r);a&&(a.activeDynamic=i,a.dynamicChildren instanceof Array&&(a.dynamicChildren=new Map(a.dynamicChildren)),a.dynamicChildren.set(i,n))},setTheme:function(e,t){e.theme=t},setPlant:function(e,t){var r=t.attr,n=t.value;e.plant||(e.plant={name:"",theme:null,baseData:{width:1920,height:1080,left:0,top:0},option:null,optionDes:null}),e.plant[r]=n},setPlantHeight:function(e,t){e.plant&&(e.plant.baseData.height=e.plant.baseData.height+t)},reversal:function(e,t){e.undos=[],e.undoRedoPointer=-1;var r=_$1.cloneDeep(t.globalVars);delete t.globalVars,e=Object.assign(e,t),ge.addVariables(r),e.globalVars=ge.getAllVariables(),setIndex(e.list)},setComTmp:function(e,t){var r=e.list.find((function(e){return e.cid===t[0]}));r.com=t[1],r.tmp=t[2]},setLoading:function(e,t){var r=t.cid,n=t.flag,i=e.list.find((function(e){return e.cid===r}));i&&(i.loading=n)},setMultiple:function(e,t){e.multiple=t},setCaseList:function(e,t){e.caseList=t},updataComponentForList:function(e,t){var r=t.cid,n=t.data,i=e.list,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataComponentForCaseList:function(e,t){var r=t.cid,n=t.data,i=e.caseList,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataComponent:function(e,t){var r=t.cid,n=t.data,i=e.pages&&e.pages[0]&&e.pages[0].list&&e.pages[0].list.length?e.pages[0].list:e.list,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataArea:function(e,t){e.currentArea.left+=t.deltaX,e.currentArea.top+=t.deltaY},updataSource:function(e,t){var r=t.cid,n=t.data,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&("indicatorCQ"===i.tmpData.source.type?i.tmpData.source.indicator.data=n:(console.log("更新数据:"+i.cid),i.tmpData.source[i.tmpData.source.type].data=n))},updataSourceForComponent:function(e,t){var r=t.cid,n=t.data;if(e.list.length){var i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.source=_$1.cloneDeep(n))}},updataAnimationForComponent:function(e,t){var r=t.cid,n=t.data;if(e.list.length){var i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.tw=n)}},updataWatermark:function(e,t){e.watermark=t},updataEndnotes:function(e,t){e.endnotes=t},updataAnimation:function(e,t){e.tw=t},setContext:function(e,t){var r=t.cid,n=t.data,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.example=n)},setContextList:function(e,t){var r=t.cid,n=t.data;e.contextList[r]=n},setPosition:function(e,t){setPositionForWorld(e.list.find((function(e){return e.cid===t[0]})),t[1])},setSelect:function(e,t){e.cache=[],e.selectd=t instanceof Array?t:[t],e.selectd.length>1&&e.selectd.forEach((function(t){e.cache.push(e.list.find((function(e){return e.cid===t&&"Other.Plant.Normal"!==e.type})))}))},setActive:function(e,t){var r=_$1.cloneDeep(t),n=r.id,i=r.multiple,o=r.origin,a=r.ctr,s=_$1.cloneDeep(e.selectd);if(i){var c=s.includes(n);if(s.length>=1){var u=s.every((function(r){return isPeer(e.list,r,t.id)}));if(!u)return void console.info("sorry Only sibling elements can be selected!")}c?s.splice(s.findIndex((function(e){return e===n})),1):s.push(n),e.selectd=s}else e.selectd=[n];e.selectd.forEach((function(t){var r=findItemDeep$1(e.list,t);if(r.pid){var n=findItemDeep$1(e.list,r.pid);n&&(n.toggle=!0)}a||(r.toggle=!0)})),e.selectdChangeOrigin=o||""},setCache:function(e){e.cache=[],e.selectd.length>1&&e.selectd.forEach((function(t){e.cache.push(e.list.find((function(e){return e.cid===t})))}))},clearActive:function(e){e.selectd=[]},setMultipleActive:function(e,t){e.selectd=t},syncMenuInfo:function(e){RecursiveList(e.menuList,(function(t){var r=10*t.lv+t.index;e.list.filter((function(e){return e.cid===t.id}))[0].z=1e4-r}))},addComs:function(e,t){var r=t.com,n=t.isMobile;"MultiStateComponent"!=r.componentType||r.stateChildren||(r.stateChildren=[]),"dynamicComponent"!=r.componentType||r.dynamicChildren||(r.dynamicChildren=new Map,r.activeDynamic="状态1",r.dynamicChildren.set("状态1",[]),r.lines={h:[],v:[]},"AnGridLayout"==r.viewComName&&r.dynamicChildren.set("状态1",null==r?void 0:r.AnGridChildren)),n?e.list.push(r):e.list.unshift(r),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},addComsForParent:function(e,t){var r=t.com,n=t.isMobile,i=t.PID;if("MultiStateComponent"!=r.componentType||r.stateChildren||(r.stateChildren=[]),"dynamicComponent"!=r.componentType||r.dynamicChildren||(r.dynamicChildren=new Map,r.activeDynamic="状态1",r.dynamicChildren.set("状态1",[])),i){var o=findItemDeep$1(e.list,i);n?(o.children=[],o.children.push(r)):o.children.unshift(r)}else n?e.list.splice(0,1,r):e.list.unshift(r);e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},addMyComs:function(e,t){var r;try{var n=t.data,i=t.shareVariableTree,o=t.globalVars,a=t.globalEvents;e.globalVars=_$1.uniq(_$1.concat(_$1.cloneDeep(e.globalVars),o)),e.globalEvents=_$1.uniq(_$1.concat(_$1.cloneDeep(e.globalEvents),a));var s=Object.keys(i),c=Object.keys(e.shareVariableTree),u=_$1.difference(s,c);u.length?u.forEach((function(t){e.shareVariableTree[t]=_$1.concat(_$1.cloneDeep(e.shareVariableTree[t]),i[t])})):e.shareVariableTree=Object.assign(_$1.cloneDeep(e.shareVariableTree),i),n instanceof Array?(resetID(n),(r=e.list).unshift.apply(r,n)):(resetID([n]),e.list.unshift(n)),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")}catch(e){}},addStateChildren:function(e,t){var r=findItemDeep$1(e.list,t.pid);r&&r.stateChildren.push(t)},addDynamicChildren:function(e,t){var r=findItemDeep$1(e.list,t.pid);r&&r.dynamicChildren.push(t)},arraySwap:function(e,t){var r;try{if(!t||2!=t.length)throw new Error("参数错误,方法接受两个组件的CID组成的数组!");var n=_$1.cloneDeep(e.list),i=findItemDeep$1(n,t[0]),o=findItemDeep$1(n,t[1]),a=findItemDeep$1(n,i.pid),s={},c=0,u=0;if(o)if("selectContainer"==o.componentType){var l=findItemDeep$1(n,t[1]);a?(c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],a.children=a.children.filter((function(e){return e.cid!==s.cid}))):(s=findItemDeep$1(n,t[0]),n=n.filter((function(e){return e.cid!==s.cid}))),s.cid=genID(),s.pid=l.cid,l.children.push(s)}else if(i.pid||o.pid)if(a)if(c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],i.pid!==o.pid){l=findItemDeep$1(n,o.pid);u=_$1.findIndex(l.children,(function(e){return e.cid==t[1]}));d=l.children[u];s.cid=genID(),s.pid=l.cid,d.cid=genID(),d.pid=a.cid,a.children.splice(c,1,d),l.children.splice(u,1,s)}else u=_$1.findIndex(a.children,(function(e){return e.cid==t[1]})),(r=a.children).splice.apply(r,__spreadArray$1([u,1],a.children.splice(c,1,a.children[u]),!1));else{var l=findItemDeep$1(n,o.pid);c=_$1.findIndex(n,(function(e){return e.cid==t[0]})),u=_$1.findIndex(l.children,(function(e){return e.cid==t[1]})),s=findItemDeep$1(n,i.cid);var d=l.children[u];s.cid=genID(),s.pid=l.cid,d.cid=genID(),d.pid=null,n.splice(c,1,d),l.children.splice(u,1,s)}else arraySwapForId(e.list,t[0],t[1]);else c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],a.children.splice(c,1),s.cid=genID(),s.pid=null,n.push(s);e.list=n,setIndex(e.list)}catch(e){console.warn("组件位置交换发生错误",e)}},changeDynamicState:function(e,t){var r=findItemDeep$1(e.list,t.cid);r&&"dynamicComponent"==r.componentType&&(r.dynamicChildren instanceof Array&&r.dynamicChildren.find((function(e){return e[0]==t.activeName}))||r.dynamicChildren instanceof Map&&r.dynamicChildren.has(t.activeName)?r.activeDynamic=t.activeName:console.error(t.activeName+"不是一个正确的状态"))},addAlternateData:function(e,t){e.alternateData[t.pid]||(e.alternateData[t.pid]=[]),e.alternateData[t.pid].push(t)},setOptionForCom:function(e,t){var r;try{var n=t.cid,i=t.key,o=t.value,a=findItemDeep$1(e.list,n);if(!a)return;if("string"!=typeof i)return void console.error("key:[".concat(i,"]格式错误"));var s=null===(r=null==a?void 0:a.tmpData)||void 0===r?void 0:r.option,c=i.split(".");s&&(null==c?void 0:c.length)&&c.forEach((function(e,t){s.hasOwnProperty(e)&&(t===c.length-1?s[e]=o:s=s[e])}))}catch(e){console.warn("同步属性发生错误:"+e)}},mergeConfig:function(e,t){t.length>0&&t.forEach((function(t){e.list.unshift(t)})),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},updataName:function(e,t){var r=findItemDeep$1(e.list,t.cid);r&&(r.name=t.name)},setDynamicActive:function(e,t){t.cid;var r=t.name,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.activeDynamic=r)},updataScroll:function(e,t){t.cid;var r=t.data,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.srcollInfo={use:!!(null==r?void 0:r.use)&&(null==r?void 0:r.use),data:(null==r?void 0:r.data)?null==r?void 0:r.data:null})},updataDySetting:function(e,t){t.cid;var r=t.data,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.dyOption=r)},setCurrentEdited:function(e,t){if(t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=breakUp(r);r.children=n}e.currentEditerCid=t}else e.currentEditerCid=""},setDynamicLine:function(e,t){var r=_$1.cloneDeep(e.list),n=findItemDeep$1(r,t.cid);r.length&&"boolean"!=typeof n&&(n.lines=Object.assign({},n.lines,t.lines)),e.list=r}},findArray=function(e,t){try{var r=e.map((function(e){var r=findItemDeep$1(t,e);if("object"==typeof r)return r;throw"Please check whether the input and output parameters are correct!"}));if(_$1.every(r,Object))return r;throw"Please check whether the input and output parameters are correct!"}catch(e){return console.error(e),[]}},alignLeft=function(e,t){1===e.length&&(e[0].baseData.left=0);var r=_$1.sortBy(e,(function(e){return e.baseData.left})),n=r[0].baseData.left;e.map((function(e){return e.baseData.left=n}))},alignRight=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.left=r.width-e[0].baseData.width}var n=_$1.sortBy(e,(function(e){return e.baseData.left})),i=1*n[n.length-1].baseData.left+1*n[n.length-1].baseData.width;e.map((function(e){return e.baseData.left=i-1*e.baseData.width}))},horizontally=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.left=r.width/2-e[0].baseData.width/2}var n=_$1.sortBy(e,(function(e){return e.baseData.left})),i=_$1.sortBy(e,(function(e){return 1*e.baseData.left+1*e.baseData.width})),o=(1*n[0].baseData.left+(1*i[i.length-1].baseData.left+1*i[i.length-1].baseData.width))/2;e.map((function(e){return e.baseData.left=o-e.baseData.width/2}))},alignTop=function(e,t){1===e.length&&(e[0].baseData.top=0);var r=_$1.sortBy(e,(function(e){return e.baseData.top})),n=1*r[0].baseData.top;e.map((function(e){return e.baseData.top=n}))},alignBottom=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.top=r.height-e[0].baseData.height}var n=_$1.sortBy(e,(function(e){return 1*e.baseData.top})),i=1*n[n.length-1].baseData.top+1*n[n.length-1].baseData.height;e.map((function(e){return e.baseData.top=i-1*e.baseData.height}))},verticalCenter=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.top=r.height/2-e[0].baseData.height/2}var n=_$1.sortBy(e,(function(e){return e.baseData.top})),i=_$1.sortBy(e,(function(e){return 1*e.baseData.top+1*e.baseData.height})),o=(1*n[0].baseData.top+(1*i[i.length-1].baseData.top+1*i[i.length-1].baseData.height))/2;e.map((function(e){return e.baseData.top=o-e.baseData.height/2}))},topDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top})),r=(t[t.length-1].baseData.top-t[0].baseData.top)/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.top=1*t[0].baseData.top+r*n)}))},bottomDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top+e.baseData.height})),r=(t[t.length-1].baseData.top+t[t.length-1].baseData.height-(t[0].baseData.top+t[0].baseData.height))/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.top=1*t[0].baseData.top+1*t[0].baseData.height-1*e.baseData.height+r*n)}))},xCenterDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left+e.baseData.width/2})),r=1*t[t.length-1].baseData.left+t[t.length-1].baseData.width/2,n=1*t[0].baseData.left+t[0].baseData.width/2,i=(r-n)/(t.length-1);t.map((function(e,r){r>0&&r<t.length-1&&(e.baseData.left=n-e.baseData.width/2+i*r)}))},leftDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left})),r=(t[t.length-1].baseData.left-t[0].baseData.left)/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.left=t[0].baseData.left+r*n)}))},rightDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left+e.baseData.width})),r=(t[t.length-1].baseData.left+t[t.length-1].baseData.width-(t[0].baseData.left+t[0].baseData.width))/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.left=t[0].baseData.left+t[0].baseData.width-e.baseData.width+r*n)}))},yCenterDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top+e.baseData.height/2})),r=1*t[t.length-1].baseData.top+t[t.length-1].baseData.height/2,n=1*t[0].baseData.top+t[0].baseData.height/2,i=(r-n)/(t.length-1);t.map((function(e,r){r>0&&r<t.length-1&&(e.baseData.top=n-e.baseData.height/2+i*r)}))},layoutMutations={layout:function(e,t){var r=findArray(e.selectd,e.list);switch(t){case"alignLeft":alignLeft(r);break;case"alignRight":alignRight(r,e);break;case"horizontally":horizontally(r,e);break;case"alignTop":alignTop(r);break;case"alignBottom":alignBottom(r,e);break;case"verticalCenter":verticalCenter(r,e);break;case"topDistribution":topDistribution(r);break;case"bottomDistribution":bottomDistribution(r);break;case"xCenterDistribution":xCenterDistribution(r);break;case"leftDistribution":leftDistribution(r);break;case"rightDistribution":rightDistribution(r);break;case"yCenterDistribution":yCenterDistribution(r)}}},pages={setPageData:function(e,t){e.pages[0]=t},parasePages:function(e,t){t instanceof Array&&(e.pages=t.map((function(e,t){return e.name||(e.name="页面"+(t+1)),e.path||(e.path="page"+(t+1)),e})))},addPage:function(e,t){var r=e.pages.length+1;t.name="页面"+r,t.path="page"+r,e.pages.push(t),e.pageIndex=e.pages.length-1,e.resource={jspaths:[],csspaths:[],otherpaths:[]},e.globalVars=e.sysConst},setCurrentPageIndex:function(e,t){var r=e.globalEvents,n=e.globalVars,i=e.list,o=e.name,a=e.theme,s=e.plant,c=e.shareVariableTree,u=e.resource;e.pages[e.pageIndex]={globalEvents:r,globalVars:n,list:i,name:o,theme:a,plant:s,shareVariableTree:c,resource:u},e.pageIndex=t},setPageDataForIndex:function(e,t){var r=t.index,n=t.data;e.pages[r]=n},setPageName:function(e,t){e.name=t,e.pages[e.pageIndex].name=t},saveCurrentPageData:function(e){var t=e.globalEvents,r=e.globalVars,n=void 0===r?[]:r,i=e.list,o=e.name,a=e.theme,s=e.plant,c=e.shareVariableTree,u=e.resource;e.pages[e.pageIndex]={globalEvents:t,globalVars:n,list:i,name:o,theme:a,plant:s,shareVariableTree:c,resource:u}},getCurrentPageData:function(e){var t=e.globalEvents,r=e.globalVars,n=e.list,i=e.name,o=e.theme,a=e.plant,s=e.shareVariableTree,c=e.resource;e.pages[e.pageIndex]={globalEvents:t,globalVars:r,list:n,name:i,theme:o,plant:a,shareVariableTree:s,resource:c}}},containerMutaitons={segmentationContainer:function(e,t){var r=_$1.cloneDeep(e.list),n=t.containerData,i=t.direction,o=[];if("del"==i)if(n.pid){var a,s=(a=findItemDeep$1(r,n.pid)).children.length;if(a)if(s<=2)a.children=[];else{var c=a.children.find((function(e){return e.cid===n.cid})),u=a.children.findIndex((function(e){return e.cid===n.cid}));a.children=a.children.filter((function(e){return e.cid!==n.cid}));var l=a.children[u>=a.children.length-1?a.children.length-1:u],d="col"==l.direction?"height":"width";l.baseData[d]=(parseFloat(l.baseData[d])+parseFloat(c.baseData[d])).toFixed(2)+"%"}}else r.length&&(r=r.filter((function(e){return e.cid!==n.cid})));else if(a=findItemDeep$1(r,n.cid)){a.direction=i,1===a.children.length&&(o=a.children,a.children=[]);for(var h=(s=a.children.length)>=2?1:2,f=(d=s>=2?(100/(s+1)).toFixed(2)+"%":"50%",0);f<h;f++)a.children.push({isLock:!1,isShow:!0,baseData:{width:"col"==i?"100%":d,height:"col"==i?d:"100%",angle:0,penetrate:0,opacity:100},direction:i,componentType:"selectContainer",iconClass:"__vue_devtool_undefined__",isAssembly:"__vue_devtool_undefined__",source:[],comData:{actions:[],option:{grid:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}],bgColor:{alpha:1,blue:0,green:0,red:0,flag:1,style:"transparent"},imgOpt:"",bgScaleOpt:3,borderRadius:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}],margins:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}]}},tmpData:{},dynamic:0,filePath:"/anov-prod/mgt/go/assembly/162-bgImage.png",origin:"anov-go",name:"容器组件",path:"/index.js",viewComName:"selectContainer",optionComName:"",dataComName:"",eventComName:"",assemblyDeveloper:"",devEmail:"",version:null,devDept:"",toggle:!0,cid:genID(),pid:a.cid,nestIndex:0,children:[],isTop:!1,isCol:"col"==i,isRow:"col"!=i,isDragged:!1,grandParentId:n.pid});o.length&&(o[0].cid=genID(),o[0].pid=a.children[0].cid,a.children[0].children=o)}e.list=r}},shareCom={goEditShareCom:function(e,t){var r=t.name,n=t.mapping;e.shareComs||(e.shareComs=new Map),e.shareComs.set(r,n)},delShareCom:function(e,t){var r=t.key;e.shareComs&&e.shareComs.has(r)&&e.shareComs.delete(r)}},globalVars={mutation:{addGoVar:function(e,t){try{ge.addVariable(t,(function(){e.globalVars=ge.getAllVariables()}))}catch(e){console.warn(e)}},delGoVar:function(e,t){try{var r=t.mapField;console.log(r,"mapFieldmapField"),ge.delVariable(r,(function(){e.globalVars=ge.getAllVariables()}))}catch(e){console.warn(e)}},editGoVar:function(e,t){var r=this;try{ge.editVariable(t,(function(n){e.globalVars=ge.getAllVariables(),he(e.globalSource,t.mapField,e.globalVars,e.list,(function(e){r.commit("GoCom/updatComs",e.cid)})),(null==t?void 0:t.delayUpdate)||r.commit("GoCom/updatComsForVar",t.mapField)}))}catch(e){console.warn(e)}},goEditVar:function(e,t){var r=t.key,n=t.value,i=e.globalVars.find((function(e){return e.mapField==r}));i&&(i.originalValue=n,i.update=!0,this.commit("GoCom/editGoVar",i))},goUpdataSysVars:function(e,t){var r={U_CITY:"cityCode",U_COUNTY:"countyCode",U_PROVINCE:"provinceCode",U_PHONE:"userPhone"},n=e.sysConst,i=Object.keys(r);n.map((function(e){if(e.originalValue=e.value,(null==e?void 0:e.name)&&(null==i?void 0:i.includes(e.name))){var n=r[e.name];e.value=t[n],e.originalValue=t[n]}return e})),ge.addVariables(n)},updateGlobalVars:function(e,t){e.globalVars=t},updataVariables:function(e){e.globalVars=ge.getAllVariables()}},actions:{updateGlobalVarsAction:function(e){(0,e.commit)("updateGlobalVars",ge.getAllVariables())},goEditVar:function(e,t){(0,e.commit)("editGoVar",{mapField:t.key,originalValue:t.value})}}},mutations=__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({},UndoRedo),baseDataMutaitons),rightMenuMutaitons),eventMutations),comTreeMutations),toolMutations),layoutMutations),pages),containerMutaitons),shareCom),globalVars.mutation),actions=__assign$1({updataList:function(e,t){var r=e.commit;t&&r("updataList",t),r("updateTree")},updataBaseData:function(e,t){var r=e.commit;t&&r("updataBaseData",t)},setActive:function(e,t){var r=e.commit;t&&r("setActive",t)},setSyncFlag:function(e,t){var r=e.commit;t&&r("setSyncFlag",t)},execute:function(e,t){var r=e.commit;t&&r("execute",t)},updataAnimationForComponent:function(e,t){var r=e.commit;t&&r("updataAnimationForComponent",t)},updataAnimation:function(e,t){(0,e.commit)("updataAnimation",t)},setOptionForCom:function(e,t){(0,e.commit)("setOptionForCom",t)},updatComs:function(e,t){var r=e.commit;setTimeout((function(){r("updatComs",t)}))},updatComsForVar:function(e,t){var r=e.dispatch,n=e.state,i=n.globalVars.map((function(e){var r,n;if((null===(r=null==e?void 0:e.forkValue)||void 0===r?void 0:r.length)&&(null===(n=null==e?void 0:e.forkValue)||void 0===n?void 0:n.includes(t))||e.forkValue==t)return e.mapField})).filter((function(e){return e})),o=[t];(null==i?void 0:i.length)&&(o=_$1.uniq(__spreadArray$1([t],i,!0)));for(var a=[],s=0,c=o;s<c.length;s++){var u=c[s];n.shareVariableTree[u]&&a.push.apply(a,n.shareVariableTree[u])}if(null==a?void 0:a.length)for(var l=0,d=a;l<d.length;l++){r("updatComs",d[l])}},goEditShareCom:function(e,t){var r=e.commit;e.state,r("goEditShareCom",t)},delShareCom:function(e,t){var r=e.commit;e.state,r("delShareCom",t)},updataSource:function(e,t){var r=e.commit;e.state,r("updataSource",t)}},globalVars.actions),getters={getCurrentPage:function(e){return e.pages.length?e.pages[e.pageIndex]:[]},globalSourceTree:function(e){if(e.list.length&&e.globalSource.length){var t=[];return recursion(_$1.cloneDeep(e.list),(function(e){var r,n,i;if("globalData"==(null===(n=null===(r=null==e?void 0:e.tmpData)||void 0===r?void 0:r.source)||void 0===n?void 0:n.type)){var o=null===(i=null==e?void 0:e.tmpData)||void 0===i?void 0:i.source.globalData;t.push({name:e.name,cid:e.cid,sourceId:o.id,viewComName:e.viewComName})}})),t}return[]}},store={namespaced:!0,state:state,mutations:mutations,actions:actions,getters:getters},VueServer=function(){function e(){}return e.setAppStore=function(t){e.store=t},e.prototype.getState=function(){return e.store.state[e.storeModule]},e.prototype.mapState=function(t){return mapState(e.storeModule,t)},e.prototype.mapGetters=function(t){return mapGetters(e.storeModule,t)},e.prototype.mapMutations=function(t){return mapMutations(e.storeModule,t)},e.prototype.callState=function(t){return e.store.state[e.storeModule][t]},e.prototype.callGetter=function(t,r){return e.store.getters[e.storeModule+"/"+t]},e.prototype.callMutation=function(t,r,n){n?e.store.commit(e.storeModule+"/"+t,r,!0):e.store.commit(e.storeModule+"/"+t,r)},e.prototype.callAction=function(t,r){e.store.dispatch(e.storeModule+"/"+t,r)},e.storeModule="GoCom",e}(),mapState=normalizeNamespace((function(e,t){var r;return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;r[n]=function(){var t=this.$store.state,r=this.$store.getters;if(e){var n=getModuleByNamespace(this.$store,"mapState",e);if(!n)return;t=n.context.state,r=n.context.getters}return"function"==typeof i?i.call(this,t,r):t[i]},r[n].VuexServer=!0})),r})),mapMutations=normalizeNamespace((function(e,t){var r;return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;r[n]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.$store.commit;if(e){var o=getModuleByNamespace(this.$store,"mapMutations",e);if(!o)return;n=o.context.commit}return"function"==typeof i?i.apply(this,[n].concat(t)):n.apply(this.$store,[i].concat(t))}})),r})),mapGetters=normalizeNamespace((function(e,t){var r={};return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;i=e+i,r[n]=function(){if(!e||getModuleByNamespace(this.$store,"mapGetters",e)){if("production"===process.env.NODE_ENV||i in this.$store.getters)return this.$store.getters[i];console.error("[VuexServer] unknown getter: ".concat(i))}},r[n].VuexServer=!0})),r}));function normalizeMap(e){return Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}}))}function normalizeNamespace(e){return function(t,r){return"string"!=typeof t?(r=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,r)}}function getModuleByNamespace(e,t,r){var n=e._modulesNamespaceMap[r];return"production"===process.env.NODE_ENV||n||console.error("[VuexServer] module namespace not found in ".concat(t,"(): ").concat(r)),n}var GoComponent=function(){function e(e){var t=this;if(this.isLock=!1,this.isShow=!0,this.baseData={left:0,top:0,width:300,height:200,angle:0,opacity:100,rotate:0,rotateY:0},this.componentType="BaseComponent",this.cid=genID(),e){Object.keys(e).forEach((function(r){t[r]=e[r]}));["AnEchartsMap","AnMaptalks","AnEchartsMap1","AnArcgisMapBase","AnAMap1","AnCesium","AnThreeMap3DChina","AnThreeMapForCesium","AnThreeMap","AnGisMap","AnMineMap","MineMapMarkerLayer","MineMapClusterLayer","AnChina3D","AncsAnovGis"].includes(e.viewComName)&&(this.componentType="MultiStateComponent"),"AnDynamic"!==e.viewComName&&"AmDynamic"!==e.viewComName&&"AnContainer"!==e.viewComName&&"AnGridLayout"!==e.viewComName||(this.componentType="dynamicComponent")}}return e.prototype.setIndex=function(e){this.z=e},e}(),Load=function(){function e(e){this.vueServer=e,this.loadScript=loadScript}return e.setStore=function(e){this.store=e},e.prototype.loadComponents=function(e){var t=e&&e.list?e.list:[];recursion(t,(function(e){e.viewComName&&(e&&e.path&&e.path,e.origin,e.viewComName?e.viewComName:e.rawData.viewComName)})),e&&this.vueServer.callMutation("reversal",_$1.cloneDeep(e))},e.prototype.addStore=function(e){this.vueServer.callMutation("setActive",{id:e}),this.vueServer.callMutation("addComs",this)},e.prototype._addPlantStore=function(){this.vueServer.callMutation("setPlant",this)},e.prototype._loadComTmp=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:if(window[t])return[3,5];r=function(t){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=e[t],[4,new Promise((function(e){e(i._load(r))}))];case 1:return n.sent(),[2]}}))},n=0,o.label=1;case 1:return n<e.length?[5,r(n)]:[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:window[t]=t,o.label=5;case 5:return[2]}}))}))},e.prototype._load=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){return[2,new Promise((function(r){r(t.loadScript(e))}))]}))}))},e}(),IndexedDB=function(){function e(e){var t=e.dbName,r=e.tables,n=e.version,i=void 0===n?1:n,o=__rest(e,["dbName","tables","version"]);this.dbName=t,this.tables=r,this.version=i,this.openDB(__assign$1({dbName:t,tables:r,version:i},o))}return e.deleteDB=function(e){var t;null===(t=window.indexedDB)||void 0===t||t.deleteDatabase(e)},e.prototype.deleteItem=function(e,t,r){var n=this.storage.transaction(e,"readwrite").objectStore(e).delete(t);return n.onsuccess=function(e){"function"==typeof r&&r(e)},n},e.prototype.getItem=function(e,t,r){var n=this.storage.transaction(e,"readwrite").objectStore(e),i=null;return(i=t?n.get(t):n.getAll()).onsuccess=function(e){var t;"function"==typeof r&&r(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.result)},i.onerror=function(e){console.error(e),r(e)},i},e.prototype.setItem=function(e,t,r,n){var i=this.storage.transaction(e,"readwrite").objectStore(e).put(r,t);return i.onsuccess=function(e){"function"==typeof n&&n(e)},i.onerror=function(e){"function"==typeof n&&n(e)},i},e.prototype.get=function(e,t){return this.getItem(this.tables[0],e,t)},e.prototype.set=function(e,t,r){return this.setItem(this.tables[0],e,t,r)},e.prototype.delete=function(e,t){return this.deleteItem(this.tables[0],e,t)},e.prototype.clear=function(e,t){var r=this.storage.transaction(this.dbName,"readwrite").objectStore(e).clear();return r.onsuccess=function(e){"function"==typeof t&&t(e)},r},e.prototype.getDB=function(){return this.storage},e.prototype.closeDB=function(){this.storage.close()},e.prototype.openDB=function(e){var t=this,r=e.dbName,n=e.tables,i=e.version,o=e.callback,a=window.indexedDB;if(a)if((null==n?void 0:n.length)<1)console.error("表名不能为空");else{var s=a.open(r,i);s.onerror=function(e){var t,r;console.error("打开数据库失败: ".concat(null===(r=null===(t=e.currentTarget)||void 0===t?void 0:t.error)||void 0===r?void 0:r.message)),"function"==typeof o&&o(e)},s.onsuccess=function(e){var r;t.storage=null===(r=e.target)||void 0===r?void 0:r.result,"function"==typeof o&&o(e)},s.onupgradeneeded=function(e){var r;t.storage=null===(r=e.target)||void 0===r?void 0:r.result,n.forEach((function(r){t.storage.objectStoreNames.contains(r)||(t.storage.createObjectStore(r),"function"==typeof o&&o(e))}))}}else console.error("你的浏览器不支持indexedDB")},e}(),Go=function(){function e(){this.VueServer=new VueServer}return e.getInstance=function(){return this.instance||(this.db=new IndexedDB({dbName:"AnovGo",tables:["logs"]}),this.instance=new e),this.instance},e.prototype.getAppStore=function(){return e.store},e.setAppStore=function(t){e.store=t,VueServer.setAppStore(t),Load.setStore(t)},e.prototype.add=function(e,t,r){t.MultiState?this.VueServer.callMutation("addStateChildren",t):(this.VueServer.callMutation("addComs",{com:t,isMobile:r}),this.VueServer.callMutation("setActive",{id:e}))},e.prototype.addForParent=function(e,t,r,n){this.VueServer.callMutation("addComsForParent",{com:t,PID:r,isMobile:n}),this.VueServer.callMutation("setActive",{id:e})},e.prototype.render=function(e,t){var r=new GoComponent(e);t?this.add(r.cid,r,!0):this.add(r.cid,r)},e.prototype.renderForParent=function(e,t,r){var n=new GoComponent(e);void 0!==r?this.addForParent(n.cid,n,t,r):this.addForParent(n.cid,n,t)},e.prototype.reversal=function(e){new Load(new VueServer).loadComponents(e)},e.prototype.emitEvent=function(e,t){var r=this,n=this.VueServer.callState("globalEvents"),i=this.VueServer.callState("globalVars"),o=this.VueServer.callState("shareVariableTree"),a=this.VueServer.callState("globalSource");this.VueServer.callState("globalConstant");var s=this.VueServer.callState("list");we(n,i,o,s,e,(function(e){r.VueServer.callMutation("changeShow",e)}),(function(e){r.VueServer.callMutation("updataSourceForComponent",e)}),t,a)},e}(),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__publicField=(e,t,r)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r),__async=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{s(r.next(e))}catch(e){i(e)}},a=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((r=r.apply(e,t)).next())})),defaultOptions={gapX:100,gapY:100,offsetLeft:0,offsetTop:0,width:120,height:64,opacity:.15,rotate:-22,fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"300",fontColor:"#000",fontFamily:"sans-serif",textAlign:"center",textBaseline:"alphabetic",monitor:!0,zIndex:9999,mode:"interval",pack:!0,blindFontSize:16,blindOpacity:.005},attributeNameTag="data-watermark-tag",observeOptions={childList:!0,subtree:!0,attributeFilter:["style","class",attributeNameTag]};function getMutationObserver(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function getDataSetKey(e){return e.split("-").slice(1).reduce(((e,t,r)=>0===r?t:`${e}${t[0].toUpperCase()+t.slice(1)}`))}var getStyleStr=e=>{let t="";return Object.keys(e).forEach((r=>{const n=r.replace(/([A-Z])/g,"-$1").toLowerCase();t+=`${n}:${e[r]};`})),t},encrypt=e=>window.btoa(decodeURI(encodeURIComponent(e))),getRandomId=(e="")=>`${encrypt(e)}-${(new Date).getTime()}-${Math.floor(Math.random()*Math.pow(10,8))}`,getContainer=(e,t,r={},n)=>{let i;if("string"==typeof e){if(i=document.getElementById(e),!i)throw new Error(`水印挂载节点未找到,请检查#${e}是否存在`)}else i=null!=e?e:document.body;i.setAttribute(attributeNameTag,t);const o=__spreadValues({position:"relative"},r);return n||delete o.position,i.setAttribute("style",getStyleStr(o)),i},getContent=e=>{const t=document.createElement("div");return t.setAttribute("style",getStyleStr({pointerEvents:"none"})),t.setAttribute(attributeNameTag,e),t};function getDrawPattern(e){const{text:t,gapX:r,gapY:n,offsetTop:i,offsetLeft:o,width:a,height:s,rotate:c,opacity:u,fontSize:l,fontStyle:d,fontVariant:h,fontWeight:f,fontFamily:p,fontColor:m,textAlign:g,textBaseline:v,image:y,blindText:_,blindFontSize:b,blindOpacity:w}=e;return new Promise(((e,D)=>{const S=document.createElement("canvas"),x=S.getContext("2d"),T=1*(Number(r)+Number(a)),k=1*(Number(n)+Number(s)),P=Number(o)||Number(r)/2,E=Number(i)||Number(n)/2;if(S.setAttribute("width",`${T}px`),S.setAttribute("height",`${k}px`),x){const r=1*a,n=1*s;if(x.translate(1*P,1*E),x.rotate(Math.PI/180*Number(c)),_&&(x.globalAlpha=w,x.font=`${b}px normal`,x.fillText(_,0,0)),x.globalAlpha=u,y){const t=new Image;return t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.src=y,void(t.onload=()=>{x.drawImage(t,0,0,r,n),e({url:x.canvas.toDataURL(),width:T,height:k})})}const i=Array.isArray(t)?t:[t],o=i.map((e=>x.measureText(e).width)),d=Math.max(...o),h=1*Number(l);x.textAlign=g,x.textBaseline=v,x.fillStyle=m,x.font=A(`${h}px`),d>a&&(x.font=A(h/2+"px"));const f=h+5;let p=(n-(l*i.length+5*(i.length-1)))/2;p=p<0?0:p;for(let e=0;e<i.length;e++)x.fillText(i[e]||"",r/2,p+f*e);e({url:x.canvas.toDataURL(),width:T,height:k})}function A(e){return`${d} ${h} ${f} ${e} ${p}`}return D()}))}var MutationObserver=getMutationObserver(),Watermark=class{constructor(e={}){__publicField(this,"options"),__publicField(this,"container"),__publicField(this,"watermarkContent"),__publicField(this,"watermarkDom"),__publicField(this,"style"),__publicField(this,"watermarkTag"),__publicField(this,"shadowRoot"),__publicField(this,"mutationObserver"),__publicField(this,"_isAgainRender",(e=>{if("attributes"===e.type){if(e.attributeName===attributeNameTag)return!0;if(this.watermarkTag===this._getNodeRandomId(e.target))return!0}return!(!e.removedNodes.length||this.watermarkTag!==this._getNodeRandomId(e.removedNodes[0]))})),__publicField(this,"_getNodeRandomId",(e=>{var t;return null==(t=null==e?void 0:e.dataset)?void 0:t[getDataSetKey(attributeNameTag)]})),__publicField(this,"_destroyMutationObserver",(()=>{this.mutationObserver&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.mutationObserver=null)})),__publicField(this,"_getWatermarkDom",(e=>__async(this,null,(function*(){this.watermarkDom||(this.watermarkDom=document.createElement("div")),"number"==typeof e&&e&&(this.style.height=`${e}px`);const t=yield getDrawPattern(this.options);if(null==t?void 0:t.url){const e=t.url;"repeat"===this.options.mode?this.style.backgroundImage=`url(${e})`:(this.style.backgroundImage=`url(${e}), url(${e})`,this.style.backgroundRepeat="repeat, repeat",this.style.backgroundPosition=`${t.width/2}px ${t.height/2}px, 0 0`),this.options.container||(this.style.position="fixed",this.style.height=void 0),this.watermarkDom.setAttribute("style",getStyleStr(this.style))}return this.watermarkDom.setAttribute(attributeNameTag,this.watermarkTag),this.watermarkDom})))),__publicField(this,"_getWatermarkHeight",(()=>{if(!this.container)return 0;let e=0;const{scrollHeight:t=0,clientHeight:r=0}=this.options.container?this.container.parentNode:this.container;return t>r&&(e=Math.max(t,r)),e})),this.options=Object.assign({},defaultOptions,e),this.style={position:"absolute",left:0,top:0,right:0,bottom:0,pointerEvents:"none",overflow:"hidden",backgroundColor:"transparent",backgroundRepeat:"repeat"},this.style.zIndex=this.options.zIndex,this.watermarkTag=getRandomId("watermark"),this.mutationObserver=null,this._render()}update(e={}){this.options=__spreadValues(__spreadValues({},this.options),e),this.style.zIndex=this.options.zIndex,this._render()}show(){this.watermarkDom&&(this.style.display="block",this.watermarkDom.setAttribute("style",getStyleStr(this.style)))}hide(){this.watermarkDom&&(this.style.display="none",this.watermarkDom.setAttribute("style",getStyleStr(this.style)))}destroy(){this.shadowRoot=void 0,this.watermarkContent&&(this.watermarkContent.remove(),this.watermarkContent=void 0),this.watermarkDom&&(this.watermarkDom.remove(),this.watermarkDom=void 0),this._destroyMutationObserver()}_render(){return __async(this,null,(function*(){this._destroyMutationObserver(),this.container=getContainer(this.options.container,this.watermarkTag,this.options.containerStyle,this.options.pack),this.watermarkContent||(this.watermarkContent=getContent(this.watermarkTag),this.container.append(this.watermarkContent));const e=this._getWatermarkHeight();if(this.watermarkDom=yield this._getWatermarkDom(e),this.watermarkContent){const e=this.watermarkContent.childNodes||[];for(let t=0;t<e.length;t++)this.watermarkContent.removeChild(e[t])}"function"==typeof this.watermarkContent.attachShadow?this.shadowRoot||(this.shadowRoot=this.watermarkContent.attachShadow({mode:"open"})):this.shadowRoot=this.watermarkContent,this.shadowRoot.append(this.watermarkDom),MutationObserver&&this.options.monitor&&(this.mutationObserver=new MutationObserver((e=>{e.forEach((e=>{if(this._isAgainRender(e))return this.destroy(),void this._render()}))})),this.mutationObserver.observe(this.container,observeOptions),this.shadowRoot&&this.mutationObserver.observe(this.shadowRoot,observeOptions))}))}},FileSaver_min=createCommonjsModule((function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){s(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,t,a){var s=o.URL||o.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?i(c):n(c.href)?r(e,t,a):i(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){i(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,o,a){if(o=o||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,a),o);else if(n(e))r(e,o,a);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){i(s)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var s="application/octet-stream"===e.type,c=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||s&&c||a)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},l.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});o.saveAs=s.saveAs=s,e.exports=s}()})),getComOptions=function(e){var t=_$1.cloneDeep(e),r=_$1.omit(t,["comData","source"]);return __assign$1({},r)},generateComponentList=function(e){if(0===e.length)return[];var t=function(e){for(var r,n=0;n<e.length;n++)e[n].tmpData&&(e[n]=Object.assign({},getComOptions(e[n]))),e[n]&&e[n].children&&(null===(r=e[n])||void 0===r?void 0:r.children.length)?t(e[n].children):e[n]&&e[n].dynamicChildren&&Array.from(e[n].dynamicChildren).forEach((function(e,r){t(e[1])}))};return t(e),e},generateCaseDataJson=function(e){var t=_$1.cloneDeep(e)?_$1.cloneDeep(e):{};"string"==typeof e&&(t=JSON.parse(e));var r=[];if(t instanceof Array)t.forEach((function(e,t){var n=JSON.parse(e.caseDetailData)?JSON.parse(e.caseDetailData):{},i=e.caseDetailPath,o=e.caseDetailName,a=n.theme,s=void 0===a?null:a,c=n.globalVars,u=void 0===c?null:c,l=n.shareVariableTree,d=void 0===l?null:l,h=n.plant,f=void 0===h?null:h,p=n.list,m=void 0===p?[]:p,g=n.path,v=void 0===g?"":g;n.name;var y=n.resource,_=void 0===y?{jspaths:[],csspaths:[],otherpaths:[]}:y,b=n.watermark,w=void 0===b?null:b,D=n.tw,S=void 0===D?null:D,x=n.globalSource,T=void 0===x?[]:x,k=n.globalEvents,P=void 0===k?[]:k,E=n.globalConstant,A=void 0===E?[]:E;r.push({path:v||i,theme:s,name:o,resource:_,tw:S,watermark:w,globalSource:T,globalVars:u,globalEvents:P,globalConstant:A,shareVariableTree:d,plant:f,list:generateComponentList(m)})}));else{var n=t.theme,i=void 0===n?null:n,o=t.globalVars,a=void 0===o?null:o,s=t.shareVariableTree,c=void 0===s?null:s,u=t.plant,l=void 0===u?null:u,d=t.list,h=void 0===d?[]:d,f=t.resource,p=void 0===f?{jspaths:[],csspaths:[],otherpaths:[]}:f,m=t.watermark,g=void 0===m?null:m,v=t.tw,y=void 0===v?null:v,_=t.globalSource,b=void 0===_?[]:_,w=t.globalEvents,D=void 0===w?[]:w,S=t.globalConstant,x=void 0===S?[]:S;r.push({resource:p,tw:y,watermark:g,globalSource:b,theme:i,globalVars:a,globalEvents:D,shareVariableTree:c,globalConstant:x,plant:l,list:generateComponentList(h)})}return r},generatePageData=function(e){var t={},r=t.theme,n=void 0===r?null:r,i=t.globalVars,o=void 0===i?null:i,a=t.shareVariableTree,s=void 0===a?null:a,c=t.plant,u=void 0===c?null:c,l=t.list,d=void 0===l?[]:l,h=t.undos,f=void 0===h?[]:h,p=t.undoRedoPointer,m=void 0===p?-1:p,g=t.globalEvents,v=void 0===g?[]:g;return e&&(n=e.theme,u=e.plant),{theme:n,globalVars:o,globalEvents:v,shareVariableTree:s,plant:u,undos:f,undoRedoPointer:m,list:generateComponentList(d)}},exportJson=function(e){var t=e.caseName,r=void 0===t?"case-name":t,n=e.caseImg,i=void 0===n?"":n,o=e.caseRemark,a=void 0===o?"":o,s=e.details,c=e.caseClientType,u=void 0===c?"":c,l=e.id,d={caseClientType:u,caseName:r,caseImg:i,caseRemark:a,caseId:void 0===l?"":l,createTime:moment().format("YYYY-MM-DD , h:mm:ss"),caseData:generateCaseDataJson(s)},h=new Blob([JSON.stringify(d)],{type:"json"});FileSaver_min.saveAs(h,r+".json")},generateJson=function(e){var t=e.caseName,r=void 0===t?"":t,n=e.caseData;return e.plangInfoForPsd,{caseName:r,createTime:moment().format("YYYY-MM-DD , h:mm:ss"),caseData:generateCaseDataJson(n)}};function elementError(e,t){throw new Error("".concat(e,":Expected HTMLElement, got ").concat(t))}var SizeAdaption=function(){function e(e){this.option=e,this.option.isResize&&window.addEventListener("resize",this.resize.bind(this))}return Object.defineProperty(e,"defaultOption",{get:function(){return e._defaultOption},set:function(t){e._defaultOption=t},enumerable:!1,configurable:!0}),e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.removeResize=function(){window.removeEventListener("resize",this.resize.bind(this))},e.prototype.resize=function(){var e=this.option,t=e.isEqualScale,r=e.wrapSelector,n=e.viewSelector,i=e.designWidth,o=e.designHeight,a=e.horizontal,s=e.vertical,c=document.querySelector(r);c||elementError("wrap",c);var u=c.clientWidth,l=c.clientHeight,d=document.querySelector(n);d||elementError("view",d),d.style.position="absolute",d.style.width=i+"px",d.style.height=o+"px";var h,f,p,m,g=Math.min(u/i,l/o);if(t){switch(d.style.transform="scale(".concat(g,")"),a){case"center":h=(u-i)/2+"px";break;case"left":h=(g-1)/2*i+"px";break;case"right":p=(g-1)/2*i+"px"}switch(s){case"center":f=(l-o)/2+"px";break;case"top":f=(g-1)/2*o+"px";break;case"bottom":m=(g-1)/2*o+"px"}}else d.style.transform="scale('".concat(u/i,", ").concat(l/o,"')"),h=(u-i)/2+"px",f=(l-o)/2+"px";f?d.style.top=f:m&&(d.style.bottom=m),h?d.style.left=h:p&&(d.style.right=p)},e._defaultOption={isEqualScale:!0,designWidth:1920,designHeight:1080,wrapSelector:"body",viewSelector:"#app",horizontal:"center",vertical:"center",isResize:!0},e}(),Scale=function(){function e(e){this.wrap=null,this.target=null,this.type=0,this.minRatio=1,this.outSize={w:0,h:0},this.inSize={w:0,h:0};var t=e.wrap,r=e.target,n=e.type,i=e.size,o=e.callback;this.size=i,this.type=n,this.initOptions(t,r,i),this.initSize(i),this.layout(),this.scale(o),window.addEventListener("resize",this.reset.bind(this,o))}return e.prototype.reset=function(e){this.initSize(this.size),this.layout(),e?this.scale(e):this.scale()},e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.removeResize=function(){window.removeEventListener("resize",this.reset.bind(this,void 0))},e.prototype.getDom=function(e){if(_$1.isElement(e))return e;var t=document.querySelector(e);return _$1.isElement(t)?t:null},e.prototype.initOptions=function(e,t,r){this.wrap=this.getDom(e),this.target=this.getDom(t),this.target.style.width=r.w+"px",this.target.style.height=r.h+"px",this.verificationDom()},e.prototype.initSize=function(e){this.outSize.w=this.wrap.clientWidth,this.outSize.h=this.wrap.clientHeight,this.inSize=e},e.prototype.verificationDom=function(){null!=this.wrap&&null!=this.target&&this.isChildOf(this.wrap,this.target)||console.warn("Please pass in the DOM element correctly!")},e.prototype.layout=function(){if(0==this.type||3==this.type){var e=(this.outSize.w-this.inSize.w)/2,t=(this.outSize.h-this.inSize.h)/2;this.target.style.top=t+"px",this.target.style.left=e+"px"}else this.wrap.style.display="flex",this.wrap.style["align-items"]="center",this.wrap.style["justify-content"]="center",this.target.style.position="static",1==this.type?(this.wrap.style["overflow-y"]="auto",this.wrap.style["overflow-x"]="hidden"):2==this.type&&(this.wrap.style["overflow-y"]="hidden",this.wrap.style["overflow-x"]="auto")},e.prototype.isChildOf=function(e,t){var r;if(e&&t)for(r=e.parentNode;r;){if(t===r)return!0;r=r.parentNode}return!1},e.prototype.scale=function(e){var t=1,r=1;switch(this.type){case 0:t=Math.min(this.outSize.w/this.inSize.w,this.outSize.h/this.inSize.h),r=Math.min(this.outSize.w/this.inSize.w,this.outSize.h/this.inSize.h);break;case 1:r=t=this.outSize.w/this.inSize.w;break;case 2:t=r=this.outSize.h/this.inSize.h;break;case 3:t=this.outSize.w/this.inSize.w,r=this.outSize.h/this.inSize.h}e&&e([t,r]),this.target.style.transform="scale(".concat(t,",").concat(r,")")},e.prototype.resize=function(){},e}(),domToImage=createCommonjsModule((function(e){!function(t){var r=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var r=e(t).toLowerCase();return(n="application/font-woff",i="image/jpeg",{woff:n,woff2:n,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:i,jpeg:i,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[r]||"";var n,i},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var r=window.atob(e.toDataURL().split(",")[1]),n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);t(new Blob([i],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var r=document.implementation.createHTMLDocument(),n=r.createElement("base");r.head.appendChild(n);var i=r.createElement("a");return r.body.appendChild(i),n.href=t,i.href=e,i.href},getAndEncode:function(e){var t=3e4;s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(r){var n,i=new XMLHttpRequest;if(i.onreadystatechange=a,i.ontimeout=c,i.responseType="blob",i.timeout=t,i.open("GET",e,!0),i.send(),s.impl.options.imagePlaceholder){var o=s.impl.options.imagePlaceholder.split(/,/);o&&o[1]&&(n=o[1])}function a(){if(4===i.readyState)if(200===i.status){var t=new FileReader;t.onloadend=function(){var e=t.result.split(/,/)[1];r(e)},t.readAsDataURL(i.response)}else n?r(n):u("cannot fetch resource: "+e+", status: "+i.status)}function c(){n?r(n):u("timeout of "+t+"ms occured while fetching resource: "+e)}function u(e){console.error(e),r("")}}))},uid:function(){var e=0;return function(){return"u"+t()+e++;function t(){return("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}}}(),delay:function(e){return function(t){return new Promise((function(r){setTimeout((function(){r(t)}),e)}))}},asArray:function(e){for(var t=[],r=e.length,n=0;n<r;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=r,n.src=e}))},width:function(e){var r=t(e,"border-left-width"),n=t(e,"border-right-width");return e.scrollWidth+r+n},height:function(e){var r=t(e,"border-top-width"),n=t(e,"border-bottom-width");return e.scrollHeight+r+n}};function e(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function t(e,t){var r=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(r.replace("px",""))}}(),n=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,r,o){return a()?Promise.resolve(e):Promise.resolve(e).then(n).then((function(t){var n=Promise.resolve(e);return t.forEach((function(e){n=n.then((function(t){return i(t,e,r,o)}))})),n}));function a(){return!t(e)}},shouldProcess:t,impl:{readUrls:n,inline:i}};function t(t){return-1!==t.search(e)}function n(t){for(var n,i=[];null!==(n=e.exec(t));)i.push(n[1]);return i.filter((function(e){return!r.isDataUrl(e)}))}function i(e,t,n,i){return Promise.resolve(t).then((function(e){return n?r.resolveUrl(e,n):e})).then(i||r.getAndEncode).then((function(e){return r.dataAsUrl(e,r.mimeType(t))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+r.escape(e)+")(['\"]?\\))","g")}(t),"$1"+n+"$3")}))}}(),i=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(r.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{r.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return n.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return n.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),o=function(){return{inlineAll:function t(i){return i instanceof Element?o(i).then((function(){return i instanceof HTMLImageElement?e(i).inline():Promise.all(r.asArray(i.childNodes).map((function(e){return t(e)})))})):Promise.resolve(i);function o(e){var t=e.style.getPropertyValue("background");return t?n.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}},impl:{newImage:e}};function e(e){return{inline:function(t){return r.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||r.getAndEncode).then((function(t){return r.dataAsUrl(t,r.mimeType(e.src))})).then((function(t){return new Promise((function(r,n){e.onload=r,e.onerror=n,e.src=t}))}))}}}}(),a={imagePlaceholder:void 0,cacheBust:!1},s={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(r.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,r.width(e),r.height(e)).data}))},impl:{fontFaces:i,images:o,util:r,inliner:n,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?s.impl.options.imagePlaceholder=a.imagePlaceholder:s.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?s.impl.options.cacheBust=a.cacheBust:s.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return l(e,t.filter,!0)})).then(d).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(r){e.style[r]=t.style[r]}));return e})).then((function(n){return function(e,t,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(r.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,t.width||r.width(e),t.height||r.height(e))}))}function u(e,t){return c(e,t).then(r.makeImage).then(r.delay(100)).then((function(n){var i=function(e){var n=document.createElement("canvas");if(n.width=t.width||r.width(e),n.height=t.height||r.height(e),t.bgcolor){var i=n.getContext("2d");i.fillStyle=t.bgcolor,i.fillRect(0,0,n.width,n.height)}return n}(e);return i.getContext("2d").drawImage(n,0,0),i}))}function l(e,t,n){return n||!t||t(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?r.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,t,n){var i=e.childNodes;return 0===i.length?Promise.resolve(t):o(t,r.asArray(i),n).then((function(){return t}));function o(e,t,r){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,r)})).then((function(t){t&&e.appendChild(t)}))})),n}}(e,n,t)})).then((function(t){return function(e,t){var n=t;return n instanceof Element?Promise.resolve().then(i).then(o).then(a).then(s).then(c).then((function(){return n})):n;function i(){if(n instanceof HTMLVideoElement){var t=window.getComputedStyle(e),r=document.createElement("canvas");r.width=parseInt(t.width,10),r.height=parseInt(t.height,10);var i=Math.max(e.videoWidth/r.width,e.videoHeight/r.height),o=e.videoWidth/i,a=e.videoHeight/i,s=r.width/2-o/2,c=r.height/2-a/2;r.getContext("2d").drawImage(e,s,c,o,a);var u=n=document.createElement("img");try{u.src=r.toDataURL()}catch(e){u.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}}}function o(){function t(e,t){function n(e,t){r.asArray(e).forEach((function(r){t.setProperty(r,e.getPropertyValue(r),e.getPropertyPriority(r))}))}e.cssText?t.cssText=e.cssText:n(e,t)}t(window.getComputedStyle(e),n.style)}function a(){function t(t){var i=window.getComputedStyle(e,t),o=i.getPropertyValue("content");if(""!==o&&"none"!==o){var a=r.uid();n.className=n.className+" "+a;var s=document.createElement("style");s.appendChild(c(a,t,i)),n.appendChild(s)}function c(e,t,n){var i="."+e+":"+t,o=n.cssText?a(n):s(n);return document.createTextNode(i+"{"+o+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return r.asArray(e).map(t).join("; ")+";";function t(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}}[":before",":after"].forEach((function(e){t(e)}))}function s(){e instanceof HTMLTextAreaElement&&(n.innerHTML=e.value),e instanceof HTMLInputElement&&n.setAttribute("value",e.value)}function c(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=n.getAttribute(e);t&&n.style.setProperty(e,t)})))}}(e,t)})):Promise.resolve()}function d(e){return o.inlineAll(e).then((function(){return e}))}e.exports=s}()})),isURL=function(e){if(!e)return!1;return 1==new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/).test(e)},ArrayBufferToBase64=function(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,i=0;i<n;i++)t+=String.fromCharCode(r[i]);return"data:image/jpeg;base64,".concat(window.btoa(t))},dataURLtoFile=function(e,t){void 0===t&&(t="screenshot.jpeg");try{for(var r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:n})}catch(e){console.error("dataURLtoFile:数据转换错误 : "+e)}},transformData=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,11,,12]),"File"!=t||"string"!=typeof e?[3,2]:[4,dataURLtoFile(e)];case 1:case 3:case 5:case 7:return[2,n.sent()];case 2:return"File"!=t||"[object ArrayBuffer]"!=e.toString()?[3,4]:[4,new File([e],"screenshot.jpeg")];case 4:return"Base64"!=t||"string"!=typeof e?[3,6]:[4,e];case 6:return"Base64"!=t||"[object ArrayBuffer]"!=e.toString()?[3,8]:[4,ArrayBufferToBase64(e)];case 8:return[4,new Error("transformData: 转换发生错误")];case 9:throw n.sent();case 10:return[3,12];case 11:return r=n.sent(),console.log(r),[3,12];case 12:return[2]}}))}))},fetch=function(t,r,n,i){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e({url:t,method:"GET",responseType:"arraybuffer",params:{url:r,dom:n,quality:i}})];case 1:return[2,o.sent()];case 2:return o.sent(),console.warn("请求截图服务器发生错误,请检查地址及参数是否正确!",{url:t,path:r,dom:n,quality:i}),[2,null];case 3:return[2]}}))}))},domToImg=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!(r=document.querySelector(e)))throw new Error("domToImg:"+e+" dom未被找到!");return[4,domToImage.toJpeg(r,{style:{transform:"scale(1)",position:"static"},quality:t})];case 1:return[2,i.sent()];case 2:return n=i.sent(),console.warn(n),[3,3];case 3:return[2]}}))}))},screenshot=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,11,,12]),t=e.dom,r=e.servePath,n=e.targetPath,i=e.quality,o=e.type,a=void 0,isURL(r)&&isURL(n)?[4,fetch(r,n,t,i||.5)]:[3,5];case 1:return(s=u.sent())&&200==s.status&&s.data?(a=s.data,[3,4]):[3,2];case 2:return console.warn("截取错误,请检查网络或服务地址配置是否正确,已转换为dom-to-img."),[4,domToImg(t,i||.5)];case 3:a=u.sent(),u.label=4;case 4:return[3,7];case 5:return console.warn("地址错误,请检查传入的地址是否争取,已转换为dom-to-img."),[4,domToImg(t,i||.5)];case 6:a=u.sent(),u.label=7;case 7:return a?[4,transformData(a,o)]:[3,9];case 8:return[2,u.sent()];case 9:return[2,null];case 10:return[3,12];case 11:return c=u.sent(),console.error("截图发生错误:"+c),[2,null];case 12:return[2]}}))}))},toHex=function(e){return"".concat(e>15?"":0).concat(e.toString(16))},toHexString=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=void 0===i?1:i;return"#".concat(toHex(t)).concat(toHex(r)).concat(toHex(n)).concat(1===o?"":toHex(Math.floor(255*o)))},toRgbString=function(e){var t=e.r,r=e.g,n=e.b;return"rgb(".concat(t,",").concat(r,",").concat(n,")")},toRgbaString=function(e,t){void 0===t&&(t=1e4);var r=e.r,n=e.g,i=e.b,o=e.a,a=void 0===o?1:o;return"rgba(".concat(r,",").concat(n,",").concat(i,",").concat(Math.floor(a*t)/t,")")},parseHexColor=function(e){var t=e.slice(1),r=1;3===t.length&&(t="".concat(t[0]).concat(t[0]).concat(t[1]).concat(t[1]).concat(t[2]).concat(t[2])),8===t.length&&(r=parseInt(t.slice(6),16)/255,t=t.slice(0,6));var n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:r}},parseRgbaColor=function(e){var t=e.match(/(\d(\.\d+)?)+/g)||[],r=t.map((function(e){return parseInt(e,10)}));return{r:r[0],g:r[1],b:r[2],a:parseFloat(t[3])}},parseColorString=function(e){if(e.startsWith("#"))return parseHexColor(e);if(e.startsWith("rgb"))return parseRgbaColor(e);if("transparent"===e)return parseHexColor("#00000000");throw new Error("color string error: ".concat(e))},getColorInfo=function(e){var t=parseColorString(e);return{hex:toHexString(t),rgba:toRgbaString(t),rgb:toRgbString(t),rgbaObj:t}},hexToRgba=function(e){var t=parseColorString(e);return toRgbaString(t)},rgbaToHex=function(e){var t=parseColorString(e);return toHexString(t)},errCode=new Map([["E1001","系统未知错误"],["E1002","vue逻辑错误"],["E1003","JavaScript错误"],["E1004","静态资源加载错误"],["E1005","请求错误"],["E1006","Promise错误"]]),watchError=function(e,t){e.config.errorHandler=function(e){console.error("监测到E1002错误"),console.error(e.filename),errorHandler("E1002",e.name+":"+e.message,t)},window.addEventListener("error",(function(e){e.message?(console.error("监测到E1003错误"),errorHandler("E1003",e.message,e.filename,t)):(console.error("监测到E1004错误"),errorHandler("E1004",e.target.currentSrc,e.filename,t))}),!0)},errorHandler=function(e,t,r,n){void 0===n&&(n="null"),saveLog({code:e,type:errCode.get("".concat(e)),msg:t,router:r.currentRoute.value.fullPath,file:n,createTime:(new Date).toLocaleString()})},saveLog=function(e){var t=localStorage.getItem("ERROR");if(t){var r=JSON.parse(t);sortArray(r),r.length>50?(r[0]=e,sortArray(r)):r.push(e),localStorage.setItem("ERROR",JSON.stringify(r))}else localStorage.setItem("ERROR",JSON.stringify([e]))},sortArray=function(e){e.sort((function(e,t){return e.createTime>t.createTime?1:-1}))},index$1=Object.freeze({__proto__:null,RecursiveList:RecursiveList,Scale:Scale,SizeAdaption:SizeAdaption,UpdataForContainer:UpdataForContainer,Watermark:Watermark,arraySwap:arraySwap,arraySwapDeep:arraySwapDeep,arraySwapForId:arraySwapForId,breakUp:breakUp,checkBaseData:checkBaseData,checkVar:checkVar,comToggle:comToggle,decrypAES:decrypAES,decrypt:decrypt,encrypt:encrypt$1,errorHandler:errorHandler,executeFilter:executeFilter,exportJson:exportJson,findItem:findItem,findItemDeep:findItemDeep$1,findItemIndexDeep:findItemIndexDeep,findParentDeep:findParentDeep,genCopyName:genCopyName,genID:genID,generateCaseDataJson:generateCaseDataJson,generateComponentList:generateComponentList,generateJson:generateJson,generatePageData:generatePageData,getAncestorsNodes:getAncestorsNodes,getColorInfo:getColorInfo,getDataForEvaluator:getDataForEvaluator,getInteractive:getInteractive,getInteractive2:getInteractive2,getLength:getLength,getPosition:getPosition,getSessionData:getSessionData,getShareTree:getShareTree,getStandardData:getStandardData,getUrlParams:getUrlParams,globalSourceTemp:globalSourceTemp,hasVar:hasVar,hexToRgba:hexToRgba,isJSON:isJSON,isPeer:isPeer,loadFont:loadFont,loadFontResource:loadFontResource,loadScript:loadScript,loadTag:loadTag,parseColorString:parseColorString,parseHexColor:parseHexColor,parseRgbaColor:parseRgbaColor,recursion:recursion,removeTag:removeTag,resetID:resetID,resetPositionForGroup:resetPositionForGroup,resizeListPosition:resizeListPosition,resizePosition:resizePosition,resziePositionForGroup:resziePositionForGroup,rgbaToHex:rgbaToHex,safeConvertToNumber:safeConvertToNumber,safeEval:safeEval,screenshot:screenshot,selectdArea:selectdArea,setActions:setActions,setAttr:setAttr,setIndex:setIndex,setPorp:setPorp,setPositionForGroup:setPositionForGroup,setPositionForWorld:setPositionForWorld,setSessionData:setSessionData,toHex:toHex,toHexString:toHexString,toRgbString:toRgbString,toRgbaString:toRgbaString,transformPosition:transformPosition,upDataGroup:upDataGroup,upDataGroupChildren:upDataGroupChildren,updataAttribute:updataAttribute,updataAttributeForOption:updataAttributeForOption,updataSizeDeep:updataSizeDeep,validateAndFixObject:validateAndFixObject,watchError:watchError});function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}
|
|
44
|
+
***************************************************************************** */function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __spreadArray(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var _global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,keys=Object.keys,isArray=Array.isArray;function extend(e,t){return"object"!=typeof t||keys(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||_global.Promise||(_global.Promise=Promise);var getProto=Object.getPrototypeOf,_hasOwn={}.hasOwnProperty;function hasOwn(e,t){return _hasOwn.call(e,t)}function props(e,t){"function"==typeof t&&(t=t(getProto(e))),("undefined"==typeof Reflect?keys:Reflect.ownKeys)(t).forEach((function(r){setProp(e,r,t[r])}))}var defineProperty=Object.defineProperty;function setProp(e,t,r,n){defineProperty(e,t,extend(r&&hasOwn(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function derive(e){return{from:function(t){return e.prototype=Object.create(t.prototype),setProp(e.prototype,"constructor",e),{extend:props.bind(null,e.prototype)}}}}var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(e,t){var r;return getOwnPropertyDescriptor(e,t)||(r=getProto(e))&&getPropertyDescriptor(r,t)}var _slice$1=[].slice;function slice(e,t,r){return _slice$1.call(e,t,r)}function override(e,t){return t(e)}function assert(e){if(!e)throw new Error("Assertion Failed")}function asap$1(e){_global.setImmediate?setImmediate(e):setTimeout(e,0)}function arrayToObject(e,t){return e.reduce((function(e,r,n){var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function getByKeyPath(e,t){if("string"==typeof t&&hasOwn(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=getByKeyPath(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:getByKeyPath(s,t.substr(a+1))}}function setByKeyPath(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){assert("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)setByKeyPath(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?isArray(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var c=e[a];c&&hasOwn(e,a)||(c=e[a]={}),setByKeyPath(c,s,r)}}else void 0===r?isArray(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function delByKeyPath(e,t){"string"==typeof t?setByKeyPath(e,t,void 0):"length"in t&&[].map.call(t,(function(t){setByKeyPath(e,t,void 0)}))}function shallowClone(e){var t={};for(var r in e)hasOwn(e,r)&&(t[r]=e[r]);return t}var concat=[].concat;function flatten(e){return concat.apply([],e)}var intrinsicTypeNames="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(flatten([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return _global[e]})),intrinsicTypes=new Set(intrinsicTypeNames.map((function(e){return _global[e]})));function cloneSimpleObjectTree(e){var t={};for(var r in e)if(hasOwn(e,r)){var n=e[r];t[r]=!n||"object"!=typeof n||intrinsicTypes.has(n.constructor)?n:cloneSimpleObjectTree(n)}return t}function objectIsEmpty(e){for(var t in e)if(hasOwn(e,t))return!1;return!0}var circularRefs=null;function deepClone(e){circularRefs=new WeakMap;var t=innerDeepClone(e);return circularRefs=null,t}function innerDeepClone(e){if(!e||"object"!=typeof e)return e;var t=circularRefs.get(e);if(t)return t;if(isArray(e)){t=[],circularRefs.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(innerDeepClone(e[r]))}else if(intrinsicTypes.has(e.constructor))t=e;else{var i=getProto(e);for(var o in t=i===Object.prototype?{}:Object.create(i),circularRefs.set(e,t),e)hasOwn(e,o)&&(t[o]=innerDeepClone(e[o]))}return t}var toString={}.toString;function toStringTag(e){return toString.call(e).slice(8,-1)}var iteratorSymbol="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",getIteratorOf="symbol"==typeof iteratorSymbol?function(e){var t;return null!=e&&(t=e[iteratorSymbol])&&t.apply(e)}:function(){return null};function delArrayItem(e,t){var r=e.indexOf(t);return r>=0&&e.splice(r,1),r>=0}var NO_CHAR_ARRAY={};function getArrayOf(e){var t,r,n,i;if(1===arguments.length){if(isArray(e))return e.slice();if(this===NO_CHAR_ARRAY&&"string"==typeof e)return[e];if(i=getIteratorOf(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}var isAsyncFunction="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},dexieErrorNames=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],idbDomErrorNames=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],errorList=dexieErrorNames.concat(idbDomErrorNames),defaultTexts={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function DexieError(e,t){this.name=e,this.message=t}function getMultiErrorMessage(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,r){return r.indexOf(e)===t})).join("\n")}function ModifyError(e,t,r,n){this.failures=t,this.failedKeys=n,this.successCount=r,this.message=getMultiErrorMessage(e,t)}function BulkError(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=getMultiErrorMessage(e,this.failures)}derive(DexieError).from(Error).extend({toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var errnames=errorList.reduce((function(e,t){return e[t]=t+"Error",e}),{}),BaseException=DexieError,exceptions=errorList.reduce((function(e,t){var r=t+"Error";function n(e,n){this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=defaultTexts[t]||r,this.inner=null)}return derive(n).from(BaseException),e[t]=n,e}),{});exceptions.Syntax=SyntaxError,exceptions.Type=TypeError,exceptions.Range=RangeError;var exceptionMap=idbDomErrorNames.reduce((function(e,t){return e[t+"Error"]=exceptions[t],e}),{});function mapError(e,t){if(!e||e instanceof DexieError||e instanceof TypeError||e instanceof SyntaxError||!e.name||!exceptionMap[e.name])return e;var r=new exceptionMap[e.name](t||e.message,e);return"stack"in e&&setProp(r,"stack",{get:function(){return this.inner.stack}}),r}var fullNameExceptions=errorList.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=exceptions[t]),e}),{});function nop(){}function mirror(e){return e}function pureFunctionChain(e,t){return null==e||e===mirror?t:function(r){return t(e(r))}}function callBoth(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function hookCreatingChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?callBoth(n,this.onsuccess):n),i&&(this.onerror=this.onerror?callBoth(i,this.onerror):i),void 0!==o?o:r}}function hookDeletingChain(e,t){return e===nop?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?callBoth(r,this.onsuccess):r),n&&(this.onerror=this.onerror?callBoth(n,this.onerror):n)}}function hookUpdatingChain(e,t){return e===nop?t:function(r){var n=e.apply(this,arguments);extend(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?callBoth(i,this.onsuccess):i),o&&(this.onerror=this.onerror?callBoth(o,this.onerror):o),void 0===n?void 0===a?void 0:a:extend(n,a)}}function reverseStoppableEventChain(e,t){return e===nop?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function promisableChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then((function(){return t.apply(n,o)}))}return t.apply(this,arguments)}}fullNameExceptions.ModifyError=ModifyError,fullNameExceptions.DexieError=DexieError,fullNameExceptions.BulkError=BulkError;var debug="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function setDebug(e,t){debug=e}var INTERNAL={},ZONE_ECHO_LIMIT=100,_a$1="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,getProto(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,getProto(t),e]}(),resolvedNativePromise=_a$1[0],nativePromiseProto=_a$1[1],resolvedGlobalPromise=_a$1[2],nativePromiseThen=nativePromiseProto&&nativePromiseProto.then,NativePromise=resolvedNativePromise&&resolvedNativePromise.constructor,patchGlobalPromise=!!resolvedGlobalPromise;function schedulePhysicalTick(){queueMicrotask(physicalTick)}var asap=function(e,t){microtickQueue.push([e,t]),needsNewPhysicalTick&&(schedulePhysicalTick(),needsNewPhysicalTick=!1)},isOutsideMicroTick=!0,needsNewPhysicalTick=!0,unhandledErrors=[],rejectingErrors=[],rejectionMapper=mirror,globalPSD={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:nop,pgp:!1,env:{},finalize:nop},PSD=globalPSD,microtickQueue=[],numScheduledCalls=0,tickFinalizers=[];function DexiePromise(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=PSD;if("function"!=typeof e){if(e!==INTERNAL)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++t.ref,executePromiseTask(this,e)}var thenProp={get:function(){var e=PSD,t=totalEchoes;function r(r,n){var i=this,o=!e.global&&(e!==PSD||t!==totalEchoes),a=o&&!decrementExpectedAwaits(),s=new DexiePromise((function(t,s){propagateToListener(i,new Listener(nativeAwaitCompatibleWrap(r,e,o,a),nativeAwaitCompatibleWrap(n,e,o,a),t,s,e))}));return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return r.prototype=INTERNAL,r},set:function(e){setProp(this,"then",e&&e.prototype===INTERNAL?thenProp:{get:function(){return e},set:thenProp.set})}};function Listener(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function executePromiseTask(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&beginMicroTickScope();t&&"function"==typeof t.then?executePromiseTask(e,(function(e,r){t instanceof DexiePromise?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,propagateAllListeners(e)),r&&endMicroTickScope()}}),handleRejection.bind(null,e))}catch(t){handleRejection(e,t)}}function handleRejection(e,t){if(rejectingErrors.push(t),null===e._state){var r=e._lib&&beginMicroTickScope();t=rejectionMapper(t),e._state=!1,e._value=t,addPossiblyUnhandledError(e),propagateAllListeners(e),r&&endMicroTickScope()}}function propagateAllListeners(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)propagateToListener(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===numScheduledCalls&&(++numScheduledCalls,asap((function(){0==--numScheduledCalls&&finalizePhysicalTick()}),[]))}function propagateToListener(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++numScheduledCalls,asap(callListener,[r,e,t])}else e._listeners.push(t)}function callListener(e,t,r){try{var n,i=t._value;!t._state&&rejectingErrors.length&&(rejectingErrors=[]),n=debug&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==rejectingErrors.indexOf(i)||markErrorAsHandled(t),r.resolve(n)}catch(e){r.reject(e)}finally{0==--numScheduledCalls&&finalizePhysicalTick(),--r.psd.ref||r.psd.finalize()}}function physicalTick(){usePSD(globalPSD,(function(){beginMicroTickScope()&&endMicroTickScope()}))}function beginMicroTickScope(){var e=isOutsideMicroTick;return isOutsideMicroTick=!1,needsNewPhysicalTick=!1,e}function endMicroTickScope(){var e,t,r;do{for(;microtickQueue.length>0;)for(e=microtickQueue,microtickQueue=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(microtickQueue.length>0);isOutsideMicroTick=!0,needsNewPhysicalTick=!0}function finalizePhysicalTick(){var e=unhandledErrors;unhandledErrors=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=tickFinalizers.slice(0),r=t.length;r;)t[--r]()}function run_at_end_of_this_or_next_physical_tick(e){tickFinalizers.push((function t(){e(),tickFinalizers.splice(tickFinalizers.indexOf(t),1)})),++numScheduledCalls,asap((function(){0==--numScheduledCalls&&finalizePhysicalTick()}),[])}function addPossiblyUnhandledError(e){unhandledErrors.some((function(t){return t._value===e._value}))||unhandledErrors.push(e)}function markErrorAsHandled(e){for(var t=unhandledErrors.length;t;)if(unhandledErrors[--t]._value===e._value)return void unhandledErrors.splice(t,1)}function PromiseReject(e){return new DexiePromise(INTERNAL,!1,e)}function wrap$1(e,t){var r=PSD;return function(){var n=beginMicroTickScope(),i=PSD;try{return switchToZone(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{switchToZone(i,!1),n&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:thenProp,_then:function(e,t){propagateToListener(this,new Listener(null,null,e,t,PSD))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?r(e):PromiseReject(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):PromiseReject(e)}))},finally:function(e){return this.then((function(t){return DexiePromise.resolve(e()).then((function(){return t}))}),(function(t){return DexiePromise.resolve(e()).then((function(){return PromiseReject(t)}))}))},timeout:function(e,t){var r=this;return e<1/0?new DexiePromise((function(n,i){var o=setTimeout((function(){return i(new exceptions.Timeout(t))}),e);r.then(n,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),globalPSD.env=snapShot(),props(DexiePromise,{all:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(i,o){return DexiePromise.resolve(i).then((function(r){e[o]=r,--n||t(e)}),r)}))}))},resolve:function(e){return e instanceof DexiePromise?e:e&&"function"==typeof e.then?new DexiePromise((function(t,r){e.then(t,r)})):new DexiePromise(INTERNAL,!0,e)},reject:PromiseReject,race:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){e.map((function(e){return DexiePromise.resolve(e).then(t,r)}))}))},PSD:{get:function(){return PSD},set:function(e){return PSD=e}},totalEchoes:{get:function(){return totalEchoes}},newPSD:newScope,usePSD:usePSD,scheduler:{get:function(){return asap},set:function(e){asap=e}},rejectionMapper:{get:function(){return rejectionMapper},set:function(e){rejectionMapper=e}},follow:function(e,t){return new DexiePromise((function(r,n){return newScope((function(t,r){var n=PSD;n.unhandleds=[],n.onunhandled=r,n.finalize=callBoth((function(){var e=this;run_at_end_of_this_or_next_physical_tick((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),NativePromise&&(NativePromise.allSettled&&setProp(DexiePromise,"allSettled",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,i){return DexiePromise.resolve(e).then((function(e){return n[i]={status:"fulfilled",value:e}}),(function(e){return n[i]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),NativePromise.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,i=new Array(n);e.forEach((function(e,o){return DexiePromise.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--n||r(new AggregateError(i))}))}))}))})));var task={awaits:0,echoes:0,id:0},taskCounter=0,zoneStack=[],zoneEchoes=0,totalEchoes=0,zone_id_counter=0;function newScope(e,t,r,n){var i=PSD,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++zone_id_counter,globalPSD.env,o.env=patchGlobalPromise?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject}:{},t&&extend(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=usePSD(o,e,r,n);return 0===o.ref&&o.finalize(),a}function incrementExpectedAwaits(){return task.id||(task.id=++taskCounter),++task.awaits,task.echoes+=ZONE_ECHO_LIMIT,task.id}function decrementExpectedAwaits(){return!!task.awaits&&(0==--task.awaits&&(task.id=0),task.echoes=task.awaits*ZONE_ECHO_LIMIT,!0)}function onPossibleParallellAsync(e){return task.echoes&&e&&e.constructor===NativePromise?(incrementExpectedAwaits(),e.then((function(e){return decrementExpectedAwaits(),e}),(function(e){return decrementExpectedAwaits(),rejection(e)}))):e}function zoneEnterEcho(e){++totalEchoes,task.echoes&&0!=--task.echoes||(task.echoes=task.awaits=task.id=0),zoneStack.push(PSD),switchToZone(e,!0)}function zoneLeaveEcho(){var e=zoneStack[zoneStack.length-1];zoneStack.pop(),switchToZone(e,!1)}function switchToZone(e,t){var r=PSD;if((t?!task.echoes||zoneEchoes++&&e===PSD:!zoneEchoes||--zoneEchoes&&e===PSD)||queueMicrotask(t?zoneEnterEcho.bind(null,e):zoneLeaveEcho),e!==PSD&&(PSD=e,r===globalPSD&&(globalPSD.env=snapShot()),patchGlobalPromise)){var n=globalPSD.env.Promise,i=e.env;(r.global||e.global)&&(Object.defineProperty(_global,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any&&(n.any=i.any))}}function snapShot(){var e=_global.Promise;return patchGlobalPromise?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(_global,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function usePSD(e,t,r,n,i){var o=PSD;try{return switchToZone(e,!0),t(r,n,i)}finally{switchToZone(o,!1)}}function nativeAwaitCompatibleWrap(e,t,r,n){return"function"!=typeof e?e:function(){var i=PSD;r&&incrementExpectedAwaits(),switchToZone(t,!0);try{return e.apply(this,arguments)}finally{switchToZone(i,!1),n&&queueMicrotask(decrementExpectedAwaits)}}}function execInGlobalContext(e){Promise===NativePromise&&0===task.echoes?0===zoneEchoes?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+nativePromiseThen).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var rejection=DexiePromise.reject;function tempTransaction(e,t,r,n){if(e.idbdb&&(e._state.openComplete||PSD.letThrough||e._vip)){var i=e._createTransaction(t,r,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===errnames.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e.close({disableAutoOpen:!1}),e.open().then((function(){return tempTransaction(e,t,r,n)}))):rejection(i)}return i._promise(t,(function(e,t){return newScope((function(){return PSD.trans=i,n(e,t,i)}))})).then((function(e){if("readwrite"===t)try{i.idbtrans.commit()}catch(e){}return"readonly"===t?e:i._completion.then((function(){return e}))}))}if(e._state.openComplete)return rejection(new exceptions.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._state.autoOpen)return rejection(new exceptions.DatabaseClosed);e.open().catch(nop)}return e._state.dbReadyPromise.then((function(){return tempTransaction(e,t,r,n)}))}var DEXIE_VERSION="4.0.4",maxString=String.fromCharCode(65535),minKey=-1/0,INVALID_KEY_ARGUMENT="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",STRING_EXPECTED="String expected.",connections=[],DBNAMES_DB="__dbnames",READONLY="readonly",READWRITE="readwrite";function combine(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var AnyRange={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=deepClone(t))[e],t}}function Entity(){throw exceptions.Type()}function cmp(e,t){try{var r=type(e),n=type(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return compareUint8Arrays(getUint8Array(e),getUint8Array(t));case"Array":return compareArrays(e,t)}}catch(e){}return NaN}function compareArrays(e,t){for(var r=e.length,n=t.length,i=r<n?r:n,o=0;o<i;++o){var a=cmp(e[o],t[o]);if(0!==a)return a}return r===n?0:r<n?-1:1}function compareUint8Arrays(e,t){for(var r=e.length,n=t.length,i=r<n?r:n,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return r===n?0:r<n?-1:1}function type(e){var t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var r=toStringTag(e);return"ArrayBuffer"===r?"binary":r}function getUint8Array(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var Table=function(){function e(){}return e.prototype._trans=function(e,t,r){var n=this._tx||PSD.trans,i=this.name,o=debug&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function a(e,r,n){if(!n.schema[i])throw new exceptions.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}var s=beginMicroTickScope();try{var c=n&&n.db._novip===this.db._novip?n===PSD.trans?n._promise(e,a,r):newScope((function(){return n._promise(e,a,r)}),{trans:n,transless:PSD.transless||PSD}):tempTransaction(this.db,e,[this.name],a);return o&&(c._consoleTask=o,c=c.catch((function(e){return console.trace(e),rejection(e)}))),c}finally{s&&endMicroTickScope()}},e.prototype.get=function(e,t){var r=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?rejection(new exceptions.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return r.core.get({trans:t,key:e}).then((function(e){return r.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(isArray(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=keys(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))){for(var r=0;r<t.length;++r)if(-1===t.indexOf(e.keyPath[r]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(r&&this.db._maxKey!==maxString){var n=r.keyPath.slice(0,t.length);return this.where(n).equals(n.map((function(t){return e[t]})))}!r&&debug&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName,o=this.db._deps.indexedDB;function a(e,t){return 0===o.cmp(e,t)}var s=t.reduce((function(t,r){var n=t[0],o=t[1],s=i[r],c=e[r];return[n||s,n||!s?combine(o,s&&s.multi?function(e){var t=getByKeyPath(e,r);return isArray(t)&&t.some((function(e){return a(c,e)}))}:function(e){return a(c,getByKeyPath(e,r))}):o]}),[null,null]),c=s[0],u=s[1];return c?this.where(c.name).equals(e[c.keyPath]).filter(u):r?this.filter(u):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,isArray(e)?"[".concat(e.join("+"),"]"):e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){var t=this.db,r=this.name;this.schema.mappedClass=e,e.prototype instanceof Entity&&(e=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return __extends(n,e),Object.defineProperty(n.prototype,"db",{get:function(){return t},enumerable:!1,configurable:!0}),n.prototype.table=function(){return r},n}(e));for(var n=new Set,i=e.prototype;i;i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(e){return n.add(e)}));var o=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var i in t)if(!n.has(i))try{r[i]=t[i]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=o,this.hook("reading",o),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){extend(this,e)}))},e.prototype.add=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=workaroundForUndefinedPrimKey(o)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{setByKeyPath(e,o,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof e||isArray(e))return this.where(":id").equals(e).modify(t);var r=getByKeyPath(e,this.schema.primKey.keyPath);return void 0===r?rejection(new exceptions.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(t)},e.prototype.put=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=workaroundForUndefinedPrimKey(o)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{setByKeyPath(e,o,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:AnyRange})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(r){return t.core.getMany({keys:e,trans:r}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},e.prototype.bulkAdd=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new exceptions.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(workaroundForUndefinedPrimKey(s)):e;return n.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new BulkError("".concat(n.name,".bulkAdd(): ").concat(t," of ").concat(c," operations failed"),a)}))}))},e.prototype.bulkPut=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new exceptions.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(workaroundForUndefinedPrimKey(s)):e;return n.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new BulkError("".concat(n.name,".bulkPut(): ").concat(t," of ").concat(c," operations failed"),a)}))}))},e.prototype.bulkUpdate=function(e){var t=this,r=this.core,n=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(a){return r.getMany({trans:a,keys:n,cache:"clone"}).then((function(s){var c=[],u=[];e.forEach((function(e,r){var n=e.key,i=e.changes,a=s[r];if(a){for(var l=0,d=Object.keys(i);l<d.length;l++){var h=d[l],f=i[h];if(h===t.schema.primKey.keyPath){if(0!==cmp(f,n))throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()")}else setByKeyPath(a,h,f)}o.push(r),c.push(n),u.push(a)}}));var l=c.length;return r.mutate({trans:a,type:"put",keys:c,values:u,updates:{keys:n,changeSpecs:i}}).then((function(e){var r=e.numFailures,n=e.failures;if(0===r)return l;for(var i=0,a=Object.keys(n);i<a.length;i++){var s=a[i],c=o[Number(s)];if(null!=c){var u=n[s];delete n[s],n[c]=u}}throw new BulkError("".concat(t.name,".bulkUpdate(): ").concat(r," of ").concat(l," operations failed"),n)}))}))}))},e.prototype.bulkDelete=function(e){var t=this,r=e.length;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:e})})).then((function(e){var n=e.numFailures,i=e.lastResult,o=e.failures;if(0===n)return i;throw new BulkError("".concat(t.name,".bulkDelete(): ").concat(n," of ").concat(r," operations failed"),o)}))},e}();function Events(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){var a;n||(n=reverseStoppableEventChain),i||(i=nop);var s={subscribers:[],fire:i,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=n(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter((function(t){return t!==e})),s.fire=s.subscribers.reduce(n,i)}};return t[e]=r[e]=s,s}keys(a=e).forEach((function(e){var t=a[e];if(isArray(t))o(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new exceptions.InvalidArgument("Invalid event config");var r=o(e,mirror,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){asap$1((function(){e.apply(null,t)}))}))}))}}))}}function makeClassConstructor(e,t){return derive(t).from({prototype:e}),t}function createTableConstructor(e){return makeClassConstructor(Table.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}function isPlainKeyRange(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function addFilter(e,t){e.filter=combine(e.filter,t)}function addReplayFilter(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return combine(n(),t())}:t,e.justLimit=r&&!n}function addMatchFilter(e,t){e.isMatch=combine(e.isMatch,t)}function getIndexOrStore(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new exceptions.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function openCursor(e,t,r){var n=getIndexOrStore(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function iter(e,t,r,n){var i=e.replayFilter?combine(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,r,n){if(!i||i(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),hasOwn(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),iterate(openCursor(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return iterate(openCursor(e,n,r),combine(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function iterate(e,t,r,n){var i=n?function(e,t,i){return r(n(e),t,i)}:r,o=wrap$1(i);return e.then((function(e){if(e)return e.start((function(){var r=function(){return e.continue()};t&&!t(e,(function(e){return r=e}),(function(t){e.stop(t),r=nop}),(function(t){e.fail(t),r=nop}))||o(e.value,e,(function(e){return r=e})),r()}))}))}var PropModification=function(){function e(e){Object.assign(this,e)}return e.prototype.execute=function(e){var t,r=null===(t=this.replacePrefix)||void 0===t?void 0:t[0];return r&&"string"==typeof e&&e.startsWith(r)?this.replacePrefix[1]+e.substring(r.length):e},e}(),Collection=function(){function e(){}return e.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,rejection.bind(null,r.error)):r.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,rejection.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=combine(t.algorithm,e)},e.prototype._iterate=function(e,t){return iter(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&extend(r,e),t._ctx=r,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return iter(t,e,r,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(isPlainKeyRange(r,!0))return n.count({trans:e,query:{index:getIndexOrStore(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var i=0;return iter(r,(function(){return++i,!1}),e,n).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&isPlainKeyRange(r,!0)&&r.limit>0){var n=r.valueMapper,i=getIndexOrStore(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var o=[];return iter(r,(function(e){return o.push(e)}),e,r.table.core).then((function(){return o}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,isPlainKeyRange(t)?addReplayFilter(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):addReplayFilter(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),addReplayFilter(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},e.prototype.until=function(e,t){return addFilter(this._ctx,(function(r,n,i){return!e(r.value)||(n(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return addFilter(this._ctx,(function(t){return e(t.value)})),addMatchFilter(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&isPlainKeyRange(t,!0)&&t.limit>0)return this._read((function(e){var r=getIndexOrStore(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return addFilter(this._ctx,(function(e){var t=e.primaryKey.toString(),n=hasOwn(r,t);return r[t]=!0,!n})),this},e.prototype.modify=function(e){var t=this,r=this._ctx;return this._write((function(n){var i;if("function"==typeof e)i=e;else{var o=keys(e),a=o.length;i=function(t){for(var r=!1,n=0;n<a;++n){var i=o[n],s=e[i],c=getByKeyPath(t,i);s instanceof PropModification?(setByKeyPath(t,i,s.execute(c)),r=!0):c!==s&&(setByKeyPath(t,i,s),r=!0)}return r}}var s=r.table.core,c=s.schema.primaryKey,u=c.outbound,l=c.extractKey,d=t.db._options.modifyChunkSize||200,h=[],f=0,p=[],m=function(e,t){var r=t.failures,n=t.numFailures;f+=e-n;for(var i=0,o=keys(r);i<o.length;i++){var a=o[i];h.push(r[a])}};return t.clone().primaryKeys().then((function(t){var o=function(a){var c=Math.min(d,t.length-a);return s.getMany({trans:n,keys:t.slice(a,a+c),cache:"immutable"}).then((function(h){for(var f=[],p=[],g=u?[]:null,v=[],y=0;y<c;++y){var _=h[y],b={value:deepClone(_),primKey:t[a+y]};!1!==i.call(b,b.value,b)&&(null==b.value?v.push(t[a+y]):u||0===cmp(l(_),l(b.value))?(p.push(b.value),u&&g.push(t[a+y])):(v.push(t[a+y]),f.push(b.value)))}var w=isPlainKeyRange(r)&&r.limit===1/0&&("function"!=typeof e||e===deleteCallback)&&{index:r.index,range:r.range};return Promise.resolve(f.length>0&&s.mutate({trans:n,type:"add",values:f}).then((function(e){for(var t in e.failures)v.splice(parseInt(t),1);m(f.length,e)}))).then((function(){return(p.length>0||w&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:p,criteria:w,changeSpec:"function"!=typeof e&&e}).then((function(e){return m(p.length,e)}))})).then((function(){return(v.length>0||w&&e===deleteCallback)&&s.mutate({trans:n,type:"delete",keys:v,criteria:w}).then((function(e){return m(v.length,e)}))})).then((function(){return t.length>a+c&&o(a+d)}))}))};return o(0).then((function(){if(h.length>0)throw new ModifyError("Error modifying one or more objects",h,f,p);return t.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return isPlainKeyRange(e)&&(e.isPrimKey||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:r,query:{index:n,range:i}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then((function(e){var r=e.failures;e.lastResult,e.results;var n=e.numFailures;if(n)throw new ModifyError("Could not delete some values",Object.keys(r).map((function(e){return r[e]})),t-n);return t-n}))}))})):this.modify(deleteCallback)},e}(),deleteCallback=function(e,t){return t.value=null};function createCollectionConstructor(e){return makeClassConstructor(Collection.prototype,(function(t,r){this.db=e;var n=AnyRange,i=null;if(r)try{n=r()}catch(e){i=e}var o=t._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==mirror?s:null}}))}function simpleCompare(e,t){return e<t?-1:e===t?0:1}function simpleCompareReverse(e,t){return e>t?-1:e===t?0:1}function fail(e,t,r){var n=e instanceof WhereClause?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function emptyCollection(e){return new e.Collection(e,(function(){return rangeEqual("")})).limit(0)}function upperFactory(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}function lowerFactory(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}function nextCasing(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==n[c])return i(e[c],r[c])<0?e.substr(0,c)+r[c]+r.substr(c+1):i(e[c],n[c])<0?e.substr(0,c)+n[c]+r.substr(c+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}function addIgnoreCaseAlgorithm(e,t,r,n){var i,o,a,s,c,u,l,d=r.length;if(!r.every((function(e){return"string"==typeof e})))return fail(e,STRING_EXPECTED);function h(e){i=upperFactory(e),o=lowerFactory(e),a="next"===e?simpleCompare:simpleCompareReverse;var t=r.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":n}h("next");var f=new e.Collection(e,(function(){return createRange(s[0],c[d-1]+n)}));f._ondirectionchange=function(e){h(e)};var p=0;return f._addAlgorithm((function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var h=o(i);if(t(h,c,p))return!0;for(var f=null,m=p;m<d;++m){var g=nextCasing(i,h,s[m],c[m],a,u);null===g&&null===f?p=m+1:(null===f||a(f,g)>0)&&(f=g)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function createRange(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function rangeEqual(e){return{type:1,lower:e,upper:e}}var WhereClause=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?emptyCollection(this):new this.Collection(this,(function(){return createRange(e,t,!r,!n)}))}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}},e.prototype.equals=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return rangeEqual(e)}))},e.prototype.above=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?fail(this,INVALID_KEY_ARGUMENT):new this.Collection(this,(function(){return createRange(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?fail(this,STRING_EXPECTED):this.between(e,e+maxString,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):addIgnoreCaseAlgorithm(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],maxString)},e.prototype.equalsIgnoreCase=function(e){return addIgnoreCaseAlgorithm(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,maxString)},e.prototype.anyOf=function(){var e=this,t=getArrayOf.apply(NO_CHAR_ARRAY,arguments),r=this._cmp;try{t.sort(r)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}if(0===t.length)return emptyCollection(this);var n=new this.Collection(this,(function(){return createRange(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var i=0;return n._addAlgorithm((function(e,n,o){for(var a=e.key;r(a,t[i])>0;)if(++i===t.length)return n(o),!1;return 0===r(a,t[i])||(n((function(){e.continue(t[i])})),!1)})),n},e.prototype.notEqual=function(e){return this.inAnyRange([[minKey,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[minKey,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return emptyCollection(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",exceptions.InvalidArgument);var c=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;var l,d=i;function h(e,t){return d(e[0],t[0])}try{l=e.reduce((function(e,t){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(h)}catch(e){return fail(this,INVALID_KEY_ARGUMENT)}var f=0,p=u?function(e){return i(e,l[f][1])>0}:function(e){return i(e,l[f][1])>=0},m=c?function(e){return o(e,l[f][0])>0}:function(e){return o(e,l[f][0])>=0};var g=p,v=new this.Collection(this,(function(){return createRange(l[0][0],l[l.length-1][1],!c,!u)}));return v._ondirectionchange=function(e){"next"===e?(g=p,d=i):(g=m,d=o),l.sort(h)},v._addAlgorithm((function(e,t,n){for(var o=e.key;g(o);)if(++f===l.length)return t(n),!1;return!!function(e){return!p(e)&&!m(e)}(o)||(0===r._cmp(o,l[f][1])||0===r._cmp(o,l[f][0])||t((function(){d===i?e.continue(l[f][0]):e.continue(l[f][1])})),!1)})),v},e.prototype.startsWithAnyOf=function(){var e=getArrayOf.apply(NO_CHAR_ARRAY,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?emptyCollection(this):this.inAnyRange(e.map((function(e){return[e,e+maxString]}))):fail(this,"startsWithAnyOf() only works with strings")},e}();function createWhereClauseConstructor(e){return makeClassConstructor(WhereClause.prototype,(function(t,r,n){if(this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n},this._cmp=this._ascending=cmp,this._descending=function(e,t){return cmp(t,e)},this._max=function(e,t){return cmp(e,t)>0?e:t},this._min=function(e,t){return cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange,!this._IDBKeyRange)throw new exceptions.MissingAPI}))}function eventRejectHandler(e){return wrap$1((function(t){return preventDefault(t),e(t.target.error),!1}))}function preventDefault(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var DEXIE_STORAGE_MUTATED_EVENT_NAME="storagemutated",STORAGE_MUTATED_DOM_EVENT_NAME="x-storagemutated-1",globalEvents=Events(null,DEXIE_STORAGE_MUTATED_EVENT_NAME),Transaction=function(){function e(){}return e.prototype._lock=function(){return assert(!PSD.global),++this._reculock,1!==this._reculock||PSD.global||(PSD.lockOwnerFor=this),this},e.prototype._unlock=function(){if(assert(!PSD.global),0==--this._reculock)for(PSD.global||(PSD.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{usePSD(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&PSD.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(assert(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new exceptions.DatabaseClosed(n);case"MissingAPIError":throw new exceptions.MissingAPI(n.message,n);default:throw new exceptions.OpenFailed(n)}if(!this.active)throw new exceptions.TransactionInactive;return assert(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):r.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=wrap$1((function(r){preventDefault(r),t._reject(e.error)})),e.onabort=wrap$1((function(r){preventDefault(r),t.active&&t._reject(new exceptions.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=wrap$1((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&globalEvents.storagemutated.fire(e.mutatedParts)})),this},e.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return rejection(new exceptions.ReadOnly("Transaction is readonly"));if(!this.active)return rejection(new exceptions.TransactionInactive);if(this._locked())return new DexiePromise((function(i,o){n._blockedFuncs.push([function(){n._promise(e,t,r).then(i,o)},PSD])}));if(r)return newScope((function(){var e=new DexiePromise((function(e,r){n._lock();var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var i=new DexiePromise((function(e,r){var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),r=DexiePromise.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return r}));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new DexiePromise((function(e,n){r.then((function(r){return t._waitingQueue.push(wrap$1(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(wrap$1(n.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new exceptions.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(hasOwn(t,e))return t[e];var r=this.schema[e];if(!r)throw new exceptions.NotFound("Table "+e+" not part of transaction");var n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n},e}();function createTransactionConstructor(e){return makeClassConstructor(Transaction.prototype,(function(t,r,n,i,o){var a=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),rejection(e)}))}))}function createIndexSpec(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+nameFromKeyPath(t)}}function nameFromKeyPath(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function createTableSchema(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:arrayToObject(r,(function(e){return[e.name,e]}))}}function safariMultiStoreFix(e){return 1===e.length?e[0]:e}var getMaxKey=function(e){try{return e.only([[]]),getMaxKey=function(){return[[]]},[[]]}catch(e){return getMaxKey=function(){return maxString},maxString}};function getKeyExtractor(e){return null==e?function(){}:"string"==typeof e?getSinglePathKeyExtractor(e):function(t){return getByKeyPath(t,e)}}function getSinglePathKeyExtractor(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return getByKeyPath(t,e)}}function arrayify(e){return[].slice.call(e)}var _id_counter=0;function getKeyPathAlias(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function createDBCore(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var r=e.lower,n=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}var i=function(e,t){var r=arrayify(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,r=e.autoIncrement,n=isArray(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:getKeyExtractor(t)},indexes:arrayify(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,n=e.multiEntry,i=e.keyPath,a={name:t,compound:isArray(i),keyPath:i,unique:r,multiEntry:n,extractKey:getKeyExtractor(i)};return o[getKeyPathAlias(i)]=a,a})),getIndexByKeyPath:function(e){return o[getKeyPathAlias(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[getKeyPathAlias(t)]=a.primaryKey),a}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=i.schema,a=i.hasGetAll,s=o.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var r=e.trans,i=e.type,o=e.keys,a=e.values,s=e.range;return new Promise((function(e,c){e=wrap$1(e);var u=r.objectStore(t),l=null==u.keyPath,d="put"===i||"add"===i;if(!d&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var h,f=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var p=[],m=[],g=0,v=function(e){++g,preventDefault(e)};if("deleteRange"===i){if(4===s.type)return e({numFailures:g,failures:m,results:[],lastResult:void 0});3===s.type?p.push(h=u.clear()):p.push(h=u.delete(n(s)))}else{var y=d?l?[a,o]:[a,null]:[o,null],_=y[0],b=y[1];if(d)for(var w=0;w<f;++w)p.push(h=b&&void 0!==b[w]?u[i](_[w],b[w]):u[i](_[w])),h.onerror=v;else for(w=0;w<f;++w)p.push(h=u[i](_[w])),h.onerror=v}var D=function(t){var r=t.target.result;p.forEach((function(e,t){return null!=e.error&&(m[t]=e.error)})),e({numFailures:g,failures:m,results:"delete"===i?o:p.map((function(e){return e.result})),lastResult:r})};h.onerror=function(e){v(e),D(e)},h.onsuccess=D}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,i){e=wrap$1(e);for(var o,a=r.objectStore(t),s=n.length,c=new Array(s),u=0,l=0,d=function(t){var r=t.target;c[r._pos]=r.result,++l===u&&e(c)},h=eventRejectHandler(i),f=0;f<s;++f)null!=n[f]&&((o=a.get(n[f]))._pos=f,o.onsuccess=d,o.onerror=h,++u);0===u&&e(c)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,i){e=wrap$1(e);var o=r.objectStore(t).get(n);o.onsuccess=function(t){return e(t.target.result)},o.onerror=eventRejectHandler(i)}))},query:function(e){return function(r){return new Promise((function(i,o){i=wrap$1(i);var a=r.trans,s=r.values,c=r.limit,u=r.query,l=c===1/0?void 0:c,d=u.index,h=u.range,f=a.objectStore(t),p=d.isPrimaryKey?f:f.index(d.name),m=n(h);if(0===c)return i({result:[]});if(e){var g=s?p.getAll(m,l):p.getAllKeys(m,l);g.onsuccess=function(e){return i({result:e.target.result})},g.onerror=eventRejectHandler(o)}else{var v=0,y=s||!("openKeyCursor"in p)?p.openCursor(m):p.openKeyCursor(m),_=[];y.onsuccess=function(e){var t=y.result;return t?(_.push(s?t.value:t.primaryKey),++v===c?i({result:_}):void t.continue()):i({result:_})},y.onerror=eventRejectHandler(o)}}))}}(a),openCursor:function(e){var r=e.trans,i=e.values,o=e.query,a=e.reverse,s=e.unique;return new Promise((function(e,c){e=wrap$1(e);var u=o.index,l=o.range,d=r.objectStore(t),h=u.isPrimaryKey?d:d.index(u.name),f=a?s?"prevunique":"prev":s?"nextunique":"next",p=i||!("openKeyCursor"in h)?h.openCursor(n(l),f):h.openKeyCursor(n(l),f);p.onerror=eventRejectHandler(c),p.onsuccess=wrap$1((function(t){var n=p.result;if(n){n.___id=++_id_counter,n.done=!1;var i=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));var a=n.advance.bind(n),s=function(){throw new Error("Cursor not stopped")};n.trans=r,n.stop=n.continue=n.continuePrimaryKey=n.advance=function(){throw new Error("Cursor not started")},n.fail=wrap$1(c),n.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},n.start=function(e){var t=new Promise((function(e,t){e=wrap$1(e),p.onerror=eventRejectHandler(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),r=function(){if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=function(){throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=wrap$1((function(e){p.onsuccess=r,r()})),n.continue=i,n.continuePrimaryKey=o,n.advance=a,r(),t},e(n)}else e(null)}),c)}))},count:function(e){var r=e.query,i=e.trans,o=r.index,a=r.range;return new Promise((function(e,r){var s=i.objectStore(t),c=o.isPrimaryKey?s:s.index(o.name),u=n(a),l=u?c.count(u):c.count();l.onsuccess=wrap$1((function(t){return e(t.target.result)})),l.onerror=eventRejectHandler(r)}))}}}(e)})),c={};return s.forEach((function(e){return c[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!c[e])throw new Error("Table '".concat(e,"' not found"));return c[e]},MIN_KEY:-1/0,MAX_KEY:getMaxKey(t),schema:o}}function createMiddlewareStack(e,t){return t.reduce((function(e,t){var r=t.create;return __assign(__assign({},e),r(e))}),e)}function createMiddlewareStacks(e,t,r,n){var i=r.IDBKeyRange;return r.indexedDB,{dbcore:createMiddlewareStack(createDBCore(t,i,n),e.dbcore)}}function generateMiddlewareStacks(e,t){var r=t.db,n=createMiddlewareStacks(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((function(t){var r=t.name;e.core.schema.tables.some((function(e){return e.name===r}))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function setApiOnPlace(e,t,r,n){r.forEach((function(r){var i=n[r];t.forEach((function(t){var n=getPropertyDescriptor(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?setProp(t,r,{get:function(){return this.table(r)},set:function(e){defineProperty(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))}))}))}function removeTablesApi(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function lowerVersionFirst(e,t){return e._cfg.version-t._cfg.version}function runUpgraders(e,t,r,n){var i=e._dbSchema;r.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=createTableSchema("$meta",parseIndexSyntax("")[0],[]),e._storeNames.push("$meta"));var o=e._createTransaction("readwrite",e._storeNames,i);o.create(r),o._completion.catch(n);var a=o._reject.bind(o),s=PSD.transless||PSD;newScope((function(){if(PSD.trans=o,PSD.transless=s,0!==t)return generateMiddlewareStacks(e,r),getExistingVersion(e,o,t).then((function(t){return updateTablesAndIndexes(e,t,o,r)})).catch(a);keys(i).forEach((function(e){createTable(r,e,i[e].primKey,i[e].indexes)})),generateMiddlewareStacks(e,r),DexiePromise.follow((function(){return e.on.populate.fire(o)})).catch(a)}))}function patchCurrentVersion(e,t){createMissingTables(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var r=buildGlobalSchema(e,e.idbdb,t);adjustToExistingIndexNames(e,e._dbSchema,t);for(var n=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var r=t.objectStore(e.name);e.add.forEach((function(t){debug&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),addIndex(r,t)}))},i=0,o=getSchemaDiff(r,e._dbSchema).change;i<o.length;i++){var a=n(o[i]);if("object"==typeof a)return a.value}}function getExistingVersion(e,t,r){return t.storeNames.includes("$meta")?t.table("$meta").get("version").then((function(e){return null!=e?e:r})):DexiePromise.resolve(r)}function updateTablesAndIndexes(e,t,r,n){var i=[],o=e._versions,a=e._dbSchema=buildGlobalSchema(e,e.idbdb,n),s=o.filter((function(e){return e._cfg.version>=t}));if(0===s.length)return DexiePromise.resolve();return s.forEach((function(o){i.push((function(){var i=a,s=o._cfg.dbschema;adjustToExistingIndexNames(e,i,n),adjustToExistingIndexNames(e,s,n),a=e._dbSchema=s;var c=getSchemaDiff(i,s);c.add.forEach((function(e){createTable(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new exceptions.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){return addIndex(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),addIndex(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var u=o._cfg.contentUpgrade;if(u&&o._cfg.version>t){generateMiddlewareStacks(e,n),r._memoizedTables={};var l=shallowClone(s);c.del.forEach((function(e){l[e]=i[e]})),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],keys(l),l),r.schema=l;var d,h=isAsyncFunction(u);h&&incrementExpectedAwaits();var f=DexiePromise.follow((function(){if((d=u(r))&&h){var e=decrementExpectedAwaits.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?DexiePromise.resolve(d):f.then((function(){return d}))}})),i.push((function(t){deleteRemovedTables(o._cfg.dbschema,t),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})),i.push((function(t){e.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(e.idbdb.version/10)===o._cfg.version?(e.idbdb.deleteObjectStore("$meta"),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(o._cfg.version,"version"))}))})),function e(){return i.length?DexiePromise.resolve(i.shift()(r.idbtrans)).then(e):DexiePromise.resolve()}().then((function(){createMissingTables(a,n)}))}function getSchemaDiff(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName,u=void 0;for(u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],d=c[u];l?l.src!==d.src&&a.change.push(d):a.add.push(d)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}function createTable(e,t,r,n){var i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return addIndex(i,e)})),i}function createMissingTables(e,t){keys(e).forEach((function(r){t.db.objectStoreNames.contains(r)||(debug&&console.debug("Dexie: Creating missing table",r),createTable(t,r,e[r].primKey,e[r].indexes))}))}function deleteRemovedTables(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(r){return null==e[r]&&t.db.deleteObjectStore(r)}))}function addIndex(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function buildGlobalSchema(e,t,r){var n={};return slice(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),i=t.keyPath,o=createIndexSpec(nameFromKeyPath(i),i||"",!0,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var u=createIndexSpec(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(u)}n[e]=createTableSchema(e,o,a)})),n}function readGlobalSchema(e,t,r){e.verno=t.version/10;var n=e._dbSchema=buildGlobalSchema(e,t,r);e._storeNames=slice(t.objectStoreNames,0),setApiOnPlace(e,[e._allTables],keys(n),n)}function verifyInstalledSchema(e,t){var r=getSchemaDiff(buildGlobalSchema(e,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}function adjustToExistingIndexNames(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+slice(u).join("+")+"]";if(t[o]){var d=t[o].idxByName[l];d&&(d.name=c,delete t[o].idxByName[l],t[o].idxByName[c]=d)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&_global.WorkerGlobalScope&&_global instanceof _global.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function parseIndexSyntax(e){return e.split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return createIndexSpec(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),isArray(n),0===t)}))}var Version=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){keys(e).forEach((function(r){if(null!==e[r]){var n=parseIndexSyntax(e[r]),i=n.shift();if(i.unique=!0,i.multi)throw new exceptions.Schema("Primary key cannot be multi-valued");n.forEach((function(e){if(e.auto)throw new exceptions.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new exceptions.Schema("Index must have a name and cannot be an empty string")})),t[r]=createTableSchema(r,i,n)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,e):e;var r=t._versions,n={},i={};return r.forEach((function(e){extend(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)})),t._dbSchema=i,removeTablesApi(t,[t._allTables,t,t.Transaction.prototype]),setApiOnPlace(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],keys(i),i),t._storeNames=keys(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=promisableChain(this._cfg.contentUpgrade||nop,e),this},e}(),_a;function createVersionConstructor(e){return makeClassConstructor(Version.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}function getDbNamesTable(e,t){var r=e._dbNamesDB;return r||(r=e._dbNamesDB=new Dexie$1(DBNAMES_DB,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function hasDatabasesNative(e){return e&&"function"==typeof e.databases}function getDatabaseNames(e){var t=e.indexedDB,r=e.IDBKeyRange;return hasDatabasesNative(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==DBNAMES_DB}))})):getDbNamesTable(t,r).toCollection().primaryKeys()}function _onDatabaseCreated(e,t){var r=e.indexedDB,n=e.IDBKeyRange;!hasDatabasesNative(r)&&t!==DBNAMES_DB&&getDbNamesTable(r,n).put({name:t}).catch(nop)}function _onDatabaseDeleted(e,t){var r=e.indexedDB,n=e.IDBKeyRange;!hasDatabasesNative(r)&&t!==DBNAMES_DB&&getDbNamesTable(r,n).delete(t).catch(nop)}function vip(e){return newScope((function(){return PSD.letThrough=!0,e()}))}function idbReady(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function isEmptyRange(e){return!("from"in e)}var RangeSet=function(e,t){if(!this){var r=new RangeSet;return e&&"d"in e&&extend(r,e),r}extend(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function addRange(e,t,r){var n=cmp(t,r);if(!isNaN(n)){if(n>0)throw RangeError();if(isEmptyRange(e))return extend(e,{from:t,to:r,d:1});var i=e.l,o=e.r;if(cmp(r,e.from)<0)return i?addRange(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},rebalance(e);if(cmp(t,e.to)>0)return o?addRange(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},rebalance(e);cmp(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),cmp(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&mergeRanges(e,i),o&&a&&mergeRanges(e,o)}}function mergeRanges(e,t){isEmptyRange(t)||function e(t,r){var n=r.from,i=r.to,o=r.l,a=r.r;addRange(t,n,i),o&&e(t,o),a&&e(t,a)}(e,t)}function rangesOverlap(e,t){var r=getRangeSetIterator(t),n=r.next();if(n.done)return!1;for(var i=n.value,o=getRangeSetIterator(e),a=o.next(i.from),s=a.value;!n.done&&!a.done;){if(cmp(s.from,i.to)<=0&&cmp(s.to,i.from)>=0)return!0;cmp(i.from,s.from)<0?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function getRangeSetIterator(e){var t=isEmptyRange(e)?null:{s:0,n:e};return{next:function(e){for(var r=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&cmp(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||cmp(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function rebalance(e){var t,r,n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){var o="r"===i?"l":"r",a=__assign({},e),s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],a[i]=s[o],e[o]=a,a.d=computeDepth(a)}e.d=computeDepth(e)}function computeDepth(e){var t=e.r,r=e.l;return(t?r?Math.max(t.d,r.d):t.d:r?r.d:0)+1}function extendObservabilitySet(e,t){return keys(t).forEach((function(r){e[r]?mergeRanges(e[r],t[r]):e[r]=cloneSimpleObjectTree(t[r])})),e}function obsSetsOverlap(e,t){return e.all||t.all||Object.keys(e).some((function(r){return t[r]&&rangesOverlap(t[r],e[r])}))}props(RangeSet.prototype,(_a={add:function(e){return mergeRanges(this,e),this},addKey:function(e){return addRange(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return addRange(t,e,e)})),this}},_a[iteratorSymbol]=function(){return getRangeSetIterator(this)},_a));var cache={},unsignaledParts={},isTaskEnqueued=!1;function signalSubscribersLazily(e,t){extendObservabilitySet(unsignaledParts,e),isTaskEnqueued||(isTaskEnqueued=!0,setTimeout((function(){isTaskEnqueued=!1;var e=unsignaledParts;unsignaledParts={},signalSubscribersNow(e,!1)}),0))}function signalSubscribersNow(e,t){void 0===t&&(t=!1);var r=new Set;if(e.all)for(var n=0,i=Object.values(cache);n<i.length;n++){collectTableSubscribers(s=i[n],e,r,t)}else for(var o in e){var a=/^idb\:\/\/(.*)\/(.*)\//.exec(o);if(a){var s,c=a[1],u=a[2];(s=cache["idb://".concat(c,"/").concat(u)])&&collectTableSubscribers(s,e,r,t)}}r.forEach((function(e){return e()}))}function collectTableSubscribers(e,t,r,n){for(var i=[],o=0,a=Object.entries(e.queries.query);o<a.length;o++){for(var s=a[o],c=s[0],u=[],l=0,d=s[1];l<d.length;l++){var h=d[l];obsSetsOverlap(t,h.obsSet)?h.subscribers.forEach((function(e){return r.add(e)})):n&&u.push(h)}n&&i.push([c,u])}if(n)for(var f=0,p=i;f<p.length;f++){var m=p[f];c=m[0],u=m[1];e.queries.query[c]=u}}function dexieOpen(e){var t=e._state,r=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?rejection(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var n=t.openCanceller,i=Math.round(10*e.verno),o=!1;function a(){if(t.openCanceller!==n)throw new exceptions.DatabaseClosed("db.open() was cancelled")}var s=t.dbReadyResolve,c=null,u=!1,l=function(){return new DexiePromise((function(n,s){if(a(),!r)throw new exceptions.MissingAPI;var d=e.name,h=t.autoSchema||!i?r.open(d):r.open(d,i);if(!h)throw new exceptions.MissingAPI;h.onerror=eventRejectHandler(s),h.onblocked=wrap$1(e._fireOnBlocked),h.onupgradeneeded=wrap$1((function(n){if(c=h.transaction,t.autoSchema&&!e._options.allowEmptyDB){h.onerror=preventDefault,c.abort(),h.result.close();var i=r.deleteDatabase(d);i.onsuccess=i.onerror=wrap$1((function(){s(new exceptions.NoSuchDatabase("Database ".concat(d," doesnt exist")))}))}else{c.onerror=eventRejectHandler(s);var a=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;u=a<1,e.idbdb=h.result,o&&patchCurrentVersion(e,c),runUpgraders(e,a/10,c,s)}}),s),h.onsuccess=wrap$1((function(){c=null;var r=e.idbdb=h.result,a=slice(r.objectStoreNames);if(a.length>0)try{var s=r.transaction(safariMultiStoreFix(a),"readonly");if(t.autoSchema)readGlobalSchema(e,r,s);else if(adjustToExistingIndexNames(e,e._dbSchema,s),!verifyInstalledSchema(e,s)&&!o)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),r.close(),i=r.version+1,o=!0,n(l());generateMiddlewareStacks(e,s)}catch(e){}connections.push(e),r.onversionchange=wrap$1((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=wrap$1((function(t){e.on("close").fire(t)})),u&&_onDatabaseCreated(e._deps,d),n()}),s)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(t.PR1398_maxLoop>0)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l();break;case"VersionError":if(i>0)return i=0,l()}return DexiePromise.reject(e)}))};return DexiePromise.race([n,("undefined"==typeof navigator?DexiePromise.resolve():idbReady()).then(l)]).then((function(){return a(),t.onReadyBeingFired=[],DexiePromise.resolve(vip((function(){return e.on.ready.fire(e.vip)}))).then((function r(){if(t.onReadyBeingFired.length>0){var n=t.onReadyBeingFired.reduce(promisableChain,nop);return t.onReadyBeingFired=[],DexiePromise.resolve(vip((function(){return n(e.vip)}))).then(r)}}))})).finally((function(){t.openCanceller===n&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(r){t.dbOpenError=r;try{c&&c.abort()}catch(e){}return n===t.openCanceller&&e._close(),rejection(r)})).finally((function(){t.openComplete=!0,s()})).then((function(){if(u){var t={};e.tables.forEach((function(r){r.schema.indexes.forEach((function(n){n.name&&(t["idb://".concat(e.name,"/").concat(r.name,"/").concat(n.name)]=new RangeSet(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(r.name,"/")]=t["idb://".concat(e.name,"/").concat(r.name,"/:dels")]=new RangeSet(-1/0,[[[]]])})),globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME).fire(t),signalSubscribersNow(t,!0)}return e}))}function awaitIterator(e){var t=function(t){return e.next(t)},r=i(t),n=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):isArray(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function extractTransactionArgs(e,t,r){var n=arguments.length;if(n<2)throw new exceptions.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,flatten(i),r]}function enterTransactionScope(e,t,r,n,i){return DexiePromise.resolve().then((function(){var o=PSD.transless||PSD,a=e._createTransaction(t,r,e._dbSchema,n);a.explicit=!0;var s={trans:a,transless:o};if(n)a.idbtrans=n.idbtrans;else try{a.create(),a.idbtrans._explicit=!0,e._state.PR1398_maxLoop=3}catch(n){return n.name===errnames.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e.close({disableAutoOpen:!1}),e.open().then((function(){return enterTransactionScope(e,t,r,null,i)}))):rejection(n)}var c,u=isAsyncFunction(i);u&&incrementExpectedAwaits();var l=DexiePromise.follow((function(){if(c=i.call(a,a))if(u){var e=decrementExpectedAwaits.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=awaitIterator(c))}),s);return(c&&"function"==typeof c.then?DexiePromise.resolve(c).then((function(e){return a.active?e:rejection(new exceptions.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),rejection(e)}))}))}function pad(e,t,r){for(var n=isArray(e)?e.slice():[e],i=0;i<r;++i)n.push(t);return n}function createVirtualIndexMiddleware(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema,i={},o=[];function a(e,t,r){var n=getKeyPathAlias(e),s=i[n]=i[n]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l=__assign(__assign({},r),{name:u?"".concat(n,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:u,keyTail:t,keyLength:c,extractKey:getKeyExtractor(e),unique:!u&&r.unique});(s.push(l),l.isPrimaryKey||o.push(l),c>1)&&a(2===c?e[0]:e.slice(0,c-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}var s=a(n.primaryKey.keyPath,0,n.primaryKey);i[":id"]=[s];for(var c=0,u=n.indexes;c<u.length;c++){var l=u[c];a(l.keyPath,0,l)}function d(t){var r,n,i=t.query.index;return i.isVirtual?__assign(__assign({},t),{query:{index:i.lowLevelIndex,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:pad(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:pad(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var h=__assign(__assign({},r),{schema:__assign(__assign({},n),{primaryKey:s,indexes:o,getIndexByKeyPath:function(e){var t=i[getKeyPathAlias(e)];return t&&t[0]}}),count:function(e){return r.count(d(e))},query:function(e){return r.query(d(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;if(!o)return r.openCursor(t);return r.openCursor(d(t)).then((function(r){return r&&function(r){var n=Object.create(r,{continue:{value:function(n){null!=n?r.continue(pad(n,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?r.continue(r.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(pad(t,e.MAX_KEY,i),n)}},primaryKey:{get:function(){return r.primaryKey}},key:{get:function(){var e=r.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return r.value}}});return n}(r)}))}});return h}})}var virtualIndexMiddleware={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:createVirtualIndexMiddleware};function getObjectDiff(e,t,r,n){return r=r||{},n=n||"",keys(e).forEach((function(i){if(hasOwn(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){var s=toStringTag(o);s!==toStringTag(a)?r[n+i]=t[i]:"Object"===s?getObjectDiff(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0})),keys(t).forEach((function(i){hasOwn(e,i)||(r[n+i]=t[i])})),r}function getEffectiveKeys(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var hooksMiddleware={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,i=__assign(__assign({},r),{mutate:function(e){var i=PSD.trans,o=i.table(t).hook,a=o.deleting,s=o.creating,c=o.updating;switch(e.type){case"add":if(s.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"put":if(s.fire===nop&&c.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"delete":if(a.fire===nop)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"deleteRange":if(a.fire===nop)break;return i._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function u(e){var t=PSD.trans,i=e.keys||getEffectiveKeys(n,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?__assign(__assign({},e),{keys:i}):__assign({},e)).type&&(e.values=__spreadArray([],e.values,!0)),e.keys&&(e.keys=__spreadArray([],e.keys,!0)),getExistingValues(r,e,i).then((function(o){var u=i.map((function(r,i){var u=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,r,u,t);else if("add"===e.type||void 0===u){var d=s.fire.call(l,r,e.values[i],t);null==r&&null!=d&&(r=d,e.keys[i]=r,n.outbound||setByKeyPath(e.values[i],n.keyPath,r))}else{var h=getObjectDiff(u,e.values[i]),f=c.fire.call(l,h,r,u,t);if(f){var p=e.values[i];Object.keys(f).forEach((function(e){hasOwn(p,e)?p[e]=f[e]:setByKeyPath(p,e,f[e])}))}}return l}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,s=t.lastResult,c=0;c<i.length;++c){var l=n?n[c]:i[c],d=u[c];null==l?d.onerror&&d.onerror(r[c]):d.onsuccess&&d.onsuccess("put"===e.type&&o[c]?e.values[c]:l)}return{failures:r,results:n,numFailures:a,lastResult:s}})).catch((function(e){return u.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,i){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:i}).then((function(r){var n=r.result;return u({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,__assign(__assign({},t),{lower:n[n.length-1],lowerOpen:!0}),i)}))}))}}});return i}})}};function getExistingValues(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}function getFromTransactionCache(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var n=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===cmp(t.keys[i],e[o])&&(n.push(r?deepClone(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}var cacheExistingValuesMiddleware={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var r=e.table(t);return __assign(__assign({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=getFromTransactionCache(e.keys,e.trans._cache,"clone"===e.cache);return t?DexiePromise.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?deepClone(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function isCachableContext(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function isCachableRequest(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var observabilityMiddleware={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,r=new RangeSet(e.MIN_KEY,e.MAX_KEY);return __assign(__assign({},e),{transaction:function(t,r,n){if(PSD.subscr&&"readonly"!==r)throw new exceptions.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(PSD.querier));return e.transaction(t,r,n)},table:function(n){var i=e.table(n),o=i.schema,a=o.primaryKey,s=o.indexes,c=a.extractKey,u=a.outbound,l=a.autoIncrement&&s.filter((function(e){return e.compound&&e.keyPath.includes(a.keyPath)})),d=__assign(__assign({},i),{mutate:function(e){var s=e.trans,c=e.mutatedParts||(e.mutatedParts={}),u=function(e){var r="idb://".concat(t,"/").concat(n,"/").concat(e);return c[r]||(c[r]=new RangeSet)},d=u(""),h=u(":dels"),f=e.type,p="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[getEffectiveKeys(a,e).filter((function(e){return e})),e.values]:[],m=p[0],g=p[1],v=e.trans._cache;if(isArray(m)){d.addKeys(m);var y="delete"===f||m.length===g.length?getFromTransactionCache(m,v):null;y||h.addKeys(m),(y||g)&&trackAffectedIndexes(u,o,y,g)}else if(m){var _={from:m.lower,to:m.upper};h.add(_),d.add(_)}else d.add(r),h.add(r),o.indexes.forEach((function(e){return u(e.name).add(r)}));return i.mutate(e).then((function(t){return!m||"add"!==e.type&&"put"!==e.type||(d.addKeys(t.results),l&&l.forEach((function(r){var n=e.values.map((function(e){return r.extractKey(e)})),i=r.keyPath.findIndex((function(e){return e===a.keyPath}));t.results.forEach((function(e){return n[i]=e})),u(r.name).addKeys(n)}))),s.mutatedParts=extendObservabilitySet(s.mutatedParts||{},c),t}))}}),h=function(t){var r,n,i=t.query,o=i.index,a=i.range;return[o,new RangeSet(null!==(r=a.lower)&&void 0!==r?r:e.MIN_KEY,null!==(n=a.upper)&&void 0!==n?n:e.MAX_KEY)]},f={get:function(e){return[a,new RangeSet(e.key)]},getMany:function(e){return[a,(new RangeSet).addKeys(e.keys)]},count:h,query:h,openCursor:h};return keys(f).forEach((function(e){d[e]=function(o){var a=PSD.subscr,s=!!a,l=isCachableContext(PSD,i)&&isCachableRequest(e,o)?o.obsSet={}:a;if(s){var d=function(e){var r="idb://".concat(t,"/").concat(n,"/").concat(e);return l[r]||(l[r]=new RangeSet)},h=d(""),p=d(":dels"),m=f[e](o),g=m[0],v=m[1];if("query"===e&&g.isPrimaryKey&&!o.values?p.add(v):d(g.name||"").add(v),!g.isPrimaryKey){if("count"!==e){var y="query"===e&&u&&o.values&&i.query(__assign(__assign({},o),{values:!1}));return i[e].apply(this,arguments).then((function(t){if("query"===e){if(u&&o.values)return y.then((function(e){var r=e.result;return h.addKeys(r),t}));var r=o.values?t.result.map(c):t.result;o.values?h.addKeys(r):p.addKeys(r)}else if("openCursor"===e){var n=t,i=o.values;return n&&Object.create(n,{key:{get:function(){return p.addKey(n.primaryKey),n.key}},primaryKey:{get:function(){var e=n.primaryKey;return p.addKey(e),e}},value:{get:function(){return i&&h.addKey(n.primaryKey),n.value}}})}return t}))}p.add(r)}}return i[e].apply(this,arguments)}})),d}})}};function trackAffectedIndexes(e,t,r,n){t.indexes.forEach((function(t){var i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&isArray(e)?e.forEach((function(e){return i.addKey(e)})):i.addKey(e)};(r||n).forEach((function(e,t){var i=r&&o(r[t]),s=n&&o(n[t]);0!==cmp(i,s)&&(null!=i&&a(i),null!=s&&a(s))}))}))}function adjustOptimisticFromFailures(e,t,r){if(0===r.numFailures)return t;if("deleteRange"===t.type)return null;var n=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;if(r.numFailures===n)return null;var i=__assign({},t);return isArray(i.keys)&&(i.keys=i.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in i&&isArray(i.values)&&(i.values=i.values.filter((function(e,t){return!(t in r.failures)}))),i}function isAboveLower(e,t){return void 0===t.lower||(t.lowerOpen?cmp(e,t.lower)>0:cmp(e,t.lower)>=0)}function isBelowUpper(e,t){return void 0===t.upper||(t.upperOpen?cmp(e,t.upper)<0:cmp(e,t.upper)<=0)}function isWithinRange(e,t){return isAboveLower(e,t)&&isBelowUpper(e,t)}function applyOptimisticOps(e,t,r,n,i,o){if(!r||0===r.length)return e;var a=t.query.index,s=a.multiEntry,c=t.query.range,u=n.schema.primaryKey.extractKey,l=a.extractKey,d=(a.lowLevelIndex||a).extractKey,h=r.reduce((function(e,r){var n=e,i="add"===r.type||"put"===r.type?r.values.filter((function(e){var t=l(e);return s&&isArray(t)?t.some((function(e){return isWithinRange(e,c)})):isWithinRange(t,c)})).map((function(e){return e=deepClone(e),o&&Object.freeze(e),e})):[];switch(r.type){case"add":n=e.concat(t.values?i:i.map((function(e){return u(e)})));break;case"put":var a=(new RangeSet).addKeys(r.values.map((function(e){return u(e)})));n=e.filter((function(e){var r=t.values?u(e):e;return!rangesOverlap(new RangeSet(r),a)})).concat(t.values?i:i.map((function(e){return u(e)})));break;case"delete":var d=(new RangeSet).addKeys(r.keys);n=e.filter((function(e){var r=t.values?u(e):e;return!rangesOverlap(new RangeSet(r),d)}));break;case"deleteRange":var h=r.range;n=e.filter((function(e){return!isWithinRange(u(e),h)}))}return n}),e);return h===e?e:(h.sort((function(e,t){return cmp(d(e),d(t))||cmp(u(e),u(t))})),t.limit&&t.limit<1/0&&(h.length>t.limit?h.length=t.limit:e.length===t.limit&&h.length<t.limit&&(i.dirty=!0)),o?Object.freeze(h):h)}function areRangesEqual(e,t){return 0===cmp(e.lower,t.lower)&&0===cmp(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function compareLowers(e,t,r,n){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;var i=cmp(e,t);if(0===i){if(r&&n)return 0;if(r)return 1;if(n)return-1}return i}function compareUppers(e,t,r,n){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;var i=cmp(e,t);if(0===i){if(r&&n)return 0;if(r)return-1;if(n)return 1}return i}function isSuperRange(e,t){return compareLowers(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&compareUppers(e.upper,t.upper,e.upperOpen,t.upperOpen)>=0}function findCompatibleQuery(e,t,r,n){var i=cache["idb://".concat(e,"/").concat(t)];if(!i)return[];var o=i.queries[r];if(!o)return[null,!1,i,null];var a=o[(n.query?n.query.index.name:null)||""];if(!a)return[null,!1,i,null];switch(r){case"query":var s=a.find((function(e){return e.req.limit===n.limit&&e.req.values===n.values&&areRangesEqual(e.req.query.range,n.query.range)}));return s?[s,!0,i,a]:[a.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=n.limit&&(!n.values||e.req.values)&&isSuperRange(e.req.query.range,n.query.range)})),!1,i,a];case"count":var c=a.find((function(e){return areRangesEqual(e.req.query.range,n.query.range)}));return[c,!!c,i,a]}}function subscribeToCacheEntry(e,t,r,n){e.subscribers.add(r),n.addEventListener("abort",(function(){e.subscribers.delete(r),0===e.subscribers.size&&enqueForDeletion(e,t)}))}function enqueForDeletion(e,t){setTimeout((function(){0===e.subscribers.size&&delArrayItem(t,e)}),3e3)}var cacheMiddleware={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name,r=__assign(__assign({},e),{transaction:function(r,n,i){var o=e.transaction(r,n,i);if("readwrite"===n){var a=new AbortController,s=a.signal,c=function(i){return function(){if(a.abort(),"readwrite"===n){for(var s=new Set,c=0,u=r;c<u.length;c++){var l=u[c],d=cache["idb://".concat(t,"/").concat(l)];if(d){var h=e.table(l),f=d.optimisticOps.filter((function(e){return e.trans===o}));if(o._explicit&&i&&o.mutatedParts)for(var p=0,m=Object.values(d.queries.query);p<m.length;p++)for(var g=0,v=(b=m[p]).slice();g<v.length;g++){obsSetsOverlap((S=v[g]).obsSet,o.mutatedParts)&&(delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)})))}else if(f.length>0){d.optimisticOps=d.optimisticOps.filter((function(e){return e.trans!==o}));for(var y=0,_=Object.values(d.queries.query);y<_.length;y++)for(var b,w=0,D=(b=_[y]).slice();w<D.length;w++){var S;if(null!=(S=D[w]).res&&o.mutatedParts)if(i&&!S.dirty){var x=Object.isFrozen(S.res),T=applyOptimisticOps(S.res,S.req,f,h,S,x);S.dirty?(delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)}))):T!==S.res&&(S.res=T,S.promise=DexiePromise.resolve({result:T}))}else S.dirty&&delArrayItem(b,S),S.subscribers.forEach((function(e){return s.add(e)}))}}}}s.forEach((function(e){return e()}))}}};o.addEventListener("abort",c(!1),{signal:s}),o.addEventListener("error",c(!1),{signal:s}),o.addEventListener("complete",c(!0),{signal:s})}return o},table:function(r){var n=e.table(r),i=n.schema.primaryKey,o=__assign(__assign({},n),{mutate:function(e){var o=PSD.trans;if(i.outbound||"disabled"===o.db._options.cache||o.explicit)return n.mutate(e);var a=cache["idb://".concat(t,"/").concat(r)];if(!a)return n.mutate(e);var s=n.mutate(e);return"add"!==e.type&&"put"!==e.type||!(e.values.length>=50||getEffectiveKeys(i,e).some((function(e){return null==e})))?(a.optimisticOps.push(e),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts),s.then((function(t){if(t.numFailures>0){delArrayItem(a.optimisticOps,e);var r=adjustOptimisticFromFailures(a,e,t);r&&a.optimisticOps.push(r),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}})),s.catch((function(){delArrayItem(a.optimisticOps,e),e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}))):s.then((function(t){var r=__assign(__assign({},e),{values:e.values.map((function(e,r){var n,o=(null===(n=i.keyPath)||void 0===n?void 0:n.includes("."))?deepClone(e):__assign({},e);return setByKeyPath(o,i.keyPath,t.results[r]),o}))}),n=adjustOptimisticFromFailures(a,r,t);a.optimisticOps.push(n),queueMicrotask((function(){return e.mutatedParts&&signalSubscribersLazily(e.mutatedParts)}))})),s},query:function(e){var i;if(!isCachableContext(PSD,n)||!isCachableRequest("query",e))return n.query(e);var o="immutable"===(null===(i=PSD.trans)||void 0===i?void 0:i.db._options.cache),a=PSD,s=a.requery,c=a.signal,u=findCompatibleQuery(t,r,"query",e),l=u[0],d=u[1],h=u[2],f=u[3];if(l&&d)l.obsSet=e.obsSet;else{var p=n.query(e).then((function(e){var t=e.result;if(l&&(l.res=t),o){for(var r=0,n=t.length;r<n;++r)Object.freeze(t[r]);Object.freeze(t)}else e.result=deepClone(t);return e})).catch((function(e){return f&&l&&delArrayItem(f,l),Promise.reject(e)}));l={obsSet:e.obsSet,promise:p,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(l):(f=[l],h||(h=cache["idb://".concat(t,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}}),h.queries.query[e.query.index.name||""]=f)}return subscribeToCacheEntry(l,f,s,c),l.promise.then((function(t){return{result:applyOptimisticOps(t.result,e,null==h?void 0:h.optimisticOps,n,l,o)}}))}});return o}});return r}};function vipify(e,t){return new Proxy(e,{get:function(e,r,n){return"db"===r?t:Reflect.get(e,r,n)}})}var Dexie$1=function(){function e(t,r){var n=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=r=__assign({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:r.autoOpen};a.dbReadyPromise=new DexiePromise((function(e){a.dbReadyResolve=e})),a.openCanceller=new DexiePromise((function(e,t){a.cancelOpen=t})),this._state=a,this.name=t,this.on=Events(this,"populate","blocked","versionchange","close",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(t){return function(r,i){e.vip((function(){var e=n._state;if(e.openComplete)e.dbOpenError||DexiePromise.resolve().then(r),i&&t(r);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(r),i&&t(r);else{t(r);var o=n;i||t((function e(){o.on.ready.unsubscribe(r),o.on.ready.unsubscribe(e)}))}}))}})),this.Collection=createCollectionConstructor(this),this.Table=createTableConstructor(this),this.Transaction=createTransactionConstructor(this),this.Version=createVersionConstructor(this),this.WhereClause=createWhereClauseConstructor(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=getMaxKey(r.IDBKeyRange),this._createTransaction=function(e,t,r,i){return new n.Transaction(e,t,r,n._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){n.on("blocked").fire(e),connections.filter((function(e){return e.name===n.name&&e!==n&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(cacheExistingValuesMiddleware),this.use(cacheMiddleware),this.use(observabilityMiddleware),this.use(virtualIndexMiddleware),this.use(hooksMiddleware);var s=new Proxy(this,{get:function(e,t,r){if("_vip"===t)return!0;if("table"===t)return function(e){return vipify(n.table(e),s)};var i=Reflect.get(e,t,r);return i instanceof Table?vipify(i,s):"tables"===t?i.map((function(e){return vipify(e,s)})):"_createTransaction"===t?function(){return vipify(i.apply(this,arguments),s)}:i}});this.vip=s,o.forEach((function(e){return e(n)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new exceptions.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new exceptions.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,r=t.filter((function(t){return t._cfg.version===e}))[0];return r||(r=new this.Version(e),t.push(r),t.sort(lowerVersionFirst),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||PSD.letThrough||this._vip)?e():new DexiePromise((function(e,r){if(t._state.openComplete)return r(new exceptions.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new exceptions.DatabaseClosed);t.open().catch(nop)}t._state.dbReadyPromise.then(e,r)})).then(e)},e.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:r,level:null==n?10:n,name:i}),o.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,r=e.name,n=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return n?e.create!==n:!!r&&e.name!==r}))),this},e.prototype.open=function(){var e=this;return usePSD(globalPSD,(function(){return dexieOpen(e)}))},e.prototype._close=function(){var e=this._state,t=connections.indexOf(this);if(t>=0&&connections.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new DexiePromise((function(t){e.dbReadyResolve=t})),e.openCanceller=new DexiePromise((function(t,r){e.cancelOpen=r})))},e.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen,r=this._state;t?(r.isBeingOpened&&r.cancelOpen(new exceptions.DatabaseClosed),this._close(),r.autoOpen=!1,r.dbOpenError=new exceptions.DatabaseClosed):(this._close(),r.autoOpen=this._options.autoOpen||r.isBeingOpened,r.openComplete=!1,r.dbOpenError=null)},e.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var r=arguments.length>0&&"object"!=typeof arguments[0],n=this._state;return new DexiePromise((function(i,o){var a=function(){t.close(e);var r=t._deps.indexedDB.deleteDatabase(t.name);r.onsuccess=wrap$1((function(){_onDatabaseDeleted(t._deps,t.name),i()})),r.onerror=eventRejectHandler(o),r.onblocked=t._fireOnBlocked};if(r)throw new exceptions.InvalidArgument("Invalid closeOptions argument to db.delete()");n.isBeingOpened?n.dbReadyPromise.then(a):a()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return keys(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,r){var n=this,i=PSD.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof n.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===READONLY)o=READONLY;else{if("rw"!=e&&e!=READWRITE)throw new exceptions.InvalidArgument("Invalid transaction mode: "+e);o=READWRITE}if(i){if(i.mode===READONLY&&o===READWRITE){if(!s)throw new exceptions.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new exceptions.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),s&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(function(t,r){r(e)})):rejection(e)}var c=enterTransactionScope.bind(null,this,o,a,i,r);return i?i._promise(o,c,"lock"):PSD.trans?usePSD(PSD.transless,(function(){return n._whenReady(c)})):this._whenReady(c)},e.prototype.table=function(e){if(!hasOwn(this._allTables,e))throw new exceptions.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},e}(),symbolObservable="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Observable=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})},e.prototype[symbolObservable]=function(){return this},e}(),domDeps;try{domDeps={indexedDB:_global.indexedDB||_global.mozIndexedDB||_global.webkitIndexedDB||_global.msIndexedDB,IDBKeyRange:_global.IDBKeyRange||_global.webkitIDBKeyRange}}catch(e){domDeps={indexedDB:null,IDBKeyRange:null}}function liveQuery(e){var t,r=!1,n=new Observable((function(n){var i=isAsyncFunction(e);var o,a=!1,s={},c={},u={get closed(){return a},unsubscribe:function(){a||(a=!0,o&&o.abort(),l&&globalEvents.storagemutated.unsubscribe(h))}};n.start&&n.start(u);var l=!1,d=function(){return execInGlobalContext(f)};var h=function(e){extendObservabilitySet(s,e),obsSetsOverlap(c,s)&&d()},f=function(){if(!a&&domDeps.indexedDB){s={};var u={};o&&o.abort(),o=new AbortController;var f={subscr:u,signal:o.signal,requery:d,querier:e,trans:null},p=function(t){var r=beginMicroTickScope();try{i&&incrementExpectedAwaits();var n=newScope(e,t);return i&&(n=n.finally(decrementExpectedAwaits)),n}finally{r&&endMicroTickScope()}}(f);Promise.resolve(p).then((function(e){r=!0,t=e,a||f.signal.aborted||(s={},objectIsEmpty(c=u)||l||(globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,h),l=!0),execInGlobalContext((function(){return!a&&n.next&&n.next(e)})))}),(function(e){r=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||a||execInGlobalContext((function(){a||n.error&&n.error(e)}))}))}};return setTimeout(d,0),u}));return n.hasValue=function(){return r},n.getValue=function(){return t},n}var Dexie=Dexie$1;function propagateLocally(e){var t=propagatingLocally;try{propagatingLocally=!0,globalEvents.storagemutated.fire(e),signalSubscribersNow(e,!0)}finally{propagatingLocally=t}}props(Dexie,__assign(__assign({},fullNameExceptions),{delete:function(e){return new Dexie(e,{addons:[]}).delete()},exists:function(e){return new Dexie(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return getDatabaseNames(Dexie.dependencies).then(e)}catch(e){return rejection(new exceptions.MissingAPI)}},defineClass:function(){return function(e){extend(this,e)}},ignoreTransaction:function(e){return PSD.trans?usePSD(PSD.transless,e):e()},vip:vip,async:function(e){return function(){try{var t=awaitIterator(e.apply(this,arguments));return t&&"function"==typeof t.then?t:DexiePromise.resolve(t)}catch(e){return rejection(e)}}},spawn:function(e,t,r){try{var n=awaitIterator(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:DexiePromise.resolve(n)}catch(e){return rejection(e)}},currentTransaction:{get:function(){return PSD.trans||null}},waitFor:function(e,t){var r=DexiePromise.resolve("function"==typeof e?Dexie.ignoreTransaction(e):e).timeout(t||6e4);return PSD.trans?PSD.trans.waitFor(r):r},Promise:DexiePromise,debug:{get:function(){return debug},set:function(e){setDebug(e)}},derive:derive,extend:extend,props:props,override:override,Events:Events,on:globalEvents,liveQuery:liveQuery,extendObservabilitySet:extendObservabilitySet,getByKeyPath:getByKeyPath,setByKeyPath:setByKeyPath,delByKeyPath:delByKeyPath,shallowClone:shallowClone,deepClone:deepClone,getObjectDiff:getObjectDiff,cmp:cmp,asap:asap$1,minKey:minKey,addons:[],connections:connections,errnames:errnames,dependencies:domDeps,cache:cache,semVer:DEXIE_VERSION,version:DEXIE_VERSION.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)}))})),Dexie.maxKey=getMaxKey(Dexie.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,(function(e){var t;propagatingLocally||(t=new CustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME,{detail:e}),propagatingLocally=!0,dispatchEvent(t),propagatingLocally=!1)})),addEventListener(STORAGE_MUTATED_DOM_EVENT_NAME,(function(e){var t=e.detail;propagatingLocally||propagateLocally(t)})));var propagatingLocally=!1,bc,createBC=function(){};"undefined"!=typeof BroadcastChannel&&(createBC=function(){(bc=new BroadcastChannel(STORAGE_MUTATED_DOM_EVENT_NAME)).onmessage=function(e){return e.data&&propagateLocally(e.data)}},createBC(),"function"==typeof bc.unref&&bc.unref(),globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME,(function(e){propagatingLocally||bc.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!Dexie$1.disableBfCache&&e.persisted){debug&&console.debug("Dexie: handling persisted pagehide"),null==bc||bc.close();for(var t=0,r=connections;t<r.length;t++){r[t].close({disableAutoOpen:!1})}}})),addEventListener("pageshow",(function(e){!Dexie$1.disableBfCache&&e.persisted&&(debug&&console.debug("Dexie: handling persisted pageshow"),createBC(),propagateLocally({all:new RangeSet(-1/0,[[]])}))}))),DexiePromise.rejectionMapper=mapError,setDebug(debug);var requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),requireFoolWebpack_1=requireFoolWebpack,environment=createCommonjsModule((function(e){var t=function(e){return void 0!==e&&null!=e.versions&&null!=e.versions.node};e.exports.isNode=t,e.exports.platform=void 0!==process$1&&t(process$1)?"node":"browser";var r=function(e){try{return requireFoolWebpack_1(e)}catch(e){return null}}("worker_threads");e.exports.isMainThread="node"===e.exports.platform?(!r||r.isMainThread)&&!process$1.connected:"undefined"!=typeof Window,e.exports.cpus="browser"===e.exports.platform?self.navigator.hardwareConcurrency:requireFoolWebpack_1("os").cpus().length}));function Promise$2(e,t){var r=this;if(!(this instanceof Promise$2))throw new SyntaxError("Constructor must be called with the new operator");if("function"!=typeof e)throw new SyntaxError("Function parameter handler(resolve, reject) missing");var n=[],i=[];this.resolved=!1,this.rejected=!1,this.pending=!0;var o=function(e,t){n.push(e),i.push(t)};this.then=function(e,t){return new Promise$2((function(r,n){var i=e?_then(e,r,n):r,a=t?_then(t,r,n):n;o(i,a)}),r)};var a=function(e){return r.resolved=!0,r.rejected=!1,r.pending=!1,n.forEach((function(t){t(e)})),o=function(t,r){t(e)},a=s=function(){},r},s=function(e){return r.resolved=!1,r.rejected=!0,r.pending=!1,i.forEach((function(t){t(e)})),o=function(t,r){r(e)},a=s=function(){},r};this.cancel=function(){return t?t.cancel():s(new CancellationError),r},this.timeout=function(e){if(t)t.timeout(e);else{var n=setTimeout((function(){s(new TimeoutError("Promise timed out after "+e+" ms"))}),e);r.always((function(){clearTimeout(n)}))}return r},e((function(e){a(e)}),(function(e){s(e)}))}function _then(e,t,r){return function(n){try{var i=e(n);i&&"function"==typeof i.then&&"function"==typeof i.catch?i.then(t,r):t(i)}catch(e){r(e)}}}function CancellationError(e){this.message=e||"promise cancelled",this.stack=(new Error).stack}function TimeoutError(e){this.message=e||"timeout exceeded",this.stack=(new Error).stack}environment.isNode,environment.platform,environment.isMainThread,environment.cpus,Promise$2.prototype.catch=function(e){return this.then(null,e)},Promise$2.prototype.always=function(e){return this.then(e,e)},Promise$2.all=function(e){return new Promise$2((function(t,r){var n=e.length,i=[];n?e.forEach((function(e,o){e.then((function(e){i[o]=e,0==--n&&t(i)}),(function(e){n=0,r(e)}))})):t(i)}))},Promise$2.defer=function(){var e={};return e.promise=new Promise$2((function(t,r){e.resolve=t,e.reject=r})),e},CancellationError.prototype=new Error,CancellationError.prototype.constructor=Error,CancellationError.prototype.name="CancellationError",Promise$2.CancellationError=CancellationError,TimeoutError.prototype=new Error,TimeoutError.prototype.constructor=Error,TimeoutError.prototype.name="TimeoutError",Promise$2.TimeoutError=TimeoutError;var _Promise=Promise$2,__dirname="/Users/wangshuai/workspace/web-design/go-design/node_modules/.pnpm/workerpool@6.4.0/node_modules/workerpool/src",embeddedWorker='!function(){var __webpack_modules__={577:function(e){e.exports=function(e,r){this.message=e,this.transfer=r}}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];return void 0!==r||(r=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e](r,r.exports,__webpack_require__)),r.exports}var __webpack_exports__={};!function(){var exports=__webpack_exports__,__webpack_unused_export__;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})(e)}var Transfer=__webpack_require__(577),requireFoolWebpack=eval("typeof require !== \'undefined\' ? require : function (module) { throw new Error(\'Module \\" + module + \\" not found.\') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}},WorkerThreads,parentPort;if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,r){addEventListener(e,function(e){r(e.data)})},worker.send=function(e){postMessage(e)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(error){if("object"!==_typeof(error)||null===error||"MODULE_NOT_FOUND"!==error.code)throw error}WorkerThreads&&null!==WorkerThreads.parentPort?(parentPort=WorkerThreads.parentPort,worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort)):(worker.on=process.on.bind(process),worker.send=function(e){process.send(e)},worker.on("disconnect",function(){process.exit(1)})),worker.exit=process.exit.bind(process)}function convertError(o){return Object.getOwnPropertyNames(o).reduce(function(e,r){return Object.defineProperty(e,r,{value:o[r],enumerable:!0})},{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,r){e=new Function("return ("+e+").apply(null, arguments);");return e.apply(e,r)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){function r(){worker.exit(e)}if(!worker.terminationHandler)return r();var o=worker.terminationHandler(e);isPromise(o)?o.then(r,r):r()};var currentRequestId=null;worker.on("message",function(r){if(r===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var e=worker.methods[r.method];if(!e)throw new Error(\'Unknown method "\'+r.method+\'"\');currentRequestId=r.id;var o=e.apply(e,r.params);isPromise(o)?o.then(function(e){e instanceof Transfer?worker.send({id:r.id,result:e.message,error:null},e.transfer):worker.send({id:r.id,result:e,error:null}),currentRequestId=null}).catch(function(e){worker.send({id:r.id,result:null,error:convertError(e)}),currentRequestId=null}):(o instanceof Transfer?worker.send({id:r.id,result:o.message,error:null},o.transfer):worker.send({id:r.id,result:o,error:null}),currentRequestId=null)}catch(e){worker.send({id:r.id,result:null,error:convertError(e)})}}),worker.register=function(e,r){if(e)for(var o in e)e.hasOwnProperty(o)&&(worker.methods[o]=e[o]);r&&(worker.terminationHandler=r.onTerminate),worker.send("ready")},worker.emit=function(e){currentRequestId&&(e instanceof Transfer?worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer):worker.send({id:currentRequestId,isEvent:!0,payload:e}))},__webpack_unused_export__=worker.register,worker.emit}()}();',TERMINATE_METHOD_ID="__workerpool-terminate__";function ensureWorkerThreads(){var e=tryRequireWorkerThreads();if(!e)throw new Error("WorkerPool: workerType = 'thread' is not supported, Node >= 11.7.0 required");return e}function ensureWebWorker(){if("function"!=typeof Worker&&("object"!=typeof Worker||"function"!=typeof Worker.prototype.constructor))throw new Error("WorkerPool: Web Workers not supported")}function tryRequireWorkerThreads(){try{return requireFoolWebpack_1("worker_threads")}catch(e){if("object"==typeof e&&null!==e&&"MODULE_NOT_FOUND"===e.code)return null;throw e}}function getDefaultWorker(){if("browser"===environment.platform){if("undefined"==typeof Blob)throw new Error("Blob not supported by the browser");if(!window.URL||"function"!=typeof window.URL.createObjectURL)throw new Error("URL.createObjectURL not supported by the browser");var e=new Blob([embeddedWorker],{type:"text/javascript"});return window.URL.createObjectURL(e)}return __dirname+"/worker.js"}function setupWorker(e,t){if("web"===t.workerType)return ensureWebWorker(),setupBrowserWorker(e,Worker);if("thread"===t.workerType)return setupWorkerThreadWorker(e,r=ensureWorkerThreads(),t.workerThreadOpts);if("process"!==t.workerType&&t.workerType){if("browser"===environment.platform)return ensureWebWorker(),setupBrowserWorker(e,Worker);var r=tryRequireWorkerThreads();return r?setupWorkerThreadWorker(e,r):setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack_1("child_process"))}return setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack_1("child_process"))}function setupBrowserWorker(e,t){var r=new t(e);return r.isBrowserWorker=!0,r.on=function(e,t){this.addEventListener(e,(function(e){t(e.data)}))},r.send=function(e,t){this.postMessage(e,t)},r}function setupWorkerThreadWorker(e,t,r){var n=new t.Worker(e,{stdout:!1,stderr:!1,...r});return n.isWorkerThread=!0,n.send=function(e,t){this.postMessage(e,t)},n.kill=function(){return this.terminate(),!0},n.disconnect=function(){this.terminate()},n}function setupProcessWorker(e,t,r){var n=r.fork(e,t.forkArgs,t.forkOpts),i=n.send;return n.send=function(e){return i.call(n,e)},n.isChildProcess=!0,n}function resolveForkOptions(e){e=e||{};var t=process$1.execArgv.join(" "),r=-1!==t.indexOf("--inspect"),n=-1!==t.indexOf("--debug-brk"),i=[];return r&&(i.push("--inspect="+e.debugPort),n&&i.push("--debug-brk")),process$1.execArgv.forEach((function(e){e.indexOf("--max-old-space-size")>-1&&i.push(e)})),Object.assign({},e,{forkArgs:e.forkArgs,forkOpts:Object.assign({},e.forkOpts,{execArgv:(e.forkOpts&&e.forkOpts.execArgv||[]).concat(i)})})}function objectToError(e){for(var t=new Error(""),r=Object.keys(e),n=0;n<r.length;n++)t[r[n]]=e[r[n]];return t}function WorkerHandler(e,t){var r=this,n=t||{};function i(e){for(var t in r.terminated=!0,r.processing)void 0!==r.processing[t]&&r.processing[t].resolver.reject(e);r.processing=Object.create(null)}this.script=e||getDefaultWorker(),this.worker=setupWorker(this.script,n),this.debugPort=n.debugPort,this.forkOpts=n.forkOpts,this.forkArgs=n.forkArgs,this.workerThreadOpts=n.workerThreadOpts,this.workerTerminateTimeout=n.workerTerminateTimeout,e||(this.worker.ready=!0),this.requestQueue=[],this.worker.on("message",(function(e){if(!r.terminated)if("string"==typeof e&&"ready"===e)r.worker.ready=!0,function(){for(const e of r.requestQueue.splice(0))r.worker.send(e.message,e.transfer)}();else{var t=e.id,n=r.processing[t];void 0!==n&&(e.isEvent?n.options&&"function"==typeof n.options.on&&n.options.on(e.payload):(delete r.processing[t],!0===r.terminating&&r.terminate(),e.error?n.resolver.reject(objectToError(e.error)):n.resolver.resolve(e.result)))}}));var o=this.worker;this.worker.on("error",i),this.worker.on("exit",(function(e,t){var n="Workerpool Worker terminated Unexpectedly\n";n+=" exitCode: `"+e+"`\n",n+=" signalCode: `"+t+"`\n",n+=" workerpool.script: `"+r.script+"`\n",n+=" spawnArgs: `"+o.spawnargs+"`\n",n+=" spawnfile: `"+o.spawnfile+"`\n",n+=" stdout: `"+o.stdout+"`\n",n+=" stderr: `"+o.stderr+"`\n",i(new Error(n))})),this.processing=Object.create(null),this.terminating=!1,this.terminated=!1,this.cleaning=!1,this.terminationHandler=null,this.lastId=0}WorkerHandler.prototype.methods=function(){return this.exec("methods")},WorkerHandler.prototype.exec=function(e,t,r,n){r||(r=_Promise.defer());var i=++this.lastId;this.processing[i]={id:i,resolver:r,options:n};var o={message:{id:i,method:e,params:t},transfer:n&&n.transfer};this.terminated?r.reject(new Error("Worker is terminated")):this.worker.ready?this.worker.send(o.message,o.transfer):this.requestQueue.push(o);var a=this;return r.promise.catch((function(e){if(e instanceof _Promise.CancellationError||e instanceof _Promise.TimeoutError)return delete a.processing[i],a.terminateAndNotify(!0).then((function(){throw e}),(function(e){throw e}));throw e}))},WorkerHandler.prototype.busy=function(){return this.cleaning||Object.keys(this.processing).length>0},WorkerHandler.prototype.terminate=function(e,t){var r=this;if(e){for(var n in this.processing)void 0!==this.processing[n]&&this.processing[n].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}if("function"==typeof t&&(this.terminationHandler=t),this.busy())this.terminating=!0;else{var i=function(e){if(r.terminated=!0,r.cleaning=!1,null!=r.worker&&r.worker.removeAllListeners&&r.worker.removeAllListeners("message"),r.worker=null,r.terminating=!1,r.terminationHandler)r.terminationHandler(e,r);else if(e)throw e};if(this.worker){if("function"==typeof this.worker.kill){if(this.worker.killed)return void i(new Error("worker already killed!"));var o=setTimeout((function(){r.worker&&r.worker.kill()}),this.workerTerminateTimeout);return this.worker.once("exit",(function(){clearTimeout(o),r.worker&&(r.worker.killed=!0),i()})),this.worker.ready?this.worker.send(TERMINATE_METHOD_ID):this.requestQueue.push(TERMINATE_METHOD_ID),void(this.cleaning=!0)}if("function"!=typeof this.worker.terminate)throw new Error("Failed to terminate worker");this.worker.terminate(),this.worker.killed=!0}i()}},WorkerHandler.prototype.terminateAndNotify=function(e,t){var r=_Promise.defer();return t&&(r.promise.timeout=t),this.terminate(e,(function(e,t){e?r.reject(e):r.resolve(t)})),r.promise};var WorkerHandler_1=WorkerHandler,_tryRequireWorkerThreads=tryRequireWorkerThreads,_setupProcessWorker=setupProcessWorker,_setupBrowserWorker=setupBrowserWorker,_setupWorkerThreadWorker=setupWorkerThreadWorker,ensureWorkerThreads_1=ensureWorkerThreads;WorkerHandler_1._tryRequireWorkerThreads=_tryRequireWorkerThreads,WorkerHandler_1._setupProcessWorker=_setupProcessWorker,WorkerHandler_1._setupBrowserWorker=_setupBrowserWorker,WorkerHandler_1._setupWorkerThreadWorker=_setupWorkerThreadWorker,WorkerHandler_1.ensureWorkerThreads=ensureWorkerThreads_1;var MAX_PORTS=65535,debugPortAllocator=DebugPortAllocator;function DebugPortAllocator(){this.ports=Object.create(null),this.length=0}DebugPortAllocator.prototype.nextAvailableStartingAt=function(e){for(;!0===this.ports[e];)e++;if(e>=MAX_PORTS)throw new Error("WorkerPool debug port limit reached: "+e+">= "+MAX_PORTS);return this.ports[e]=!0,this.length++,e},DebugPortAllocator.prototype.releasePort=function(e){delete this.ports[e],this.length--};var DEBUG_PORT_ALLOCATOR=new debugPortAllocator;function Pool(e,t){"string"==typeof e?this.script=e||null:(this.script=null,t=e),this.workers=[],this.tasks=[],t=t||{},this.forkArgs=Object.freeze(t.forkArgs||[]),this.forkOpts=Object.freeze(t.forkOpts||{}),this.workerThreadOpts=Object.freeze(t.workerThreadOpts||{}),this.debugPortStart=t.debugPortStart||43210,this.nodeWorker=t.nodeWorker,this.workerType=t.workerType||t.nodeWorker||"auto",this.maxQueueSize=t.maxQueueSize||1/0,this.workerTerminateTimeout=t.workerTerminateTimeout||1e3,this.onCreateWorker=t.onCreateWorker||(()=>null),this.onTerminateWorker=t.onTerminateWorker||(()=>null),t&&"maxWorkers"in t?(validateMaxWorkers(t.maxWorkers),this.maxWorkers=t.maxWorkers):this.maxWorkers=Math.max((environment.cpus||4)-1,1),t&&"minWorkers"in t&&("max"===t.minWorkers?this.minWorkers=this.maxWorkers:(validateMinWorkers(t.minWorkers),this.minWorkers=t.minWorkers,this.maxWorkers=Math.max(this.minWorkers,this.maxWorkers)),this._ensureMinWorkers()),this._boundNext=this._next.bind(this),"thread"===this.workerType&&WorkerHandler_1.ensureWorkerThreads()}function validateMaxWorkers(e){if(!isNumber(e)||!isInteger(e)||e<1)throw new TypeError("Option maxWorkers must be an integer number >= 1")}function validateMinWorkers(e){if(!isNumber(e)||!isInteger(e)||e<0)throw new TypeError("Option minWorkers must be an integer number >= 0")}function isNumber(e){return"number"==typeof e}function isInteger(e){return Math.round(e)==e}Pool.prototype.exec=function(e,t,r){if(t&&!Array.isArray(t))throw new TypeError('Array expected as argument "params"');if("string"==typeof e){var n=_Promise.defer();if(this.tasks.length>=this.maxQueueSize)throw new Error("Max queue size of "+this.maxQueueSize+" reached");var i=this.tasks,o={method:e,params:t,resolver:n,timeout:null,options:r};i.push(o);var a=n.promise.timeout;return n.promise.timeout=function(e){return-1!==i.indexOf(o)?(o.timeout=e,n.promise):a.call(n.promise,e)},this._next(),n.promise}if("function"==typeof e)return this.exec("run",[String(e),t]);throw new TypeError('Function or string expected as argument "method"')},Pool.prototype.proxy=function(){if(arguments.length>0)throw new Error("No arguments expected");var e=this;return this.exec("methods").then((function(t){var r={};return t.forEach((function(t){r[t]=function(){return e.exec(t,Array.prototype.slice.call(arguments))}})),r}))},Pool.prototype._next=function(){if(this.tasks.length>0){var e=this._getWorker();if(e){var t=this,r=this.tasks.shift();if(r.resolver.promise.pending){var n=e.exec(r.method,r.params,r.resolver,r.options).then(t._boundNext).catch((function(){if(e.terminated)return t._removeWorker(e)})).then((function(){t._next()}));"number"==typeof r.timeout&&n.timeout(r.timeout)}else t._next()}}},Pool.prototype._getWorker=function(){for(var e=this.workers,t=0;t<e.length;t++){var r=e[t];if(!1===r.busy())return r}return e.length<this.maxWorkers?(r=this._createWorkerHandler(),e.push(r),r):null},Pool.prototype._removeWorker=function(e){var t=this;return DEBUG_PORT_ALLOCATOR.releasePort(e.debugPort),this._removeWorkerFromList(e),this._ensureMinWorkers(),new _Promise((function(r,n){e.terminate(!1,(function(i){t.onTerminateWorker({forkArgs:e.forkArgs,forkOpts:e.forkOpts,workerThreadOpts:e.workerThreadOpts,script:e.script}),i?n(i):r(e)}))}))},Pool.prototype._removeWorkerFromList=function(e){var t=this.workers.indexOf(e);-1!==t&&this.workers.splice(t,1)},Pool.prototype.terminate=function(e,t){var r=this;this.tasks.forEach((function(e){e.resolver.reject(new Error("Pool terminated"))})),this.tasks.length=0;var n=function(e){DEBUG_PORT_ALLOCATOR.releasePort(e.debugPort),this._removeWorkerFromList(e)}.bind(this),i=[];return this.workers.slice().forEach((function(o){var a=o.terminateAndNotify(e,t).then(n).always((function(){r.onTerminateWorker({forkArgs:o.forkArgs,forkOpts:o.forkOpts,workerThreadOpts:o.workerThreadOpts,script:o.script})}));i.push(a)})),_Promise.all(i)},Pool.prototype.stats=function(){var e=this.workers.length,t=this.workers.filter((function(e){return e.busy()})).length;return{totalWorkers:e,busyWorkers:t,idleWorkers:e-t,pendingTasks:this.tasks.length,activeTasks:t}},Pool.prototype._ensureMinWorkers=function(){if(this.minWorkers)for(var e=this.workers.length;e<this.minWorkers;e++)this.workers.push(this._createWorkerHandler())},Pool.prototype._createWorkerHandler=function(){const e=this.onCreateWorker({forkArgs:this.forkArgs,forkOpts:this.forkOpts,workerThreadOpts:this.workerThreadOpts,script:this.script})||{};return new WorkerHandler_1(e.script||this.script,{forkArgs:e.forkArgs||this.forkArgs,forkOpts:e.forkOpts||this.forkOpts,workerThreadOpts:e.workerThreadOpts||this.workerThreadOpts,debugPort:DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart),workerType:this.workerType,workerTerminateTimeout:this.workerTerminateTimeout})};var Pool_1=Pool;function Transfer$1(e,t){this.message=e,this.transfer=t}var transfer=Transfer$1,worker_1=createCommonjsModule((function(module,exports){var requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}};if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,t){addEventListener(e,(function(e){t(e.data)}))},worker.send=function(e){postMessage(e)};else{if(void 0===process$1)throw new Error("Script must be executed as a worker");var WorkerThreads;try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(e){if("object"!=typeof e||null===e||"MODULE_NOT_FOUND"!==e.code)throw e}if(WorkerThreads&&null!==WorkerThreads.parentPort){var parentPort=WorkerThreads.parentPort;worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort),worker.exit=process$1.exit.bind(process$1)}else worker.on=process$1.on.bind(process$1),worker.send=function(e){process$1.send(e)},worker.on("disconnect",(function(){process$1.exit(1)})),worker.exit=process$1.exit.bind(process$1)}function convertError(e){return Object.getOwnPropertyNames(e).reduce((function(t,r){return Object.defineProperty(t,r,{value:e[r],enumerable:!0})}),{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,t){var r=new Function("return ("+e+").apply(null, arguments);");return r.apply(r,t)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){var t=function(){worker.exit(e)};if(!worker.terminationHandler)return t();var r=worker.terminationHandler(e);isPromise(r)?r.then(t,t):t()};var currentRequestId=null;worker.on("message",(function(e){if(e===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var t=worker.methods[e.method];if(!t)throw new Error('Unknown method "'+e.method+'"');currentRequestId=e.id;var r=t.apply(t,e.params);isPromise(r)?r.then((function(t){t instanceof transfer?worker.send({id:e.id,result:t.message,error:null},t.transfer):worker.send({id:e.id,result:t,error:null}),currentRequestId=null})).catch((function(t){worker.send({id:e.id,result:null,error:convertError(t)}),currentRequestId=null})):(r instanceof transfer?worker.send({id:e.id,result:r.message,error:null},r.transfer):worker.send({id:e.id,result:r,error:null}),currentRequestId=null)}catch(t){worker.send({id:e.id,result:null,error:convertError(t)})}})),worker.register=function(e,t){if(e)for(var r in e)e.hasOwnProperty(r)&&(worker.methods[r]=e[r]);t&&(worker.terminationHandler=t.onTerminate),worker.send("ready")},worker.emit=function(e){if(currentRequestId){if(e instanceof transfer)return void worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer);worker.send({id:currentRequestId,isEvent:!0,payload:e})}},exports.add=worker.register,exports.emit=worker.emit}));worker_1.add,worker_1.emit;var pool=function(e,t){return new Pool_1(e,t)},worker=function(e,t){var r=worker_1;r.add(e,t)},workerEmit=function(e){worker_1.emit(e)},Promise$1=_Promise,Transfer=transfer,platform=environment.platform,isMainThread=environment.isMainThread,cpus=environment.cpus,src={pool:pool,worker:worker,workerEmit:workerEmit,Promise:Promise$1,Transfer:Transfer,platform:platform,isMainThread:isMainThread,cpus:cpus};function s(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.requests=[],console.log("RequestTracker")}static getInstance(){return l.instance||(l.instance=new l),l.instance}addRequest(e){if(this.isDuplicateRequest(e)){let t=this.findRequest(e);this.cancelRequest(t)}this.requests.push(e)}findRequest(e){let t;for(const r of this.requests)if(this.areRequestsEqual(r,e)){t=r;break}return t}removeRequest(e){const t=this.requests.indexOf(e);-1!==t&&this.requests.splice(t,1)}cancelRequest(e){e.cancelToken.cancel("Request canceled"),this.removeRequest(e)}isDuplicateRequest(e){return this.requests.some((t=>this.areRequestsEqual(t,e)))}areRequestsEqual(e,t){var r,n;return e.url===t.url&&JSON.stringify(null===(r=e.headers)||void 0===r?void 0:r.sponsor)===JSON.stringify(null===(n=t.headers)||void 0===n?void 0:n.sponsor)&&JSON.stringify(e.data)===JSON.stringify(t.data)&&JSON.stringify(e.params)===JSON.stringify(t.params)&&e.method===t.method}}const d=l.getInstance(),c=3e4,u=3e4,h=(t="",r)=>{let n,i=e.create({baseURL:t,timeout:c,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}});return i.interceptors.request.use((function(t){let{url:r,params:i,headers:o,data:a,method:s}=t;const c=e.CancelToken.source();return n={url:r,params:i,headers:o,data:a,method:s,cancelToken:c},t.cancelToken=c.token,d.addRequest(n),sessionStorage.getItem("anov-go-token")&&"null"!=sessionStorage.getItem("anov-go-token")&&(t.headers["X-ANOV-ACCESS-TOKEN"]=sessionStorage.getItem("anov-go-token")),sessionStorage.getItem("unify-access-token")&&"null"!=sessionStorage.getItem("unify-access-token")&&(t.headers["X-UNIFY-ACCESS-TOKEN"]=sessionStorage.getItem("unify-access-token")),sessionStorage.getItem("dgcc_authorization")&&"null"!=sessionStorage.getItem("dgcc_authorization")&&(t.headers.dgcc_authorization=sessionStorage.getItem("dgcc_authorization")),"post"===t.method?(t.headers["Content-Type"]="application/json;",t):"get"===t.method?t:"put"===t.method?(t.headers["Content-Type"]="application/json; charset=UTF-8",t):"delete"===t.method?t:void 0}),(function(e){return Promise.reject(e)})),i.interceptors.response.use((function(e){return 200===e.status||e.data.code,r&&r(e),d.removeRequest(n),e.data}),(function(e){return r&&(d.removeRequest(n),r(null==e?void 0:e.response)),Promise.reject(e.response)})),i},p=(e,t)=>{try{let r=t||window.location.href;if(-1!=r.indexOf("?")){let t={};return r.slice(r.indexOf("?")+1).split("&").forEach((e=>{let r=e.split("=");t[r[0]]=r[1]})),e?t[e]?t[e]:null:t}return console.log("没有参数"),null}catch(e){console.error(e)}};function m(e,t=!1){try{return t?f(e)?e:JSON.stringify(e):f(e)?JSON.parse(e):e}catch(t){return console.log("转化JSON 发生错我!",e),e}}const f=e=>{if("string"==typeof e)try{const t=JSON.parse(e);return"object"==typeof t&&null!==t}catch(e){return!1}return!1},g=(e,t)=>{try{const r=JSON.stringify(t);sessionStorage.setItem(e,r)}catch(t){console.error(`Error setting session data for key ${e}:`,t)}},v=e=>{const t=sessionStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(t){console.error(`Error parsing session data for key ${e}:`,t)}return null},y=e=>{for(const t of e)t.code&&(t.code=t.code.replace(/>/g,">").replace(/</g,"<"))},b=(e,t)=>{e instanceof Map?e.forEach((e=>{t([e])})):Array.isArray(e)&&e.forEach((e=>{t(e.children)}))},w=(e,t)=>{const r=e=>{var n,i,o;if(e)for(const a of e){const e=null===(o=null===(i=null===(n=null==a?void 0:a.tmpData)||void 0===n?void 0:n.source)||void 0===i?void 0:i.converse)||void 0===o?void 0:o.data;(null==e?void 0:e.length)&&y(e),t(a),a.children?r(a.children):a.dynamicChildren?b(a.dynamicChildren,r):a.stateChildren&&r(a.stateChildren)}};r(e)},D=(e,t,r,n)=>{const i=e.match(/({{[\w]*}})|((@)[\w]*)/gm);if(i){const e=i.map((e=>e.replace(/{{|}}|@/gm,"")));for(const i of e)if(i&&t&&!(t.findIndex((e=>e.mapField===i))<0))return r&&n&&k(n,i,r.cid),!0}return!1},k=(e,t,r)=>{if(!e)throw new Error("Share variable tree is not defined");if("string"!=typeof t)throw new Error("Variable name should be a string");if(!r)throw new Error("ID is required");Array.isArray(e[t])||(e[t]=[]),e[t].includes(r)||e[t].push(r)},N=(e,t,r)=>{var n;let i=!1;const o=null==t?void 0:t.converse;if(o&&o.use&&o.data.length)for(const t of o.data)if((null==t?void 0:t.dependVars)&&t.dependVars.includes(e))return!0;const a=null==t?void 0:t[null==t?void 0:t.type];return((null==a?void 0:a.inputSql)||(null==a?void 0:a.url)||(null==a?void 0:a.headers)||(null==a?void 0:a.params))&&(i=D(a.inputSql||a.url||(null===(n=a.headers)||void 0===n?void 0:n.value)||a.params,r)),i},x=(e,t,r=!1)=>{let n=null;const i=e=>{for(const o of e){if(o.cid===t){n=o,r&&_$1.remove(e,(e=>e.cid===t));break}if(o.children&&i(o.children),o.dynamicChildren&&Array.isArray(o.dynamicChildren))for(const[,e]of Array.from(o.dynamicChildren))i(e);o.stateChildren&&i(o.stateChildren)}};return i(e),n},S=(e,t,r)=>{let n=!1;const i=e=>{for(let o=0;o<e.length;o++){if(e[o].cid==t){n=e[o],r&&_$1.remove(e,(e=>e.cid==t));break}if(e[o].children)i(e[o].children);else if(e[o].dynamicChildren){if(e[o].dynamicChildren instanceof Map){let t=Array.from(e[o].dynamicChildren);for(let e=0;e<t.length;e++)if(t[e]instanceof Array){let r=t[e][1];i(r)}}else if(e[o].dynamicChildren instanceof Array){let t=e[o].dynamicChildren;for(let e=0;e<t.length;e++)if(t[e]instanceof Array){let r=t[e][1];i(r)}}}else e[o].stateChildren&&i(e[o].stateChildren)}};return i(e),n||!1};function C(e,t,r){const n={};r&&r.forEach((e=>{(null==e?void 0:e.name)&&(n[e.name]=e.value||e.originvalue)}));try{return new Function("data","vars",e)(t,n)}catch(e){return console.error(e),t}}function A(e,t,r){let n=_$1.cloneDeep(t);const i={};r&&r.forEach((e=>{(null==e?void 0:e.name)&&(i[e.name]=e.value||e.originvalue)}));try{return new Function("data","vars",e)(n,i)}catch(e){return console.error(e),n}}const O=e=>{let t=window.goFetchList;return t||(window.goFetchList={},t=window.goFetchList),t[e]?!t[e]&&void 0:(t[e]={id:e,time:(new Date).getTime()},!0)},I=e=>{let t=window.goFetchList;t&&t[e]&&delete t[e]},T="anov@2019:helloX",V="anov@2020:helloX";function F(e){let t=cryptoJs.enc.Utf8.parse(T),r=cryptoJs.enc.Utf8.parse(V);return cryptoJs.AES.encrypt(e,t,{iv:r,mode:cryptoJs.mode.CBC,padding:cryptoJs.pad.Pkcs7}).toString()}function E(e,t){if(0===e.length)throw new Error("Array is empty.");if(!t)return e[Math.floor(Math.random()*e.length)];if(t.length!==e.length)throw new Error("Length of probabilities array must match length of array.");const r=t.reduce(((e,t)=>e+t),0),n=Math.random()*r;let i=0;for(let r=0;r<e.length;r++)if(i+=t[r],n<i)return e[r];return e[0]}const P=new Blob(["\nfunction proxyObj(originObj) {\n const exposeObj = new Proxy(originObj, {\n has: (target, key) => {\n if (['fetch', 'XMLHttpRequest', 'postMessage'].indexOf(key) >= 0) {\n throw new Error('Illegal operation for key'+key)\n } else {\n return target[key]\n }\n },\n })\n return exposeObj\n}\nfunction compileCode(src) {\n src = 'with (exposeObj) {'+src+'}'\n //console.log(src)\n return new Function('exposeObj', src)\n}\nfunction run(code) {\n let proxy = proxyObj({})\n let result = compileCode(code)(proxy)\n return result\n}\n\nonmessage = (e) => {\n try {\n let result = run(e.data.code)\n postMessage({\n code: 1,\n result,\n })\n } catch (err) {\n postMessage({\n code: -1,\n err,\n })\n }\n}\n"]),j=URL.createObjectURL(P);function R(e,t){return s(this,arguments,void 0,(function*(e,t,r={},n="worker"){try{if("window"==n){let[n,i]=[["data"],[t]];"object"==typeof r&&Object.keys(r).forEach((e=>{n.push(e),i.push(r[e])}));return{success:!0,data:new Function(...n,e)(...i)}}{let[n,i,o]=[t,r,""];"object"==typeof n&&(n=JSON.stringify(t)),"object"==typeof r&&(i=JSON.stringify(r)),Object.keys(r).forEach((e=>o+=`${e},`));let a=`let data=eval(${n}); \n let app=${JSON.stringify({})};`;a+=o?`let {${o}} = eval(${i}); `:"",a+=`${e}`;let c=yield function(e){return s(this,arguments,void 0,(function*(e,t=5e3){let r=new Worker(j);return new Promise(((n,i)=>{const o=()=>{clearTimeout(s),r.removeEventListener("message",a),r.terminate(),r=null},a=e=>{let{code:t,result:r,err:a}=e.data;o(),1===t?n(r):i(a)};r.postMessage({code:e}),r.addEventListener("message",a);let s=setTimeout((()=>{o(),i("timeout")}),t)}))}))}(a);return{success:!0,data:c}}}catch(e){return{success:!1,error:e,data:t}}}))}var $,q,M,U;!function(e){e.StaticFile="staticFile",e.DataSource="datasource"}($||($={})),function(e){e.json="application/json;charset=UTF-8",e.form="application/x-www-form-urlencoded; charset=UTF-8"}(q||(q={})),function(e){e.get="GET",e.post="POST",e.put="PUT",e.patch="PATCH",e.delete="DELETE"}(M||(M={}));class L{constructor(e){this.db=null,this.dbName=e.databaseName,this.tableName=e.tableName,this.keyPath=e.keyPath}static getInstance(e){return L.instance||(L.instance=new L(e)),L.instance}init(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,1);r.onerror=e=>{t(e.target.error)},r.onupgradeneeded=e=>{this.db=e.target.result,this.db.objectStoreNames.contains(this.tableName)||this.db.createObjectStore(this.tableName,{keyPath:this.keyPath})},r.onsuccess=t=>{this.db=t.target.result,e()}}))}))}addRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).add(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}deleteRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}updateRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(e);n.onsuccess=()=>{t()},n.onerror=e=>{r(e.target.error)}}))}))}getRecord(e){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((t,r)=>{const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.onsuccess=()=>{t(n.result)},n.onerror=e=>{r(e.target.error)}}))}))}getAllRecords(){return s(this,void 0,void 0,(function*(){if(!this.db)throw new Error("数据库未初始化。");return new Promise(((e,t)=>{const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAll();r.onsuccess=()=>{e(r.result)},r.onerror=e=>{t(e.target.error)}}))}))}}L.instance=null,function(e){e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e[e.TRACE=5]="TRACE"}(U||(U={}));const H={databaseName:"GODB",tableName:"go-log",keyPath:"time"};class B{constructor(){this.logLevel=U.INFO,this.indexedDBInstance=L.getInstance(H);try{this.indexedDBInstance.init(),console.log("IndexedDB 初始化成功。")}catch(e){console.error("初始化 IndexedDB 时出错:",e)}}static getInstance(){return B.instance||(B.instance=new B),B.instance}setLogLevel(e){this.logLevel=e}getColor(e){switch(e){case U.FATAL:return"[31;1m";case U.ERROR:return"[31m";case U.WARN:return"[33m";case U.INFO:return"[32m";case U.DEBUG:return"[36m";case U.TRACE:return"[34m";default:return"[0m"}}log(e,t){if(t<=this.logLevel){const r=(new Date).toISOString(),n=`[${r}] [${U[t]}]`,i=this.getColor(t);if(null===window||void 0===window?void 0:window.goDev)console.log(`${i}${n} ${e}[0m`);else{let t=v("anov-go-userInfo"),o=v("anov-go-proid"),a=` [操作人:${null==t?void 0:t.userName} 项目ID:${o}] `;const s={time:r,value:`${e}`};try{this.indexedDBInstance.addRecord(s)}catch(e){console.error("添加记录时出错:",e)}console.log(`${i}${n} ${a} ${e}[0m`)}}}fatal(e){this.log(e,U.FATAL)}error(e){this.log(e,U.ERROR)}warn(e){this.log(e,U.WARN)}info(e){this.log(e,U.INFO)}debug(e){this.log(e,U.DEBUG)}trace(e){this.log(e,U.TRACE)}}const z=B.getInstance(),J=(e,t)=>"string"!=typeof e?Promise.reject(new Error("URL should be a string")):h(e,t),G$1=h();let _=h();function W(e){return s(this,arguments,void 0,(function*(e,t="get",r={},n={},i){try{const o={method:M[t],url:e,headers:n,timeout:u};return["post","put"].includes(t.toLowerCase())?o.data=_$1.cloneDeep(r):o.params=_$1.cloneDeep(r),i&&(o.headers.sponsor=i),/.json$/.test(e)?function(e){return s(this,void 0,void 0,(function*(){try{return(yield G$1({method:"get",url:e})).data}catch(e){throw console.error("JSON 数据请求:",e),e}}))}(e):function(e){return s(this,void 0,void 0,(function*(){try{return{code:2e4,data:(yield G$1(e)).data}}catch(e){throw console.error("请求数据发生错误-Error:",e),e}}))}(o)}catch(e){throw console.error("获取数据:Error:",e),e}}))}function X(e,t,r,n,i){return s(this,void 0,void 0,(function*(){try{const o=(window.anUrl||"")+(window.agentPath||"/ds/v1/api-proxy/v1/query"),a=m(r,!0);return yield G$1({url:o,method:"post",headers:{"Content-Type":"application/json;charset=UTF-8",sponsor:i||""},data:{body:"post"===e?a:void 0,headers:f(n)?m(n,!0):n,method:e,url:t}})}catch(e){throw console.error("代理请求数据:Error1:",e),e}}))}function K(e,t,r,n,i,o){return s(this,void 0,void 0,(function*(){return i?X(t,e,r,n,o):W(e,t,r,n,o)}))}function Q(e,t="",r){var n,i,o,a;const s=`${null!==(i=null===(n=null===window||void 0===window?void 0:window.BaseUrl)||void 0===n?void 0:n.replace("/management",""))&&void 0!==i?i:""}/ds/data-engine/v1/${e}/zb-query?token=${(null===(o=de("YZH_EXCHANGE_TOKEN"))||void 0===o?void 0:o.YZH_EXCHANGE_TOKEN)||(null===(a=null===window||void 0===window?void 0:window.yzhAuth)||void 0===a?void 0:a.getToken())}&passid=${null===window||void 0===window?void 0:window.gdPassid}${(null===window||void 0===window?void 0:window.BASE_RELEASE)?"&preview=1":""}`;let u={};try{u=t?JSON.parse(t):{}}catch(e){u=t||{}}return G$1({method:"POST",url:s,data:{headers:r,param:u},timeout:c})}function Y(e="",t){const r=`${null===window||void 0===window?void 0:window.BaseUrl}/ds/v1/data-views/query`;let n={};try{n=e?JSON.parse(e):{}}catch(t){n=e||{}}return G$1({method:"POST",url:r,data:{headers:t,param:n},timeout:c})}const Z=(e,t)=>s(void 0,void 0,void 0,(function*(){const r=window.BaseUrl,{dateType:n="",endPeriod:i="",metricsName:o=e,startPeriod:a=""}=t;return _({method:"GET",url:`${r}ds/v1/metrics/v1/data-alarm?dateType=${n}&endPeriod=${i}&metricsName=${o}&startPeriod=${a}`,timeout:c})})),ee=(e,t,r)=>s(void 0,void 0,void 0,(function*(){var n;const i=(null===(n=window.BaseUrl)||void 0===n?void 0:n.replace("/management",""))||"";t.newEncryption=!0;const o={staticFile:{method:"get",params:t,url:`${i}/ds/v1/file/v1/${e}/query`},datasource:{method:"post",url:`${i}/ds/v1/database/v1/${e}/query`,data:Object.assign({},t)}}[r];if(!o)throw new Error("Invalid data type provided");return G$1(Object.assign({timeout:c},o))})),te=e=>new Promise(((t,r)=>{let n;n=e.originData&&Object.keys(e.originData).length?e.originData:e.data,void 0!==n?t({data:n}):r("Failed to retrieve cdata")})),ie=(e,t,r)=>{try{switch(t){case"api":{let t=he(e,r);return{requestType:t.requestType,url:t.url,params:t.params,headers:t.headers,agency:t.agency}}case"static":return{data:e};case"datasource":{const t=ue(e.inputSql,r);return{dsName:e.dsName,dsType:"1",sql:F(t),filter:e.sqlFilter}}case"staticFile":return{dsName:e.dsName,dsType:e.dsType,sql:""};case"indicator":return{zbId:e.zbId,params:ue(e.params,r),headers:ue(e.headers,r)};case"dataSet":return{params:ue(e.params,r),headers:ue(e.headers,r)};case"indicatorCQ":return{zbName:e.zbName,params:ue(e.params,r)};case"packData":return{};default:throw new Error("Invalid type")}}catch(t){console.log("准备请求数据发生错误",t,e)}},oe=(e,t,r)=>s(void 0,void 0,void 0,(function*(){try{switch(t){case"api":return yield K(e.url,e.requestType,e.params,e.headers,e.agency,r);case"static":return yield te(e.data);case"datasource":return yield ee(e.dsName,{dsType:e.dsType,sql:e.sql,filter:e.filter},"datasource");case"staticFile":return yield ee(e.dsName,{dsType:e.dsType,sql:e.sql},"staticFile");case"indicator":return yield Q(e.zbId,e.params,e.headers);case"dataSet":return yield Y(e.params,e.headers);case"indicatorCQ":return yield Z(e.zbName,e.params);case"packData":return{};default:throw new Error("Invalid type")}}catch(e){return console.warn(e,"执行请求并获取数据发生错误"),yield new Promise(((e,t)=>{e({error:!0})}))}})),re=(e,t,r,...n)=>s(void 0,[e,t,r,...n],void 0,(function*(e,t,r,n=[],i=!1){const o=t||e.tmpData.source.dataType,a=e.tmpData.source["indicatorCQ"==o?"indicator":o];if("globalData"===o){const e=n.find((e=>e.key===a.id||e.key===a.key)),t=v(a.id);if(t&&!i)return t.data;if(e){let t=yield ae(e,r),n={key:a.id,data:t};return g(a.id,n),t}return}const s=ie(a,o,r),c=yield oe(s,o,e.cid?e.cid:"");return(null==c?void 0:c.data)?c.data:c})),ae=(e,t)=>s(void 0,void 0,void 0,(function*(){let r=Object.assign({},{tmpData:{source:e.value}});const n=r.tmpData.source.type,i=r.tmpData.source[n],o=ie(i,n,t),a=yield oe(o,n);return yield ne(a.data,r,!0,t)})),ne=(e,t,...r)=>s(void 0,[e,t,...r],void 0,(function*(e,t,r=!0,n){try{const{converse:i,mapFields:o}=t.tmpData.source;return i&&i.use&&r?yield new Promise(((t,r)=>{const o=function(e,t,r,n,i){return s(this,void 0,void 0,(function*(){let r,i=e,{use:o,data:a}=_$1.cloneDeep(t);if(o)for(let e=0;e<a.length;e++)if(a[e].use){let t=a[e].dependVars,o={};n&&o&&t&&t.length&&t.map((e=>{let t=_$1.cloneDeep(n).filter((t=>{let r=t.mapField==e;return r&&(o[e]=t.value),r}));t&&0!=t.length||(o[e]="")})),r=yield R(a[e].code,i,o,a[e].mode?a[e].mode:"worker"),i=r.data}return i}))}(e,i,0,n);t(o)})):yield new Promise(((t,r)=>{t(e)}))}catch(t){return console.error("执行过滤器发生错误:"+t),yield new Promise(((t,r)=>{t(e)}))}})),se=(e,t,r)=>{const{source:n}=e.tmpData,i=n.type;r?("static"===i&&n[i]&&(n[i].originData=r),"indicatorCQ"===i?n.indicator.data=t:n[i].data=t):"indicatorCQ"===i?n.indicator.data=t:n[i].data=t,e.source=t},le=(e,t,...r)=>s(void 0,[e,t,...r],void 0,(function*(e,t,r=[],n,i,o){try{let a=e.tmpData.source.type,s=yield re(e,a,r,n,o||!1);if(null==s||!s)return i&&i({error:!0}),Promise.resolve({error:!0});let c=yield ne(s,e,t,r);return se(e,c),i&&i(c),(null==e?void 0:e.cid)&&I(e.cid),Promise.resolve(c)}catch(e){return i&&i(e),z.error("Error in updateComData"),console.error("Error in updateComData:",e),Promise.reject(e)}})),de=e=>{const t={};if(e&&e.includes("?")){const r=e.split("?")[1].split("&");for(let e of r){const[r,n]=e.split("=").map(decodeURIComponent);t[r]=n}}return t},ce=e=>{try{return(null==e?void 0:e.value)&&"string"==typeof e.value?JSON.parse(e.value):"string"==typeof e?JSON.parse(e):e}catch(t){return e}},ue=(e,t)=>{if(!t)return ce(e);if("string"==typeof e){if(""===e.trim())return"";try{if("string"!=typeof JSON.parse(e))return ue(JSON.parse(e),t);{let r=e.replace(/@(\w+)|{{(\w+)}}/g,((e,r,n)=>{const i=r||n,o=t.find((e=>e.mapField===i));return o?o.value||o.originalValue||"":e}));return ce(r)}}catch(r){let n=e.replace(/@(\w+)|{{(\w+)}}/g,((e,r,n)=>{const i=r||n,o=t.find((e=>e.mapField===i));return o?o.value:e}));return ce(n)}}else{if(Array.isArray(e))return e.map((e=>ue(e,t)));if("object"==typeof e&&null!==e){const r={};for(let n in e)r[n]=ue(e[n],t);return ce(r)}}return ce(e)},he=(e,t)=>{const r=e.agency,n=e,{url:i=null,headers:o,params:a,requestType:s}=n,c=i?ue(i,t):void 0,u=o&&o.use?ue(o.value,t):{};return{url:c,requestType:s,params:a?ue(a,t):{},headers:u,agency:r}},pe=(e,t,r,n,i)=>s(void 0,void 0,void 0,(function*(){if(e&&e.length)for(const o of e)N(t,o.value,r)&&(yield le({tmpData:{source:{type:"globalData",globalData:{id:o.key}}}},!0,r,e,(e=>{console.log("数据更新成功-变量改变全局数据跟新")}),!0),w(n,(t=>{var n,a,s;"globalData"===(null===(a=null===(n=null==t?void 0:t.tmpData)||void 0===n?void 0:n.source)||void 0===a?void 0:a.type)&&(null===(s=null==t?void 0:t.tmpData)||void 0===s?void 0:s.source.globalData).id===o.key&&le(t,!0,r,e,(e=>{i(t,e)}),!1)})))})),me=(e,t,r,n,i)=>s(void 0,void 0,void 0,(function*(){e&&(yield le({tmpData:{source:{type:"globalData",globalData:{id:e.key}}}},!0,t,r,(e=>{console.log("数据更新成功-数据源编辑")}),!0),w(n,(n=>{var o,a,s;"globalData"===(null===(a=null===(o=null==n?void 0:n.tmpData)||void 0===o?void 0:o.source)||void 0===a?void 0:a.type)&&(null===(s=null==n?void 0:n.tmpData)||void 0===s?void 0:s.source.globalData).id===e.key&&le(n,!0,t,r,(e=>{i(n,e)}),!1)})))}));class fe{constructor(e,t){this.isUpdating=!1,this.des=e.des,this.field=e.field,this.id=e.id,this.key=e.key,this.mapping=e.mapping,this.mapField=e.mapField,this.type=e.type,this.originalValue=e.originalValue,this.model=(null==e?void 0:e.model)?null==e?void 0:e.model:1,this.converter=e.converter,this.converterCode=e.converterCode,this.fork=e.fork,this.delayUpdate=!!(null==e?void 0:e.delayUpdate),t&&(this.globalVariables=t),e.fork&&(this.model=5,this.forkValue=e.forkValue,this.originalValue=this.getForkedValue())}get value(){if(this.fork&&(this.originalValue=this.getForkedValue()),this.converter&&this.converterCode){let e=[];return A(this.converterCode,this.originalValue,e)}return this.originalValue}togglePropertyState(e){let t=Object.prototype.hasOwnProperty.call(this,e);this[e]=!t||!e}getForkedValue(){if(this.forkValue&&Array.isArray(this.forkValue))return this.forkValue.map((e=>{const t=this.globalVariables.get(e);return t?t.value:null}));if(this.forkValue){const e=this.globalVariables.get(this.forkValue);return e?e.value:null}return null}updateValue(e,t){var r;const n=Object.assign({},this,e);this.des=n.des,this.field=n.field,this.mapping=n.mapping,this.type=n.type,this.originalValue=n.originalValue,this.converter=n.converter,this.converterCode=n.converterCode,this.fork=n.fork,this.delayUpdate=null==n?void 0:n.delayUpdate,this.model=null==n?void 0:n.model,e.id&&(this.id?"string"==typeof this.id?e.id instanceof Array?this.id=_$1.uniq([this.id,...e.id]):this.id=[this.id,e.id]:this.id instanceof Array&&(e.id instanceof Array?this.id=_$1.uniq([...this.id,...e.id]):this.id=_$1.uniq([...this.id,e.id])):this.id=e.id),e.fork&&(this.model=5,this.forkValue=null!==(r=e.forkValue)&&void 0!==r?r:this.forkValue,this.originalValue=this.getForkedValue()),t&&t(this)}updateWidthOriginalValue(e,t){var r;this.originalValue=e,this.fork&&(this.forkValue=null!==(r=this.forkValue)&&void 0!==r?r:this.forkValue,this.originalValue=this.getForkedValue()),t&&t(this)}renew(e){e&&e(this)}static create(e,t){return new fe(e,t)}}class ge{constructor(){this.variables=new Map,this.globalObservers=[],this.url=window.location.search,this.list=[]}clearVars(){this.list=[],this.variables.clear()}togglePropertyState(e,t,r){try{let n=this.getVariable(e);if(!n)throw new Error("没有找到相应的变量!");n.togglePropertyState(t),this.addToObjectArray(this.list,n),r&&r()}catch(e){console.error(e)}}static getInstance(){return ge.instance||(ge.instance=new ge),ge.instance}getFullUrl(){this.url=window.location.search}getAllUrlParams(){const e=new URLSearchParams(window.location.search),t={};for(const[r,n]of e.entries())t[r]=n;return t}delVariable(e,t){this.variables.delete(e),this.list=this.list.filter((t=>t.mapField!=e)),t&&t()}addUrlParamsToGlobalVars(){this.getFullUrl();let e=this.getAllUrlParams(),t=Object.keys(e),r=[];for(const n of t)r.push({mapField:n,originalValue:e[n],model:4});if(r.length)for(const e of r)this.addVariable(e)}addVariables(e){Array.isArray(e)?e.map(((e,t)=>{this.addVariable(e)})):this.addVariable(e),this.addUrlParamsToGlobalVars()}addVariable(e,t){if(!e||!(null==e?void 0:e.mapField))return console.error(e+"参数不合法!"),!1;if(this.isVariableNameExist(e.mapField)){let r=this.getVariable(e.mapField);return this.sameValue(r,e)?r:(this.editVariable(e,t),!1)}const r=fe.create(e,this.variables);return this.variables.set(r.mapField,r),this.addToObjectArray(this.list,r),t&&t(r),this.notifyGlobalObservers(r),r}toJSON(e){try{return!!e&&JSON.stringify(e)}catch(e){return!1}}sameValue(e,t){if(e.mapfield!==t.mapfield)return!1;for(const r in t)if(!(["mapfield","field","key","value","name","globalVariables"].includes(r)||r in e&&e[r]==t[r]))return!1;return!0}creatVarJson(e){const{des:t,field:r,id:n,key:i,mapping:o,mapField:a,type:s,value:c,originalValue:u,model:l,converter:d,converterCode:h,fork:f,forkValue:p,update:m,delayUpdate:g}=e,v={};return void 0!==t&&(v.des=t),void 0!==r&&(v.field=r),void 0!==n&&(v.id=n),void 0!==i&&(v.key=i),void 0!==o&&(v.mapping=o),void 0!==a&&(v.mapField=a),void 0!==s&&(v.type=s),void 0!==c&&(v.value=c),void 0!==u&&(v.originalValue=u),void 0!==l&&(v.model=l),void 0!==d&&(v.converter=d),void 0!==h&&(v.converterCode=h),void 0!==f&&(v.fork=f),void 0!==p&&(v.forkValue=p),void 0!==m&&(v.update=m),void 0!==g&&(v.delayUpdate=g),v}addToObjectArray(e,t){let r=!1;for(let n=0;n<e.length;n++)if(e[n].mapField==t.mapField){e[n]=this.creatVarJson(t),r=!0;break}r||e.push(t)}editVariable(e,t){const r=this.getVariable(e.mapField);if(r&&this.isVariableNameExist(e.mapField)&&this.sameValue(r,e))return;const n=e=>{e.isUpdating||(e.isUpdating=!0,this.notifyGlobalObservers(e),this.isMapFieldInForkValues(e.mapField).forEach((e=>{let t=this.getVariable(e.mapField);t&&t.renew((e=>{this.addToObjectArray(this.list,e),this.notifyGlobalObservers(e)}))})),this.addToObjectArray(this.list,e),t&&t(e),e.isUpdating=!1)};r?r.updateValue(e,n):this.addVariable(e,n)}getForkList(e){return this.isMapFieldInForkValues(e)||[]}editVariableForValue(e,t,r){const n=this.getVariable(e);n&&n.updateWidthOriginalValue(t,(e=>{e.isUpdating||(e.isUpdating=!0,this.notifyGlobalObservers(e),this.isMapFieldInForkValues(e.mapField).forEach((e=>{let t=this.getVariable(e.mapField);t&&t.renew((e=>{this.addToObjectArray(this.list,e),this.notifyGlobalObservers(e)}))})),this.addToObjectArray(this.list,e),r&&r(e),e.isUpdating=!1)}))}isMapFieldInForkValues(e){return this.getAllVariables().filter((e=>e.fork&&e.forkValue)).filter((t=>t.forkValue==e||Array.from(t.forkValue).includes(e)))}isVariableNameExist(e){return this.variables.has(e)}checkExist(e,t){if("string"==typeof e&&this.isVariableNameExist(e)){let r=this.getVariable(e);return t==r.id&&!r.id.includes(t)&&[{key:e}]}if(Array.isArray(e)){const r=e.filter((e=>{let r=this.getVariable(e);return this.isVariableNameExist(e)&&t!=r.id&&!(r.id&&r.id.includes(t))})).map((e=>({key:e})));return!!r.length&&r}return!1}getVariable(e){return this.variables.get(e)}getVariableForId(e){var t;let r=[];for(const[,n]of this.variables)(n.id===e||(null===(t=n.id)||void 0===t?void 0:t.includes(e)))&&r.push(n);return _$1.uniq(r)}getAllVariables(e=!1){return this.addUrlParamsToGlobalVars(),e?(this.list=Array.from(this.variables.values()),this.list):[...this.list]}restoreVariables(e){e.forEach((e=>{this.addVariable(e)}))}registerGlobalObserver(e){this.globalObservers.push(e)}notifyGlobalObservers(e){this.globalObservers.forEach((t=>{t.update(e)}))}}ge.instance=null;const ve=ge.getInstance(),ye=(e,t)=>Array.isArray(t)?t.some((t=>e&&(void 0!==e[t]||e.hasOwnProperty(t)))):"string"==typeof t&&e&&(void 0!==e[t]||e.hasOwnProperty(t)),be=(e,t,r,n)=>{const i=((e,t,r,n)=>{var i;let o;if(ye(e,null==t?void 0:t.field)||ye(e,null==t?void 0:t.forkValue))o=e[null==t?void 0:t.field]||"";else if(ye(e.data,null==t?void 0:t.field)||ye(e.data,null==t?void 0:t.forkValue))o=e.data[null==t?void 0:t.field]||"";else{const e=x(r,n),a=(null===(i=null==e?void 0:e.tmpData)||void 0===i?void 0:i.actions)||[];for(const e of a){const r=e.vars.find((e=>(null==e?void 0:e.mapField)===(null==t?void 0:t.mapField)));if(r){o=r.value;break}}}return o})(e,t,r,n);return void 0!==i?i:t.value},we=(e,t,r,n,i,o,a,s,c)=>{var u;switch(e.type){case"link":let l=ue(e.link,o);window.open(l,e.target);break;case"page":if(null===(u=null==e?void 0:e.params)||void 0===u?void 0:u.length)for(let t=0;t<e.params.length;t++){const r=e.params[t],n=o.find((e=>e.mapField==r.mapField));n&&(r.value=n.value)}c&&c(e);break;case"dynamic":((e,t,r,n,i)=>{const o=e.dynamic||[];for(const a of o){if(e.id!==t.cid)continue;const o=x(r,a.pid);o&&(o.activeDynamic=a.name,o.isShow=a.visible||!n||e.index===t.index-1,i({cid:o.cid,flag:a.visible}))}})(e,t,r,n,i);break;case"toggle":((e,t,r,n,i)=>{const o=e.children||[];for(const r of o){const o=r.visible&&(!n||e.index===t.index-1);i({cid:r.cid,flag:o})}})(e,t,0,n,i);break;case"update":((e,t,r,n,i)=>{const o=e.children||[];for(const e of o){const o=x(t,e.cid);o&&le(o,!0,r,n,(e=>{i({cid:o.cid,data:e})}))}})(e,r,o,a,s)}},De=(e,t,r,n,i,o,a,s,c,u)=>{const{cid:l,actions:d,index:h}=i,{eventName:f,mode:p}=d,m=2===p;((e,t,r,n,i,o)=>{let a=ve.getVariableForId(t.cid);if(null==a?void 0:a.length)for(const s of a)if(s.type==e){let e=be(t,s,r,n);ve.editVariableForValue(s.mapField,e,(()=>{let e=i[s.mapField]||[],t=ve.getForkList(s.mapField);if(t)for(const r of t){let t=i[r.mapField];e=_$1.concat(e,t)}o&&o(s,_$1.uniq(e))}))}})(f,i,n,l,r,((e,t)=>{if(pe(c,e.mapFile,ve.getAllVariables(),n,((e,t)=>{a({cid:e.cid,data:t})})),null==t?void 0:t.length)for(const r of t){e.eventSourceId=r;const t=x(n,r);!(null==e?void 0:e.delayUpdate)&&t&&le(t,!0,ve.getAllVariables(),c,(e=>{a({cid:t.cid,data:e})}))}}));const g=((e,t,r,n,i)=>e.filter((e=>e.id===t&&e.eventType===r&&(!i||parseInt(e.index||"0")+1===parseInt(n||"0")))))(e,l,f,h,m);for(const e of g)we(e,i,n,m,o,ve.getAllVariables(),c,a,s)},ke=(e,t={})=>{let r={},n={type:"static",converse:{use:!1,data:[]},static:{data:e},api:{requestType:"get",url:"",headers:{use:!1,value:""},params:"",agency:!1,cookie:!0,autoUpdate:{open:!1,time:10},data:""}};return Object.assign(r,n,t),r},Ne=(e,t)=>{let{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}=((e,t)=>{let{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}=_$1.cloneDeep(t[e]);return{option:r,actions:n,data:i,optionDes:o,actionsDes:a,source:s,theme:c}})(e,t);return{iconClass:null,isAssembly:null,source:i,cid:(Math.random().toString().substr(3,10)+Date.now()).toString(),isLock:!1,isShow:!0,tmpData:{option:r,source:ke(i,s),actions:n},baseData:Se(),dynamic:null,filePath:"",origin:"anov-ui",name:"",componentType:"",viewComName:e,optionComName:"AnOptionPanel",dataComName:"AnSourcePanel",eventComName:"AnActionsPanel",assemblyDeveloper:"",devEmail:"",version:"",devDept:""}},xe=(e,t,r)=>{let n=Ne(e,t);return r?_$1.merge(n,r):n},Se=e=>{let t={left:0,top:0,width:100,height:100,angle:0,penetrate:0,opacity:100,perspective:100,rotateX:0,rotateY:0,rotateZ:0,transformOriginX:"center",transformOriginY:"center",transformSwitch:!1};return e?Object.assign(t,e):t};class Ce{constructor(e,t,r){this.theme=null,this.plant=null,this.list=[],this.titleHeqadeHeight=70,this.clearance=3,this.checkComponentIntersection=(e,t,r=10)=>{const n=e.left,i=e.left+e.width,o=e.top,a=e.top+e.height,s=t.left,c=t.left+t.width,u=t.top,l=t.top+t.height,d=n<c&&i>s&&o<l&&a>u,h=Math.abs(e.left+e.width/2-(t.left+t.width/2)),f=Math.abs(e.top+e.height/2-(t.top+t.height/2));return d||h<r&&f<r},this.calculateCombinedComponent=e=>{if(0===e.length)return{left:0,top:0,width:0,height:0};let t=e[0].left,r=e[0].top,n=e[0].left+e[0].width,i=e[0].top+e[0].height;for(let o=1;o<e.length;o++){const a=e[o];t=Math.min(t,a.left),r=Math.min(r,a.top),n=Math.max(n,a.left+a.width),i=Math.max(i,a.top+a.height)}return{left:t,top:r,width:n-t,height:i-r}},this.getAnTextNormaltText=e=>{var t,r;try{return null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.text}catch(e){return console.error("配置优化(ConfigOptimizer):",e),""}},this.initProp(e),this.upgradePlant(),this.staticComponentData=t,this.upgradeHeaderComponent(),r&&Object.assign(this,r)}isStringOrObject(e){return"string"==typeof e?"string":"object"==typeof e&&null!==e&&"object"}initProp(e){try{let t,r=this.isStringOrObject(e);if(r&&"string"===r)t=JSON.parse(e);else{if(!r||"object"!==r)throw new Error(`initProp fn error :-- 传入参数${e}不合法!`);t=e}if(t){this.originData=t;const{theme:e,plant:r,list:n}=t;this.theme=e,this.plant=r,this.list=n,this.filterFileGroup()}}catch(e){console.error("配置优化(ConfigOptimizer):",e)}}upgradePlant(){this.plant&&(this.plant.option.bg={type:1,code:"70942ec525344c96aa32b81b2c9155f6",path:"/anov-prod/resources/page/png/bg22 科技星球背景.png",thumb:"/anov-prod/resources/page/thumbnail/1e48f8fb26ec4edfb1a0f499627e84fc.png"})}areComponentsIntersecting(e,t){let r=e.baseData,n=t.baseData;const i=Math.max(0,Math.min(r.left+r.width,n.left+n.width)-Math.max(r.left,n.left)),o=Math.max(0,Math.min(r.top+r.height,n.top+n.height)-Math.max(r.top,n.top));return i>0&&o>0}filterFileGroup(){this.list=_$1.cloneDeep(this.list).map((e=>{var t,r;if(1===(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.children[0])||void 0===r?void 0:r.children)){const t=e.children[0],{left:r,top:n}=e.baseData;return t.baseData.left=r,t.baseData.top=n,t}return e}))}getText(e,t,r){const n=document.createElement("canvas").getContext("2d");if(!n)throw new Error("Failed to get 2D context from canvas.");return n.font=`${r}px ${t}`,n.measureText(e).width}calculateMaxWidths(e){const t=Math.min(...e.map((e=>e.width))),r=[];let n=[],i=e[0].width;for(const o of e){const e=o.width;Math.abs(e-i)<=t?n.push(e):(n.length>0&&r.push(n),n=[e]),i=e}n.length>0&&r.push(n);const o=[];for(const e of r){const t=Math.max(...e);o.push(t)}return o}findClosestValue(e,t){let r=t[0],n=Math.abs(e-r);for(const i of t){const t=Math.abs(e-i);t<n&&(n=t,r=i)}return r}adjustHeightAndTop(e,t){const r=t-e.height;return Object.assign(Object.assign({},e),{height:t,top:e.top-r/2})}findNearestComponent(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=_$1.cloneDeep(e).sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=_$1.cloneDeep(t).baseData;a.top,a.height;for(const e of o){const t=e.baseData;if(t.top,t.height,a.left<t.left+t.width&&a.left+a.width>t.left){const r=t.top-a.top;r<i&&r<100&&(i=r,n=e)}}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestComponentForPoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=this.getDistance(a.left,a.top+a.height,t.left,t.top);r<i&&r<a.width&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestComponentForTitlePoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=this.getDistance(a.left,a.top+a.height,t.left,t.top);r<i&&r<a.width&&t.top-a.top>100&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}findNearestTitleForPoint(e,t,r){let n=null,i=1/0;t.tmpData.option.textNormal.text;try{const o=e.sort(((e,t)=>e.baseData.top-t.baseData.top)).sort(((e,t)=>e.baseData.left-t.baseData.left)).filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=t.baseData;a.top,a.height;for(const e of o){const t=e.baseData;let r=t.top-a.top;r<i&&r<a.width&&t.top-a.top>100&&(i=r,n=e)}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}getDistance(e,t,r,n){return Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2))}findNearestComponent2(e,t,r){let n=null,i=1/0,o=_$1.cloneDeep(e).sort(((e,t)=>e.baseData.top-t.baseData.top));try{const e=o.filter((e=>!(e.cid===t.cid||"AnTextNormal"===e.viewComName||r&&r.includes(e.cid)))),a=_$1.cloneDeep(t).baseData,s=a.top+a.height;for(const t of e){const e=t.baseData,r=e.top+e.height;if(a.left<e.left+e.width&&a.left+a.width>e.left){const e=r-s;e>=0&&e<i&&(i=e,n=t)}}}catch(e){console.error("配置优化(ConfigOptimizer)- findNearestComponent :",e)}return n}verticalDistance(e,t){e.left,e.width;const r=e.top+e.height,n=(t.left,t.width,t.top);return Math.abs(r-n)}extractAmount(e){const t=e.match(/(\d{1,3}(?:,\d{3})*)(\D+)/);if(t){const e=t[1].replace(/,/g,"");return[parseInt(e,10),t[2].trim()]}return[!1,!1]}getAnTextNormal(){return this.list.filter((e=>"AnTextNormal"==e.viewComName))}getAnDeckTitle3(){return this.list.filter((e=>"AnDeckTitle3"==e.viewComName)).sort(((e,t)=>e.baseData.left-t.baseData.left))}judgeAnOdometer(){let e=this.getAnTextNormal().sort(((e,t)=>e.baseData.left-t.baseData.left)),t=[],r=new Set;for(const n of e){if(r.has(n.cid))continue;let i=[];for(const t of e)r.has(t.cid)||n.cid==t.cid||this.checkComponentIntersection(n.baseData,t.baseData)&&(r.add(t.cid),r.add(n.cid),i.push(t));t.push([n,...i])}let n=[];for(const e of t)for(const t of e){let r=this.getAnTextNormaltText(t);this.extractAmount(r).every((e=>e))&&n.push(e)}return n}createAnOdometer(){var e,t;let r=this.judgeAnOdometer();for(const n of r){let r,i,o,a=this.calculateCombinedComponent(n.map((e=>e.baseData)));for(const e of n){let t=this.getAnTextNormaltText(e),n=this.extractAmount(t);n.every((e=>!e))&&(r=t),n.every((e=>e))&&(i=n[0],o=n[1]),_$1.remove(this.list,(t=>t.cid==e.cid))}let s=xe("AnIndicatorNormal",this.staticComponentData,_$1.cloneDeep({baseData:a}));(null===(t=null===(e=null==s?void 0:s.tmpData)||void 0===e?void 0:e.source)||void 0===t?void 0:t.static)&&(s.tmpData.source.static.data={text:r,num:i,unit:o},s.tmpData.source.static.originData={text:r,num:i,unit:o}),this.list.push(s)}}upgradeHeaderComponent(){for(let e=0;e<this.list.length;e++){const t=this.list[e];"AnDeckHeader3"==t.viewComName&&(t.baseData.left=0,t.baseData.top=0)}}upgradeTitleComponent(){let e=this.getAnDeckTitle3().map((e=>e.baseData)),t=this.calculateMaxWidths(e);for(let e=0;e<this.list.length;e++){const r=this.list[e];if("AnDeckTitle3"==r.viewComName){let e=this.findClosestValue(r.baseData.width,t);r.baseData.width=e>300?e:300,r.baseData=this.adjustHeightAndTop(r.baseData,this.titleHeqadeHeight)}}this.removeErroneousComponents()}containsFractionStructure(e){return/\b\d+\/\d+\b/.test(e)}removeErroneousComponents(){let e=this.getAnDeckTitle3(),t=[];for(let r=0;r<e.length;r++){const n=e[r];let i=n.tmpData.option.textNormal.text;if(this.containsFractionStructure(i))for(let r=0;r<e.length;r++){const i=e[r];n.cid!=i.cid&&this.areComponentsIntersecting(n,i)&&t.push(n.cid)}}this.list=this.list.filter((e=>!t.includes(e.cid)))}upgradeGroupComponent(){try{let e=this.getAnDeckTitle3(),t=this.list.filter((e=>"AnDeckTitle3"!=e.viewComName&&"AnDeckHeader3"!=e.viewComName&&"AnTextNormal"!=e.viewComName)),r=[],n=[];for(let i=0;i<e.length;i++){const o=e[i];let a=this.findNearestComponentForPoint(t,o,r);if(a&&a.cid&&r.push(a.cid),a){o.baseData.left=a.baseData.left;let t=this.upgradeComponentHeight(o,e,n);t&&t>=30&&(a.baseData=Object.assign({},a.baseData,{top:o.baseData.top+o.baseData.height+this.clearance}))}}}catch(e){console.error("配置优化(ConfigOptimizer):",e)}}upgradeComponentHeight(e,t,r=[]){const n=e;let i=this.findNearestTitleForPoint(_$1.cloneDeep(t),n);return i?i.baseData.top-n.baseData.top-this.titleHeqadeHeight:1080-n.baseData.top-this.titleHeqadeHeight}getData(){return this.originData.list=this.list,this.originData.plant=this.plant,this.originData}}const Ae=new class{randomNum(e,t){return Math.floor(Math.random()*(t-e+1))+e}generateRandomIntArray(e,t,r,n){const i=[];for(let n=0;n<e;n++){const e=this.randomNum(t,r);i.push(e)}return n&&"asc"===n?i.sort(((e,t)=>e-t)):n&&"desc"===n?i.sort(((e,t)=>t-e)):i}randomString(e,t){const r=this.randomNum(e,t);let n="";for(let e=0;e<r;e++){const e=Math.floor(26*Math.random());n+="abcdefghijklmnopqrstuvwxyz".charAt(e)}return n}generateRandomNameArray(e,t,r){const n=[];for(let i=0;i<e;i++){const e=this.randomString(t,r);n.push(e)}return n}pick(e,t){const r=void 0!==t?e.filter((e=>e!==t)):e;return r[Math.floor(Math.random()*r.length)]}},Oe=()=>{const e=[],t=Ae.pick([!0,!1]);let r=Ae.randomNum(3,20);const n=Ae.pick([null,null,null,{}]);let i=Ae.pick(["asc","desc",void 0,void 0,void 0]);for(let o=0;o<Ae.randomNum(1,9);o++)e.push({data:Ae.generateRandomIntArray(r,0,300,i),type:"line",smooth:t,symbolSize:Ae.randomNum(1,10),lineStyle:{width:Ae.randomNum(1,4)},areaStyle:n});return{xAxis:{type:"category",show:!1,boundaryGap:!1,data:Ae.generateRandomNameArray(r,3,6)},grid:{left:0,top:0,bottom:0,right:0},yAxis:{show:!1,type:"value"},series:e}},Ie=(e,t)=>{let r={type:e,show:!1};return"category"===e&&(r.data=Ae.generateRandomNameArray(t,3,6)),r},Te=()=>{const e=[],t=Ae.pick([!0,!1]);let r=Ae.randomNum(3,20);const n=Ae.pick([null,null,null,{}]);let i=Ae.pick(["asc","desc",void 0,void 0,void 0]),o=Ae.randomNum(1,9),a=Ae.pick([!0,!1]);for(let s=0;s<o;s++){let o={data:Ae.generateRandomIntArray(r,0,300,i),type:"bar",smooth:t,stack:a,areaStyle:n};e.push(o)}let s=Ae.pick(["value","category"]),c=Ae.pick(["value","category"],s);return{xAxis:Ie(s,r),grid:{left:0,top:0,bottom:0,right:0},yAxis:Ie(c,r),series:e}},Ve=()=>{const e=[];let t=Ae.randomNum(3,20);Ae.pick([null,null,null,{}]);let r=Ae.pick(["asc","desc",void 0,void 0,void 0]),n=Ae.pick([1,2]),i=[Ae.pick(["10%","20%","30%","40%","50%","60%","70%","80%"]),Ae.pick(["90%","100%"])];return e.push({data:Ae.generateRandomIntArray(t,3,20,r),type:"pie",radius:1==n?"100%":i,roseType:1==n?Ae.pick(["area",null,null]):null,padAngle:1==n?0:Ae.randomNum(1,5),startAngle:1==n?Ae.pick([0,180]):0,endAngle:360,label:{show:!1},itemStyle:{borderRadius:3}}),{grid:{left:0,top:0,bottom:0,right:0},series:e}},Fe=()=>{const e=[];Ae.pick([!0,!1]),Ae.randomNum(3,20),Ae.pick([null,null,null,{}]),Ae.pick(["asc","desc",void 0,void 0,void 0]);for(let t=0;t<Ae.randomNum(1,20);t++){let t=Ae.randomNum(3,Ae.randomNum(3,20)),r=[];for(let e=0;e<t;e++){let e=[];for(let t=0;t<2;t++)e.push(Ae.randomNum(1,30));r.push(e)}e.push({type:"scatter",symbolSize:Ae.randomNum(3,30),data:r})}return{xAxis:{show:!1},grid:{left:0,top:0,bottom:0,right:0},yAxis:{show:!1,type:"value"},series:e}},Ee=()=>{const e=[],t=Ae.pick(["polygon","circle"]);let r=Ae.randomNum(1e4,99999),n=Ae.randomNum(3,10),i=[];for(let e=0;e<n;e++)i.push({name:Ae.randomString(4,8),max:r});for(let t=0;t<Ae.randomNum(2,10);t++)e.push({value:Ae.generateRandomIntArray(n,1e4,r),name:Ae.randomString(4,8)});return{radar:{shape:t,indicator:i,axisName:{show:!1},radius:"100%"},grid:{left:0,top:0,bottom:0,right:0},series:[{type:"radar",symbol:"none",lineStyle:{width:1},data:e}]}},Pe=()=>{const e=[];for(let t=0;t<Ae.randomNum(4,15);t++)e.push({value:Ae.randomNum(1,100),name:Ae.randomString(4,8)});return{grid:{left:0,top:0,bottom:0,right:0},series:[{type:"funnel",left:"0%",top:0,bottom:0,width:"100%",min:0,minSize:"0%",maxSize:"100%",label:{show:!1,position:"inside"},sort:Ae.pick(["descending","ascending"]),gap:2,lineStyle:{width:1},data:e}]}};let je=Ae.randomNum(5,20);const Re={width:je};Ae.pick([!0,!1])&&(Re.color=[[.3,"#67e0e3"],[.7,"#37a2da"],[1,"#fd666d"]]);class $e{constructor(){this.names=["line","bar","pie","scatter","radar","funnel","gauge"]}static getInstance(){return $e.instance||($e.instance=new $e),$e.instance}createLine(){switch(Ae.pick(this.names)){case"line":return{type:"line",typeNum:1,option:Oe()};case"bar":return{type:"bar",typeNum:2,option:Te()};case"pie":return{type:"pie",typeNum:3,option:Ve()};case"scatter":return{type:"scatter",typeNum:4,option:Fe()};case"radar":return{type:"radar",typeNum:5,option:Ee()};case"funnel":return{type:"funnel",typeNum:6,option:Pe()};case"gauge":return{type:"gauge",typeNum:7,option:{grid:{left:0,top:0,bottom:0,right:0},series:[{type:"gauge",radius:"100%",detail:{formatter:"{value}"},progress:{show:Ae.pick([!0,!1]),width:je},axisLine:{lineStyle:Re},data:[{value:Ae.randomNum(1,100),name:"SCORE"}]}]}}}}}$e.instance=null;const qe=$e.getInstance(),Me=new class{constructor(){this.directions=["row","row"],this.direction="column",this.splitNumbers=24,this.margin=[0,0]}baseLayout(e){const t=(null==e?void 0:e.maRrows)?null==e?void 0:e.maRrows:this.splitNumbers,r=(null==e?void 0:e.colNum)?null==e?void 0:e.colNum:this.splitNumbers,n=e.wrapWidth/r,i=e.wrapHeight/t;let o=E(this.directions);o&&(this.direction=o);let a=[];if("row"===this.direction){let e=E([3,4]);a=this.simulateRandomSegments(24,4,12,e)}else{let e=E([2,3]);a=this.simulateRandomSegments(24,4,6,e)}let s=[],c=[];if("row"===this.direction){for(let e=0;e<a.length;e++)if(0==e)s.push({x:0,y:0,w:a[e],h:24,i:e,wStep:n,hStep:i});else{let t=s[e-1].x;s.push({x:a[e-1]+t,y:0,w:a[e],h:24,i:e,wStep:n,hStep:i})}let e=E([2,3]),t=this.simulateRandomSegments(24,6,12,e);for(let e=0;e<s.length;e++){const r=s[e];for(let o=0;o<t.length;o++){const a=t[o];c.push({x:r.x,y:a,w:r.w,h:a,i:10*e+o,wStep:n,hStep:i})}}}else{for(let e=0;e<a.length;e++)if(0==e)s.push({x:0,y:0,w:24,h:a[e],i:e,wStep:n,hStep:i});else{let t=s[e-1].y;s.push({x:0,y:a[e-1]+t,w:24,h:a[e],i:e,wStep:n,hStep:i})}for(let e=0;e<s.length;e++){const t=s[e];let r=E([1,2,3,4]),o=this.simulateRandomSegments(24,5,12,r),a=[];for(let r=0;r<o.length;r++){const s=o[r];if(0==r)a.push({x:0,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i}),c.push({x:0,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i});else{let u=a[r-1].x;a.push({x:o[r-1]+u,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i}),c.push({x:o[r-1]+u,y:t.y,w:s,h:t.h,i:10*e+r,wStep:n,hStep:i})}}}}return{layouts:c.map((t=>{let{option:r,typeNum:n}=qe.createLine(),i=t.x*t.wStep+t.w*t.wStep/2,o=t.y*t.hStep+t.h*t.hStep/2,a=t.w*t.wStep,s=t.h*t.hStep;if(3==n||5==n||7==n){let e=Math.min(a,s);a=e,s=e}let c=e.wrapWidth,u=e.wrapHeight;return t.chartsOption=r,t.typeNum=n,t.txt=n+" "+i/c+" "+o/u+" "+a/c+" "+s/u,console.log(t.txt),t})),option:{colNum:r,margin:(null==e?void 0:e.margin)?null==e?void 0:e.margin:this.margin,isDraggable:!!(null==e?void 0:e.isDraggable)&&(null==e?void 0:e.isDraggable),isResizable:!!(null==e?void 0:e.isResizable)&&(null==e?void 0:e.isResizable),verticalCompact:!(null==e?void 0:e.verticalCompact)||(null==e?void 0:e.verticalCompact),useCssTransforms:!(null==e?void 0:e.useCssTransforms)||(null==e?void 0:e.useCssTransforms),rowHeight:e.wrapHeight/t,maRrows:t}}}simulateRandomSegments(e,t,r,n){const i=[];let o=e,a=n;for(;a>0;)if(1===a)i.push(o),a--;else{const e=Math.min(r,o-t*(a-1)),n=Math.floor(Math.random()*(e-t+1))+t;i.push(n),o-=n,a--}return i}simulateRandomSegments2(e,t,r,n){const i=[];let o=e,a=n;for(;a>0;)if(1==a){const t=e-i.reduce(((e,t)=>e+t),0);i.push(t),a--}else{let e=Math.floor(Math.random()*r),n=Math.max(t,e),s=o-t*a;const c=Math.min(n,s);i.push(c),o-=c,a--}return i}},Ue=src.pool(),Le=e=>{try{return JSON.parse(e)}catch(t){return e}},He=new class{constructor(){this.requested=new Set,this.db=new Dexie$1("go-db"),this.init()}init(){return s(this,void 0,void 0,(function*(){this.db.version(1).stores({store:"key, value"})}))}pushCaseIdToRequested(e){this.requested.add(e)}add(e,t){return s(this,void 0,void 0,(function*(){try{(yield this.isExist(e))||(t.caseDetailData&&(t.caseDetailData="string"==typeof t.caseDetailData?Le(t.caseDetailData):t.caseDetailData),this.pushCaseIdToRequested(e),yield this.db.table("store").add({key:e,value:t}))}catch(e){console.error(e)}}))}bulkPut(e){return s(this,void 0,void 0,(function*(){let t=yield Promise.all(e.map((e=>s(this,void 0,void 0,(function*(){const{caseId:t,id:r}=e,n=`${t}_${r}`;if(yield this.isExist(n))return null;if(e.caseDetailData){const t=yield Ue.exec(Le,[e.caseDetailData]);e.caseDetailData=t,Ue.terminate()}return e})))));t=t.filter((e=>null!==e));const r=t.map((e=>{const{caseId:t,id:r}=e,n=`${t}_${r}`;return this.pushCaseIdToRequested(n),{key:n,value:e}}));this.db.table("store").bulkPut(r).then((()=>{})).catch((e=>console.error(e)))}))}get(e){return s(this,void 0,void 0,(function*(){if(!(yield this.isExist(e)))return null;const t=yield this.db.table("store").where("key").equals(e).first();return t?t.value:null}))}getAllData(){return s(this,void 0,void 0,(function*(){return yield this.db.table("store").toArray()}))}update(e,t){return s(this,void 0,void 0,(function*(){if(yield this.isExist(e)){const r=yield this.get(e),n=yield Ue.exec(Le,[t]);Ue.terminate(),yield this.db.table("store").update(e,{value:Object.assign(Object.assign({},r),{caseDetailData:n})})}else console.error("update indexdb error")}))}delete(e){this.requested.delete(e),this.db.table("store").delete(e)}isExist(e){return s(this,void 0,void 0,(function*(){return(yield this.db.table("store").where("key").equals(e).count())>0}))}reset(){this.requested.clear(),this.db.table("store").clear()}clear(){return s(this,void 0,void 0,(function*(){yield this.db.table("store").clear()}))}isExistStore(){return s(this,void 0,void 0,(function*(){try{return yield this.db.open(),!0}catch(e){return!1}}))}},Be=function(e){return s(this,void 0,void 0,(function*(){try{let{fontUrl:t,fontName:r}=e;const n="__custom_font__";let i=document.getElementById(n);if(!i){i=document.createElement("style"),i.id=n;const e=document.head||document.getElementsByTagName("head")[0];yield e.appendChild(i)}i.innerText+=`@font-face{font-family:'${r}';src:url(${t});}`}catch(e){console.warn(e)}}))},ze=(e,...t)=>s(void 0,[e,...t],void 0,(function*(e,t="jspaths",r){const n="csspaths"===t?"link":"script",i=document.createElement(n);"jspaths"===t?i.defer=!0:i.rel="stylesheet",i.className=t,i.src=e,(r||document.head||document.getElementsByTagName("head")[0]).appendChild(i),yield new Promise(((e,t)=>{i.addEventListener("load",e),i.addEventListener("error",e)}))})),Je=(e,...t)=>s(void 0,[e,...t],void 0,(function*(e,t="jspaths"){const r="fonts"===t?Be:ze;yield Promise.all(e.map((e=>r(e))))}));function Ge(e){!function(e,t){e.depends?optionTheme_js.setOptionColorByTheme(e):_e(e,!1)}(e)}function _e(e,t=!0){let{theme:r,option:n,optionDes:i}=e;n&&i&&r&&Object.keys(i).forEach((o=>{"conditionSeries"!==i[o].type&&"tabs"!==i[o].type||!n[o]?i[o].theme?n.hasOwnProperty(o)&&function({theme:e,option:t,optionDes:r},n,i){let o;if("color"!=r[n].type||!i&&t[n]){if("bgcolor"==r[n].type&&(i||!t[n]||!t[n].style)){t[n]||(t[n]={});let{key:i,points:a,degree:s,type:c,opacity:u}=r[n].theme;if(a){s||(s=90),c||(c="linear");let r=`${c}-gradient(${s}deg`,i=100/(a.length-1),l=[];a.forEach(((t,n)=>{o=We(e,t),r+=`,${Xe(o,t.opacity)} ${i*n}%`;let{red:a,green:s,blue:c,alpha:d}=Ke(o,u);l.push({red:a,green:s,blue:c,alpha:d,left:i*n})})),r+=")",t[n].style=r,t[n].degree=s,t[n].flag=a.length?3:2,t[n].points=l,t[n].type=c}else i&&(o=We(e,r[n].theme),t[n]=Object.assign(Object.assign({},Ke(o,u)),{style:Xe(o,u)}))}}else{let{opacity:i}=r[n].theme;o=We(e,r[n].theme),t[n]=Xe(o,i)}}(e,o,t):i[o].hasOwnProperty("type")&&"slot"!=i[o].type&&"textStyle"!=i[o].type&&"sheet"!=i[o].type||i[o].constructor!=Object||_e({option:n[o],optionDes:i[o],theme:r},t):function(e,t,r,n,i,o){let a=t.form,s=e;if(Array.isArray(a))for(let e=0;e<a.length;e++){let t,r=a[e];t=o?s[e].form:s[e],_e({option:t,optionDes:r,theme:n},i)}else{let e=s.length;for(let t=0;t<e;t++){let e;e=o?s[t].form:s[t],_e({option:e,optionDes:a,theme:n},i)}}}(n[o],i[o],0,r,t,"conditionSeries"===i[o].type)}))}function We(e,t){return e[t.key]?e[t.key]||e.color:t.key.indexOf(".")>-1?[e,...t.key.split(".")].reduce(((t,r)=>"object"==typeof t&&r in t?t[r]:(Qe(`属性${r}不存在,获取主题颜色错误,将使用默认主题色`),e.color))):(Qe(`属性${t.key}不存在,获取主题颜色错误,将使用默认主题色`),e.color)}function Xe(e,t){let{red:r,green:n,blue:i,alpha:o}=Ke(e,t);return`rgba(${r},${n},${i},${o})`}function Ke(e,t){return-1!=e.indexOf("#")&&(e=e.substr(1)),null==t&&(t=1),{red:parseInt("0x"+e.slice(0,2)),green:parseInt("0x"+e.slice(2,4)),blue:parseInt("0x"+e.slice(4,6)),alpha:t}}function Qe(e){console.warn(e)}class Ye{constructor(e){this.processedIds=new Set,this.validateAccessResolve=null,e?(e.caseId&&(this.caseId=e.caseId),e.pageId&&(this.pageId=e.pageId),e.mode&&(this.mode=e.mode),e.environment&&(this.environment=e.environment),e.xhr&&(this.xhr=e.xhr),e.staticComponentData&&(this.staticComponentData=e.staticComponentData),e.theme&&(this.theme=e.theme)):console.log("初始化错误!"),this.defaultTheme={name:"科技蓝",color:"#006aee",background:"#00000033",pageBackground:"#051836",text:"#F0F0F0",groups:["#006aee","#00eae9","#00a9ec","#00ec80","#edc700","#9913ee"]}}checkHardware(){return s(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{e("Hardware is not available")}))}))}checkSecurity(e){return s(this,void 0,void 0,(function*(){return yield new Promise(((t,r)=>{"preview"==this.environment?t(0):this.getShareForRelease(e).then((e=>{2e4==e.code&&e.data?(e.data,e.data.loginLimitSwitch?t(1):e.data.hasAuth?t(2):t(3)):t(4)}))}))}))}validateAccess(e,t){return s(this,void 0,void 0,(function*(){return new Promise(((r,n)=>{this.validateAccessResolve=r,t&&t(e)}))}))}initBefore(){return new Promise(((e,t)=>{let r=p("secretFree");r?sessionStorage.setItem("secret-free",r):sessionStorage.setItem("secret-free",null),console.log("运行免登录设置完成!"),e(!0)}))}fetchCaseId(e,t){return s(this,void 0,void 0,(function*(){try{const r=yield this.getKey(e,t);return 2e4===(null==r?void 0:r.code)&&(null==r?void 0:r.data)?r.data:e}catch(t){return console.error("Error fetching caseId:",t),e}}))}getDataForrelease(){return new Promise(((e,t)=>{e("data")}))}onProjectLoaded(e){}authenticate(){return s(this,void 0,void 0,(function*(){this.environment}))}getShareForRelease(e){return this.xhr.get(`/go/v1/go-share/v1/${e}/config`)}findById(e,t="",r=0,n=""){return"release"===this.environment?this.xhr.get(`/go/v1/go-share/v1/${e}?pwd=${t}&mode=${r}&token=${n}`):this.xhr.get(`/go/v1/go-cases/v1/${e}?mode=${r}&token=${n}`)}getKey(e,t=0){return this.xhr.get(`/go/v1/go-cases/v1/key/${e}?caseMode=${t}`)}getPageData(e,t){return s(this,void 0,void 0,(function*(){const r=yield He.get(e+"_"+t);return r?{data:r}:"release"===this.environment?this.xhr.get(`/go/v1/go-share/v1/${e}/pages/${t}`):this.xhr.get(`/go/v1/go-cases/v1/${e}/pages/${t}`)}))}getPageId(e,t){if(null==t?void 0:t.length){if(t.find((t=>t.id==e)))return e;let r=t.find((t=>t.caseDetailPath==e||t.caseDetailName==e));return r?r.id:e}return e}fetchProjectForId(e){return s(this,arguments,void 0,(function*(e,t="",r=0,n=""){return yield this.findById(e,t,r,n)}))}updataPageData(e,t){return s(this,void 0,void 0,(function*(){var r;let n=yield this.getPageDataForID(e,t);(null==n?void 0:n.data)?null===(r=null==this?void 0:this.lifecycleHooks)||void 0===r||r.onPageDataReady(n.data.caseDetailData):console.error("请求数据发生错误!")}))}getPageDataForID(e,t,r){return s(this,void 0,void 0,(function*(){const n=this.getPageId(t,this.projectInfo.details);if(this.processedIds.has(n)){console.log(`ID ${n} has already been processed.`);const t=yield He.get(e+"_"+n);if(t)return{data:t}}const i=this.getPageData(e,n);this.processedIds.add(n),r&&r.length&&r.map((t=>s(this,void 0,void 0,(function*(){try{if(this.processedIds.has(t))return void console.log(`ID ${n} has already been processed.`);const r=yield this.getPageData(e,t);He.add(e+"_"+t,r.data),this.processedIds.add(t)}catch(e){console.error(`Error processing ID ${t}: ${e}`)}}))));const o=yield i;return He.add(e+"_"+n,o.data),yield i}))}fetchPageDataForId(e){return s(this,arguments,void 0,(function*(e,t="",r=0,n=""){return yield this.findById(e,t,r,n)}))}setTheme(){console.log("设置主题")}setBackground(){console.log("设置背景信息")}updateVariables(){console.log("更新变量信息")}beforeRender(e){}renderComponents(){return s(this,void 0,void 0,(function*(){}))}setGlobalThemeVars(e){document.body.style.cssText=`\n --theme-background: ${e.background};\n --theme-color: ${e.color};\n --theme-pageBackground: ${e.pageBackground};\n --theme-text: ${e.text};\n ${e.groups.map(((e,t)=>`--theme-groups-${t}: ${e};`)).join("\n")}\n `}listenForRenderCompletion(){}showAnimation(){console.log("所有组件渲染完成,显示动画。")}setComTheme(e,t){var r,n;let i=null===(r=this.staticComponentData[t.viewComName])||void 0===r?void 0:r.optionDes,o=null===(n=this.staticComponentData[t.viewComName])||void 0===n?void 0:n.theme;return Ge({theme:e,option:t.tmpData.option,optionDes:i,depends:o}),t}getComData(e,t,r,n){return s(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{if(e.tmpData&&e.tmpData.source){this.setComTheme(n,e);try{le(e,!0,t,r).then((t=>{t&&(e.source=t)})),i(1)}catch(e){i(e)}}else i("")}))}))}pageInit(e){return s(this,void 0,void 0,(function*(){var t;try{let r=null==e?void 0:e.caseDetailData,n=this.defaultTheme;if((null==r?void 0:r.theme)&&(n=r.theme),this.setGlobalThemeVars(n),r.resource){let e=(null===(t=null===window||void 0===window?void 0:window.anovuiConfig)||void 0===t?void 0:t.fonts)||[],n=_$1.concat(r.resource.fonts,e),i=_$1.cloneDeep(r.resource);i.fonts=n,yield(e=>s(void 0,[e],void 0,(function*({jspaths:e=[],csspaths:t=[],fonts:r=[]}){const n=_$1.uniqBy(r,"fontName");yield Promise.all([Je(e,"jspaths"),Je(t,"csspaths"),Je(n,"fonts")])})))(i)}ve.clearVars(),ve.addVariables(r.globalVars);let i=ve.getAllVariables();return w(r.list,(e=>s(this,void 0,void 0,(function*(){yield this.getComData(e,i,r.globalSource,n)})))),r}catch(t){return console.warn("页面初始化发生错误:",t),(null==e?void 0:e.data)?e.data:e}}))}validate(e,t,r){return s(this,void 0,void 0,(function*(){return new Promise(((n,i)=>{const o=(e,r)=>s(this,void 0,void 0,(function*(){let i=yield this.validateAccess(e,r),a=(null==i?void 0:i.pwd)?i.pwd:"",s=(null==i?void 0:i.mode)?i.mode:0,c=(null==i?void 0:i.token)?i.token:"",u=yield this.fetchProjectForId(t,a,s,c);2e4==(null==u?void 0:u.code)&&(null==u?void 0:u.data)?(this.projectInfo=u.data,console.log("验证成功!"),this.lifecycleHooks.message("验证成功!"),n(!0)):(this.lifecycleHooks.validateError(u),this.lifecycleHooks.message(u.msg,"warning"),o(e,r))}));o(e,r)}))}))}init(e){return s(this,void 0,void 0,(function*(){var t;try{this.lifecycleHooks=e,yield this.checkHardware();let r=yield this.fetchCaseId(this.caseId,this.mode),n=yield this.checkSecurity(r),i=e.onValidateAccess||(()=>{});(yield this.validate(n,r,i))&&e.onCaseReady(this.projectInfo);let o=(null===(t=this.projectInfo)||void 0===t?void 0:t.details).map((e=>e.id)),a=this.getPageId(this.pageId,this.projectInfo.details);console.log(a,this.pageId,"this.pageId");let s=yield this.getPageDataForID(r,a||o[0],o);const c=yield this.pageInit(s.data);return e.onPageDataReady(c),{currentData:this.projectInfo,currentPageData:c}}catch(e){console.error("加载页面时出错:",e)}}))}}var index$3=Object.freeze({__proto__:null,ConfigOptimizer:Ce,GlobalVariables:ge,Http:J,Log:z,PageLoader:Ye,agentData:X,delFetchStatus:I,displayGenerator:Me,editItem:se,emitEvent:De,fetchDataByGlobal:ae,fetchDataByType:re,filterData:ne,findItemDeep:x,findItemDeep2:S,getData:W,getDataForApi:K,getDataForDataSet:Y,getDataForSource:ee,getDataForStatic:te,getDataForZb:Q,getDataForZbCQ:Z,getSessionData:v,getStandardData:m,getStringVars:D,getUrlParams:p,getVarDefaultVal:be,globalVars:ve,hasVar:N,isJSON:f,recursion:w,replaceVariable:ue,safeEval:C,safeEvalForCode:A,setFetchStatus:O,setSessionData:g,updataGlobalDataSourceForVar:pe,updateComData:le,updateGlobalDataSource:me}),getInteractive=function(e,t,r,n,i){var o;try{var a={},s=[],c=[],u=[],l=_$1.cloneDeep(e);return(null===(o=null===window||void 0===window?void 0:window.go)||void 0===o?void 0:o.dev)&&recursion(e,(function(e){var t,r,n;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length)for(var i=0,o=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions;i<o.length;i++){var a=o[i];if("toggle"==a.behave){var s=a.toggle;if(null==s?void 0:s.length)for(var c=0,u=s;c<u.length;c++){var l=u[c],d=l.value;(null==d?void 0:d.length)&&(l.value=l.value.map((function(e){return{cid:e.cid,viewComName:e.viewComName,name:e.name,visible:e.visible}})))}}}})),recursion(l,(function(e){var t,r;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length){var n=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:n,element:e,actions:s,events:c,eventsComs:u,filter:i})}})),ve.addVariables(s),s=ve.getAllVariables(),recursion(l,(function(e){var t,r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.source;getShareVariableTree(r,s,e,a)})),{shareVariableTree:a,globalVars:ve.getAllVariables(),globalEvents:c.filter((function(e){return e})),eventsComs:u}}catch(e){return console.error("error",e),{}}},getInteractive2=function(e,t,r,n,i){var o;try{var a={},s=[],c=[],u=[],l=_$1.cloneDeep(e);return(null===(o=null===window||void 0===window?void 0:window.go)||void 0===o?void 0:o.dev)&&recursion(e,(function(e){var t,r,n;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length)for(var i=0,o=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions;i<o.length;i++){var a=o[i];if("toggle"==a.behave){var s=a.toggle;if(null==s?void 0:s.length)for(var c=0,u=s;c<u.length;c++){var l=u[c],d=l.value;(null==d?void 0:d.length)&&(l.value=l.value.map((function(e){return{cid:e.cid,viewComName:e.viewComName,name:e.name,visible:e.visible}})))}}}})),recursion(l,(function(e){var t,r;if(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.actions)||void 0===r?void 0:r.length){var n=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:n,element:e,actions:s,events:c,eventsComs:u})}})),t&&t.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),t,!0)),r&&r.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),r,!0)),n&&n.length&&(s=__spreadArray$1(__spreadArray$1([],s,!0),n,!0)),recursion(l,(function(e){var t,r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.source;getShareVariableTree(r,s,e,a)})),s.filter((function(e){if(e.fork){var t=s.find((function(t){return t.mapField==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(t.mapField)}));(i?i==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(i):!!t)&&(Array.isArray(e.forkValue)?e.originalValue=e.forkValue.map((function(e){var t=s.find((function(t){return t.mapField==e}));if(t)return t.value})):e.originalValue=t.value)}})),{shareVariableTree:a,globalVars:s.filter((function(e){return i?(i==e.forkValue||Array.isArray(e.forkValue)&&e.forkValue.includes(i))&&(e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue):(e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue),e})),globalEvents:c.filter((function(e){return e})),eventsComs:u}}catch(e){return console.error("error",e),{}}},checkVar=function(e,t){var r,n,i,o=!1,a=e.type,s=e.converse,c=e[a];if((null==s?void 0:s.use)&&(null===(r=null==s?void 0:s.data)||void 0===r?void 0:r.length))for(var u=0,l=s.data;u<l.length;u++){if((null==(v=l[u])?void 0:v.use)&&v.dependVars.includes(t)){o=!0;break}}if(o)return o;var d="",h="",f="";"api"==a&&(d=c.url,(null===(n=c.headers)||void 0===n?void 0:n.use)&&(h=c.headers.value),f=c.params),"datasource"==a&&(d=c.inputSql),"indicator"==a&&((null===(i=c.headers)||void 0===i?void 0:i.use)&&(h=c.headers.value),f=c.params);for(var p=/({{[\w]*}})|((@)[\w]*)/gm,m=0,g=[d,h,f];m<g.length;m++){var v,y=(v=g[m]).match(p);if((null==y?void 0:y.length)&&y.find((function(e){return e=="{{".concat(t,"}}")||e=="@".concat(t)}))){o=!0;break}}return o},executeFilter=function(e){return e.hasOwnProperty("originalValue")||(e.originalValue=e.value),e.converter&&e.converterCode?e.value=safeEval(e.converterCode,e.originalValue):e.value=e.originalValue,e},getShareTree=function(e,t){try{var r={},n=[],i=[];return recursion(e,(function(e){var o,a,s,c=null===(o=null==e?void 0:e.tmpData)||void 0===o?void 0:o.source;if(getShareVariableTree(c,t,e,r),null===(s=null===(a=null==e?void 0:e.tmpData)||void 0===a?void 0:a.actions)||void 0===s?void 0:s.length){var u=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:u,element:e,actions:n,events:i})}})),r}catch(e){return console.error(e),{}}},hasVar=function(e,t,r){var n,i,o,a,s=t[null==t?void 0:t.type],c=null==t?void 0:t.converse,u=!1;if(c&&c.use&&c.data.length)for(var l=0,d=c.data;l<d.length;l++){var h=d[l];if((null==h?void 0:h.dependVars)&&(null===(n=null==h?void 0:h.dependVars)||void 0===n?void 0:n.length)&&(null==h?void 0:h.dependVars.includes(e)))return u=!0}return(null==s?void 0:s.inputSql)&&(u=getStringVars(null==s?void 0:s.inputSql,r)),(null==s?void 0:s.url)&&(u=getStringVars(s.url,r)),(null==s?void 0:s.headers)&&(null===(i=null==s?void 0:s.headers)||void 0===i?void 0:i.use)&&(null===(o=null==s?void 0:s.headers)||void 0===o?void 0:o.value)&&(u=getStringVars(null===(a=null==s?void 0:s.headers)||void 0===a?void 0:a.value,r)),(null==s?void 0:s.params)&&(u=getStringVars(null==s?void 0:s.params,r)),u},getShareVariableTree=function(e,t,r,n){var i,o,a;if(e){var s=e[null==e?void 0:e.type],c=null==e?void 0:e.converse;c&&c.use&&c.data.length&&c.data.map((function(e){var t;(null==e?void 0:e.dependVars)&&(null===(t=null==e?void 0:e.dependVars)||void 0===t?void 0:t.length)&&e.dependVars.map((function(e){setShareVariableTreeData(n,e,r.cid)}))})),(null==s?void 0:s.inputSql)&&getStringVars(null==s?void 0:s.inputSql,t,r,n),(null==s?void 0:s.url)&&getStringVars(s.url,t,r,n),(null==s?void 0:s.headers)&&(null===(i=null==s?void 0:s.headers)||void 0===i?void 0:i.use)&&(null===(o=null==s?void 0:s.headers)||void 0===o?void 0:o.value)&&getStringVars(null===(a=null==s?void 0:s.headers)||void 0===a?void 0:a.value,t,r,n),(null==s?void 0:s.params)&&getStringVars(null==s?void 0:s.params,t,r,n)}},getStringVars=function(e,t,r,n){"string"!=typeof e&&(e=JSON.stringify(e));var i=e.match(/({{[\w]*}})|((@)[\w]*)/gm);if(i){var o=i.map((function(e){return e.replace(/{{|}}|@/gm,"")}));if(r)for(var a=function(e){var i=o[e];if(!i||!t||t.findIndex((function(e){return e.mapField===i}))<0)return"continue";r&&n&&setShareVariableTreeData(n,i,r.cid)},s=0;s<o.length;s++)a(s);else{var c=function(e){var i=o[e];return!i||!t||t.findIndex((function(e){return e.mapField===i}))<0?"continue":(r&&n&&setShareVariableTreeData(n,i,r.cid),{value:!0})};for(s=0;s<o.length;s++){var u=c(s);if("object"==typeof u)return u.value}}}return!1},setShareVariableTreeData=function(e,t,r){if(e[t]&&_$1.isArray(e[t])){e[t].push(r);var n=e[t];e[t]=_$1.uniq(n)}else e[t]=[],e[t].push(r)},isJSON=function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(e){return!1}return!1};function getStandardData(e,t){return void 0===t&&(t=!1),t?isJSON(e)?e:JSON.stringify(e):isJSON(e)?JSON.parse(e):e}var rightMenuMutaitons={delListItem:function(e,t){var r=_$1.cloneDeep(e.list);"string"==typeof t?findItemDeep$1(r,t,!0):t.forEach((function(e){findItemDeep$1(r,e,!0)})),e.list=r,e.globalVars=getInteractive(e.list,e.globalConstant,e.sysConst).globalVars},editCloneCache:function(e,t){var r=_$1.cloneDeep(e.cloneCache);r.length&&r.map((function(e){e.baseData=Object.assign({},e.baseData,t)})),e.cloneCache=r},cloneItem:function(e){if(e.selectd.length>0){e.cloneCache=[];for(var t=function(t){var r=findItemDeep$1(e.list,e.selectd[t]);if("boolean"!=typeof r){var n=_$1.cloneDeep(r);if(n.pid="",(null==n?void 0:n.stateChildren)||(null==n?void 0:n.children))((null==n?void 0:n.stateChildren)?null==n?void 0:n.stateChildren:null==n?void 0:n.children).forEach((function(e){var t,r,i,o,a=e.cid;if(e.cid=genID(),e.pid=n.cid,(null==n?void 0:n.stateChildren)&&(null===(r=null===(t=null==n?void 0:n.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.children)){var s=null===(o=null===(i=null==n?void 0:n.tmpData)||void 0===i?void 0:i.option)||void 0===o?void 0:o.children.find((function(e){return e.cid==a}));s&&(s.cid=e.cid)}}));e.cloneCache.push(n),window.localStorage.setItem("cloneCache",JSON.stringify(e.cloneCache))}},r=0;r<e.selectd.length;r++)t(r)}},shearItem:function(e,t){if(e.selectd.length>0){e.cloneCache=[];for(var r=0;r<e.selectd.length;r++){var n=findItemDeep$1(e.list,e.selectd[r],!0);if("boolean"!=typeof n){var i=_$1.cloneDeep(n);e.cloneCache.push(i)}}e.selectd=[]}},pasteItem:function(e){var t,r;try{var n=(null===(r=_$1.cloneDeep(e.cloneCache))||void 0===r?void 0:r.length)?_$1.cloneDeep(e.cloneCache):JSON.parse(window.localStorage.getItem("cloneCache"));if(n.length>0){var i=[],o={};recursion(n,(function(e){var t=genID();if(o[e.cid]=t,e.cid=t,e&&e.children)for(var r=0,n=e.children;r<n.length;r++){n[r].pid=e.cid}else if(e.stateChildren)for(var a=0,s=e.stateChildren;a<s.length;a++){s[a].pid=e.cid}if("dynamicComponent"==e.componentType){var c=void 0;e.dynamicChildren instanceof Map?c=e.dynamicChildren.get(e.activeDynamic):e.dynamicChildren instanceof Array&&(c=e.dynamicChildren.find((function(t){return t[0]==e.activeDynamic}))),c.length>1&&(Array.isArray(c[1])?c[1].forEach((function(t){t.pid=e.cid})):c.forEach((function(t){t.pid=e.cid}))),1==c.length&&c.forEach((function(t){t.pid=e.cid}))}i.push(e.cid)})),e.selectd.length>0?selectdArea(e.selectd,e.list):getPosition(n),n.forEach((function(e){var t,r,n,i;if(e.baseData.top=e.baseData.top+20,e.baseData.left=e.baseData.left+20,e&&e.hasOwnProperty("stateChildren")&&(null===(r=null===(t=null==e?void 0:e.tmpData)||void 0===t?void 0:t.option)||void 0===r?void 0:r.children))for(var o=function(t){t.pid=e.cid;var r=null===(i=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.option)||void 0===i?void 0:i.children.find((function(e){return e.disName==t.name}));r&&(r.cid=t.cid)},a=0,s=e.stateChildren;a<s.length;a++){o(s[a])}}));try{var a=Object.keys(o),s=JSON.stringify(n);(null==a?void 0:a.length)&&a.forEach((function(e){var t=o[e];-1!==s.indexOf(e)&&(s=s.replaceAll(null==e?void 0:e.toString(),null==t?void 0:t.toString()))})),n=JSON.parse(s)}catch(e){}(t=e.list).unshift.apply(t,_$1.cloneDeep(n)),e.selectd=i}}catch(e){console.warn(e)}},updataShow:function(e,t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=!r.isShow;updataAttribute(r,"isShow",n,"")}},changeShow:function(e,t){var r=t.cid,n=t.flag,i=findItemDeep$1(e.list,r);i&&updataAttribute(i,"isShow",n,"")},comToggle:function(e,t){var r=findItemDeep$1(e.list,t);r&&comToggle(r)},updataLock:function(e,t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=!r.isLock;updataAttribute(r,"isLock",n,"")}},breakUp:function(e,t){var r,n;try{if(!t)throw"Please pass in the component CID correctly!";var i=findParentDeep(e.list,t),o=findItemDeep$1(e.list,t),a=o.baseData;if(isNaN(a.left)||isNaN(a.top))throw new Error("top or left is NAN");var s=breakUp(o,e.list);if(s.map((function(e){return e.pid=""})),i){var c=i.children.findIndex((function(e){return e.cid==t}));i.children.splice(c,1),(r=i.children).push.apply(r,s.reverse())}else{c=e.list.findIndex((function(e){return e.cid==t}));e.list.splice(c,1),(n=e.list).push.apply(n,s.reverse())}}catch(e){console.error(e)}},editGroup:function(e,t){var r,n=t.groupId;t.status;try{if(!n)throw"Please pass in the component CID correctly!";var i=e.list.findIndex((function(e){return e.cid===n})),o=e.list[i],a=breakUp(o);a.map((function(e){return e.pid=""})),e.list.splice(i,1),(r=e.list).push.apply(r,a)}catch(e){console.error(e)}},combination:function(e){_$1.cloneDeep(e.list);var t,r,n=[],i=[],o=genID(),a=findItemDeep$1(e.list,e.selectd[0]);a.pid?console.info("Sorry, only level 2 is supported group"):a.children&&1===e.selectd.length?console.info("Sorry, only level 2 is supported group"):(e.selectd.forEach((function(t){var r=e.list.findIndex((function(e){return e.cid===t}));if(r>-1){n.push(r);var a=e.list.splice(r,1)[0];a.pid=o,i.push(a)}})),t=n.sort((function(e,t){return e-t}))[0],r=1===i.length?_$1.cloneDeep(i[0].baseData):e.currentArea,Object.assign(r,{angle:0,opacity:100,rotate:0,rotateY:0}),setPositionForGroup(r,i),e.list.splice(t,0,{cid:o,pid:"",isShow:!0,isLock:!1,editer:!1,baseData:r,z:0,toggle:!0,name:"群组",type:"folder",origin:"anov-ui",tmpData:{actions:null,option:null,source:globalSourceTemp},children:i}),setIndex(e.list),e.selectd=[o])},moveUp:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>=1?arraySwap(e.list,r-1,r):arraySwapDeep(e.list,"up",t)}catch(e){console.error(e)}},moveDown:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>-1&&r<=e.list.length-2?arraySwap(e.list,r+1,r):arraySwapDeep(e.list,"down",t)}catch(e){console.error(e)}},moveTop:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t}));r>-1&&0!==r?arraySwap(e.list,0,r):arraySwapDeep(e.list,"top",t)}catch(e){console.error(e)}},moveBottom:function(e,t){try{var r=e.list.findIndex((function(e){return e.cid===t})),n=e.list.length-1;r>-1&&r!==n?arraySwap(e.list,n,r):arraySwapDeep(e.list,"bottom",t)}catch(e){console.error(e)}}};function setComActions(e){var t=[],r=[];recursion(_$1.cloneDeep(e),(function(e){var n,i;if(null===(i=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.actions)||void 0===i?void 0:i.length){var o=e.tmpData.actions.map((function(e){return e.eventType}));setActions({types:o,element:e,actions:t,events:r})}}));var n=r.filter((function(e){return e}));return{actions:t,events:n}}var eventMutations={addGlobalSource:function(e,t){var r=t.name,n=t.value,i=genID();e.globalSource.push({key:i,name:r,value:n}),me({key:i,name:r,value:n},e.globalVars,e.globalSource,e.list,(function(e){}))},editGlobalSource:function(e,t){var r=this,n=t.key,i=t.value,o=e.globalSource.find((function(e){return e.key==n}));o&&(o.name=t.name,o.value=i,me(o,e.globalVars,e.globalSource,e.list,(function(e,t){r.commit("GoCom/updataSourceForComponent",{cid:e.cid,data:t})})))},delGlobalSource:function(e,t){try{var r=e.globalSource.findIndex((function(e){return e.key===t}));-1!==r&&e.globalSource.splice(r,1)}catch(e){console.error("删除错误",e)}},setSyncFlag:function(e,t){e.syncFlag=t},goUpShareVar:function(e,t){e.shareVariable[t.key]=__assign$1({},t)},addGoRunVar:function(e,t){try{var r=getInteractive(e.list,e.globalConstant,e.sysConst);e.globalVars=r.globalVars,e.eventsComs=r.eventsComs}catch(e){console.warn(e)}},copyGoVar:function(e,t){try{for(var r=t.mapField,n=(r.toString().trim(),e.globalConstant.filter((function(e){return e.mapField.includes(r)}))),i=1,o=0;o<n.length;o++)i++;var a="".concat(r," (").concat(i,")"),s=e.globalConstant.find((function(e){return e.mapField==r}));if(r&&s){var c=_$1.cloneDeep(s);c.mapField=a,e.globalConstant.push(c);var u=getInteractive(e.list,e.globalConstant,e.sysConst);e.globalVars=u.globalVars,e.eventsComs=u.eventsComs}}catch(e){console.warn(e)}},goDelShareVar:function(e,t){delete e.shareVariable[t]},signal:function(e,t){},goSynchroDataAll:function(e,t){e.list=_$1.cloneDeep(t)},goSynchroDataForOption:function(e,t){if(e){var r=t.cid,n=t.value,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&i&&updataAttributeForOption(i,n)}this.commit("GoCom/execute")},goSynchroData:function(e,t){if(e){var r=t.cid,n=t.attr,i=t.value,o=t.attrModel,a=findItemDeep$1(e.list,r);if("boolean"!=typeof a){if(a&&updataAttribute(a,n,i,o),"actions"===n.toLowerCase()){var s=e.list,c=_$1.uniqWith(_$1.concat(setComActions(s).actions,setComActions(e.caseList).actions),_$1.isEqual),u=_$1.uniqWith(_$1.concat(setComActions(s).events,setComActions(e.caseList).events),_$1.isEqual);ve.addVariables(c),e.globalVars=ve.getAllVariables(),e.globalEvents=u,e.pages[e.pageIndex]&&(e.pages[e.pageIndex].globalVars=c),e.pages[e.pageIndex]&&(e.pages[e.pageIndex].globalEvents=u)}if("source"===n){if(!a.tmpData.source)return!1;var l=a.tmpData.source,d=l.type;if("api"===d){var h=l[d].url.match(/{{[\w]*}}|(@)[\w]*/gm);if(h)for(var f=h.map((function(e){return e.replace(/{{|}}|@/gm,"")})),p=function(t){var r=f[t];if(!r||!e.globalVars||e.globalVars.findIndex((function(e){return e.mapField===r}))<0)return"continue";if(e.shareVariableTree||(e.shareVariableTree={}),e.shareVariableTree[r]&&_$1.isArray(e.shareVariableTree[r])){e.shareVariableTree[r].push(a.cid);var n=e.shareVariableTree[r];e.shareVariableTree[r]=_$1.uniq(n)}else e.shareVariableTree[r]=[],e.shareVariableTree[r].push(a.cid)},m=0;m<f.length;m++)p(m)}}}}this.commit("GoCom/execute")},goUpdataSysVars:function(e,t){var r={U_CITY:"cityCode",U_COUNTY:"countyCode",U_PROVINCE:"provinceCode",U_PHONE:"userPhone"},n=e.sysConst,i=Object.keys(r);n.map((function(e){if(e.originalValue=e.value,(null==e?void 0:e.name)&&(null==i?void 0:i.includes(e.name))){var n=r[e.name];e.value=t[n],e.originalValue=t[n]}return e})),ve.addVariables(n)},resetGlobalData:function(e){e.globalVars=e.sysConst,e.globalConstant=[],e.globalSource=[]},updateGlobalRelatedVars:function(e,t){var r=t.run,n=t.gvData;return r.length&&r.forEach((function(e){var t=n.filter((function(t){return t.mapField==e.mapField||t.fork&&t.forkValue==e.mapField}));if(t.length)for(var r=0,i=t;r<i.length;r++){var o=i[r],a=e.value;o.mapField==e.mapField?o.value=a:o.fork&&e.mapField==o.forkValue?(o.converter&&o.converterCode,o.originalValue=a):n.push(e)}})),n}},comTreeMutations={updataList:function(e,t){var r=t.cid,n=produceWithImmer(t.list,(function(e){var t=findItemDeep$1(e,r),n=t.pid,i=getAncestorsNodes(e,r),o=function(e){for(var t=0;t<e.length;t++){var r=e[t];upDataGroup(r,r.baseData,null,!0)}},a=function(e){return e.reduce((function(e,t){return{left:e.left+t.baseData.left,top:e.top+t.baseData.top}}),{left:0,top:0})},s=function(e,t){void 0===t&&(t=e);for(var r=0;r<e.length;r++){var n=e[r];if(n.children&&Array.isArray(n.children))return 0===n.children.length?(t.splice(r,1),!0):(s(n.children,n.children)&&0===n.children.length&&t.splice(r,1),!0)}};if(i.length>0)if(t.pid=i[0].cid,n){var c=__spreadArray$1([findItemDeep$1(e,n)],getAncestorsNodes(e,n),!0),u=a(c),l=a(i);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,u)),t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,l,1)),o(c),o(i)}else{l=a(i);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,l,1)),o(i)}n&&0==i.length&&(t.pid="",function(t,r){var n=getAncestorsNodes(e,r),i=findItemDeep$1(e,r);if(0===n.length)t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,i.baseData));else{n=__spreadArray$1([i],n,!0);var s=a(n);t.baseData=__assign$1(__assign$1({},t.baseData),transformPosition(t.baseData,s))}o(__spreadArray$1([i],n,!0))}(t,n)),s(e),setIndex(e)}));e.list=n},updataListForContrast:function(e,t){var r=t.cid,n=t.list,i=findItemDeep$1(n,r);findParentDeep(n,r);var o=findParentDeep(e.list,r);if(!i.pid){i.pid=o.cid;var a=_$1.cloneDeep(i.baseData),s=transformPosition(i.baseData,o.baseData,1);Object.assign(i.baseData,s),upDataGroup(o,a)}setIndex(e.list)},updateTree:function(e){for(var t=e.list,r=0;r<t.length;r++){var n=t[r];if(n.pid)(a=findItemDeep$1(t,n.pid))&&Object.assign(n.baseData,transformPosition(n.baseData,a.baseData));if(n.children)for(var i=0;i<n.children.length;i++){var o=n.children[i];if(o.pid!=n.cid){var a=findItemDeep$1(t,o.pid);if(_$1.cloneDeep(o.baseData),a){Object.assign(o.baseData,transformPosition(o.baseData,a.baseData));var s=transformPosition(o.baseData,n.baseData,1);Object.assign(o.baseData,s),upDataGroup(n,n.baseData)}o.pid=n.cid}}}setIndex(t)}},ERR_OK=200,ERR_OK2=2e4,TIMEOUT=3e4,STATUS="status",xhr=function(t,r){void 0===t&&(t="");var n=e.create({baseURL:t,timeout:TIMEOUT,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}});return n.interceptors.request.use((function(e){return sessionStorage.getItem("anov-go-token")&&"null"!=sessionStorage.getItem("anov-go-token")&&(e.headers["X-ANOV-ACCESS-TOKEN"]=sessionStorage.getItem("anov-go-token")),sessionStorage.getItem("unify-access-token")&&"null"!=sessionStorage.getItem("unify-access-token")&&(e.headers["X-UNIFY-ACCESS-TOKEN"]=sessionStorage.getItem("unify-access-token")),sessionStorage.getItem("dgcc_authorization")&&"null"!=sessionStorage.getItem("dgcc_authorization")&&(e.headers.dgcc_authorization=sessionStorage.getItem("dgcc_authorization")),"post"===e.method?(e.headers["Content-Type"]="application/json;",e):"get"===e.method?e:"put"===e.method?(e.headers["Content-Type"]="application/json; charset=UTF-8",e):"delete"===e.method?e:void 0}),(function(e){return Promise.reject(e)})),n.interceptors.response.use((function(e){return e[STATUS]===ERR_OK||e.data.code,r&&r(e),e.data}),(function(e){return r&&r(null==e?void 0:e.response),Promise.reject(e.response)})),n},Http=function(e,t){return xhr(e,t)},filterData=ne,parseSource=function(e,t,r,n,i,o,a,s){void 0===n&&(n=!0);console.log(t,r,n,i,"callback"),le(t,n,r,[],(function(e){i(e),("AnContainer"===(null==t?void 0:t.viewComName)&&n||"AnGridLayout"===(null==t?void 0:t.viewComName)&&n)&&UpdataForContainer(t)}),s)},updateComData=function(e,t,r,n,i,o,a){return void 0===r&&(r=!0),__awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,le(e,r,t,i,(function(e){n&&n(e)}),a)];case 1:return[2,s.sent()];case 2:return o=s.sent(),n&&n(o),console.log("error:11"+o),[3,3];case 3:return[2]}}))}))},autoUpdateComData=function(e,t,r){var n,i,o,a,s,c=null===(n=null==e?void 0:e.tmpData)||void 0===n?void 0:n.source,u=null===(o=null===(i=c[null==c?void 0:c.type])||void 0===i?void 0:i.autoUpdate)||void 0===o?void 0:o.open,l=null===(s=null===(a=c[null==c?void 0:c.type])||void 0===a?void 0:a.autoUpdate)||void 0===s?void 0:s.time;u&&_$1.isNumber(l)&&l>0&&setInterval((function(){updateComData(e,t,!0,(function(t){r({cid:e.cid,data:t})}))}),1e3*l)},refreshData=function(e,t,r,n,i,o){void 0===o&&(o=!0),e&&le(e,o,t,[],(function(t){r({cid:e.clientWidth,data:t})}))},index$2=Object.freeze({__proto__:null,Http:Http,autoUpdateComData:autoUpdateComData,axios:e,filterData:filterData,getDataForEvaluator:getDataForEvaluator,parseSource:parseSource,refreshData:refreshData,updateComData:updateComData}),loadFontResource=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=e.fontUrl,r=e.fontName,n="__custom_font__",(i=document.getElementById(n))?[3,2]:((i=document.createElement("style")).id=n,[4,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)]);case 1:a.sent(),a.label=2;case 2:return i.innerText+="@font-face{font-family:'".concat(r,"';src:url(").concat(t,");}"),[3,4];case 3:return o=a.sent(),console.warn(o),[3,4];case 4:return[2]}}))}))},loadScript=function(e,t,r){return void 0===t&&(t="jspaths"),__awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n="csspaths"===t?"link":"script",i=document.createElement(n),"jspaths"===t?i.defer=!0:i.rel="stylesheet",i.className=t,i.src=e,(r||document.head||document.getElementsByTagName("head")[0]).appendChild(i),[4,new Promise((function(e,t){i.addEventListener("load",e),i.addEventListener("error",e)}))];case 1:return o.sent(),[2]}}))}))},addTag=function(e,t){return void 0===t&&(t="jspaths"),__awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r="fonts"===t?loadFontResource:loadScript,[4,Promise.all(e.map((function(e){return r(e)})))];case 1:return n.sent(),[2]}}))}))},loadFont=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return e.fonts&&e.fonts.length?[4,addTag(e.fonts,"fonts")]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},loadTag=function(e){var t=e.jspaths,r=void 0===t?[]:t,n=e.csspaths,i=void 0===n?[]:n,o=e.fonts,a=void 0===o?[]:o;return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=_$1.uniqBy(a,"fontName"),[4,Promise.all([addTag(r,"jspaths"),addTag(i,"csspaths"),addTag(e,"fonts")])];case 1:return t.sent(),[2]}}))}))},loadFontTag=function(e){var t=e.fonts,r=void 0===t?[]:t;return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=_$1.uniqBy(r,"fontName"),[4,Promise.all([addTag(e,"fonts")])];case 1:return t.sent(),[2]}}))}))},removeTag=function(){removeFont(),Array.from(document.getElementsByTagName("script")).filter((function(e){return"jspaths"==e.className})).forEach((function(e){removeScript(e.src)})),Array.from(document.getElementsByTagName("link")).filter((function(e){return"csspaths"==e.className})).forEach((function(e){removeCss(e.href)}))};function removeScript(e){for(var t,r=Array.from(document.getElementsByTagName("script")),n=0;n<r.length;n++)r[n]&&r[n].src&&-1!=r[n].src.indexOf(e)&&(null===(t=r[n])||void 0===t?void 0:t.parentNode)&&r[n].parentNode.removeChild(r[n])}function removeCss(e){for(var t,r=Array.from(document.getElementsByTagName("link")),n=0;n<r.length;n++)r[n].href,r[n]&&r[n].href&&-1!=r[n].href.indexOf(e)&&(null===(t=r[n])||void 0===t?void 0:t.parentNode)&&r[n].parentNode.removeChild(r[n])}function removeFont(){var e=document.getElementById("__custom_font__");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)}var toolMutations={reset:function(e){e.selectd=[],e.list=[],e.plant=null,e.tw=null,e.watermark=null,e.endnotes=null,e.globalConstant=[]},setFonts:function(e,t){e.resource.fonts.push({fontName:t.name,fontUrl:t.src}),loadFont(e.resource)},setCaseInfo:function(e,t){e.caseInfo=t},setPageId:function(e,t){e.pageId=t},pagePush:function(e,t){try{var r=t.type,n=t.value,i=t.option,o=["name","path","id"];if(!o.includes(r))throw new Error("页面跳转错误!".concat(r," 不是一个正确的参数 请填以下参数 ").concat(o.join(",")));if(!n)throw new Error("页面跳转错误!".concat(r," 不是一个正确的参数 请填正确的页面路径或者页面名称"));e.toPage=i?{type:r,value:n,option:i}:{type:r,value:n}}catch(e){console.warn(e)}},updatComs:function(e,t){var r=this,n=findItemDeep$1(e.list,t);if("boolean"!=typeof n){(null==n?void 0:n.children)&&(null==n||n.children),updateComData(n,e.globalVars,!0,(function(e){r.commit("GoCom/updataSourceForComponent",{cid:n.cid,data:e})}),e.globalSource)}},updatComsForVar:function(e,t){var r=e.globalVars.map((function(e){var r,n;if((null===(r=null==e?void 0:e.forkValue)||void 0===r?void 0:r.length)&&(null===(n=null==e?void 0:e.forkValue)||void 0===n?void 0:n.includes(t))||e.forkValue==t)return e.mapField})).filter((function(e){return e})),n=[t];(null==r?void 0:r.length)&&(n=_$1.uniq(__spreadArray$1([t],r,!0)));for(var i=[],o=0,a=n;o<a.length;o++){var s=a[o];e.shareVariableTree[s]&&i.push.apply(i,e.shareVariableTree[s])}if(null==i?void 0:i.length)for(var c=0,u=i;c<u.length;c++){var l=u[c];this.commit("GoCom/updatComs",l)}},addConstant:function(e,t){var r=_$1.find(e.constant,{name:t.name});r?Object.assign(r,t):e.constant.push(t)},editConstant:function(e,t){var r=_$1.find(e.constant,{name:t.name});r&&Object.assign(r,t)},delConstant:function(e,t){_$1.remove(e.constant,(function(e){return e.name==t}))},setResource:function(e,t){var r=t.type,n=t.value;e.resource[r]=n,removeTag(),loadTag(e.resource)},updataResource:function(e){removeTag(),loadTag(e.resource)},resetResource:function(e){e.resource={jspaths:[],csspaths:[],otherpaths:[]}},setData:function(e,t){e.selectd=t.selectd},setList:function(e,t){e.list=t,setIndex(e.list)},saveDynamicChildren:function(e,t){var r=t.cid,n=t.data,i=t.name,o=e.pages[e.pageIndex].list,a=findItemDeep$1(o,r);a&&(a.activeDynamic=i,a.dynamicChildren instanceof Array&&(a.dynamicChildren=new Map(a.dynamicChildren)),a.dynamicChildren.set(i,n))},setTheme:function(e,t){e.theme=t},setPlant:function(e,t){var r=t.attr,n=t.value;e.plant||(e.plant={name:"",theme:null,baseData:{width:1920,height:1080,left:0,top:0},option:null,optionDes:null}),e.plant[r]=n},setPlantHeight:function(e,t){e.plant&&(e.plant.baseData.height=e.plant.baseData.height+t)},reversal:function(e,t){e.undos=[],e.undoRedoPointer=-1;var r=_$1.cloneDeep(t.globalVars);delete t.globalVars,e=Object.assign(e,t),ve.addVariables(r),e.globalVars=ve.getAllVariables(),setIndex(e.list)},setComTmp:function(e,t){var r=e.list.find((function(e){return e.cid===t[0]}));r.com=t[1],r.tmp=t[2]},setLoading:function(e,t){var r=t.cid,n=t.flag,i=e.list.find((function(e){return e.cid===r}));i&&(i.loading=n)},setMultiple:function(e,t){e.multiple=t},setCaseList:function(e,t){e.caseList=t},updataComponentForList:function(e,t){var r=t.cid,n=t.data,i=e.list,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataComponentForCaseList:function(e,t){var r=t.cid,n=t.data,i=e.caseList,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataComponent:function(e,t){var r=t.cid,n=t.data,i=e.pages&&e.pages[0]&&e.pages[0].list&&e.pages[0].list.length?e.pages[0].list:e.list,o=findItemDeep$1(i,r);"boolean"!=typeof o&&Object.assign(o,n)},updataArea:function(e,t){e.currentArea.left+=t.deltaX,e.currentArea.top+=t.deltaY},updataSource:function(e,t){var r=t.cid,n=t.data,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&("indicatorCQ"===i.tmpData.source.type?i.tmpData.source.indicator.data=n:(console.log("更新数据:"+i.cid),i.tmpData.source[i.tmpData.source.type].data=n))},updataSourceForComponent:function(e,t){var r=t.cid,n=t.data;if(e.list.length){var i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.source=_$1.cloneDeep(n))}},updataAnimationForComponent:function(e,t){var r=t.cid,n=t.data;if(e.list.length){var i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.tw=n)}},updataWatermark:function(e,t){e.watermark=t},updataEndnotes:function(e,t){e.endnotes=t},updataAnimation:function(e,t){e.tw=t},setContext:function(e,t){var r=t.cid,n=t.data,i=findItemDeep$1(e.list,r);"boolean"!=typeof i&&(i.example=n)},setContextList:function(e,t){var r=t.cid,n=t.data;e.contextList[r]=n},setPosition:function(e,t){setPositionForWorld(e.list.find((function(e){return e.cid===t[0]})),t[1])},setSelect:function(e,t){e.cache=[],e.selectd=t instanceof Array?t:[t],e.selectd.length>1&&e.selectd.forEach((function(t){e.cache.push(e.list.find((function(e){return e.cid===t&&"Other.Plant.Normal"!==e.type})))}))},setActive:function(e,t){var r=_$1.cloneDeep(t),n=r.id,i=r.multiple,o=r.origin,a=r.ctr,s=_$1.cloneDeep(e.selectd);if(i){var c=s.includes(n);if(s.length>=1){var u=s.every((function(r){return isPeer(e.list,r,t.id)}));if(!u)return void console.info("sorry Only sibling elements can be selected!")}c?s.splice(s.findIndex((function(e){return e===n})),1):s.push(n),e.selectd=s}else e.selectd=[n];e.selectd.forEach((function(t){var r=findItemDeep$1(e.list,t);if(r.pid){var n=findItemDeep$1(e.list,r.pid);n&&(n.toggle=!0)}a||(r.toggle=!0)})),e.selectdChangeOrigin=o||""},setCache:function(e){e.cache=[],e.selectd.length>1&&e.selectd.forEach((function(t){e.cache.push(e.list.find((function(e){return e.cid===t})))}))},clearActive:function(e){e.selectd=[]},setMultipleActive:function(e,t){e.selectd=t},syncMenuInfo:function(e){RecursiveList(e.menuList,(function(t){var r=10*t.lv+t.index;e.list.filter((function(e){return e.cid===t.id}))[0].z=1e4-r}))},addComs:function(e,t){var r=t.com,n=t.isMobile;"MultiStateComponent"!=r.componentType||r.stateChildren||(r.stateChildren=[]),"dynamicComponent"!=r.componentType||r.dynamicChildren||(r.dynamicChildren=new Map,r.activeDynamic="状态1",r.dynamicChildren.set("状态1",[]),r.lines={h:[],v:[]},"AnGridLayout"==r.viewComName&&r.dynamicChildren.set("状态1",null==r?void 0:r.AnGridChildren)),n?e.list.push(r):e.list.unshift(r),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},addComsForParent:function(e,t){var r=t.com,n=t.isMobile,i=t.PID;if("MultiStateComponent"!=r.componentType||r.stateChildren||(r.stateChildren=[]),"dynamicComponent"!=r.componentType||r.dynamicChildren||(r.dynamicChildren=new Map,r.activeDynamic="状态1",r.dynamicChildren.set("状态1",[])),i){var o=findItemDeep$1(e.list,i);n?(o.children=[],o.children.push(r)):o.children.unshift(r)}else n?e.list.splice(0,1,r):e.list.unshift(r);e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},addMyComs:function(e,t){var r;try{var n=t.data,i=t.shareVariableTree,o=t.globalVars,a=t.globalEvents;e.globalVars=_$1.uniq(_$1.concat(_$1.cloneDeep(e.globalVars),o)),e.globalEvents=_$1.uniq(_$1.concat(_$1.cloneDeep(e.globalEvents),a));var s=Object.keys(i),c=Object.keys(e.shareVariableTree),u=_$1.difference(s,c);u.length?u.forEach((function(t){e.shareVariableTree[t]=_$1.concat(_$1.cloneDeep(e.shareVariableTree[t]),i[t])})):e.shareVariableTree=Object.assign(_$1.cloneDeep(e.shareVariableTree),i),n instanceof Array?(resetID(n),(r=e.list).unshift.apply(r,n)):(resetID([n]),e.list.unshift(n)),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")}catch(e){}},addStateChildren:function(e,t){var r=findItemDeep$1(e.list,t.pid);r&&r.stateChildren.push(t)},addDynamicChildren:function(e,t){var r=findItemDeep$1(e.list,t.pid);r&&r.dynamicChildren.push(t)},arraySwap:function(e,t){var r;try{if(!t||2!=t.length)throw new Error("参数错误,方法接受两个组件的CID组成的数组!");var n=_$1.cloneDeep(e.list),i=findItemDeep$1(n,t[0]),o=findItemDeep$1(n,t[1]),a=findItemDeep$1(n,i.pid),s={},c=0,u=0;if(o)if("selectContainer"==o.componentType){var l=findItemDeep$1(n,t[1]);a?(c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],a.children=a.children.filter((function(e){return e.cid!==s.cid}))):(s=findItemDeep$1(n,t[0]),n=n.filter((function(e){return e.cid!==s.cid}))),s.cid=genID(),s.pid=l.cid,l.children.push(s)}else if(i.pid||o.pid)if(a)if(c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],i.pid!==o.pid){l=findItemDeep$1(n,o.pid);u=_$1.findIndex(l.children,(function(e){return e.cid==t[1]}));d=l.children[u];s.cid=genID(),s.pid=l.cid,d.cid=genID(),d.pid=a.cid,a.children.splice(c,1,d),l.children.splice(u,1,s)}else u=_$1.findIndex(a.children,(function(e){return e.cid==t[1]})),(r=a.children).splice.apply(r,__spreadArray$1([u,1],a.children.splice(c,1,a.children[u]),!1));else{var l=findItemDeep$1(n,o.pid);c=_$1.findIndex(n,(function(e){return e.cid==t[0]})),u=_$1.findIndex(l.children,(function(e){return e.cid==t[1]})),s=findItemDeep$1(n,i.cid);var d=l.children[u];s.cid=genID(),s.pid=l.cid,d.cid=genID(),d.pid=null,n.splice(c,1,d),l.children.splice(u,1,s)}else arraySwapForId(e.list,t[0],t[1]);else c=_$1.findIndex(a.children,(function(e){return e.cid==t[0]})),s=a.children[c],a.children.splice(c,1),s.cid=genID(),s.pid=null,n.push(s);e.list=n,setIndex(e.list)}catch(e){console.warn("组件位置交换发生错误",e)}},changeDynamicState:function(e,t){var r=findItemDeep$1(e.list,t.cid);r&&"dynamicComponent"==r.componentType&&(r.dynamicChildren instanceof Array&&r.dynamicChildren.find((function(e){return e[0]==t.activeName}))||r.dynamicChildren instanceof Map&&r.dynamicChildren.has(t.activeName)?r.activeDynamic=t.activeName:console.error(t.activeName+"不是一个正确的状态"))},addAlternateData:function(e,t){e.alternateData[t.pid]||(e.alternateData[t.pid]=[]),e.alternateData[t.pid].push(t)},setOptionForCom:function(e,t){var r;try{var n=t.cid,i=t.key,o=t.value,a=findItemDeep$1(e.list,n);if(!a)return;if("string"!=typeof i)return void console.error("key:[".concat(i,"]格式错误"));var s=null===(r=null==a?void 0:a.tmpData)||void 0===r?void 0:r.option,c=i.split(".");s&&(null==c?void 0:c.length)&&c.forEach((function(e,t){s.hasOwnProperty(e)&&(t===c.length-1?s[e]=o:s=s[e])}))}catch(e){console.warn("同步属性发生错误:"+e)}},mergeConfig:function(e,t){t.length>0&&t.forEach((function(t){e.list.unshift(t)})),e.menuList=_$1.cloneDeep(e.list),setIndex(e.list),this.commit("GoCom/execute")},updataName:function(e,t){var r=findItemDeep$1(e.list,t.cid);r&&(r.name=t.name)},setDynamicActive:function(e,t){t.cid;var r=t.name,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.activeDynamic=r)},updataScroll:function(e,t){t.cid;var r=t.data,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.srcollInfo={use:!!(null==r?void 0:r.use)&&(null==r?void 0:r.use),data:(null==r?void 0:r.data)?null==r?void 0:r.data:null})},updataDySetting:function(e,t){t.cid;var r=t.data,n=findItemDeep$1(e.list,t.cid);n&&"dynamicComponent"==n.componentType&&(n.dyOption=r)},setCurrentEdited:function(e,t){if(t){var r=findItemDeep$1(e.list,t);if("boolean"!=typeof r){var n=breakUp(r);r.children=n}e.currentEditerCid=t}else e.currentEditerCid=""},setDynamicLine:function(e,t){var r=_$1.cloneDeep(e.list),n=findItemDeep$1(r,t.cid);r.length&&"boolean"!=typeof n&&(n.lines=Object.assign({},n.lines,t.lines)),e.list=r}},findArray=function(e,t){try{var r=e.map((function(e){var r=findItemDeep$1(t,e);if("object"==typeof r)return r;throw"Please check whether the input and output parameters are correct!"}));if(_$1.every(r,Object))return r;throw"Please check whether the input and output parameters are correct!"}catch(e){return console.error(e),[]}},alignLeft=function(e,t){1===e.length&&(e[0].baseData.left=0);var r=_$1.sortBy(e,(function(e){return e.baseData.left})),n=r[0].baseData.left;e.map((function(e){return e.baseData.left=n}))},alignRight=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.left=r.width-e[0].baseData.width}var n=_$1.sortBy(e,(function(e){return e.baseData.left})),i=1*n[n.length-1].baseData.left+1*n[n.length-1].baseData.width;e.map((function(e){return e.baseData.left=i-1*e.baseData.width}))},horizontally=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.left=r.width/2-e[0].baseData.width/2}var n=_$1.sortBy(e,(function(e){return e.baseData.left})),i=_$1.sortBy(e,(function(e){return 1*e.baseData.left+1*e.baseData.width})),o=(1*n[0].baseData.left+(1*i[i.length-1].baseData.left+1*i[i.length-1].baseData.width))/2;e.map((function(e){return e.baseData.left=o-e.baseData.width/2}))},alignTop=function(e,t){1===e.length&&(e[0].baseData.top=0);var r=_$1.sortBy(e,(function(e){return e.baseData.top})),n=1*r[0].baseData.top;e.map((function(e){return e.baseData.top=n}))},alignBottom=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.top=r.height-e[0].baseData.height}var n=_$1.sortBy(e,(function(e){return 1*e.baseData.top})),i=1*n[n.length-1].baseData.top+1*n[n.length-1].baseData.height;e.map((function(e){return e.baseData.top=i-1*e.baseData.height}))},verticalCenter=function(e,t){if(1===e.length){var r=t.plant?t.plant.baseData:{width:1920,height:1080};e[0].baseData.top=r.height/2-e[0].baseData.height/2}var n=_$1.sortBy(e,(function(e){return e.baseData.top})),i=_$1.sortBy(e,(function(e){return 1*e.baseData.top+1*e.baseData.height})),o=(1*n[0].baseData.top+(1*i[i.length-1].baseData.top+1*i[i.length-1].baseData.height))/2;e.map((function(e){return e.baseData.top=o-e.baseData.height/2}))},topDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top})),r=(t[t.length-1].baseData.top-t[0].baseData.top)/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.top=1*t[0].baseData.top+r*n)}))},bottomDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top+e.baseData.height})),r=(t[t.length-1].baseData.top+t[t.length-1].baseData.height-(t[0].baseData.top+t[0].baseData.height))/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.top=1*t[0].baseData.top+1*t[0].baseData.height-1*e.baseData.height+r*n)}))},xCenterDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left+e.baseData.width/2})),r=1*t[t.length-1].baseData.left+t[t.length-1].baseData.width/2,n=1*t[0].baseData.left+t[0].baseData.width/2,i=(r-n)/(t.length-1);t.map((function(e,r){r>0&&r<t.length-1&&(e.baseData.left=n-e.baseData.width/2+i*r)}))},leftDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left})),r=(t[t.length-1].baseData.left-t[0].baseData.left)/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.left=t[0].baseData.left+r*n)}))},rightDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.left+e.baseData.width})),r=(t[t.length-1].baseData.left+t[t.length-1].baseData.width-(t[0].baseData.left+t[0].baseData.width))/(t.length-1);t.map((function(e,n){n>0&&n<t.length-1&&(e.baseData.left=t[0].baseData.left+t[0].baseData.width-e.baseData.width+r*n)}))},yCenterDistribution=function(e){if(e.length<3)return console.warn("A minimum of three elements are required for a distribution arrangement"),!1;var t=_$1.sortBy(e,(function(e){return e.baseData.top+e.baseData.height/2})),r=1*t[t.length-1].baseData.top+t[t.length-1].baseData.height/2,n=1*t[0].baseData.top+t[0].baseData.height/2,i=(r-n)/(t.length-1);t.map((function(e,r){r>0&&r<t.length-1&&(e.baseData.top=n-e.baseData.height/2+i*r)}))},layoutMutations={layout:function(e,t){var r=findArray(e.selectd,e.list);switch(t){case"alignLeft":alignLeft(r);break;case"alignRight":alignRight(r,e);break;case"horizontally":horizontally(r,e);break;case"alignTop":alignTop(r);break;case"alignBottom":alignBottom(r,e);break;case"verticalCenter":verticalCenter(r,e);break;case"topDistribution":topDistribution(r);break;case"bottomDistribution":bottomDistribution(r);break;case"xCenterDistribution":xCenterDistribution(r);break;case"leftDistribution":leftDistribution(r);break;case"rightDistribution":rightDistribution(r);break;case"yCenterDistribution":yCenterDistribution(r)}}},pages={setPageData:function(e,t){e.pages[0]=t},parasePages:function(e,t){t instanceof Array&&(e.pages=t.map((function(e,t){return e.name||(e.name="页面"+(t+1)),e.path||(e.path="page"+(t+1)),e})))},addPage:function(e,t){var r=e.pages.length+1;t.name="页面"+r,t.path="page"+r,e.pages.push(t),e.pageIndex=e.pages.length-1,e.resource={jspaths:[],csspaths:[],otherpaths:[]},e.globalVars=e.sysConst},setCurrentPageIndex:function(e,t){var r=e.globalEvents,n=e.globalVars,i=e.list,o=e.name,a=e.theme,s=e.plant,c=e.shareVariableTree,u=e.resource;e.pages[e.pageIndex]={globalEvents:r,globalVars:n,list:i,name:o,theme:a,plant:s,shareVariableTree:c,resource:u},e.pageIndex=t},setPageDataForIndex:function(e,t){var r=t.index,n=t.data;e.pages[r]=n},setPageName:function(e,t){e.name=t,e.pages[e.pageIndex].name=t},saveCurrentPageData:function(e){var t=e.globalEvents,r=e.globalVars,n=void 0===r?[]:r,i=e.list,o=e.name,a=e.theme,s=e.plant,c=e.shareVariableTree,u=e.resource;e.pages[e.pageIndex]={globalEvents:t,globalVars:n,list:i,name:o,theme:a,plant:s,shareVariableTree:c,resource:u}},getCurrentPageData:function(e){var t=e.globalEvents,r=e.globalVars,n=e.list,i=e.name,o=e.theme,a=e.plant,s=e.shareVariableTree,c=e.resource;e.pages[e.pageIndex]={globalEvents:t,globalVars:r,list:n,name:i,theme:o,plant:a,shareVariableTree:s,resource:c}}},containerMutaitons={segmentationContainer:function(e,t){var r=_$1.cloneDeep(e.list),n=t.containerData,i=t.direction,o=[];if("del"==i)if(n.pid){var a=findItemDeep$1(r,n.pid),s=a.children.length;if(a)if(s<=2)(o=a.children.filter((function(e){return e.cid!==n.cid&&e.children.length}))).length?(a.direction=o[0].direction,a.children=o[0].children.map((function(e){return e.pid=a.pid||a.cid,e}))):a.children=[];else{var c=a.children.find((function(e){return e.cid===n.cid})),u=a.children.findIndex((function(e){return e.cid===n.cid}));a.children=a.children.filter((function(e){return e.cid!==n.cid}));var l=a.children[u>=a.children.length-1?a.children.length-1:u],d="col"==l.direction?"height":"width";l.baseData[d]=(parseFloat(l.baseData[d])+parseFloat(c.baseData[d])).toFixed(2)+"%"}}else r.length&&(r=r.filter((function(e){return e.cid!==n.cid})));else{var h=findItemDeep$1(r,n.cid);if(h){h.direction=i,1===h.children.length&&(o=h.children,h.children=[]);for(var f=(s=h.children.length)>=2?1:2,p=(d=s>=2?(100/(s+1)).toFixed(2)+"%":"50%",0);p<f;p++)h.children.push({isLock:!1,isShow:!0,baseData:{width:"col"==i?"100%":d,height:"col"==i?d:"100%",angle:0,penetrate:0,opacity:100},direction:i,componentType:"selectContainer",iconClass:"__vue_devtool_undefined__",isAssembly:"__vue_devtool_undefined__",source:[],comData:{actions:[],option:{grid:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}],bgColor:{alpha:1,blue:0,green:0,red:0,flag:1,style:"transparent"},imgOpt:"",bgScaleOpt:3,borderRadius:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}],margins:[{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"},{val:0,unit:"px"}]}},tmpData:{},dynamic:0,filePath:"/anov-prod/mgt/go/assembly/162-bgImage.png",origin:"anov-go",name:"容器组件",path:"/index.js",viewComName:"selectContainer",optionComName:"",dataComName:"",eventComName:"",assemblyDeveloper:"",devEmail:"",version:null,devDept:"",toggle:!0,cid:genID(),pid:h.cid,nestIndex:0,children:[],isTop:!1,isCol:"col"==i,isRow:"col"!=i,isDragged:!1,grandParentId:n.pid});o.length&&(o[0].cid=genID(),o[0].pid=h.children[0].cid,h.children[0].children=o)}}e.list=r,0==r.length&&(e.selectd=[])}},shareCom={goEditShareCom:function(e,t){var r=t.name,n=t.mapping;e.shareComs||(e.shareComs=new Map),e.shareComs.set(r,n)},delShareCom:function(e,t){var r=t.key;e.shareComs&&e.shareComs.has(r)&&e.shareComs.delete(r)}},globalVars={mutation:{addGoVar:function(e,t){try{ve.addVariable(t,(function(){e.globalVars=ve.getAllVariables()}))}catch(e){console.warn(e)}},delGoVar:function(e,t){try{var r=t.mapField;console.log(r,"mapFieldmapField"),ve.delVariable(r,(function(){e.globalVars=ve.getAllVariables()}))}catch(e){console.warn(e)}},editGoVar:function(e,t){var r=this;try{ve.editVariable(t,(function(n){e.globalVars=ve.getAllVariables(),pe(e.globalSource,t.mapField,e.globalVars,e.list,(function(e){r.commit("GoCom/updatComs",e.cid)})),(null==t?void 0:t.delayUpdate)||r.commit("GoCom/updatComsForVar",t.mapField)}))}catch(e){console.warn(e)}},goEditVar:function(e,t){var r=t.key,n=t.value,i=e.globalVars.find((function(e){return e.mapField==r}));i&&(i.originalValue=n,i.update=!0,this.commit("GoCom/editGoVar",i))},goUpdataSysVars:function(e,t){var r={U_CITY:"cityCode",U_COUNTY:"countyCode",U_PROVINCE:"provinceCode",U_PHONE:"userPhone"},n=e.sysConst,i=Object.keys(r);n.map((function(e){if(e.originalValue=e.value,(null==e?void 0:e.name)&&(null==i?void 0:i.includes(e.name))){var n=r[e.name];e.value=t[n],e.originalValue=t[n]}return e})),ve.addVariables(n)},updateGlobalVars:function(e,t){e.globalVars=t},updataVariables:function(e){e.globalVars=ve.getAllVariables()}},actions:{updateGlobalVarsAction:function(e){(0,e.commit)("updateGlobalVars",ve.getAllVariables())},goEditVar:function(e,t){(0,e.commit)("editGoVar",{mapField:t.key,originalValue:t.value})}}},mutations=__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({},UndoRedo),baseDataMutaitons),rightMenuMutaitons),eventMutations),comTreeMutations),toolMutations),layoutMutations),pages),containerMutaitons),shareCom),globalVars.mutation),actions=__assign$1({updataList:function(e,t){var r=e.commit;t&&r("updataList",t),r("updateTree")},updataBaseData:function(e,t){var r=e.commit;t&&r("updataBaseData",t)},setActive:function(e,t){var r=e.commit;t&&r("setActive",t)},setSyncFlag:function(e,t){var r=e.commit;t&&r("setSyncFlag",t)},execute:function(e,t){var r=e.commit;t&&r("execute",t)},updataAnimationForComponent:function(e,t){var r=e.commit;t&&r("updataAnimationForComponent",t)},updataAnimation:function(e,t){(0,e.commit)("updataAnimation",t)},setOptionForCom:function(e,t){(0,e.commit)("setOptionForCom",t)},updatComs:function(e,t){var r=e.commit;setTimeout((function(){r("updatComs",t)}))},updatComsForVar:function(e,t){var r=e.dispatch,n=e.state,i=n.globalVars.map((function(e){var r,n;if((null===(r=null==e?void 0:e.forkValue)||void 0===r?void 0:r.length)&&(null===(n=null==e?void 0:e.forkValue)||void 0===n?void 0:n.includes(t))||e.forkValue==t)return e.mapField})).filter((function(e){return e})),o=[t];(null==i?void 0:i.length)&&(o=_$1.uniq(__spreadArray$1([t],i,!0)));for(var a=[],s=0,c=o;s<c.length;s++){var u=c[s];n.shareVariableTree[u]&&a.push.apply(a,n.shareVariableTree[u])}if(null==a?void 0:a.length)for(var l=0,d=a;l<d.length;l++){r("updatComs",d[l])}},goEditShareCom:function(e,t){var r=e.commit;e.state,r("goEditShareCom",t)},delShareCom:function(e,t){var r=e.commit;e.state,r("delShareCom",t)},updataSource:function(e,t){var r=e.commit;e.state,r("updataSource",t)}},globalVars.actions),getters={getCurrentPage:function(e){return e.pages.length?e.pages[e.pageIndex]:[]},globalSourceTree:function(e){if(e.list.length&&e.globalSource.length){var t=[];return recursion(_$1.cloneDeep(e.list),(function(e){var r,n,i;if("globalData"==(null===(n=null===(r=null==e?void 0:e.tmpData)||void 0===r?void 0:r.source)||void 0===n?void 0:n.type)){var o=null===(i=null==e?void 0:e.tmpData)||void 0===i?void 0:i.source.globalData;t.push({name:e.name,cid:e.cid,sourceId:o.id,viewComName:e.viewComName})}})),t}return[]}},store={namespaced:!0,state:state,mutations:mutations,actions:actions,getters:getters},VueServer=function(){function e(){}return e.setAppStore=function(t){e.store=t},e.prototype.getState=function(){return e.store.state[e.storeModule]},e.prototype.mapState=function(t){return mapState(e.storeModule,t)},e.prototype.mapGetters=function(t){return mapGetters(e.storeModule,t)},e.prototype.mapMutations=function(t){return mapMutations(e.storeModule,t)},e.prototype.callState=function(t){return e.store.state[e.storeModule][t]},e.prototype.callGetter=function(t,r){return e.store.getters[e.storeModule+"/"+t]},e.prototype.callMutation=function(t,r,n){n?e.store.commit(e.storeModule+"/"+t,r,!0):e.store.commit(e.storeModule+"/"+t,r)},e.prototype.callAction=function(t,r){e.store.dispatch(e.storeModule+"/"+t,r)},e.storeModule="GoCom",e}(),mapState=normalizeNamespace((function(e,t){var r;return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;r[n]=function(){var t=this.$store.state,r=this.$store.getters;if(e){var n=getModuleByNamespace(this.$store,"mapState",e);if(!n)return;t=n.context.state,r=n.context.getters}return"function"==typeof i?i.call(this,t,r):t[i]},r[n].VuexServer=!0})),r})),mapMutations=normalizeNamespace((function(e,t){var r;return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;r[n]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.$store.commit;if(e){var o=getModuleByNamespace(this.$store,"mapMutations",e);if(!o)return;n=o.context.commit}return"function"==typeof i?i.apply(this,[n].concat(t)):n.apply(this.$store,[i].concat(t))}})),r})),mapGetters=normalizeNamespace((function(e,t){var r={};return normalizeMap(t).forEach((function(t){var n=t.key,i=t.val;i=e+i,r[n]=function(){if(!e||getModuleByNamespace(this.$store,"mapGetters",e)){if("production"===process.env.NODE_ENV||i in this.$store.getters)return this.$store.getters[i];console.error("[VuexServer] unknown getter: ".concat(i))}},r[n].VuexServer=!0})),r}));function normalizeMap(e){return Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}}))}function normalizeNamespace(e){return function(t,r){return"string"!=typeof t?(r=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,r)}}function getModuleByNamespace(e,t,r){var n=e._modulesNamespaceMap[r];return"production"===process.env.NODE_ENV||n||console.error("[VuexServer] module namespace not found in ".concat(t,"(): ").concat(r)),n}var GoComponent=function(){function e(e){var t=this;if(this.isLock=!1,this.isShow=!0,this.baseData={left:0,top:0,width:300,height:200,angle:0,opacity:100,rotate:0,rotateY:0},this.componentType="BaseComponent",this.cid=genID(),e){Object.keys(e).forEach((function(r){t[r]=e[r]}));["AnEchartsMap","AnMaptalks","AnEchartsMap1","AnArcgisMapBase","AnAMap1","AnCesium","AnThreeMap3DChina","AnThreeMapForCesium","AnThreeMap","AnGisMap","AnMineMap","MineMapMarkerLayer","MineMapClusterLayer","AnChina3D","AncsAnovGis"].includes(e.viewComName)&&(this.componentType="MultiStateComponent"),"AnDynamic"!==e.viewComName&&"AmDynamic"!==e.viewComName&&"AnContainer"!==e.viewComName&&"AnGridLayout"!==e.viewComName||(this.componentType="dynamicComponent")}}return e.prototype.setIndex=function(e){this.z=e},e}(),Load=function(){function e(e){this.vueServer=e,this.loadScript=loadScript}return e.setStore=function(e){this.store=e},e.prototype.loadComponents=function(e){var t=e&&e.list?e.list:[];recursion(t,(function(e){e.viewComName&&(e&&e.path&&e.path,e.origin,e.viewComName?e.viewComName:e.rawData.viewComName)})),e&&this.vueServer.callMutation("reversal",_$1.cloneDeep(e))},e.prototype.addStore=function(e){this.vueServer.callMutation("setActive",{id:e}),this.vueServer.callMutation("addComs",this)},e.prototype._addPlantStore=function(){this.vueServer.callMutation("setPlant",this)},e.prototype._loadComTmp=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:if(window[t])return[3,5];r=function(t){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=e[t],[4,new Promise((function(e){e(i._load(r))}))];case 1:return n.sent(),[2]}}))},n=0,o.label=1;case 1:return n<e.length?[5,r(n)]:[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:window[t]=t,o.label=5;case 5:return[2]}}))}))},e.prototype._load=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){return[2,new Promise((function(r){r(t.loadScript(e))}))]}))}))},e}(),IndexedDB=function(){function e(e){var t=e.dbName,r=e.tables,n=e.version,i=void 0===n?1:n,o=__rest(e,["dbName","tables","version"]);this.dbName=t,this.tables=r,this.version=i,this.openDB(__assign$1({dbName:t,tables:r,version:i},o))}return e.deleteDB=function(e){var t;null===(t=window.indexedDB)||void 0===t||t.deleteDatabase(e)},e.prototype.deleteItem=function(e,t,r){var n=this.storage.transaction(e,"readwrite").objectStore(e).delete(t);return n.onsuccess=function(e){"function"==typeof r&&r(e)},n},e.prototype.getItem=function(e,t,r){var n=this.storage.transaction(e,"readwrite").objectStore(e),i=null;return(i=t?n.get(t):n.getAll()).onsuccess=function(e){var t;"function"==typeof r&&r(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.result)},i.onerror=function(e){console.error(e),r(e)},i},e.prototype.setItem=function(e,t,r,n){var i=this.storage.transaction(e,"readwrite").objectStore(e).put(r,t);return i.onsuccess=function(e){"function"==typeof n&&n(e)},i.onerror=function(e){"function"==typeof n&&n(e)},i},e.prototype.get=function(e,t){return this.getItem(this.tables[0],e,t)},e.prototype.set=function(e,t,r){return this.setItem(this.tables[0],e,t,r)},e.prototype.delete=function(e,t){return this.deleteItem(this.tables[0],e,t)},e.prototype.clear=function(e,t){var r=this.storage.transaction(this.dbName,"readwrite").objectStore(e).clear();return r.onsuccess=function(e){"function"==typeof t&&t(e)},r},e.prototype.getDB=function(){return this.storage},e.prototype.closeDB=function(){this.storage.close()},e.prototype.openDB=function(e){var t=this,r=e.dbName,n=e.tables,i=e.version,o=e.callback,a=window.indexedDB;if(a)if((null==n?void 0:n.length)<1)console.error("表名不能为空");else{var s=a.open(r,i);s.onerror=function(e){var t,r;console.error("打开数据库失败: ".concat(null===(r=null===(t=e.currentTarget)||void 0===t?void 0:t.error)||void 0===r?void 0:r.message)),"function"==typeof o&&o(e)},s.onsuccess=function(e){var r;t.storage=null===(r=e.target)||void 0===r?void 0:r.result,"function"==typeof o&&o(e)},s.onupgradeneeded=function(e){var r;t.storage=null===(r=e.target)||void 0===r?void 0:r.result,n.forEach((function(r){t.storage.objectStoreNames.contains(r)||(t.storage.createObjectStore(r),"function"==typeof o&&o(e))}))}}else console.error("你的浏览器不支持indexedDB")},e}(),Go=function(){function e(){this.VueServer=new VueServer}return e.getInstance=function(){return this.instance||(this.db=new IndexedDB({dbName:"AnovGo",tables:["logs"]}),this.instance=new e),this.instance},e.prototype.getAppStore=function(){return e.store},e.setAppStore=function(t){e.store=t,VueServer.setAppStore(t),Load.setStore(t)},e.prototype.add=function(e,t,r){t.MultiState?this.VueServer.callMutation("addStateChildren",t):(this.VueServer.callMutation("addComs",{com:t,isMobile:r}),this.VueServer.callMutation("setActive",{id:e}))},e.prototype.addForParent=function(e,t,r,n){this.VueServer.callMutation("addComsForParent",{com:t,PID:r,isMobile:n}),this.VueServer.callMutation("setActive",{id:e})},e.prototype.render=function(e,t){var r=new GoComponent(e);t?this.add(r.cid,r,!0):this.add(r.cid,r)},e.prototype.renderForParent=function(e,t,r){var n=new GoComponent(e);void 0!==r?this.addForParent(n.cid,n,t,r):this.addForParent(n.cid,n,t)},e.prototype.reversal=function(e){new Load(new VueServer).loadComponents(e)},e.prototype.emitEvent=function(e,t){var r=this,n=this.VueServer.callState("globalEvents"),i=this.VueServer.callState("globalVars"),o=this.VueServer.callState("shareVariableTree"),a=this.VueServer.callState("globalSource");this.VueServer.callState("globalConstant");var s=this.VueServer.callState("list");De(n,i,o,s,e,(function(e){r.VueServer.callMutation("changeShow",e)}),(function(e){r.VueServer.callMutation("updataSourceForComponent",e)}),t,a)},e}(),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__publicField=(e,t,r)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r),__async=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{s(r.next(e))}catch(e){i(e)}},a=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((r=r.apply(e,t)).next())})),defaultOptions={gapX:100,gapY:100,offsetLeft:0,offsetTop:0,width:120,height:64,opacity:.15,rotate:-22,fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"300",fontColor:"#000",fontFamily:"sans-serif",textAlign:"center",textBaseline:"alphabetic",monitor:!0,zIndex:9999,mode:"interval",pack:!0,blindFontSize:16,blindOpacity:.005},attributeNameTag="data-watermark-tag",observeOptions={childList:!0,subtree:!0,attributeFilter:["style","class",attributeNameTag]};function getMutationObserver(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function getDataSetKey(e){return e.split("-").slice(1).reduce(((e,t,r)=>0===r?t:`${e}${t[0].toUpperCase()+t.slice(1)}`))}var getStyleStr=e=>{let t="";return Object.keys(e).forEach((r=>{const n=r.replace(/([A-Z])/g,"-$1").toLowerCase();t+=`${n}:${e[r]};`})),t},encrypt=e=>window.btoa(decodeURI(encodeURIComponent(e))),getRandomId=(e="")=>`${encrypt(e)}-${(new Date).getTime()}-${Math.floor(Math.random()*Math.pow(10,8))}`,getContainer=(e,t,r={},n)=>{let i;if("string"==typeof e){if(i=document.getElementById(e),!i)throw new Error(`水印挂载节点未找到,请检查#${e}是否存在`)}else i=null!=e?e:document.body;i.setAttribute(attributeNameTag,t);const o=__spreadValues({position:"relative"},r);return n||delete o.position,i.setAttribute("style",getStyleStr(o)),i},getContent=e=>{const t=document.createElement("div");return t.setAttribute("style",getStyleStr({pointerEvents:"none"})),t.setAttribute(attributeNameTag,e),t};function getDrawPattern(e){const{text:t,gapX:r,gapY:n,offsetTop:i,offsetLeft:o,width:a,height:s,rotate:c,opacity:u,fontSize:l,fontStyle:d,fontVariant:h,fontWeight:f,fontFamily:p,fontColor:m,textAlign:g,textBaseline:v,image:y,blindText:_,blindFontSize:b,blindOpacity:w}=e;return new Promise(((e,D)=>{const S=document.createElement("canvas"),x=S.getContext("2d"),T=1*(Number(r)+Number(a)),k=1*(Number(n)+Number(s)),P=Number(o)||Number(r)/2,E=Number(i)||Number(n)/2;if(S.setAttribute("width",`${T}px`),S.setAttribute("height",`${k}px`),x){const r=1*a,n=1*s;if(x.translate(1*P,1*E),x.rotate(Math.PI/180*Number(c)),_&&(x.globalAlpha=w,x.font=`${b}px normal`,x.fillText(_,0,0)),x.globalAlpha=u,y){const t=new Image;return t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.src=y,void(t.onload=()=>{x.drawImage(t,0,0,r,n),e({url:x.canvas.toDataURL(),width:T,height:k})})}const i=Array.isArray(t)?t:[t],o=i.map((e=>x.measureText(e).width)),d=Math.max(...o),h=1*Number(l);x.textAlign=g,x.textBaseline=v,x.fillStyle=m,x.font=A(`${h}px`),d>a&&(x.font=A(h/2+"px"));const f=h+5;let p=(n-(l*i.length+5*(i.length-1)))/2;p=p<0?0:p;for(let e=0;e<i.length;e++)x.fillText(i[e]||"",r/2,p+f*e);e({url:x.canvas.toDataURL(),width:T,height:k})}function A(e){return`${d} ${h} ${f} ${e} ${p}`}return D()}))}var MutationObserver=getMutationObserver(),Watermark=class{constructor(e={}){__publicField(this,"options"),__publicField(this,"container"),__publicField(this,"watermarkContent"),__publicField(this,"watermarkDom"),__publicField(this,"style"),__publicField(this,"watermarkTag"),__publicField(this,"shadowRoot"),__publicField(this,"mutationObserver"),__publicField(this,"_isAgainRender",(e=>{if("attributes"===e.type){if(e.attributeName===attributeNameTag)return!0;if(this.watermarkTag===this._getNodeRandomId(e.target))return!0}return!(!e.removedNodes.length||this.watermarkTag!==this._getNodeRandomId(e.removedNodes[0]))})),__publicField(this,"_getNodeRandomId",(e=>{var t;return null==(t=null==e?void 0:e.dataset)?void 0:t[getDataSetKey(attributeNameTag)]})),__publicField(this,"_destroyMutationObserver",(()=>{this.mutationObserver&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.mutationObserver=null)})),__publicField(this,"_getWatermarkDom",(e=>__async(this,null,(function*(){this.watermarkDom||(this.watermarkDom=document.createElement("div")),"number"==typeof e&&e&&(this.style.height=`${e}px`);const t=yield getDrawPattern(this.options);if(null==t?void 0:t.url){const e=t.url;"repeat"===this.options.mode?this.style.backgroundImage=`url(${e})`:(this.style.backgroundImage=`url(${e}), url(${e})`,this.style.backgroundRepeat="repeat, repeat",this.style.backgroundPosition=`${t.width/2}px ${t.height/2}px, 0 0`),this.options.container||(this.style.position="fixed",this.style.height=void 0),this.watermarkDom.setAttribute("style",getStyleStr(this.style))}return this.watermarkDom.setAttribute(attributeNameTag,this.watermarkTag),this.watermarkDom})))),__publicField(this,"_getWatermarkHeight",(()=>{if(!this.container)return 0;let e=0;const{scrollHeight:t=0,clientHeight:r=0}=this.options.container?this.container.parentNode:this.container;return t>r&&(e=Math.max(t,r)),e})),this.options=Object.assign({},defaultOptions,e),this.style={position:"absolute",left:0,top:0,right:0,bottom:0,pointerEvents:"none",overflow:"hidden",backgroundColor:"transparent",backgroundRepeat:"repeat"},this.style.zIndex=this.options.zIndex,this.watermarkTag=getRandomId("watermark"),this.mutationObserver=null,this._render()}update(e={}){this.options=__spreadValues(__spreadValues({},this.options),e),this.style.zIndex=this.options.zIndex,this._render()}show(){this.watermarkDom&&(this.style.display="block",this.watermarkDom.setAttribute("style",getStyleStr(this.style)))}hide(){this.watermarkDom&&(this.style.display="none",this.watermarkDom.setAttribute("style",getStyleStr(this.style)))}destroy(){this.shadowRoot=void 0,this.watermarkContent&&(this.watermarkContent.remove(),this.watermarkContent=void 0),this.watermarkDom&&(this.watermarkDom.remove(),this.watermarkDom=void 0),this._destroyMutationObserver()}_render(){return __async(this,null,(function*(){this._destroyMutationObserver(),this.container=getContainer(this.options.container,this.watermarkTag,this.options.containerStyle,this.options.pack),this.watermarkContent||(this.watermarkContent=getContent(this.watermarkTag),this.container.append(this.watermarkContent));const e=this._getWatermarkHeight();if(this.watermarkDom=yield this._getWatermarkDom(e),this.watermarkContent){const e=this.watermarkContent.childNodes||[];for(let t=0;t<e.length;t++)this.watermarkContent.removeChild(e[t])}"function"==typeof this.watermarkContent.attachShadow?this.shadowRoot||(this.shadowRoot=this.watermarkContent.attachShadow({mode:"open"})):this.shadowRoot=this.watermarkContent,this.shadowRoot.append(this.watermarkDom),MutationObserver&&this.options.monitor&&(this.mutationObserver=new MutationObserver((e=>{e.forEach((e=>{if(this._isAgainRender(e))return this.destroy(),void this._render()}))})),this.mutationObserver.observe(this.container,observeOptions),this.shadowRoot&&this.mutationObserver.observe(this.shadowRoot,observeOptions))}))}},FileSaver_min=createCommonjsModule((function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){s(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,t,a){var s=o.URL||o.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?i(c):n(c.href)?r(e,t,a):i(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){i(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,o,a){if(o=o||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,a),o);else if(n(e))r(e,o,a);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){i(s)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var s="application/octet-stream"===e.type,c=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||s&&c||a)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},l.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});o.saveAs=s.saveAs=s,e.exports=s}()})),getComOptions=function(e){var t=_$1.cloneDeep(e),r=_$1.omit(t,["comData","source"]);return __assign$1({},r)},generateComponentList=function(e){if(0===e.length)return[];var t=function(e){for(var r,n=0;n<e.length;n++)e[n].tmpData&&(e[n]=Object.assign({},getComOptions(e[n]))),e[n]&&e[n].children&&(null===(r=e[n])||void 0===r?void 0:r.children.length)?t(e[n].children):e[n]&&e[n].dynamicChildren&&Array.from(e[n].dynamicChildren).forEach((function(e,r){t(e[1])}))};return t(e),e},generateCaseDataJson=function(e){var t=_$1.cloneDeep(e)?_$1.cloneDeep(e):{};"string"==typeof e&&(t=JSON.parse(e));var r=[];if(t instanceof Array)t.forEach((function(e,t){var n=JSON.parse(e.caseDetailData)?JSON.parse(e.caseDetailData):{},i=e.caseDetailPath,o=e.caseDetailName,a=n.theme,s=void 0===a?null:a,c=n.globalVars,u=void 0===c?null:c,l=n.shareVariableTree,d=void 0===l?null:l,h=n.plant,f=void 0===h?null:h,p=n.list,m=void 0===p?[]:p,g=n.path,v=void 0===g?"":g;n.name;var y=n.resource,_=void 0===y?{jspaths:[],csspaths:[],otherpaths:[]}:y,b=n.watermark,w=void 0===b?null:b,D=n.tw,S=void 0===D?null:D,x=n.globalSource,T=void 0===x?[]:x,k=n.globalEvents,P=void 0===k?[]:k,E=n.globalConstant,A=void 0===E?[]:E;r.push({path:v||i,theme:s,name:o,resource:_,tw:S,watermark:w,globalSource:T,globalVars:u,globalEvents:P,globalConstant:A,shareVariableTree:d,plant:f,list:generateComponentList(m)})}));else{var n=t.theme,i=void 0===n?null:n,o=t.globalVars,a=void 0===o?null:o,s=t.shareVariableTree,c=void 0===s?null:s,u=t.plant,l=void 0===u?null:u,d=t.list,h=void 0===d?[]:d,f=t.resource,p=void 0===f?{jspaths:[],csspaths:[],otherpaths:[]}:f,m=t.watermark,g=void 0===m?null:m,v=t.tw,y=void 0===v?null:v,_=t.globalSource,b=void 0===_?[]:_,w=t.globalEvents,D=void 0===w?[]:w,S=t.globalConstant,x=void 0===S?[]:S;r.push({resource:p,tw:y,watermark:g,globalSource:b,theme:i,globalVars:a,globalEvents:D,shareVariableTree:c,globalConstant:x,plant:l,list:generateComponentList(h)})}return r},generatePageData=function(e){var t={},r=t.theme,n=void 0===r?null:r,i=t.globalVars,o=void 0===i?null:i,a=t.shareVariableTree,s=void 0===a?null:a,c=t.plant,u=void 0===c?null:c,l=t.list,d=void 0===l?[]:l,h=t.undos,f=void 0===h?[]:h,p=t.undoRedoPointer,m=void 0===p?-1:p,g=t.globalEvents,v=void 0===g?[]:g;return e&&(n=e.theme,u=e.plant),{theme:n,globalVars:o,globalEvents:v,shareVariableTree:s,plant:u,undos:f,undoRedoPointer:m,list:generateComponentList(d)}},exportJson=function(e){var t=e.caseName,r=void 0===t?"case-name":t,n=e.caseImg,i=void 0===n?"":n,o=e.caseRemark,a=void 0===o?"":o,s=e.details,c=e.caseClientType,u=void 0===c?"":c,l=e.id,d={caseClientType:u,caseName:r,caseImg:i,caseRemark:a,caseId:void 0===l?"":l,createTime:moment().format("YYYY-MM-DD , h:mm:ss"),caseData:generateCaseDataJson(s)},h=new Blob([JSON.stringify(d)],{type:"json"});FileSaver_min.saveAs(h,r+".json")},generateJson=function(e){var t=e.caseName,r=void 0===t?"":t,n=e.caseData;return e.plangInfoForPsd,{caseName:r,createTime:moment().format("YYYY-MM-DD , h:mm:ss"),caseData:generateCaseDataJson(n)}};function elementError(e,t){throw new Error("".concat(e,":Expected HTMLElement, got ").concat(t))}var SizeAdaption=function(){function e(e){this.option=e,this.option.isResize&&window.addEventListener("resize",this.resize.bind(this))}return Object.defineProperty(e,"defaultOption",{get:function(){return e._defaultOption},set:function(t){e._defaultOption=t},enumerable:!1,configurable:!0}),e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.removeResize=function(){window.removeEventListener("resize",this.resize.bind(this))},e.prototype.resize=function(){var e=this.option,t=e.isEqualScale,r=e.wrapSelector,n=e.viewSelector,i=e.designWidth,o=e.designHeight,a=e.horizontal,s=e.vertical,c=document.querySelector(r);c||elementError("wrap",c);var u=c.clientWidth,l=c.clientHeight,d=document.querySelector(n);d||elementError("view",d),d.style.position="absolute",d.style.width=i+"px",d.style.height=o+"px";var h,f,p,m,g=Math.min(u/i,l/o);if(t){switch(d.style.transform="scale(".concat(g,")"),a){case"center":h=(u-i)/2+"px";break;case"left":h=(g-1)/2*i+"px";break;case"right":p=(g-1)/2*i+"px"}switch(s){case"center":f=(l-o)/2+"px";break;case"top":f=(g-1)/2*o+"px";break;case"bottom":m=(g-1)/2*o+"px"}}else d.style.transform="scale('".concat(u/i,", ").concat(l/o,"')"),h=(u-i)/2+"px",f=(l-o)/2+"px";f?d.style.top=f:m&&(d.style.bottom=m),h?d.style.left=h:p&&(d.style.right=p)},e._defaultOption={isEqualScale:!0,designWidth:1920,designHeight:1080,wrapSelector:"body",viewSelector:"#app",horizontal:"center",vertical:"center",isResize:!0},e}(),Scale=function(){function e(e){this.wrap=null,this.target=null,this.type=0,this.minRatio=1,this.outSize={w:0,h:0},this.inSize={w:0,h:0};var t=e.wrap,r=e.target,n=e.type,i=e.size,o=e.callback;this.size=i,this.type=n,this.initOptions(t,r,i),this.initSize(i),this.layout(),this.scale(o),window.addEventListener("resize",this.reset.bind(this,o))}return e.prototype.reset=function(e){this.initSize(this.size),this.layout(),e?this.scale(e):this.scale()},e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.removeResize=function(){window.removeEventListener("resize",this.reset.bind(this,void 0))},e.prototype.getDom=function(e){if(_$1.isElement(e))return e;var t=document.querySelector(e);return _$1.isElement(t)?t:null},e.prototype.initOptions=function(e,t,r){this.wrap=this.getDom(e),this.target=this.getDom(t),this.target.style.width=r.w+"px",this.target.style.height=r.h+"px",this.verificationDom()},e.prototype.initSize=function(e){this.outSize.w=this.wrap.clientWidth,this.outSize.h=this.wrap.clientHeight,this.inSize=e},e.prototype.verificationDom=function(){null!=this.wrap&&null!=this.target&&this.isChildOf(this.wrap,this.target)||console.warn("Please pass in the DOM element correctly!")},e.prototype.layout=function(){if(0==this.type||3==this.type){var e=(this.outSize.w-this.inSize.w)/2,t=(this.outSize.h-this.inSize.h)/2;this.target.style.top=t+"px",this.target.style.left=e+"px"}else this.wrap.style.display="flex",this.wrap.style["align-items"]="center",this.wrap.style["justify-content"]="center",this.target.style.position="static",1==this.type?(this.wrap.style["overflow-y"]="auto",this.wrap.style["overflow-x"]="hidden"):2==this.type&&(this.wrap.style["overflow-y"]="hidden",this.wrap.style["overflow-x"]="auto")},e.prototype.isChildOf=function(e,t){var r;if(e&&t)for(r=e.parentNode;r;){if(t===r)return!0;r=r.parentNode}return!1},e.prototype.scale=function(e){var t=1,r=1;switch(this.type){case 0:t=Math.min(this.outSize.w/this.inSize.w,this.outSize.h/this.inSize.h),r=Math.min(this.outSize.w/this.inSize.w,this.outSize.h/this.inSize.h);break;case 1:r=t=this.outSize.w/this.inSize.w;break;case 2:t=r=this.outSize.h/this.inSize.h;break;case 3:t=this.outSize.w/this.inSize.w,r=this.outSize.h/this.inSize.h}e&&e([t,r]),this.target.style.transform="scale(".concat(t,",").concat(r,")")},e.prototype.resize=function(){},e}(),domToImage=createCommonjsModule((function(e){!function(t){var r=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var r=e(t).toLowerCase();return(n="application/font-woff",i="image/jpeg",{woff:n,woff2:n,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:i,jpeg:i,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[r]||"";var n,i},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var r=window.atob(e.toDataURL().split(",")[1]),n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);t(new Blob([i],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var r=document.implementation.createHTMLDocument(),n=r.createElement("base");r.head.appendChild(n);var i=r.createElement("a");return r.body.appendChild(i),n.href=t,i.href=e,i.href},getAndEncode:function(e){var t=3e4;s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(r){var n,i=new XMLHttpRequest;if(i.onreadystatechange=a,i.ontimeout=c,i.responseType="blob",i.timeout=t,i.open("GET",e,!0),i.send(),s.impl.options.imagePlaceholder){var o=s.impl.options.imagePlaceholder.split(/,/);o&&o[1]&&(n=o[1])}function a(){if(4===i.readyState)if(200===i.status){var t=new FileReader;t.onloadend=function(){var e=t.result.split(/,/)[1];r(e)},t.readAsDataURL(i.response)}else n?r(n):u("cannot fetch resource: "+e+", status: "+i.status)}function c(){n?r(n):u("timeout of "+t+"ms occured while fetching resource: "+e)}function u(e){console.error(e),r("")}}))},uid:function(){var e=0;return function(){return"u"+t()+e++;function t(){return("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}}}(),delay:function(e){return function(t){return new Promise((function(r){setTimeout((function(){r(t)}),e)}))}},asArray:function(e){for(var t=[],r=e.length,n=0;n<r;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=r,n.src=e}))},width:function(e){var r=t(e,"border-left-width"),n=t(e,"border-right-width");return e.scrollWidth+r+n},height:function(e){var r=t(e,"border-top-width"),n=t(e,"border-bottom-width");return e.scrollHeight+r+n}};function e(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function t(e,t){var r=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(r.replace("px",""))}}(),n=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,r,o){return a()?Promise.resolve(e):Promise.resolve(e).then(n).then((function(t){var n=Promise.resolve(e);return t.forEach((function(e){n=n.then((function(t){return i(t,e,r,o)}))})),n}));function a(){return!t(e)}},shouldProcess:t,impl:{readUrls:n,inline:i}};function t(t){return-1!==t.search(e)}function n(t){for(var n,i=[];null!==(n=e.exec(t));)i.push(n[1]);return i.filter((function(e){return!r.isDataUrl(e)}))}function i(e,t,n,i){return Promise.resolve(t).then((function(e){return n?r.resolveUrl(e,n):e})).then(i||r.getAndEncode).then((function(e){return r.dataAsUrl(e,r.mimeType(t))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+r.escape(e)+")(['\"]?\\))","g")}(t),"$1"+n+"$3")}))}}(),i=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(r.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{r.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return n.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return n.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),o=function(){return{inlineAll:function t(i){return i instanceof Element?o(i).then((function(){return i instanceof HTMLImageElement?e(i).inline():Promise.all(r.asArray(i.childNodes).map((function(e){return t(e)})))})):Promise.resolve(i);function o(e){var t=e.style.getPropertyValue("background");return t?n.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}},impl:{newImage:e}};function e(e){return{inline:function(t){return r.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||r.getAndEncode).then((function(t){return r.dataAsUrl(t,r.mimeType(e.src))})).then((function(t){return new Promise((function(r,n){e.onload=r,e.onerror=n,e.src=t}))}))}}}}(),a={imagePlaceholder:void 0,cacheBust:!1},s={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(r.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,r.width(e),r.height(e)).data}))},impl:{fontFaces:i,images:o,util:r,inliner:n,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?s.impl.options.imagePlaceholder=a.imagePlaceholder:s.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?s.impl.options.cacheBust=a.cacheBust:s.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return l(e,t.filter,!0)})).then(d).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(r){e.style[r]=t.style[r]}));return e})).then((function(n){return function(e,t,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(r.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,t.width||r.width(e),t.height||r.height(e))}))}function u(e,t){return c(e,t).then(r.makeImage).then(r.delay(100)).then((function(n){var i=function(e){var n=document.createElement("canvas");if(n.width=t.width||r.width(e),n.height=t.height||r.height(e),t.bgcolor){var i=n.getContext("2d");i.fillStyle=t.bgcolor,i.fillRect(0,0,n.width,n.height)}return n}(e);return i.getContext("2d").drawImage(n,0,0),i}))}function l(e,t,n){return n||!t||t(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?r.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,t,n){var i=e.childNodes;return 0===i.length?Promise.resolve(t):o(t,r.asArray(i),n).then((function(){return t}));function o(e,t,r){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,r)})).then((function(t){t&&e.appendChild(t)}))})),n}}(e,n,t)})).then((function(t){return function(e,t){var n=t;return n instanceof Element?Promise.resolve().then(i).then(o).then(a).then(s).then(c).then((function(){return n})):n;function i(){if(n instanceof HTMLVideoElement){var t=window.getComputedStyle(e),r=document.createElement("canvas");r.width=parseInt(t.width,10),r.height=parseInt(t.height,10);var i=Math.max(e.videoWidth/r.width,e.videoHeight/r.height),o=e.videoWidth/i,a=e.videoHeight/i,s=r.width/2-o/2,c=r.height/2-a/2;r.getContext("2d").drawImage(e,s,c,o,a);var u=n=document.createElement("img");try{u.src=r.toDataURL()}catch(e){u.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}}}function o(){function t(e,t){function n(e,t){r.asArray(e).forEach((function(r){t.setProperty(r,e.getPropertyValue(r),e.getPropertyPriority(r))}))}e.cssText?t.cssText=e.cssText:n(e,t)}t(window.getComputedStyle(e),n.style)}function a(){function t(t){var i=window.getComputedStyle(e,t),o=i.getPropertyValue("content");if(""!==o&&"none"!==o){var a=r.uid();n.className=n.className+" "+a;var s=document.createElement("style");s.appendChild(c(a,t,i)),n.appendChild(s)}function c(e,t,n){var i="."+e+":"+t,o=n.cssText?a(n):s(n);return document.createTextNode(i+"{"+o+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return r.asArray(e).map(t).join("; ")+";";function t(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}}[":before",":after"].forEach((function(e){t(e)}))}function s(){e instanceof HTMLTextAreaElement&&(n.innerHTML=e.value),e instanceof HTMLInputElement&&n.setAttribute("value",e.value)}function c(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=n.getAttribute(e);t&&n.style.setProperty(e,t)})))}}(e,t)})):Promise.resolve()}function d(e){return o.inlineAll(e).then((function(){return e}))}e.exports=s}()})),isURL=function(e){if(!e)return!1;return 1==new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/).test(e)},ArrayBufferToBase64=function(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,i=0;i<n;i++)t+=String.fromCharCode(r[i]);return"data:image/jpeg;base64,".concat(window.btoa(t))},dataURLtoFile=function(e,t){void 0===t&&(t="screenshot.jpeg");try{for(var r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:n})}catch(e){console.error("dataURLtoFile:数据转换错误 : "+e)}},transformData=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,11,,12]),"File"!=t||"string"!=typeof e?[3,2]:[4,dataURLtoFile(e)];case 1:case 3:case 5:case 7:return[2,n.sent()];case 2:return"File"!=t||"[object ArrayBuffer]"!=e.toString()?[3,4]:[4,new File([e],"screenshot.jpeg")];case 4:return"Base64"!=t||"string"!=typeof e?[3,6]:[4,e];case 6:return"Base64"!=t||"[object ArrayBuffer]"!=e.toString()?[3,8]:[4,ArrayBufferToBase64(e)];case 8:return[4,new Error("transformData: 转换发生错误")];case 9:throw n.sent();case 10:return[3,12];case 11:return r=n.sent(),console.log(r),[3,12];case 12:return[2]}}))}))},fetch=function(t,r,n,i){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e({url:t,method:"GET",responseType:"arraybuffer",params:{url:r,dom:n,quality:i}})];case 1:return[2,o.sent()];case 2:return o.sent(),console.warn("请求截图服务器发生错误,请检查地址及参数是否正确!",{url:t,path:r,dom:n,quality:i}),[2,null];case 3:return[2]}}))}))},domToImg=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!(r=document.querySelector(e)))throw new Error("domToImg:"+e+" dom未被找到!");return[4,domToImage.toJpeg(r,{style:{transform:"scale(1)",position:"static"},quality:t})];case 1:return[2,i.sent()];case 2:return n=i.sent(),console.warn(n),[3,3];case 3:return[2]}}))}))},screenshot=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,11,,12]),t=e.dom,r=e.servePath,n=e.targetPath,i=e.quality,o=e.type,a=void 0,isURL(r)&&isURL(n)?[4,fetch(r,n,t,i||.5)]:[3,5];case 1:return(s=u.sent())&&200==s.status&&s.data?(a=s.data,[3,4]):[3,2];case 2:return console.warn("截取错误,请检查网络或服务地址配置是否正确,已转换为dom-to-img."),[4,domToImg(t,i||.5)];case 3:a=u.sent(),u.label=4;case 4:return[3,7];case 5:return console.warn("地址错误,请检查传入的地址是否争取,已转换为dom-to-img."),[4,domToImg(t,i||.5)];case 6:a=u.sent(),u.label=7;case 7:return a?[4,transformData(a,o)]:[3,9];case 8:return[2,u.sent()];case 9:return[2,null];case 10:return[3,12];case 11:return c=u.sent(),console.error("截图发生错误:"+c),[2,null];case 12:return[2]}}))}))},toHex=function(e){return"".concat(e>15?"":0).concat(e.toString(16))},toHexString=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=void 0===i?1:i;return"#".concat(toHex(t)).concat(toHex(r)).concat(toHex(n)).concat(1===o?"":toHex(Math.floor(255*o)))},toRgbString=function(e){var t=e.r,r=e.g,n=e.b;return"rgb(".concat(t,",").concat(r,",").concat(n,")")},toRgbaString=function(e,t){void 0===t&&(t=1e4);var r=e.r,n=e.g,i=e.b,o=e.a,a=void 0===o?1:o;return"rgba(".concat(r,",").concat(n,",").concat(i,",").concat(Math.floor(a*t)/t,")")},parseHexColor=function(e){var t=e.slice(1),r=1;3===t.length&&(t="".concat(t[0]).concat(t[0]).concat(t[1]).concat(t[1]).concat(t[2]).concat(t[2])),8===t.length&&(r=parseInt(t.slice(6),16)/255,t=t.slice(0,6));var n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:r}},parseRgbaColor=function(e){var t=e.match(/(\d(\.\d+)?)+/g)||[],r=t.map((function(e){return parseInt(e,10)}));return{r:r[0],g:r[1],b:r[2],a:parseFloat(t[3])}},parseColorString=function(e){if(e.startsWith("#"))return parseHexColor(e);if(e.startsWith("rgb"))return parseRgbaColor(e);if("transparent"===e)return parseHexColor("#00000000");throw new Error("color string error: ".concat(e))},getColorInfo=function(e){var t=parseColorString(e);return{hex:toHexString(t),rgba:toRgbaString(t),rgb:toRgbString(t),rgbaObj:t}},hexToRgba=function(e){var t=parseColorString(e);return toRgbaString(t)},rgbaToHex=function(e){var t=parseColorString(e);return toHexString(t)},errCode=new Map([["E1001","系统未知错误"],["E1002","vue逻辑错误"],["E1003","JavaScript错误"],["E1004","静态资源加载错误"],["E1005","请求错误"],["E1006","Promise错误"]]),watchError=function(e,t){e.config.errorHandler=function(e){console.error("监测到E1002错误"),console.error(e.filename),errorHandler("E1002",e.name+":"+e.message,t)},window.addEventListener("error",(function(e){e.message?(console.error("监测到E1003错误"),errorHandler("E1003",e.message,e.filename,t)):(console.error("监测到E1004错误"),errorHandler("E1004",e.target.currentSrc,e.filename,t))}),!0)},errorHandler=function(e,t,r,n){void 0===n&&(n="null"),saveLog({code:e,type:errCode.get("".concat(e)),msg:t,router:r.currentRoute.value.fullPath,file:n,createTime:(new Date).toLocaleString()})},saveLog=function(e){var t=localStorage.getItem("ERROR");if(t){var r=JSON.parse(t);sortArray(r),r.length>50?(r[0]=e,sortArray(r)):r.push(e),localStorage.setItem("ERROR",JSON.stringify(r))}else localStorage.setItem("ERROR",JSON.stringify([e]))},sortArray=function(e){e.sort((function(e,t){return e.createTime>t.createTime?1:-1}))},index$1=Object.freeze({__proto__:null,RecursiveList:RecursiveList,Scale:Scale,SizeAdaption:SizeAdaption,UpdataForContainer:UpdataForContainer,Watermark:Watermark,arraySwap:arraySwap,arraySwapDeep:arraySwapDeep,arraySwapForId:arraySwapForId,breakUp:breakUp,checkBaseData:checkBaseData,checkVar:checkVar,comToggle:comToggle,decrypAES:decrypAES,decrypt:decrypt,encrypt:encrypt$1,errorHandler:errorHandler,executeFilter:executeFilter,exportJson:exportJson,findItem:findItem,findItemDeep:findItemDeep$1,findItemIndexDeep:findItemIndexDeep,findParentDeep:findParentDeep,genCopyName:genCopyName,genID:genID,generateCaseDataJson:generateCaseDataJson,generateComponentList:generateComponentList,generateJson:generateJson,generatePageData:generatePageData,getAncestorsNodes:getAncestorsNodes,getColorInfo:getColorInfo,getDataForEvaluator:getDataForEvaluator,getInteractive:getInteractive,getInteractive2:getInteractive2,getLength:getLength,getPosition:getPosition,getSessionData:getSessionData,getShareTree:getShareTree,getStandardData:getStandardData,getUrlParams:getUrlParams,globalSourceTemp:globalSourceTemp,hasVar:hasVar,hexToRgba:hexToRgba,isJSON:isJSON,isPeer:isPeer,loadFont:loadFont,loadFontResource:loadFontResource,loadFontTag:loadFontTag,loadScript:loadScript,loadTag:loadTag,parseColorString:parseColorString,parseHexColor:parseHexColor,parseRgbaColor:parseRgbaColor,recursion:recursion,removeTag:removeTag,resetID:resetID,resetPositionForGroup:resetPositionForGroup,resizeListPosition:resizeListPosition,resizePosition:resizePosition,resziePositionForGroup:resziePositionForGroup,rgbaToHex:rgbaToHex,safeConvertToNumber:safeConvertToNumber,safeEval:safeEval,screenshot:screenshot,selectdArea:selectdArea,setActions:setActions,setAttr:setAttr,setIndex:setIndex,setPorp:setPorp,setPositionForGroup:setPositionForGroup,setPositionForWorld:setPositionForWorld,setSessionData:setSessionData,toHex:toHex,toHexString:toHexString,toRgbString:toRgbString,toRgbaString:toRgbaString,transformPosition:transformPosition,upDataGroup:upDataGroup,upDataGroupChildren:upDataGroupChildren,updataAttribute:updataAttribute,updataAttributeForOption:updataAttributeForOption,updataSizeDeep:updataSizeDeep,validateAndFixObject:validateAndFixObject,watchError:watchError});function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}
|
|
45
45
|
/*!
|
|
46
46
|
* GSAP 3.12.5
|
|
47
47
|
* https://gsap.com
|
|
@@ -60,5 +60,5 @@ function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,
|
|
|
60
60
|
* Club GSAP members, the agreement issued with that membership.
|
|
61
61
|
* @author: Jack Doyle, jack@greensock.com
|
|
62
62
|
*/
|
|
63
|
-
var _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function(){return"undefined"!=typeof window},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},_renderPropWithEnd=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},_renderCSSPropWithBeginning=function(e,t){return t.set(t.t,t.p,e?Math.round(1e4*(t.s+t.c*e))/1e4+t.u:t.b,t)},_renderRoundedCSSProp=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},_renderNonTweeningValue=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},_renderNonTweeningValueOnlyAtEnd=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},_setterCSSStyle=function(e,t,r){return e.style[t]=r},_setterCSSProp=function(e,t,r){return e.style.setProperty(t,r)},_setterTransform=function(e,t,r){return e._gsap[t]=r},_setterScale=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},_setterScaleWithRender=function(e,t,r,n,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},_setterTransformWithRender=function(e,t,r,n,i){var o=e._gsap;o[t]=r,o.renderTransform(i,o)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function e(t,r){var n=this,i=this.target,o=i.style,a=i._gsap;if(t in _transformProps&&o){if(this.tfm=this.tfm||{},"transform"===t)return _propertyAliases.transform.split(",").forEach((function(t){return e.call(n,t,r)}));if(~(t=_propertyAliases[t]||t).indexOf(",")?t.split(",").forEach((function(e){return n.tfm[e]=_get(i,e)})):this.tfm[t]=a.x?a[t]:_get(i,t),t===_transformOriginProp&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(_transformProp)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,r,"")),t=_transformProp}(o||r)&&this.props.push(t,r,o[t])},_removeIndependentTransforms=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},_revertStyle=function(){var e,t,r=this.props,n=this.target,i=n.style,o=n._gsap;for(e=0;e<r.length;e+=3)r[e+1]?n[r[e]]=r[e+2]:r[e+2]?i[r[e]]=r[e+2]:i.removeProperty("--"===r[e].substr(0,2)?r[e]:r[e].replace(_capsExp,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)o[t]=this.tfm[t];o.svg&&(o.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(e=_reverting())&&e.isStart||i[_transformProp]||(_removeIndependentTransforms(i),o.zOrigin&&i[_transformOriginProp]&&(i[_transformOriginProp]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},_getStyleSaver=function(e,t){var r={target:e,props:[],revert:_revertStyle,save:_saveStyle};return e._gsap||gsap.core.getCache(e),t&&t.split(",").forEach((function(e){return r.save(e)})),r},_supports3D,_createElement=function(e,t){var r=_doc.createElementNS?_doc.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):_doc.createElement(e);return r&&r.style?r:_doc.createElement(e)},_getComputedProperty=function e(t,r,n){var i=getComputedStyle(t);return i[r]||i.getPropertyValue(r.replace(_capsExp,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&e(t,_checkPropPrefix(r)||r,1)||""},_prefixes="O,Moz,ms,Ms,Webkit".split(","),_checkPropPrefix=function(e,t,r){var n=(t||_tempDiv).style,i=5;if(e in n&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(_prefixes[i]+e in n););return i<0?null:(3===i?"ms":i>=0?_prefixes[i]:"")+e},_initCore=function(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function e(t){var r,n=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(_docElement.appendChild(n),n.appendChild(this),this.style.display="block",t)try{r=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(r=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),_docElement.removeChild(n),this.style.cssText=a,r},_getAttributeFallbacks=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},_getBBox=function(e){var t;try{t=e.getBBox()}catch(r){t=_getBBoxHack.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===_getBBoxHack||(t=_getBBoxHack.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+_getAttributeFallbacks(e,["x","cx","x1"])||0,y:+_getAttributeFallbacks(e,["y","cy","y1"])||0,width:0,height:0}},_isSVG=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!_getBBox(e))},_removeProperty=function(e,t){if(t){var r,n=e.style;t in _transformProps&&t!==_transformOriginProp&&(t=_transformProp),n.removeProperty?("ms"!==(r=t.substr(0,2))&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty("--"===r?t:t.replace(_capsExp,"-$1").toLowerCase())):n.removeAttribute(t)}},_addNonTweeningPT=function(e,t,r,n,i,o){var a=new PropTween(e._pt,t,r,0,1,o?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return e._pt=a,a.b=n,a.e=i,e._props.push(r),a},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function e(t,r,n,i){var o,a,s,c,u=parseFloat(n)||0,l=(n+"").trim().substr((u+"").length)||"px",d=_tempDiv.style,h=_horizontalExp.test(r),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(h?"Width":"Height"),m=100,g="px"===i,v="%"===i;if(i===l||!u||_nonConvertibleUnits[i]||_nonConvertibleUnits[l])return u;if("px"!==l&&!g&&(u=e(t,r,n,"px")),c=t.getCTM&&_isSVG(t),(v||"%"===l)&&(_transformProps[r]||~r.indexOf("adius")))return o=c?t.getBBox()[h?"width":"height"]:t[p],_round(v?u/o*m:u/100*o);if(d[h?"width":"height"]=m+(g?l:i),a=~r.indexOf("adius")||"em"===i&&t.appendChild&&!f?t:t.parentNode,c&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==_doc&&a.appendChild||(a=_doc.body),(s=a._gsap)&&v&&s.width&&h&&s.time===_ticker.time&&!s.uncache)return _round(u/s.width*m);if(!v||"height"!==r&&"width"!==r)(v||"%"===l)&&!_nonStandardLayouts[_getComputedProperty(a,"display")]&&(d.position=_getComputedProperty(t,"position")),a===t&&(d.position="static"),a.appendChild(_tempDiv),o=_tempDiv[p],a.removeChild(_tempDiv),d.position="absolute";else{var y=t.style[r];t.style[r]=m+i,o=t[p],y?t.style[r]=y:_removeProperty(t,r)}return h&&v&&((s=_getCache(a)).time=_ticker.time,s.width=a[p]),_round(g?o*u/m:o&&u?m/o*u:0)},_get=function(e,t,r,n){var i;return _pluginInitted||_initCore(),t in _propertyAliases&&"transform"!==t&&~(t=_propertyAliases[t]).indexOf(",")&&(t=t.split(",")[0]),_transformProps[t]&&"transform"!==t?(i=_parseTransform(e,n),i="transformOrigin"!==t?i[t]:i.svg?i.origin:_firstTwoOnly(_getComputedProperty(e,_transformOriginProp))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=_specialProps[t]&&_specialProps[t](e,t,r)||_getComputedProperty(e,t)||_getProperty(e,t)||("opacity"===t?1:0)),r&&!~(i+"").trim().indexOf(" ")?_convertToUnit(e,t,i,r)+r:i},_tweenComplexCSSString=function(e,t,r,n){if(!r||"none"===r){var i=_checkPropPrefix(t,e,1),o=i&&_getComputedProperty(e,i,1);o&&o!==r?(t=i,r=o):"borderColor"===t&&(r=_getComputedProperty(e,"borderTopColor"))}var a,s,c,u,l,d,h,f,p,m,g,v=new PropTween(this._pt,e.style,t,0,1,_renderComplexString),y=0,_=0;if(v.b=r,v.e=n,r+="","auto"===(n+="")&&(d=e.style[t],e.style[t]=n,n=_getComputedProperty(e,t)||n,d?e.style[t]=d:_removeProperty(e,t)),_colorStringFilter(a=[r,n]),n=a[1],c=(r=a[0]).match(_numWithUnitExp)||[],(n.match(_numWithUnitExp)||[]).length){for(;s=_numWithUnitExp.exec(n);)h=s[0],p=n.substring(y,s.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),h!==(d=c[_++]||"")&&(u=parseFloat(d)||0,g=d.substr((u+"").length),"="===h.charAt(1)&&(h=_parseRelative(u,h)+g),f=parseFloat(h),m=h.substr((f+"").length),y=_numWithUnitExp.lastIndex-m.length,m||(m=m||_config.units[t]||g,y===n.length&&(n+=m,v.e+=m)),g!==m&&(u=_convertToUnit(e,t,d,m)||0),v._pt={_next:v._pt,p:p||1===_?p:",",s:u,c:f-u,m:l&&l<4||"zIndex"===t?Math.round:0});v.c=y<n.length?n.substring(y,n.length):""}else v.r="display"===t&&"none"===n?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue;return _relExp.test(n)&&(v.e=0),this._pt=v,v},_keywordToPercent={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_convertKeywordsToPercentages=function(e){var t=e.split(" "),r=t[0],n=t[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==n&&"right"!==n||(e=r,r=n,n=e),t[0]=_keywordToPercent[r]||r,t[1]=_keywordToPercent[n]||n,t.join(" ")},_renderClearProps=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r,n,i,o=t.t,a=o.style,s=t.u,c=o._gsap;if("all"===s||!0===s)a.cssText="",n=1;else for(i=(s=s.split(",")).length;--i>-1;)r=s[i],_transformProps[r]&&(n=1,r="transformOrigin"===r?_transformOriginProp:_transformProp),_removeProperty(o,r);n&&(_removeProperty(o,_transformProp),c&&(c.svg&&o.removeAttribute("transform"),_parseTransform(o,1),c.uncache=1,_removeIndependentTransforms(a)))}},_specialProps={clearProps:function(e,t,r,n,i){if("isFromStart"!==i.data){var o=e._pt=new PropTween(e._pt,t,r,0,0,_renderClearProps);return o.u=n,o.pr=-10,o.tween=i,e._props.push(r),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},_getComputedTransformMatrixAsArray=function(e){var t=_getComputedProperty(e,_transformProp);return _isNullTransform(t)?_identity2DMatrix:t.substr(7).match(_numExp).map(_round)},_getMatrix=function(e,t){var r,n,i,o,a=e._gsap||_getCache(e),s=e.style,c=_getComputedTransformMatrixAsArray(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(c=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?_identity2DMatrix:c:(c!==_identity2DMatrix||e.offsetParent||e===_docElement||a.svg||(i=s.display,s.display="block",(r=e.parentNode)&&e.offsetParent||(o=1,n=e.nextElementSibling,_docElement.appendChild(e)),c=_getComputedTransformMatrixAsArray(e),i?s.display=i:_removeProperty(e,"display"),o&&(n?r.insertBefore(e,n):r?r.appendChild(e):_docElement.removeChild(e))),t&&c.length>6?[c[0],c[1],c[4],c[5],c[12],c[13]]:c)},_applySVGOrigin=function(e,t,r,n,i,o){var a,s,c,u=e._gsap,l=i||_getMatrix(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,f=u.xOffset||0,p=u.yOffset||0,m=l[0],g=l[1],v=l[2],y=l[3],_=l[4],b=l[5],w=t.split(" "),D=parseFloat(w[0])||0,S=parseFloat(w[1])||0;r?l!==_identity2DMatrix&&(s=m*y-g*v)&&(c=D*(-g/s)+S*(m/s)-(m*b-g*_)/s,D=D*(y/s)+S*(-v/s)+(v*b-y*_)/s,S=c):(D=(a=_getBBox(e)).x+(~w[0].indexOf("%")?D/100*a.width:D),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),n||!1!==n&&u.smooth?(_=D-d,b=S-h,u.xOffset=f+(_*m+b*v)-_,u.yOffset=p+(_*g+b*y)-b):u.xOffset=u.yOffset=0,u.xOrigin=D,u.yOrigin=S,u.smooth=!!n,u.origin=t,u.originIsAbsolute=!!r,e.style[_transformOriginProp]="0px 0px",o&&(_addNonTweeningPT(o,u,"xOrigin",d,D),_addNonTweeningPT(o,u,"yOrigin",h,S),_addNonTweeningPT(o,u,"xOffset",f,u.xOffset),_addNonTweeningPT(o,u,"yOffset",p,u.yOffset)),e.setAttribute("data-svg-origin",D+" "+S)},_parseTransform=function(e,t){var r=e._gsap||new GSCache(e);if("x"in r&&!t&&!r.uncache)return r;var n,i,o,a,s,c,u,l,d,h,f,p,m,g,v,y,_,b,w,D,S,x,T,k,P,E,A,C,O,R,M,I,N=e.style,B=r.scaleX<0,F="px",j="deg",V=getComputedStyle(e),$=_getComputedProperty(e,_transformOriginProp)||"0";return n=i=o=c=u=l=d=h=f=0,a=s=1,r.svg=!(!e.getCTM||!_isSVG(e)),V.translate&&("none"===V.translate&&"none"===V.scale&&"none"===V.rotate||(N[_transformProp]=("none"!==V.translate?"translate3d("+(V.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==V.rotate?"rotate("+V.rotate+") ":"")+("none"!==V.scale?"scale("+V.scale.split(" ").join(",")+") ":"")+("none"!==V[_transformProp]?V[_transformProp]:"")),N.scale=N.rotate=N.translate="none"),g=_getMatrix(e,r.svg),r.svg&&(r.uncache?(P=e.getBBox(),$=r.xOrigin-P.x+"px "+(r.yOrigin-P.y)+"px",k=""):k=!t&&e.getAttribute("data-svg-origin"),_applySVGOrigin(e,k||$,!!k||r.originIsAbsolute,!1!==r.smooth,g)),p=r.xOrigin||0,m=r.yOrigin||0,g!==_identity2DMatrix&&(b=g[0],w=g[1],D=g[2],S=g[3],n=x=g[4],i=T=g[5],6===g.length?(a=Math.sqrt(b*b+w*w),s=Math.sqrt(S*S+D*D),c=b||w?_atan2(w,b)*_RAD2DEG:0,(d=D||S?_atan2(D,S)*_RAD2DEG+c:0)&&(s*=Math.abs(Math.cos(d*_DEG2RAD))),r.svg&&(n-=p-(p*b+m*D),i-=m-(p*w+m*S))):(I=g[6],R=g[7],A=g[8],C=g[9],O=g[10],M=g[11],n=g[12],i=g[13],o=g[14],u=(v=_atan2(I,O))*_RAD2DEG,v&&(k=x*(y=Math.cos(-v))+A*(_=Math.sin(-v)),P=T*y+C*_,E=I*y+O*_,A=x*-_+A*y,C=T*-_+C*y,O=I*-_+O*y,M=R*-_+M*y,x=k,T=P,I=E),l=(v=_atan2(-D,O))*_RAD2DEG,v&&(y=Math.cos(-v),M=S*(_=Math.sin(-v))+M*y,b=k=b*y-A*_,w=P=w*y-C*_,D=E=D*y-O*_),c=(v=_atan2(w,b))*_RAD2DEG,v&&(k=b*(y=Math.cos(v))+w*(_=Math.sin(v)),P=x*y+T*_,w=w*y-b*_,T=T*y-x*_,b=k,x=P),u&&Math.abs(u)+Math.abs(c)>359.9&&(u=c=0,l=180-l),a=_round(Math.sqrt(b*b+w*w+D*D)),s=_round(Math.sqrt(T*T+I*I)),v=_atan2(x,T),d=Math.abs(v)>2e-4?v*_RAD2DEG:0,f=M?1/(M<0?-M:M):0),r.svg&&(k=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(e,_transformProp)),k&&e.setAttribute("transform",k))),Math.abs(d)>90&&Math.abs(d)<270&&(B?(a*=-1,d+=c<=0?180:-180,c+=c<=0?180:-180):(s*=-1,d+=d<=0?180:-180)),t=t||r.uncache,r.x=n-((r.xPercent=n&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-n)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+F,r.y=i-((r.yPercent=i&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+F,r.z=o+F,r.scaleX=_round(a),r.scaleY=_round(s),r.rotation=_round(c)+j,r.rotationX=_round(u)+j,r.rotationY=_round(l)+j,r.skewX=d+j,r.skewY=h+j,r.transformPerspective=f+F,(r.zOrigin=parseFloat($.split(" ")[2])||!t&&r.zOrigin||0)&&(N[_transformOriginProp]=_firstTwoOnly($)),r.xOffset=r.yOffset=0,r.force3D=_config.force3D,r.renderTransform=r.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,r.uncache=0,r},_firstTwoOnly=function(e){return(e=e.split(" "))[0]+" "+e[1]},_addPxTranslate=function(e,t,r){var n=getUnit(t);return _round(parseFloat(t)+parseFloat(_convertToUnit(e,"x",r+"px",n)))+n},_renderNon3DTransforms=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,_renderCSSTransforms(e,t)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function(e,t){var r=t||this,n=r.xPercent,i=r.yPercent,o=r.x,a=r.y,s=r.z,c=r.rotation,u=r.rotationY,l=r.rotationX,d=r.skewX,h=r.skewY,f=r.scaleX,p=r.scaleY,m=r.transformPerspective,g=r.force3D,v=r.target,y=r.zOrigin,_="",b="auto"===g&&e&&1!==e||!0===g;if(y&&(l!==_zeroDeg||u!==_zeroDeg)){var w,D=parseFloat(u)*_DEG2RAD,S=Math.sin(D),x=Math.cos(D);D=parseFloat(l)*_DEG2RAD,w=Math.cos(D),o=_addPxTranslate(v,o,S*w*-y),a=_addPxTranslate(v,a,-Math.sin(D)*-y),s=_addPxTranslate(v,s,x*w*-y+y)}m!==_zeroPx&&(_+="perspective("+m+_endParenthesis),(n||i)&&(_+="translate("+n+"%, "+i+"%) "),(b||o!==_zeroPx||a!==_zeroPx||s!==_zeroPx)&&(_+=s!==_zeroPx||b?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+_endParenthesis),c!==_zeroDeg&&(_+="rotate("+c+_endParenthesis),u!==_zeroDeg&&(_+="rotateY("+u+_endParenthesis),l!==_zeroDeg&&(_+="rotateX("+l+_endParenthesis),d===_zeroDeg&&h===_zeroDeg||(_+="skew("+d+", "+h+_endParenthesis),1===f&&1===p||(_+="scale("+f+", "+p+_endParenthesis),v.style[_transformProp]=_||"translate(0, 0)"},_renderSVGTransforms=function(e,t){var r,n,i,o,a,s=t||this,c=s.xPercent,u=s.yPercent,l=s.x,d=s.y,h=s.rotation,f=s.skewX,p=s.skewY,m=s.scaleX,g=s.scaleY,v=s.target,y=s.xOrigin,_=s.yOrigin,b=s.xOffset,w=s.yOffset,D=s.forceCSS,S=parseFloat(l),x=parseFloat(d);h=parseFloat(h),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),h+=p),h||f?(h*=_DEG2RAD,f*=_DEG2RAD,r=Math.cos(h)*m,n=Math.sin(h)*m,i=Math.sin(h-f)*-g,o=Math.cos(h-f)*g,f&&(p*=_DEG2RAD,a=Math.tan(f-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),r*=a=Math.sqrt(1+a*a),n*=a)),r=_round(r),n=_round(n),i=_round(i),o=_round(o)):(r=m,o=g,n=i=0),(S&&!~(l+"").indexOf("px")||x&&!~(d+"").indexOf("px"))&&(S=_convertToUnit(v,"x",l,"px"),x=_convertToUnit(v,"y",d,"px")),(y||_||b||w)&&(S=_round(S+y-(y*r+_*i)+b),x=_round(x+_-(y*n+_*o)+w)),(c||u)&&(a=v.getBBox(),S=_round(S+c/100*a.width),x=_round(x+u/100*a.height)),a="matrix("+r+","+n+","+i+","+o+","+S+","+x+")",v.setAttribute("transform",a),D&&(v.style[_transformProp]=a)},_addRotationalPropTween=function(e,t,r,n,i){var o,a,s=360,c=_isString(i),u=parseFloat(i)*(c&&~i.indexOf("rad")?_RAD2DEG:1)-n,l=n+u+"deg";return c&&("short"===(o=i.split("_")[1])&&(u%=s)!==u%180&&(u+=u<0?s:-360),"cw"===o&&u<0?u=(u+s*_bigNum)%s-~~(u/s)*s:"ccw"===o&&u>0&&(u=(u-s*_bigNum)%s-~~(u/s)*s)),e._pt=a=new PropTween(e._pt,t,r,n,u,_renderPropWithEnd),a.e=l,a.u="deg",e._props.push(r),a},_assign=function(e,t){for(var r in t)e[r]=t[r];return e},_addRawTransformPTs=function(e,t,r){var n,i,o,a,s,c,u,l=_assign({},r._gsap),d=r.style;for(i in l.svg?(o=r.getAttribute("transform"),r.setAttribute("transform",""),d[_transformProp]=t,n=_parseTransform(r,1),_removeProperty(r,_transformProp),r.setAttribute("transform",o)):(o=getComputedStyle(r)[_transformProp],d[_transformProp]=t,n=_parseTransform(r,1),d[_transformProp]=o),_transformProps)(o=l[i])!==(a=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=getUnit(o)!==(u=getUnit(a))?_convertToUnit(r,i,o,u):parseFloat(o),c=parseFloat(a),e._pt=new PropTween(e._pt,n,i,s,c-s,_renderCSSProp),e._pt.u=u||0,e._props.push(i));_assign(n,l)};_forEachName("padding,margin,Width,Radius",(function(e,t){var r="Top",n="Right",i="Bottom",o="Left",a=(t<3?[r,n,i,o]:[r+o,r+n,i+n,i+o]).map((function(r){return t<2?e+r:"border"+r+e}));_specialProps[t>1?"border"+e:e]=function(e,t,r,n,i){var o,s;if(arguments.length<4)return o=a.map((function(t){return _get(e,t,r)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(n+"").split(" "),s={},a.forEach((function(e,t){return s[e]=o[t]=o[t]||o[(t-1)/2|0]})),e.init(t,s,i)}}));var CSSPlugin={name:"css",register:_initCore,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,n,i){var o,a,s,c,u,l,d,h,f,p,m,g,v,y,_,b,w=this._props,D=e.style,S=r.vars.startAt;for(d in _pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(e),b=this.styles.props,this.tween=r,t)if("autoRound"!==d&&(a=t[d],!_plugins[d]||!_checkPlugin(d,t,r,n,e,i)))if(u=typeof a,l=_specialProps[d],"function"===u&&(u=typeof(a=a.call(r,n,e,i))),"string"===u&&~a.indexOf("random(")&&(a=_replaceRandom(a)),l)l(this,e,d,a,r)&&(_=1);else if("--"===d.substr(0,2))o=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",_colorExp.lastIndex=0,_colorExp.test(o)||(h=getUnit(o),f=getUnit(a)),f?h!==f&&(o=_convertToUnit(e,d,o,f)+f):h&&(a+=h),this.add(D,"setProperty",o,a,n,i,0,0,d),w.push(d),b.push(d,0,D[d]);else if("undefined"!==u){if(S&&d in S?(o="function"==typeof S[d]?S[d].call(r,n,e,i):S[d],_isString(o)&&~o.indexOf("random(")&&(o=_replaceRandom(o)),getUnit(o+"")||"auto"===o||(o+=_config.units[d]||getUnit(_get(e,d))||""),"="===(o+"").charAt(1)&&(o=_get(e,d))):o=_get(e,d),c=parseFloat(o),(p="string"===u&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),s=parseFloat(a),d in _propertyAliases&&("autoAlpha"===d&&(1===c&&"hidden"===_get(e,"visibility")&&s&&(c=0),b.push("visibility",0,D.visibility),_addNonTweeningPT(this,D,"visibility",c?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==d&&"transform"!==d&&~(d=_propertyAliases[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in _transformProps)if(this.styles.save(d),g||((v=e._gsap).renderTransform&&!t.parseTransform||_parseTransform(e,t.parseTransform),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new PropTween(this._pt,D,_transformProp,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new PropTween(this._pt,v,"scaleY",v.scaleY,(p?_parseRelative(v.scaleY,p+s):s)-v.scaleY||0,_renderCSSProp),this._pt.u=0,w.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(_transformOriginProp,0,D[_transformOriginProp]),a=_convertKeywordsToPercentages(a),v.svg?_applySVGOrigin(e,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&_addNonTweeningPT(this,v,"zOrigin",v.zOrigin,f),_addNonTweeningPT(this,D,d,_firstTwoOnly(o),_firstTwoOnly(a)));continue}if("svgOrigin"===d){_applySVGOrigin(e,a,1,y,0,this);continue}if(d in _rotationalProperties){_addRotationalPropTween(this,v,d,c,p?_parseRelative(c,p+a):a);continue}if("smoothOrigin"===d){_addNonTweeningPT(this,v,"smooth",v.smooth,a);continue}if("force3D"===d){v[d]=a;continue}if("transform"===d){_addRawTransformPTs(this,a,e);continue}}else d in D||(d=_checkPropPrefix(d)||d);if(m||(s||0===s)&&(c||0===c)&&!_complexExp.test(a)&&d in D)s||(s=0),(h=(o+"").substr((c+"").length))!==(f=getUnit(a)||(d in _config.units?_config.units[d]:h))&&(c=_convertToUnit(e,d,o,f)),this._pt=new PropTween(this._pt,m?v:D,d,c,(p?_parseRelative(c,p+s):s)-c,m||"px"!==f&&"zIndex"!==d||!1===t.autoRound?_renderCSSProp:_renderRoundedCSSProp),this._pt.u=f||0,h!==f&&"%"!==f&&(this._pt.b=o,this._pt.r=_renderCSSPropWithBeginning);else if(d in D)_tweenComplexCSSString.call(this,e,d,o,p?p+a:a);else if(d in e)this.add(e,d,o||e[d],p?p+a:a,n,i);else if("parseTransform"!==d){_missingPlugin(d,a);continue}m||(d in D?b.push(d,0,D[d]):b.push(d,1,o||e[d])),w.push(d)}_&&_sortPropTweensByPriority(this)},render:function(e,t){if(t.tween._time||!_reverting())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:_get,aliases:_propertyAliases,getSetter:function(e,t,r){var n=_propertyAliases[t];return n&&n.indexOf(",")<0&&(t=n),t in _transformProps&&t!==_transformOriginProp&&(e._gsap.x||_get(e,"x"))?r&&_recentSetterPlugin===r?"scale"===t?_setterScale:_setterTransform:(_recentSetterPlugin=r||{})&&("scale"===t?_setterScaleWithRender:_setterTransformWithRender):e.style&&!_isUndefined(e.style[t])?_setterCSSStyle:~t.indexOf("-")?_setterCSSProp:_getSetter(e,t)},core:{_removeProperty:_removeProperty,_getMatrix:_getMatrix}},positionAndScale,rotation,all;gsap.utils.checkPrefix=_checkPropPrefix,gsap.core.getStyleSaver=_getStyleSaver,positionAndScale="x,y,z,scale,scaleX,scaleY,xPercent,yPercent",rotation="rotation,rotationX,rotationY,skewX,skewY",all=_forEachName(positionAndScale+","+rotation+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){_transformProps[e]=1})),_forEachName(rotation,(function(e){_config.units[e]="deg",_rotationalProperties[e]=1})),_propertyAliases[all[13]]=positionAndScale+","+rotation,_forEachName("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");_propertyAliases[t[1]]=all[t[0]]})),_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){_config.units[e]="px"})),gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;var GoAnimation=function(){function e(){this.startPoisiton={x:0,y:0},this.endPoisiton={x:1920,y:0},this.curtain={width:1920,height:1080},this.totalTime=5,this.timeLine=gsapWithCSS.timeline()}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.init=function(e,t){var r;null===(r=this.timeLine)||void 0===r||r.clear();var n=t.curtain,i=t.totalTime,o=t.admissionMode;i&&(this.totalTime=i),this.setEndPoisiton(n);var a=this.filterData(e,o);this.goAnimationParams=t;for(var s=0;s<a.length;s++){var c=a[s];if(c instanceof Array)for(var u=0;u<c.length;u++){var l=this.totalTime/c.length,d=c[u],h=this._creatTl("#wrap"+d.cid);this._add(h,u*l)}else{l=this.totalTime/a.length,h=this._creatTl("#wrap"+c.cid);this._add(h,s*l)}}return this.timeLine},e.prototype.filterData=function(e,t){var r;if("left"==t)r=_$1.orderBy(e,["baseData.left"],["asc"]);else if("top"==t)r=_$1.orderBy(e,["baseData.top"],["asc"]);else if("topLeft"==t){var n=this.setSpacing(e,"left");r=_$1.orderBy(n,["spacing"],["asc"])}else if("topRight"==t){var i=this.setSpacing(e,"right");r=_$1.orderBy(i,["spacing"],["asc"])}else if("center"==t){var o=this.splitArrayForCenter(e,"left");r=[_$1.orderBy(o.true,["center.x"],["asc"]),_$1.orderBy(o.false,["center.x"],["desc"])]}else if("spaceBetween"==t){o=this.splitArrayForCenter(e,"left");r=[_$1.orderBy(o.true,["center.x"],["desc"]),_$1.orderBy(o.false,["center.x"],["asc"])]}else r=_$1.orderBy(e,["baseData.left"],["asc"]);return r},e.prototype.getSpacing=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y,a=Math.abs(r-i),s=Math.abs(n-o);return Math.sqrt(a*a+s*s)},e.prototype.creatPosition=function(e,t){var r=0,n=0;return e?("left"===t?(r=e.left,n=e.top):"right"===t&&(r=e.left+e.width,n=e.top),{x:r,y:n}):{x:r,y:n}},e.prototype.setEndPoisiton=function(e){if(e){var t=e.width,r=e.height;this.curtain=e,this.endPoisiton.x=t,this.endPoisiton.y=r}},e.prototype.setSpacing=function(e,t){var r,n=this;return"left"===t?r=this.startPoisiton:"right"===t&&(r=this.endPoisiton),e.forEach((function(e){var i=e.baseData;if(i){var o=n.creatPosition(i,t),a=n.getSpacing(o,r);e.spacing=a}})),e},e.prototype.setCenter=function(e){return e.forEach((function(e){if(e.baseData){var t=e.baseData.left+e.baseData.width/2,r=e.baseData.top+e.baseData.height/2;e.center={x:t,y:r}}})),e},e.prototype.splitArrayForCenter=function(e,t){var r,n=this,i=this.setCenter(e);return"left"!=t&&"right"!=t||(r=_$1.groupBy(i,(function(e){return e.center.x>=n.curtain.width/2}))),"top"!=t&&"bottom"!=t||(r=_$1.groupBy(i,(function(e){return e.center.y>=n.curtain.height/2}))),r},e.prototype._add=function(e,t){this.timeLine.add(e,t)},e.prototype._creatTl=function(e){var t=gsapWithCSS.timeline();return t.add(this._creatTw(e)),t},e.prototype._creatTw=function(e){var t=this.goAnimationParams.params,r=t.delay,n=t.duration,i=t.repeat,o=t.type,a=t.value;return a&&a.length&&a.forEach((function(e){e.delay=r||0,e.repeat=i||0})),gsapWithCSS[o](e,n,a[0],a[1])},e.prototype.in=function(){},e.prototype.out=function(){},e}(),index=GoAnimation.getInstance(),findItemDeep=function(e,t,r){var n=!1,i=function(e){for(var o=0;o<e.length;o++){if(e[o].cid==t){n=e[o],r&&_$1.remove(e,(function(e){return e.cid==t}));break}if(e[o].children)i(e[o].children);else if(e[o].dynamicChildren){if(e[o].dynamicChildren instanceof Map){for(var a=Array.from(e[o].dynamicChildren),s=0;s<a.length;s++)if(a[s]instanceof Array){var c=a[s][1];i(c)}}else if(e[o].dynamicChildren instanceof Array)for(a=e[o].dynamicChildren,s=0;s<a.length;s++)if(a[s]instanceof Array){c=a[s][1];i(c)}}else e[o].stateChildren&&i(e[o].stateChildren)}};return i(e),n||!1};function mitt(e,t){return e=e||new Map,__assign$1(__assign$1({},t),{EventType:e,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);if(n){var i=n.slice().map((function(e){return e(r)}));if(i&&1==i.length)return i[0]}(n=e.get("*"))&&n.slice().map((function(e){e(t,r)}))}})}var RuntimeServer=function(){function e(e){this.root=null,this.vuex=Go.getInstance().VueServer,this.eventType=new Map,(null==e?void 0:e.root)&&(this.root=e.root);var t={setGlobalVar:this.setGlobalVar.bind(this),showComponent:this._showComponent.bind(this),hideComponent:this._hideComponent.bind(this),pageChange:this.pageChange.bind(this),changeDynamicState:this.changeDynamicState.bind(this)};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.eventType.set(r,[t[r]])}return e.prototype.findComponentDownward=function(e,t){var r=e.$children;if(r.length)for(var n=0,i=r;n<i.length;n++){var o=i[n];o.$options&&o.$options.propsData&&o.$options.propsData.cid&&(t[o.$options.propsData.cid]=o),o.$children&&o.$children.length&&this.findComponentDownward(o,t)}return t},e.prototype.getAllComponents=function(){var e={};return this.findComponentDownward(this.root,e),e},e.prototype.getComponentByCid=function(e){try{var t=this.getAllComponents()[e];if(!t)throw new Error("The instance was not found");return t}catch(e){console.warn(e)}},e.prototype.getElementByCid=function(e){try{if(!e)throw new Error("Please input the parameters correctly");var t=this.getComponentByCid(e);if(!t)throw new Error("The element was not found");return t.$el}catch(e){console.warn(e)}},e.prototype.setGlobalVar=function(e){try{var t=e.key,r=e.value;if(!(e&&t&&r))throw new Error("An error occurred. Please check whether the incoming parameters are correct! The correct format of data is an object containing key and value");this.setVars(e)}catch(e){console.warn(e)}},e.prototype._showComponent=function(e){try{if(!e)throw new Error("Please input the parameters correctly");this.changeVis({cid:e,flag:!0})}catch(e){console.warn(e)}},e.prototype._hideComponent=function(e){try{if(!e)throw new Error("Please input the parameters correctly");this.changeVis({cid:e,flag:!1})}catch(e){console.warn(e)}},e.prototype.getList=function(e){return e&&"id"===e?this.vuex.callState("list").map((function(e){return e.cid})):this.vuex.callState("list")},e.prototype.getTheme=function(e){var t=this.vuex.callState("theme");return e&&e(t),t},e.prototype.getElement=function(e){var t=this.vuex.callState("list");return findItemDeep(t,e)},e.prototype.changeVis=function(e){return this.vuex.callMutation("changeShow",e)},e.prototype.comToggle=function(e){return this.vuex.callMutation("comToggle",e)},e.prototype.getPageInfo=function(e){var t=this.vuex.callState("caseInfo");return e&&e(t),(null==t?void 0:t.details)?t.details.map((function(e){return{name:e.caseDetailName,path:e.caseDetailPath,id:e.id}})):t},e.prototype.updateComp=function(e){return this.vuex.callMutation("updatComs",e)},e.prototype.changeDynamicState=function(e){return this.vuex.callMutation("changeDynamicState",e)},e.prototype.pageChange=function(e){return this.vuex.callMutation("setPageId",e)},e.prototype.pagePush=function(e,t,r){return void 0===r&&(r={}),this.vuex.callMutation("pagePush",{type:e,value:t,option:r})},e.prototype.activeState=function(e,t){return this.vuex.callMutation("setDynamicActive",{cid:e,name:t})},e.prototype.getVars=function(e){var t=ge.getAllVariables();return e&&e(t),t},e.prototype.setVars=function(e){var t=ge.getVariable(e.key);if(2!=(null==t?void 0:t.model))return this.vuex.callAction("goEditVar",e);console.warn("系统变量禁止修改!")},e}(),Run=function(e){function t(t){var r=e.call(this,t)||this,n=mitt(r.eventType);return r.$emit=n.emit,r.$on=n.on,r.$off=n.off,r}return __extends$2(t,e),Object.defineProperty(t.prototype,"Theme",{get:function(){return this.getTheme()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Components",{get:function(){return this.getAllComponents()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"GlobalVars",{get:function(){return this.getVars()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Pages",{get:function(){return this.getPageInfo()},enumerable:!1,configurable:!0}),t.prototype.getElementById=function(e){this.getElementByCid(e)},t.prototype.getComponentById=function(e){this.getComponentByCid(e)},t.prototype.getPage=function(){},t}(RuntimeServer),G=function(){function e(e){this.$action=new GoEvent(e),this.instance=new Run(e)}return e.prototype.getGlobalvars=function(){for(var e=ge.getAllVariables(),t=e.map((function(e){return e.mapField})),r={},n=function(t){var n=e.find((function(e){return e.mapField==t}));n&&(r[t]=n.value)},i=0,o=t;i<o.length;i++){n(o[i])}var a=this.instance;return new Proxy(r,{has:function(e,t){return!t&&t in e},get:function(e,t){if(t in e)return e[t];throw new ReferenceError('Prop name "'+t+'" does not exist.')},set:function(e,t,r){if(!e[t])return console.log("变量不存在/不能被修改"),!1;if(e[t]=r,!t||"string"!=typeof t)throw new Error("Invalid key");a.setGlobalVar({key:t,value:r})}})},Object.defineProperty(e.prototype,"globalvars",{get:function(){return this.getGlobalvars()},enumerable:!1,configurable:!0}),e}(),GoEvent=function(e){var t=this;this.setGlobalVars=function(e,r){if(!e||"string"!=typeof e)throw new Error("Invalid key");t.instance.setGlobalVar({key:e,value:r})},this.skipTo=function(e){var r=null==e?void 0:e.params;if(!e||0===Object.keys(e).length)throw new Error("事件跳转发生错误:参数:".concat(e," 不正确,请正确填写!doc: https://anov.cucloud.cn/anov-go-doc/"));if(e.name)t.instance.pagePush("name",e.name,r);else if(e.path)t.instance.pagePush("path",e.path,r);else{if(!e.url)throw new Error("事件跳转发生错误:参数:".concat(e," 不正确,请正确填写!doc: https://anov.cucloud.cn/anov-go-doc/"));window.open(e.url)}},this.toggle=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e)if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance.comToggle(i):console.warn("请传入正确的参数!")}else console.warn("请传入正确的参数!");else t.instance.comToggle(e);else console.warn("请传入正确的参数!")},this.show=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance._showComponent(i.toString()):console.warn("请传入正确的参数!")}}else t.instance._showComponent(e.toString());else console.warn("请传入正确的参数!")},this.hide=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance._hideComponent(i):console.warn("请传入正确的参数!")}}else t.instance._hideComponent(e);else console.warn("请传入正确的参数!")},this.activeState=function(e,r){t.instance.activeState(e,r)},this.updateComp=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance.updateComp(i):console.warn("请传入正确的参数!")}}else t.instance.updateComp(e);else console.warn("请传入正确的参数!")},this.instance=new Run(e)},run=function(e){return new G(e)},getDataForRelease=function(e,t){console.log("弃用")},createComponent=function(e,t){return t&&e?Go.getInstance().render(e,t):e?Go.getInstance().render(e):void 0},createComponentForParent=function(e,t,r){return void 0!==r&&e?Go.getInstance().renderForParent(e,t,r):e?Go.getInstance().renderForParent(e,t):void 0},emitEvent=function(e,t){return Go.getInstance().emitEvent(e,t||function(){})},log=function(){};exports.Go=Go,exports.GoAnimation=index,exports.Tool=index$1,exports.createComponent=createComponent,exports.createComponentForParent=createComponentForParent,exports.emitEvent=emitEvent,exports.fxhr=index$2,exports.getDataForRelease=getDataForRelease,exports.goUtils=index$3,exports.log=log,exports.refreshData=refreshData,exports.run=run,exports.store=store}));
|
|
63
|
+
var _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function(){return"undefined"!=typeof window},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},_renderPropWithEnd=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round(1e4*(t.s+t.c*e))/1e4+t.u,t)},_renderCSSPropWithBeginning=function(e,t){return t.set(t.t,t.p,e?Math.round(1e4*(t.s+t.c*e))/1e4+t.u:t.b,t)},_renderRoundedCSSProp=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},_renderNonTweeningValue=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},_renderNonTweeningValueOnlyAtEnd=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},_setterCSSStyle=function(e,t,r){return e.style[t]=r},_setterCSSProp=function(e,t,r){return e.style.setProperty(t,r)},_setterTransform=function(e,t,r){return e._gsap[t]=r},_setterScale=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},_setterScaleWithRender=function(e,t,r,n,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},_setterTransformWithRender=function(e,t,r,n,i){var o=e._gsap;o[t]=r,o.renderTransform(i,o)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function e(t,r){var n=this,i=this.target,o=i.style,a=i._gsap;if(t in _transformProps&&o){if(this.tfm=this.tfm||{},"transform"===t)return _propertyAliases.transform.split(",").forEach((function(t){return e.call(n,t,r)}));if(~(t=_propertyAliases[t]||t).indexOf(",")?t.split(",").forEach((function(e){return n.tfm[e]=_get(i,e)})):this.tfm[t]=a.x?a[t]:_get(i,t),t===_transformOriginProp&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(_transformProp)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,r,"")),t=_transformProp}(o||r)&&this.props.push(t,r,o[t])},_removeIndependentTransforms=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},_revertStyle=function(){var e,t,r=this.props,n=this.target,i=n.style,o=n._gsap;for(e=0;e<r.length;e+=3)r[e+1]?n[r[e]]=r[e+2]:r[e+2]?i[r[e]]=r[e+2]:i.removeProperty("--"===r[e].substr(0,2)?r[e]:r[e].replace(_capsExp,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)o[t]=this.tfm[t];o.svg&&(o.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(e=_reverting())&&e.isStart||i[_transformProp]||(_removeIndependentTransforms(i),o.zOrigin&&i[_transformOriginProp]&&(i[_transformOriginProp]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},_getStyleSaver=function(e,t){var r={target:e,props:[],revert:_revertStyle,save:_saveStyle};return e._gsap||gsap.core.getCache(e),t&&t.split(",").forEach((function(e){return r.save(e)})),r},_supports3D,_createElement=function(e,t){var r=_doc.createElementNS?_doc.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):_doc.createElement(e);return r&&r.style?r:_doc.createElement(e)},_getComputedProperty=function e(t,r,n){var i=getComputedStyle(t);return i[r]||i.getPropertyValue(r.replace(_capsExp,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&e(t,_checkPropPrefix(r)||r,1)||""},_prefixes="O,Moz,ms,Ms,Webkit".split(","),_checkPropPrefix=function(e,t,r){var n=(t||_tempDiv).style,i=5;if(e in n&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(_prefixes[i]+e in n););return i<0?null:(3===i?"ms":i>=0?_prefixes[i]:"")+e},_initCore=function(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function e(t){var r,n=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(_docElement.appendChild(n),n.appendChild(this),this.style.display="block",t)try{r=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(r=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),_docElement.removeChild(n),this.style.cssText=a,r},_getAttributeFallbacks=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},_getBBox=function(e){var t;try{t=e.getBBox()}catch(r){t=_getBBoxHack.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===_getBBoxHack||(t=_getBBoxHack.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+_getAttributeFallbacks(e,["x","cx","x1"])||0,y:+_getAttributeFallbacks(e,["y","cy","y1"])||0,width:0,height:0}},_isSVG=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!_getBBox(e))},_removeProperty=function(e,t){if(t){var r,n=e.style;t in _transformProps&&t!==_transformOriginProp&&(t=_transformProp),n.removeProperty?("ms"!==(r=t.substr(0,2))&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty("--"===r?t:t.replace(_capsExp,"-$1").toLowerCase())):n.removeAttribute(t)}},_addNonTweeningPT=function(e,t,r,n,i,o){var a=new PropTween(e._pt,t,r,0,1,o?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return e._pt=a,a.b=n,a.e=i,e._props.push(r),a},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function e(t,r,n,i){var o,a,s,c,u=parseFloat(n)||0,l=(n+"").trim().substr((u+"").length)||"px",d=_tempDiv.style,h=_horizontalExp.test(r),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(h?"Width":"Height"),m=100,g="px"===i,v="%"===i;if(i===l||!u||_nonConvertibleUnits[i]||_nonConvertibleUnits[l])return u;if("px"!==l&&!g&&(u=e(t,r,n,"px")),c=t.getCTM&&_isSVG(t),(v||"%"===l)&&(_transformProps[r]||~r.indexOf("adius")))return o=c?t.getBBox()[h?"width":"height"]:t[p],_round(v?u/o*m:u/100*o);if(d[h?"width":"height"]=m+(g?l:i),a=~r.indexOf("adius")||"em"===i&&t.appendChild&&!f?t:t.parentNode,c&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==_doc&&a.appendChild||(a=_doc.body),(s=a._gsap)&&v&&s.width&&h&&s.time===_ticker.time&&!s.uncache)return _round(u/s.width*m);if(!v||"height"!==r&&"width"!==r)(v||"%"===l)&&!_nonStandardLayouts[_getComputedProperty(a,"display")]&&(d.position=_getComputedProperty(t,"position")),a===t&&(d.position="static"),a.appendChild(_tempDiv),o=_tempDiv[p],a.removeChild(_tempDiv),d.position="absolute";else{var y=t.style[r];t.style[r]=m+i,o=t[p],y?t.style[r]=y:_removeProperty(t,r)}return h&&v&&((s=_getCache(a)).time=_ticker.time,s.width=a[p]),_round(g?o*u/m:o&&u?m/o*u:0)},_get=function(e,t,r,n){var i;return _pluginInitted||_initCore(),t in _propertyAliases&&"transform"!==t&&~(t=_propertyAliases[t]).indexOf(",")&&(t=t.split(",")[0]),_transformProps[t]&&"transform"!==t?(i=_parseTransform(e,n),i="transformOrigin"!==t?i[t]:i.svg?i.origin:_firstTwoOnly(_getComputedProperty(e,_transformOriginProp))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=_specialProps[t]&&_specialProps[t](e,t,r)||_getComputedProperty(e,t)||_getProperty(e,t)||("opacity"===t?1:0)),r&&!~(i+"").trim().indexOf(" ")?_convertToUnit(e,t,i,r)+r:i},_tweenComplexCSSString=function(e,t,r,n){if(!r||"none"===r){var i=_checkPropPrefix(t,e,1),o=i&&_getComputedProperty(e,i,1);o&&o!==r?(t=i,r=o):"borderColor"===t&&(r=_getComputedProperty(e,"borderTopColor"))}var a,s,c,u,l,d,h,f,p,m,g,v=new PropTween(this._pt,e.style,t,0,1,_renderComplexString),y=0,_=0;if(v.b=r,v.e=n,r+="","auto"===(n+="")&&(d=e.style[t],e.style[t]=n,n=_getComputedProperty(e,t)||n,d?e.style[t]=d:_removeProperty(e,t)),_colorStringFilter(a=[r,n]),n=a[1],c=(r=a[0]).match(_numWithUnitExp)||[],(n.match(_numWithUnitExp)||[]).length){for(;s=_numWithUnitExp.exec(n);)h=s[0],p=n.substring(y,s.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),h!==(d=c[_++]||"")&&(u=parseFloat(d)||0,g=d.substr((u+"").length),"="===h.charAt(1)&&(h=_parseRelative(u,h)+g),f=parseFloat(h),m=h.substr((f+"").length),y=_numWithUnitExp.lastIndex-m.length,m||(m=m||_config.units[t]||g,y===n.length&&(n+=m,v.e+=m)),g!==m&&(u=_convertToUnit(e,t,d,m)||0),v._pt={_next:v._pt,p:p||1===_?p:",",s:u,c:f-u,m:l&&l<4||"zIndex"===t?Math.round:0});v.c=y<n.length?n.substring(y,n.length):""}else v.r="display"===t&&"none"===n?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue;return _relExp.test(n)&&(v.e=0),this._pt=v,v},_keywordToPercent={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_convertKeywordsToPercentages=function(e){var t=e.split(" "),r=t[0],n=t[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==n&&"right"!==n||(e=r,r=n,n=e),t[0]=_keywordToPercent[r]||r,t[1]=_keywordToPercent[n]||n,t.join(" ")},_renderClearProps=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r,n,i,o=t.t,a=o.style,s=t.u,c=o._gsap;if("all"===s||!0===s)a.cssText="",n=1;else for(i=(s=s.split(",")).length;--i>-1;)r=s[i],_transformProps[r]&&(n=1,r="transformOrigin"===r?_transformOriginProp:_transformProp),_removeProperty(o,r);n&&(_removeProperty(o,_transformProp),c&&(c.svg&&o.removeAttribute("transform"),_parseTransform(o,1),c.uncache=1,_removeIndependentTransforms(a)))}},_specialProps={clearProps:function(e,t,r,n,i){if("isFromStart"!==i.data){var o=e._pt=new PropTween(e._pt,t,r,0,0,_renderClearProps);return o.u=n,o.pr=-10,o.tween=i,e._props.push(r),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},_getComputedTransformMatrixAsArray=function(e){var t=_getComputedProperty(e,_transformProp);return _isNullTransform(t)?_identity2DMatrix:t.substr(7).match(_numExp).map(_round)},_getMatrix=function(e,t){var r,n,i,o,a=e._gsap||_getCache(e),s=e.style,c=_getComputedTransformMatrixAsArray(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(c=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?_identity2DMatrix:c:(c!==_identity2DMatrix||e.offsetParent||e===_docElement||a.svg||(i=s.display,s.display="block",(r=e.parentNode)&&e.offsetParent||(o=1,n=e.nextElementSibling,_docElement.appendChild(e)),c=_getComputedTransformMatrixAsArray(e),i?s.display=i:_removeProperty(e,"display"),o&&(n?r.insertBefore(e,n):r?r.appendChild(e):_docElement.removeChild(e))),t&&c.length>6?[c[0],c[1],c[4],c[5],c[12],c[13]]:c)},_applySVGOrigin=function(e,t,r,n,i,o){var a,s,c,u=e._gsap,l=i||_getMatrix(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,f=u.xOffset||0,p=u.yOffset||0,m=l[0],g=l[1],v=l[2],y=l[3],_=l[4],b=l[5],w=t.split(" "),D=parseFloat(w[0])||0,S=parseFloat(w[1])||0;r?l!==_identity2DMatrix&&(s=m*y-g*v)&&(c=D*(-g/s)+S*(m/s)-(m*b-g*_)/s,D=D*(y/s)+S*(-v/s)+(v*b-y*_)/s,S=c):(D=(a=_getBBox(e)).x+(~w[0].indexOf("%")?D/100*a.width:D),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),n||!1!==n&&u.smooth?(_=D-d,b=S-h,u.xOffset=f+(_*m+b*v)-_,u.yOffset=p+(_*g+b*y)-b):u.xOffset=u.yOffset=0,u.xOrigin=D,u.yOrigin=S,u.smooth=!!n,u.origin=t,u.originIsAbsolute=!!r,e.style[_transformOriginProp]="0px 0px",o&&(_addNonTweeningPT(o,u,"xOrigin",d,D),_addNonTweeningPT(o,u,"yOrigin",h,S),_addNonTweeningPT(o,u,"xOffset",f,u.xOffset),_addNonTweeningPT(o,u,"yOffset",p,u.yOffset)),e.setAttribute("data-svg-origin",D+" "+S)},_parseTransform=function(e,t){var r=e._gsap||new GSCache(e);if("x"in r&&!t&&!r.uncache)return r;var n,i,o,a,s,c,u,l,d,h,f,p,m,g,v,y,_,b,w,D,S,x,T,k,P,E,A,C,O,R,M,I,N=e.style,B=r.scaleX<0,F="px",j="deg",V=getComputedStyle(e),$=_getComputedProperty(e,_transformOriginProp)||"0";return n=i=o=c=u=l=d=h=f=0,a=s=1,r.svg=!(!e.getCTM||!_isSVG(e)),V.translate&&("none"===V.translate&&"none"===V.scale&&"none"===V.rotate||(N[_transformProp]=("none"!==V.translate?"translate3d("+(V.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==V.rotate?"rotate("+V.rotate+") ":"")+("none"!==V.scale?"scale("+V.scale.split(" ").join(",")+") ":"")+("none"!==V[_transformProp]?V[_transformProp]:"")),N.scale=N.rotate=N.translate="none"),g=_getMatrix(e,r.svg),r.svg&&(r.uncache?(P=e.getBBox(),$=r.xOrigin-P.x+"px "+(r.yOrigin-P.y)+"px",k=""):k=!t&&e.getAttribute("data-svg-origin"),_applySVGOrigin(e,k||$,!!k||r.originIsAbsolute,!1!==r.smooth,g)),p=r.xOrigin||0,m=r.yOrigin||0,g!==_identity2DMatrix&&(b=g[0],w=g[1],D=g[2],S=g[3],n=x=g[4],i=T=g[5],6===g.length?(a=Math.sqrt(b*b+w*w),s=Math.sqrt(S*S+D*D),c=b||w?_atan2(w,b)*_RAD2DEG:0,(d=D||S?_atan2(D,S)*_RAD2DEG+c:0)&&(s*=Math.abs(Math.cos(d*_DEG2RAD))),r.svg&&(n-=p-(p*b+m*D),i-=m-(p*w+m*S))):(I=g[6],R=g[7],A=g[8],C=g[9],O=g[10],M=g[11],n=g[12],i=g[13],o=g[14],u=(v=_atan2(I,O))*_RAD2DEG,v&&(k=x*(y=Math.cos(-v))+A*(_=Math.sin(-v)),P=T*y+C*_,E=I*y+O*_,A=x*-_+A*y,C=T*-_+C*y,O=I*-_+O*y,M=R*-_+M*y,x=k,T=P,I=E),l=(v=_atan2(-D,O))*_RAD2DEG,v&&(y=Math.cos(-v),M=S*(_=Math.sin(-v))+M*y,b=k=b*y-A*_,w=P=w*y-C*_,D=E=D*y-O*_),c=(v=_atan2(w,b))*_RAD2DEG,v&&(k=b*(y=Math.cos(v))+w*(_=Math.sin(v)),P=x*y+T*_,w=w*y-b*_,T=T*y-x*_,b=k,x=P),u&&Math.abs(u)+Math.abs(c)>359.9&&(u=c=0,l=180-l),a=_round(Math.sqrt(b*b+w*w+D*D)),s=_round(Math.sqrt(T*T+I*I)),v=_atan2(x,T),d=Math.abs(v)>2e-4?v*_RAD2DEG:0,f=M?1/(M<0?-M:M):0),r.svg&&(k=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(e,_transformProp)),k&&e.setAttribute("transform",k))),Math.abs(d)>90&&Math.abs(d)<270&&(B?(a*=-1,d+=c<=0?180:-180,c+=c<=0?180:-180):(s*=-1,d+=d<=0?180:-180)),t=t||r.uncache,r.x=n-((r.xPercent=n&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-n)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+F,r.y=i-((r.yPercent=i&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+F,r.z=o+F,r.scaleX=_round(a),r.scaleY=_round(s),r.rotation=_round(c)+j,r.rotationX=_round(u)+j,r.rotationY=_round(l)+j,r.skewX=d+j,r.skewY=h+j,r.transformPerspective=f+F,(r.zOrigin=parseFloat($.split(" ")[2])||!t&&r.zOrigin||0)&&(N[_transformOriginProp]=_firstTwoOnly($)),r.xOffset=r.yOffset=0,r.force3D=_config.force3D,r.renderTransform=r.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,r.uncache=0,r},_firstTwoOnly=function(e){return(e=e.split(" "))[0]+" "+e[1]},_addPxTranslate=function(e,t,r){var n=getUnit(t);return _round(parseFloat(t)+parseFloat(_convertToUnit(e,"x",r+"px",n)))+n},_renderNon3DTransforms=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,_renderCSSTransforms(e,t)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function(e,t){var r=t||this,n=r.xPercent,i=r.yPercent,o=r.x,a=r.y,s=r.z,c=r.rotation,u=r.rotationY,l=r.rotationX,d=r.skewX,h=r.skewY,f=r.scaleX,p=r.scaleY,m=r.transformPerspective,g=r.force3D,v=r.target,y=r.zOrigin,_="",b="auto"===g&&e&&1!==e||!0===g;if(y&&(l!==_zeroDeg||u!==_zeroDeg)){var w,D=parseFloat(u)*_DEG2RAD,S=Math.sin(D),x=Math.cos(D);D=parseFloat(l)*_DEG2RAD,w=Math.cos(D),o=_addPxTranslate(v,o,S*w*-y),a=_addPxTranslate(v,a,-Math.sin(D)*-y),s=_addPxTranslate(v,s,x*w*-y+y)}m!==_zeroPx&&(_+="perspective("+m+_endParenthesis),(n||i)&&(_+="translate("+n+"%, "+i+"%) "),(b||o!==_zeroPx||a!==_zeroPx||s!==_zeroPx)&&(_+=s!==_zeroPx||b?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+_endParenthesis),c!==_zeroDeg&&(_+="rotate("+c+_endParenthesis),u!==_zeroDeg&&(_+="rotateY("+u+_endParenthesis),l!==_zeroDeg&&(_+="rotateX("+l+_endParenthesis),d===_zeroDeg&&h===_zeroDeg||(_+="skew("+d+", "+h+_endParenthesis),1===f&&1===p||(_+="scale("+f+", "+p+_endParenthesis),v.style[_transformProp]=_||"translate(0, 0)"},_renderSVGTransforms=function(e,t){var r,n,i,o,a,s=t||this,c=s.xPercent,u=s.yPercent,l=s.x,d=s.y,h=s.rotation,f=s.skewX,p=s.skewY,m=s.scaleX,g=s.scaleY,v=s.target,y=s.xOrigin,_=s.yOrigin,b=s.xOffset,w=s.yOffset,D=s.forceCSS,S=parseFloat(l),x=parseFloat(d);h=parseFloat(h),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),h+=p),h||f?(h*=_DEG2RAD,f*=_DEG2RAD,r=Math.cos(h)*m,n=Math.sin(h)*m,i=Math.sin(h-f)*-g,o=Math.cos(h-f)*g,f&&(p*=_DEG2RAD,a=Math.tan(f-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),r*=a=Math.sqrt(1+a*a),n*=a)),r=_round(r),n=_round(n),i=_round(i),o=_round(o)):(r=m,o=g,n=i=0),(S&&!~(l+"").indexOf("px")||x&&!~(d+"").indexOf("px"))&&(S=_convertToUnit(v,"x",l,"px"),x=_convertToUnit(v,"y",d,"px")),(y||_||b||w)&&(S=_round(S+y-(y*r+_*i)+b),x=_round(x+_-(y*n+_*o)+w)),(c||u)&&(a=v.getBBox(),S=_round(S+c/100*a.width),x=_round(x+u/100*a.height)),a="matrix("+r+","+n+","+i+","+o+","+S+","+x+")",v.setAttribute("transform",a),D&&(v.style[_transformProp]=a)},_addRotationalPropTween=function(e,t,r,n,i){var o,a,s=360,c=_isString(i),u=parseFloat(i)*(c&&~i.indexOf("rad")?_RAD2DEG:1)-n,l=n+u+"deg";return c&&("short"===(o=i.split("_")[1])&&(u%=s)!==u%180&&(u+=u<0?s:-360),"cw"===o&&u<0?u=(u+s*_bigNum)%s-~~(u/s)*s:"ccw"===o&&u>0&&(u=(u-s*_bigNum)%s-~~(u/s)*s)),e._pt=a=new PropTween(e._pt,t,r,n,u,_renderPropWithEnd),a.e=l,a.u="deg",e._props.push(r),a},_assign=function(e,t){for(var r in t)e[r]=t[r];return e},_addRawTransformPTs=function(e,t,r){var n,i,o,a,s,c,u,l=_assign({},r._gsap),d=r.style;for(i in l.svg?(o=r.getAttribute("transform"),r.setAttribute("transform",""),d[_transformProp]=t,n=_parseTransform(r,1),_removeProperty(r,_transformProp),r.setAttribute("transform",o)):(o=getComputedStyle(r)[_transformProp],d[_transformProp]=t,n=_parseTransform(r,1),d[_transformProp]=o),_transformProps)(o=l[i])!==(a=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=getUnit(o)!==(u=getUnit(a))?_convertToUnit(r,i,o,u):parseFloat(o),c=parseFloat(a),e._pt=new PropTween(e._pt,n,i,s,c-s,_renderCSSProp),e._pt.u=u||0,e._props.push(i));_assign(n,l)};_forEachName("padding,margin,Width,Radius",(function(e,t){var r="Top",n="Right",i="Bottom",o="Left",a=(t<3?[r,n,i,o]:[r+o,r+n,i+n,i+o]).map((function(r){return t<2?e+r:"border"+r+e}));_specialProps[t>1?"border"+e:e]=function(e,t,r,n,i){var o,s;if(arguments.length<4)return o=a.map((function(t){return _get(e,t,r)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(n+"").split(" "),s={},a.forEach((function(e,t){return s[e]=o[t]=o[t]||o[(t-1)/2|0]})),e.init(t,s,i)}}));var CSSPlugin={name:"css",register:_initCore,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,n,i){var o,a,s,c,u,l,d,h,f,p,m,g,v,y,_,b,w=this._props,D=e.style,S=r.vars.startAt;for(d in _pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(e),b=this.styles.props,this.tween=r,t)if("autoRound"!==d&&(a=t[d],!_plugins[d]||!_checkPlugin(d,t,r,n,e,i)))if(u=typeof a,l=_specialProps[d],"function"===u&&(u=typeof(a=a.call(r,n,e,i))),"string"===u&&~a.indexOf("random(")&&(a=_replaceRandom(a)),l)l(this,e,d,a,r)&&(_=1);else if("--"===d.substr(0,2))o=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",_colorExp.lastIndex=0,_colorExp.test(o)||(h=getUnit(o),f=getUnit(a)),f?h!==f&&(o=_convertToUnit(e,d,o,f)+f):h&&(a+=h),this.add(D,"setProperty",o,a,n,i,0,0,d),w.push(d),b.push(d,0,D[d]);else if("undefined"!==u){if(S&&d in S?(o="function"==typeof S[d]?S[d].call(r,n,e,i):S[d],_isString(o)&&~o.indexOf("random(")&&(o=_replaceRandom(o)),getUnit(o+"")||"auto"===o||(o+=_config.units[d]||getUnit(_get(e,d))||""),"="===(o+"").charAt(1)&&(o=_get(e,d))):o=_get(e,d),c=parseFloat(o),(p="string"===u&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),s=parseFloat(a),d in _propertyAliases&&("autoAlpha"===d&&(1===c&&"hidden"===_get(e,"visibility")&&s&&(c=0),b.push("visibility",0,D.visibility),_addNonTweeningPT(this,D,"visibility",c?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==d&&"transform"!==d&&~(d=_propertyAliases[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in _transformProps)if(this.styles.save(d),g||((v=e._gsap).renderTransform&&!t.parseTransform||_parseTransform(e,t.parseTransform),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new PropTween(this._pt,D,_transformProp,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new PropTween(this._pt,v,"scaleY",v.scaleY,(p?_parseRelative(v.scaleY,p+s):s)-v.scaleY||0,_renderCSSProp),this._pt.u=0,w.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(_transformOriginProp,0,D[_transformOriginProp]),a=_convertKeywordsToPercentages(a),v.svg?_applySVGOrigin(e,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&_addNonTweeningPT(this,v,"zOrigin",v.zOrigin,f),_addNonTweeningPT(this,D,d,_firstTwoOnly(o),_firstTwoOnly(a)));continue}if("svgOrigin"===d){_applySVGOrigin(e,a,1,y,0,this);continue}if(d in _rotationalProperties){_addRotationalPropTween(this,v,d,c,p?_parseRelative(c,p+a):a);continue}if("smoothOrigin"===d){_addNonTweeningPT(this,v,"smooth",v.smooth,a);continue}if("force3D"===d){v[d]=a;continue}if("transform"===d){_addRawTransformPTs(this,a,e);continue}}else d in D||(d=_checkPropPrefix(d)||d);if(m||(s||0===s)&&(c||0===c)&&!_complexExp.test(a)&&d in D)s||(s=0),(h=(o+"").substr((c+"").length))!==(f=getUnit(a)||(d in _config.units?_config.units[d]:h))&&(c=_convertToUnit(e,d,o,f)),this._pt=new PropTween(this._pt,m?v:D,d,c,(p?_parseRelative(c,p+s):s)-c,m||"px"!==f&&"zIndex"!==d||!1===t.autoRound?_renderCSSProp:_renderRoundedCSSProp),this._pt.u=f||0,h!==f&&"%"!==f&&(this._pt.b=o,this._pt.r=_renderCSSPropWithBeginning);else if(d in D)_tweenComplexCSSString.call(this,e,d,o,p?p+a:a);else if(d in e)this.add(e,d,o||e[d],p?p+a:a,n,i);else if("parseTransform"!==d){_missingPlugin(d,a);continue}m||(d in D?b.push(d,0,D[d]):b.push(d,1,o||e[d])),w.push(d)}_&&_sortPropTweensByPriority(this)},render:function(e,t){if(t.tween._time||!_reverting())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:_get,aliases:_propertyAliases,getSetter:function(e,t,r){var n=_propertyAliases[t];return n&&n.indexOf(",")<0&&(t=n),t in _transformProps&&t!==_transformOriginProp&&(e._gsap.x||_get(e,"x"))?r&&_recentSetterPlugin===r?"scale"===t?_setterScale:_setterTransform:(_recentSetterPlugin=r||{})&&("scale"===t?_setterScaleWithRender:_setterTransformWithRender):e.style&&!_isUndefined(e.style[t])?_setterCSSStyle:~t.indexOf("-")?_setterCSSProp:_getSetter(e,t)},core:{_removeProperty:_removeProperty,_getMatrix:_getMatrix}},positionAndScale,rotation,all;gsap.utils.checkPrefix=_checkPropPrefix,gsap.core.getStyleSaver=_getStyleSaver,positionAndScale="x,y,z,scale,scaleX,scaleY,xPercent,yPercent",rotation="rotation,rotationX,rotationY,skewX,skewY",all=_forEachName(positionAndScale+","+rotation+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){_transformProps[e]=1})),_forEachName(rotation,(function(e){_config.units[e]="deg",_rotationalProperties[e]=1})),_propertyAliases[all[13]]=positionAndScale+","+rotation,_forEachName("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");_propertyAliases[t[1]]=all[t[0]]})),_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){_config.units[e]="px"})),gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;var GoAnimation=function(){function e(){this.startPoisiton={x:0,y:0},this.endPoisiton={x:1920,y:0},this.curtain={width:1920,height:1080},this.totalTime=5,this.timeLine=gsapWithCSS.timeline()}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.init=function(e,t){var r;null===(r=this.timeLine)||void 0===r||r.clear();var n=t.curtain,i=t.totalTime,o=t.admissionMode;i&&(this.totalTime=i),this.setEndPoisiton(n);var a=this.filterData(e,o);this.goAnimationParams=t;for(var s=0;s<a.length;s++){var c=a[s];if(c instanceof Array)for(var u=0;u<c.length;u++){var l=this.totalTime/c.length,d=c[u],h=this._creatTl("#wrap"+d.cid);this._add(h,u*l)}else{l=this.totalTime/a.length,h=this._creatTl("#wrap"+c.cid);this._add(h,s*l)}}return this.timeLine},e.prototype.filterData=function(e,t){var r;if("left"==t)r=_$1.orderBy(e,["baseData.left"],["asc"]);else if("top"==t)r=_$1.orderBy(e,["baseData.top"],["asc"]);else if("topLeft"==t){var n=this.setSpacing(e,"left");r=_$1.orderBy(n,["spacing"],["asc"])}else if("topRight"==t){var i=this.setSpacing(e,"right");r=_$1.orderBy(i,["spacing"],["asc"])}else if("center"==t){var o=this.splitArrayForCenter(e,"left");r=[_$1.orderBy(o.true,["center.x"],["asc"]),_$1.orderBy(o.false,["center.x"],["desc"])]}else if("spaceBetween"==t){o=this.splitArrayForCenter(e,"left");r=[_$1.orderBy(o.true,["center.x"],["desc"]),_$1.orderBy(o.false,["center.x"],["asc"])]}else r=_$1.orderBy(e,["baseData.left"],["asc"]);return r},e.prototype.getSpacing=function(e,t){var r=e.x,n=e.y,i=t.x,o=t.y,a=Math.abs(r-i),s=Math.abs(n-o);return Math.sqrt(a*a+s*s)},e.prototype.creatPosition=function(e,t){var r=0,n=0;return e?("left"===t?(r=e.left,n=e.top):"right"===t&&(r=e.left+e.width,n=e.top),{x:r,y:n}):{x:r,y:n}},e.prototype.setEndPoisiton=function(e){if(e){var t=e.width,r=e.height;this.curtain=e,this.endPoisiton.x=t,this.endPoisiton.y=r}},e.prototype.setSpacing=function(e,t){var r,n=this;return"left"===t?r=this.startPoisiton:"right"===t&&(r=this.endPoisiton),e.forEach((function(e){var i=e.baseData;if(i){var o=n.creatPosition(i,t),a=n.getSpacing(o,r);e.spacing=a}})),e},e.prototype.setCenter=function(e){return e.forEach((function(e){if(e.baseData){var t=e.baseData.left+e.baseData.width/2,r=e.baseData.top+e.baseData.height/2;e.center={x:t,y:r}}})),e},e.prototype.splitArrayForCenter=function(e,t){var r,n=this,i=this.setCenter(e);return"left"!=t&&"right"!=t||(r=_$1.groupBy(i,(function(e){return e.center.x>=n.curtain.width/2}))),"top"!=t&&"bottom"!=t||(r=_$1.groupBy(i,(function(e){return e.center.y>=n.curtain.height/2}))),r},e.prototype._add=function(e,t){this.timeLine.add(e,t)},e.prototype._creatTl=function(e){var t=gsapWithCSS.timeline();return t.add(this._creatTw(e)),t},e.prototype._creatTw=function(e){var t=this.goAnimationParams.params,r=t.delay,n=t.duration,i=t.repeat,o=t.type,a=t.value;return a&&a.length&&a.forEach((function(e){e.delay=r||0,e.repeat=i||0})),gsapWithCSS[o](e,n,a[0],a[1])},e.prototype.in=function(){},e.prototype.out=function(){},e}(),index=GoAnimation.getInstance(),findItemDeep=function(e,t,r){var n=!1,i=function(e){for(var o=0;o<e.length;o++){if(e[o].cid==t){n=e[o],r&&_$1.remove(e,(function(e){return e.cid==t}));break}if(e[o].children)i(e[o].children);else if(e[o].dynamicChildren){if(e[o].dynamicChildren instanceof Map){for(var a=Array.from(e[o].dynamicChildren),s=0;s<a.length;s++)if(a[s]instanceof Array){var c=a[s][1];i(c)}}else if(e[o].dynamicChildren instanceof Array)for(a=e[o].dynamicChildren,s=0;s<a.length;s++)if(a[s]instanceof Array){c=a[s][1];i(c)}}else e[o].stateChildren&&i(e[o].stateChildren)}};return i(e),n||!1};function mitt(e,t){return e=e||new Map,__assign$1(__assign$1({},t),{EventType:e,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);if(n){var i=n.slice().map((function(e){return e(r)}));if(i&&1==i.length)return i[0]}(n=e.get("*"))&&n.slice().map((function(e){e(t,r)}))}})}var RuntimeServer=function(){function e(e){this.root=null,this.vuex=Go.getInstance().VueServer,this.eventType=new Map,(null==e?void 0:e.root)&&(this.root=e.root);var t={setGlobalVar:this.setGlobalVar.bind(this),showComponent:this._showComponent.bind(this),hideComponent:this._hideComponent.bind(this),pageChange:this.pageChange.bind(this),changeDynamicState:this.changeDynamicState.bind(this)};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.eventType.set(r,[t[r]])}return e.prototype.findComponentDownward=function(e,t){var r=e.$children;if(r.length)for(var n=0,i=r;n<i.length;n++){var o=i[n];o.$options&&o.$options.propsData&&o.$options.propsData.cid&&(t[o.$options.propsData.cid]=o),o.$children&&o.$children.length&&this.findComponentDownward(o,t)}return t},e.prototype.getAllComponents=function(){var e={};return this.findComponentDownward(this.root,e),e},e.prototype.getComponentByCid=function(e){try{var t=this.getAllComponents()[e];if(!t)throw new Error("The instance was not found");return t}catch(e){console.warn(e)}},e.prototype.getElementByCid=function(e){try{if(!e)throw new Error("Please input the parameters correctly");var t=this.getComponentByCid(e);if(!t)throw new Error("The element was not found");return t.$el}catch(e){console.warn(e)}},e.prototype.setGlobalVar=function(e){try{var t=e.key,r=e.value;if(!(e&&t&&r))throw new Error("An error occurred. Please check whether the incoming parameters are correct! The correct format of data is an object containing key and value");this.setVars(e)}catch(e){console.warn(e)}},e.prototype._showComponent=function(e){try{if(!e)throw new Error("Please input the parameters correctly");this.changeVis({cid:e,flag:!0})}catch(e){console.warn(e)}},e.prototype._hideComponent=function(e){try{if(!e)throw new Error("Please input the parameters correctly");this.changeVis({cid:e,flag:!1})}catch(e){console.warn(e)}},e.prototype.getList=function(e){return e&&"id"===e?this.vuex.callState("list").map((function(e){return e.cid})):this.vuex.callState("list")},e.prototype.getTheme=function(e){var t=this.vuex.callState("theme");return e&&e(t),t},e.prototype.getElement=function(e){var t=this.vuex.callState("list");return findItemDeep(t,e)},e.prototype.changeVis=function(e){return this.vuex.callMutation("changeShow",e)},e.prototype.comToggle=function(e){return this.vuex.callMutation("comToggle",e)},e.prototype.getPageInfo=function(e){var t=this.vuex.callState("caseInfo");return e&&e(t),(null==t?void 0:t.details)?t.details.map((function(e){return{name:e.caseDetailName,path:e.caseDetailPath,id:e.id}})):t},e.prototype.updateComp=function(e){return this.vuex.callMutation("updatComs",e)},e.prototype.changeDynamicState=function(e){return this.vuex.callMutation("changeDynamicState",e)},e.prototype.pageChange=function(e){return this.vuex.callMutation("setPageId",e)},e.prototype.pagePush=function(e,t,r){return void 0===r&&(r={}),this.vuex.callMutation("pagePush",{type:e,value:t,option:r})},e.prototype.activeState=function(e,t){return this.vuex.callMutation("setDynamicActive",{cid:e,name:t})},e.prototype.getVars=function(e){var t=ve.getAllVariables();return e&&e(t),t},e.prototype.setVars=function(e){var t=ve.getVariable(e.key);if(2!=(null==t?void 0:t.model))return this.vuex.callAction("goEditVar",e);console.warn("系统变量禁止修改!")},e}(),Run=function(e){function t(t){var r=e.call(this,t)||this,n=mitt(r.eventType);return r.$emit=n.emit,r.$on=n.on,r.$off=n.off,r}return __extends$2(t,e),Object.defineProperty(t.prototype,"Theme",{get:function(){return this.getTheme()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Components",{get:function(){return this.getAllComponents()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"GlobalVars",{get:function(){return this.getVars()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Pages",{get:function(){return this.getPageInfo()},enumerable:!1,configurable:!0}),t.prototype.getElementById=function(e){this.getElementByCid(e)},t.prototype.getComponentById=function(e){this.getComponentByCid(e)},t.prototype.getPage=function(){},t}(RuntimeServer),G=function(){function e(e){this.$action=new GoEvent(e),this.instance=new Run(e)}return e.prototype.getGlobalvars=function(){for(var e=ve.getAllVariables(),t=e.map((function(e){return e.mapField})),r={},n=function(t){var n=e.find((function(e){return e.mapField==t}));n&&(r[t]=n.value)},i=0,o=t;i<o.length;i++){n(o[i])}var a=this.instance;return new Proxy(r,{has:function(e,t){return!t&&t in e},get:function(e,t){if(t in e)return e[t];throw new ReferenceError('Prop name "'+t+'" does not exist.')},set:function(e,t,r){if(!e[t])return console.log("变量不存在/不能被修改"),!1;if(e[t]=r,!t||"string"!=typeof t)throw new Error("Invalid key");a.setGlobalVar({key:t,value:r})}})},Object.defineProperty(e.prototype,"globalvars",{get:function(){return this.getGlobalvars()},enumerable:!1,configurable:!0}),e}(),GoEvent=function(e){var t=this;this.setGlobalVars=function(e,r){if(!e||"string"!=typeof e)throw new Error("Invalid key");t.instance.setGlobalVar({key:e,value:r})},this.skipTo=function(e){var r=null==e?void 0:e.params;if(!e||0===Object.keys(e).length)throw new Error("事件跳转发生错误:参数:".concat(e," 不正确,请正确填写!doc: https://anov.cucloud.cn/anov-go-doc/"));if(e.name)t.instance.pagePush("name",e.name,r);else if(e.path)t.instance.pagePush("path",e.path,r);else{if(!e.url)throw new Error("事件跳转发生错误:参数:".concat(e," 不正确,请正确填写!doc: https://anov.cucloud.cn/anov-go-doc/"));window.open(e.url)}},this.toggle=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e)if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance.comToggle(i):console.warn("请传入正确的参数!")}else console.warn("请传入正确的参数!");else t.instance.comToggle(e);else console.warn("请传入正确的参数!")},this.show=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance._showComponent(i.toString()):console.warn("请传入正确的参数!")}}else t.instance._showComponent(e.toString());else console.warn("请传入正确的参数!")},this.hide=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance._hideComponent(i):console.warn("请传入正确的参数!")}}else t.instance._hideComponent(e);else console.warn("请传入正确的参数!")},this.activeState=function(e,r){t.instance.activeState(e,r)},this.updateComp=function(e){if(e)if("string"!=typeof e&&"number"!=typeof e){if(Array.isArray(e))for(var r=0,n=e;r<n.length;r++){var i=n[r];"string"==typeof i||"number"==typeof i?t.instance.updateComp(i):console.warn("请传入正确的参数!")}}else t.instance.updateComp(e);else console.warn("请传入正确的参数!")},this.instance=new Run(e)},run=function(e){return new G(e)},getDataForRelease=function(e,t){console.log("弃用")},createComponent=function(e,t){return t&&e?Go.getInstance().render(e,t):e?Go.getInstance().render(e):void 0},createComponentForParent=function(e,t,r){return void 0!==r&&e?Go.getInstance().renderForParent(e,t,r):e?Go.getInstance().renderForParent(e,t):void 0},emitEvent=function(e,t){return Go.getInstance().emitEvent(e,t||function(){})},log=function(){};exports.Go=Go,exports.GoAnimation=index,exports.Tool=index$1,exports.createComponent=createComponent,exports.createComponentForParent=createComponentForParent,exports.emitEvent=emitEvent,exports.fxhr=index$2,exports.getDataForRelease=getDataForRelease,exports.goUtils=index$3,exports.log=log,exports.refreshData=refreshData,exports.run=run,exports.store=store}));
|
|
64
64
|
//# sourceMappingURL=code.umd.js.map
|