@drincs/pixi-vn 1.8.4 → 1.8.7
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/ContainerMemory-BjcfYRU7.d.cts +392 -0
- package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
- package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
- package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
- package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
- package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
- package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
- package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
- package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
- package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
- package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
- package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
- package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
- package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
- package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
- package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +54 -464
- package/dist/canvas.d.ts +54 -464
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +5 -5
- package/dist/characters.d.ts +5 -5
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-Z4GZCINS.mjs → chunk-3M6A7TU2.mjs} +1 -1
- package/dist/chunk-BQRPDCUT.mjs +1 -0
- package/dist/{chunk-YCWXA3OR.mjs → chunk-IFPF4NRX.mjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -114
- package/dist/core.d.ts +5 -114
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +7 -11
- package/dist/history.d.ts +7 -11
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +20 -826
- package/dist/index.d.ts +20 -826
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +57 -22
- package/dist/narration.d.ts +57 -22
- package/dist/narration.mjs +1 -1
- package/dist/pixi/index.d.cts +12 -0
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +4 -435
- package/dist/sound.d.ts +4 -435
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +4 -27
- package/dist/storage.d.ts +4 -27
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.d.cts +1 -1
- package/dist/vite-listener.d.ts +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +1 -1
- package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
- package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
- package/dist/chunk-V34PMA2H.mjs +0 -1
package/dist/characters.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var se=Object.defineProperty;var Xt=c=>{throw TypeError(c)};var ae=(c,i,e)=>i in c?se(c,i,{enumerable:true,configurable:true,writable:true,value:e}):c[i]=e;var _=(c,i,e)=>ae(c,typeof i!="symbol"?i+"":i,e),Yt=(c,i,e)=>i.has(c)||Xt("Cannot "+e);var t=(c,i,e)=>(Yt(c,i,"read from private field"),e?e.call(c):i.get(c)),m=(c,i,e)=>i.has(c)?Xt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(c):i.set(c,e),f=(c,i,e,r)=>(Yt(c,i,"write to private field"),i.set(c,e),e),h=(c,i,e)=>(Yt(c,i,"access private method"),e);var Mt=(c,i,e,r)=>({set _(a){f(c,i,a);},get _(){return t(c,i,r)}});var st="storage",ut="temp",Ft="flags",z={CHARACTER_CATEGORY_KEY:"character"};var oe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zt=new Set,Kt=typeof process=="object"&&process?process:{},te=(c,i,e,r)=>{typeof Kt.emitWarning=="function"?Kt.emitWarning(c,i,e,r):console.error(`[${e}] ${i}: ${c}`);},Ut=globalThis.AbortController,Jt=globalThis.AbortSignal;if(typeof Ut>"u"){Jt=class{constructor(){_(this,"onabort");_(this,"_onabort",[]);_(this,"reason");_(this,"aborted",false);}addEventListener(e,r){this._onabort.push(r);}},Ut=class{constructor(){_(this,"signal",new Jt);i();}abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=true;for(let r of this.signal._onabort)r(e);this.signal.onabort?.(e);}}};let c=Kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",i=()=>{c&&(c=false,te("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",i));};}var ne=c=>!Zt.has(c);var at=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),ee=c=>at(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?Gt:null:null,Gt=class extends Array{constructor(c){super(c),this.fill(0);}},it,St,le=(it=class{constructor(i,e){_(this,"heap");_(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(i),this.length=0;}static create(i){let e=ee(i);if(!e)return [];f(it,St,true);let r=new it(i,e);return f(it,St,false),r}push(i){this.heap[this.length++]=i;}pop(){return this.heap[--this.length]}},St=new WeakMap,m(it,St,false),it),qt,Qt,j,P,k,ft,B,Et,Tt,X,C,J,R,w,g,V,Y,M,D,q,N,Q,Z,K,W,tt,ht,L,yt,n,Wt,gt,rt,Ct,H,re,dt,bt,It,ot,nt,Ht,Vt,Lt,v,$t,Rt,lt,jt,At,ie=(At=class{constructor(i){m(this,n);m(this,j);m(this,P);m(this,k);m(this,ft);m(this,B);m(this,Et);m(this,Tt);m(this,X);_(this,"ttl");_(this,"ttlResolution");_(this,"ttlAutopurge");_(this,"updateAgeOnGet");_(this,"updateAgeOnHas");_(this,"allowStale");_(this,"noDisposeOnSet");_(this,"noUpdateTTL");_(this,"maxEntrySize");_(this,"sizeCalculation");_(this,"noDeleteOnFetchRejection");_(this,"noDeleteOnStaleGet");_(this,"allowStaleOnFetchAbort");_(this,"allowStaleOnFetchRejection");_(this,"ignoreFetchAbort");m(this,C);m(this,J);m(this,R);m(this,w);m(this,g);m(this,V);m(this,Y);m(this,M);m(this,D);m(this,q);m(this,N);m(this,Q);m(this,Z);m(this,K);m(this,W);m(this,tt);m(this,ht);m(this,L);m(this,yt);m(this,gt,()=>{});m(this,rt,()=>{});m(this,Ct,()=>{});m(this,H,()=>false);m(this,dt,i=>{});m(this,bt,(i,e,r)=>{});m(this,It,(i,e,r,a)=>{if(r||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});_(this,qt,"LRUCache");let{max:e=0,ttl:r,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:u,dispose:E,onInsert:I,disposeAfter:d,noDisposeOnSet:b,noUpdateTTL:y,maxSize:T=0,maxEntrySize:A=0,sizeCalculation:O,fetchMethod:p,memoMethod:F,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:xt,ignoreFetchAbort:pt,perf:_t}=i;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,_t??oe),e!==0&&!at(e))throw new TypeError("max option must be a nonnegative integer");let mt=e?ee(e):Array;if(!mt)throw new Error("invalid max value: "+e);if(f(this,j,e),f(this,P,T),this.maxEntrySize=A||t(this,P),this.sizeCalculation=O,this.sizeCalculation){if(!t(this,P)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(F!==void 0&&typeof F!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,Tt,F),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,Et,p),f(this,ht,!!p),f(this,R,new Map),f(this,w,new Array(e).fill(void 0)),f(this,g,new Array(e).fill(void 0)),f(this,V,new mt(e)),f(this,Y,new mt(e)),f(this,M,0),f(this,D,0),f(this,q,le.create(e)),f(this,C,0),f(this,J,0),typeof E=="function"&&f(this,k,E),typeof I=="function"&&f(this,ft,I),typeof d=="function"?(f(this,B,d),f(this,N,[])):(f(this,B,void 0),f(this,N,void 0)),f(this,tt,!!t(this,k)),f(this,yt,!!t(this,ft)),f(this,L,!!t(this,B)),this.noDisposeOnSet=!!b,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!pt,this.maxEntrySize!==0){if(t(this,P)!==0&&!at(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,n,re).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=at(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,n,Wt).call(this);}if(t(this,j)===0&&this.ttl===0&&t(this,P)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,j)&&!t(this,P)){let Pt="LRU_CACHE_UNBOUNDED";ne(Pt)&&(Zt.add(Pt),te("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,At));}}get perf(){return t(this,X)}static unsafeExposeInternals(i){return {starts:t(i,Z),ttls:t(i,K),autopurgeTimers:t(i,W),sizes:t(i,Q),keyMap:t(i,R),keyList:t(i,w),valList:t(i,g),next:t(i,V),prev:t(i,Y),get head(){return t(i,M)},get tail(){return t(i,D)},free:t(i,q),isBackgroundFetch:e=>{var r;return h(r=i,n,v).call(r,e)},backgroundFetch:(e,r,a,o)=>{var s;return h(s=i,n,Lt).call(s,e,r,a,o)},moveToTail:e=>{var r;return h(r=i,n,Rt).call(r,e)},indexes:e=>{var r;return h(r=i,n,ot).call(r,e)},rindexes:e=>{var r;return h(r=i,n,nt).call(r,e)},isStale:e=>{var r;return t(r=i,H).call(r,e)}}}get max(){return t(this,j)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,J)}get size(){return t(this,C)}get fetchMethod(){return t(this,Et)}get memoMethod(){return t(this,Tt)}get dispose(){return t(this,k)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,B)}getRemainingTTL(i){return t(this,R).has(i)?1/0:0}*entries(){for(let i of h(this,n,ot).call(this))t(this,g)[i]!==void 0&&t(this,w)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield [t(this,w)[i],t(this,g)[i]]);}*rentries(){for(let i of h(this,n,nt).call(this))t(this,g)[i]!==void 0&&t(this,w)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield [t(this,w)[i],t(this,g)[i]]);}*keys(){for(let i of h(this,n,ot).call(this)){let e=t(this,w)[i];e!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield e);}}*rkeys(){for(let i of h(this,n,nt).call(this)){let e=t(this,w)[i];e!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield e);}}*values(){for(let i of h(this,n,ot).call(this))t(this,g)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield t(this,g)[i]);}*rvalues(){for(let i of h(this,n,nt).call(this))t(this,g)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield t(this,g)[i]);}[(Qt=Symbol.iterator,qt=Symbol.toStringTag,Qt)](){return this.entries()}find(i,e={}){for(let r of h(this,n,ot).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;if(o!==void 0&&i(o,t(this,w)[r],this))return this.get(t(this,w)[r],e)}}forEach(i,e=this){for(let r of h(this,n,ot).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&i.call(e,o,t(this,w)[r],this);}}rforEach(i,e=this){for(let r of h(this,n,nt).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&i.call(e,o,t(this,w)[r],this);}}purgeStale(){let i=false;for(let e of h(this,n,nt).call(this,{allowStale:true}))t(this,H).call(this,e)&&(h(this,n,lt).call(this,t(this,w)[e],"expire"),i=true);return i}info(i){let e=t(this,R).get(i);if(e===void 0)return;let r=t(this,g)[e],a=h(this,n,v).call(this,r)?r.__staleWhileFetching:r;if(a===void 0)return;let o={value:a};if(t(this,K)&&t(this,Z)){let s=t(this,K)[e],l=t(this,Z)[e];if(s&&l){let u=s-(t(this,X).now()-l);o.ttl=u,o.start=Date.now();}}return t(this,Q)&&(o.size=t(this,Q)[e]),o}dump(){let i=[];for(let e of h(this,n,ot).call(this,{allowStale:true})){let r=t(this,w)[e],a=t(this,g)[e],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;if(o===void 0||r===void 0)continue;let s={value:o};if(t(this,K)&&t(this,Z)){s.ttl=t(this,K)[e];let l=t(this,X).now()-t(this,Z)[e];s.start=Math.floor(Date.now()-l);}t(this,Q)&&(s.size=t(this,Q)[e]),i.unshift([r,s]);}return i}load(i){this.clear();for(let[e,r]of i){if(r.start){let a=Date.now()-r.start;r.start=t(this,X).now()-a;}this.set(e,r.value,r);}}set(i,e,r={}){var b,y,T,A;if(e===void 0)return this.delete(i),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=r,{noUpdateTTL:E=this.noUpdateTTL}=r,I=t(this,It).call(this,i,e,r.size||0,l);if(this.maxEntrySize&&I>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,n,lt).call(this,i,"set"),this;let d=t(this,C)===0?void 0:t(this,R).get(i);if(d===void 0)d=t(this,C)===0?t(this,D):t(this,q).length!==0?t(this,q).pop():t(this,C)===t(this,j)?h(this,n,Vt).call(this,false):t(this,C),t(this,w)[d]=i,t(this,g)[d]=e,t(this,R).set(i,d),t(this,V)[t(this,D)]=d,t(this,Y)[d]=t(this,D),f(this,D,d),Mt(this,C)._++,t(this,bt).call(this,d,I,u),u&&(u.set="add"),E=false,t(this,yt)&&((b=t(this,ft))==null||b.call(this,e,i,"add"));else {h(this,n,Rt).call(this,d);let O=t(this,g)[d];if(e!==O){if(t(this,ht)&&h(this,n,v).call(this,O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=O;p!==void 0&&!s&&(t(this,tt)&&((y=t(this,k))==null||y.call(this,p,i,"set")),t(this,L)&&t(this,N)?.push([p,i,"set"]));}else s||(t(this,tt)&&((T=t(this,k))==null||T.call(this,O,i,"set")),t(this,L)&&t(this,N)?.push([O,i,"set"]));if(t(this,dt).call(this,d),t(this,bt).call(this,d,I,u),t(this,g)[d]=e,u){u.set="replace";let p=O&&h(this,n,v).call(this,O)?O.__staleWhileFetching:O;p!==void 0&&(u.oldValue=p);}}else u&&(u.set="update");t(this,yt)&&this.onInsert?.(e,i,e===O?"update":"replace");}if(a!==0&&!t(this,K)&&h(this,n,Wt).call(this),t(this,K)&&(E||t(this,Ct).call(this,d,a,o),u&&t(this,rt).call(this,u,d)),!s&&t(this,L)&&t(this,N)){let O=t(this,N),p;for(;p=O?.shift();)(A=t(this,B))==null||A.call(this,...p);}return this}pop(){var i;try{for(;t(this,C);){let e=t(this,g)[t(this,M)];if(h(this,n,Vt).call(this,!0),h(this,n,v).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(t(this,L)&&t(this,N)){let e=t(this,N),r;for(;r=e?.shift();)(i=t(this,B))==null||i.call(this,...r);}}}has(i,e={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:a}=e,o=t(this,R).get(i);if(o!==void 0){let s=t(this,g)[o];if(h(this,n,v).call(this,s)&&s.__staleWhileFetching===void 0)return false;if(t(this,H).call(this,o))a&&(a.has="stale",t(this,rt).call(this,a,o));else return r&&t(this,gt).call(this,o),a&&(a.has="hit",t(this,rt).call(this,a,o)),true}else a&&(a.has="miss");return false}peek(i,e={}){let{allowStale:r=this.allowStale}=e,a=t(this,R).get(i);if(a===void 0||!r&&t(this,H).call(this,a))return;let o=t(this,g)[a];return h(this,n,v).call(this,o)?o.__staleWhileFetching:o}async fetch(i,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:A,forceRefresh:O=false,status:p,signal:F}=e;if(!t(this,ht))return p&&(p.fetch="get"),this.get(i,{allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:p});let U={allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:l,size:u,sizeCalculation:E,noUpdateTTL:I,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:T,ignoreFetchAbort:y,status:p,signal:F},G=t(this,R).get(i);if(G===void 0){p&&(p.fetch="miss");let x=h(this,n,Lt).call(this,i,G,U,A);return x.__returned=x}else {let x=t(this,g)[G];if(h(this,n,v).call(this,x)){let mt=r&&x.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",mt&&(p.returnedStale=true)),mt?x.__staleWhileFetching:x.__returned=x}let xt=t(this,H).call(this,G);if(!O&&!xt)return p&&(p.fetch="hit"),h(this,n,Rt).call(this,G),a&&t(this,gt).call(this,G),p&&t(this,rt).call(this,p,G),x;let pt=h(this,n,Lt).call(this,i,G,U,A),_t=pt.__staleWhileFetching!==void 0&&r;return p&&(p.fetch=xt?"stale":"refresh",_t&&xt&&(p.returnedStale=true)),_t?pt.__staleWhileFetching:pt.__returned=pt}}async forceFetch(i,e={}){let r=await this.fetch(i,e);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(i,e={}){let r=t(this,Tt);if(!r)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...s}=e,l=this.get(i,s);if(!o&&l!==void 0)return l;let u=r(i,l,{options:s,context:a});return this.set(i,u,s),u}get(i,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=e,l=t(this,R).get(i);if(l!==void 0){let u=t(this,g)[l],E=h(this,n,v).call(this,u);return s&&t(this,rt).call(this,s,l),t(this,H).call(this,l)?(s&&(s.get="stale"),E?(s&&r&&u.__staleWhileFetching!==void 0&&(s.returnedStale=true),r?u.__staleWhileFetching:void 0):(o||h(this,n,lt).call(this,i,"expire"),s&&r&&(s.returnedStale=true),r?u:void 0)):(s&&(s.get="hit"),E?u.__staleWhileFetching:(h(this,n,Rt).call(this,l),a&&t(this,gt).call(this,l),u))}else s&&(s.get="miss");}delete(i){return h(this,n,lt).call(this,i,"delete")}clear(){return h(this,n,jt).call(this,"delete")}},j=new WeakMap,P=new WeakMap,k=new WeakMap,ft=new WeakMap,B=new WeakMap,Et=new WeakMap,Tt=new WeakMap,X=new WeakMap,C=new WeakMap,J=new WeakMap,R=new WeakMap,w=new WeakMap,g=new WeakMap,V=new WeakMap,Y=new WeakMap,M=new WeakMap,D=new WeakMap,q=new WeakMap,N=new WeakMap,Q=new WeakMap,Z=new WeakMap,K=new WeakMap,W=new WeakMap,tt=new WeakMap,ht=new WeakMap,L=new WeakMap,yt=new WeakMap,n=new WeakSet,Wt=function(){let i=new Gt(t(this,j)),e=new Gt(t(this,j));f(this,K,i),f(this,Z,e);let r=this.ttlAutopurge?new Array(t(this,j)):void 0;f(this,W,r),f(this,Ct,(l,u,E=t(this,X).now())=>{e[l]=u!==0?E:0,i[l]=u,a(l,u);}),f(this,gt,l=>{e[l]=i[l]!==0?t(this,X).now():0,a(l,i[l]);});let a=this.ttlAutopurge?(l,u)=>{if(r?.[l]&&(clearTimeout(r[l]),r[l]=void 0),u&&u!==0&&r){let E=setTimeout(()=>{t(this,H).call(this,l)&&h(this,n,lt).call(this,t(this,w)[l],"expire");},u+1);E.unref&&E.unref(),r[l]=E;}}:()=>{};f(this,rt,(l,u)=>{if(i[u]){let E=i[u],I=e[u];if(!E||!I)return;l.ttl=E,l.start=I,l.now=o||s();let d=l.now-I;l.remainingTTL=E-d;}});let o=0,s=()=>{let l=t(this,X).now();if(this.ttlResolution>0){o=l;let u=setTimeout(()=>o=0,this.ttlResolution);u.unref&&u.unref();}return l};this.getRemainingTTL=l=>{let u=t(this,R).get(l);if(u===void 0)return 0;let E=i[u],I=e[u];if(!E||!I)return 1/0;let d=(o||s())-I;return E-d},f(this,H,l=>{let u=e[l],E=i[l];return !!E&&!!u&&(o||s())-u>E});},gt=new WeakMap,rt=new WeakMap,Ct=new WeakMap,H=new WeakMap,re=function(){let i=new Gt(t(this,j));f(this,J,0),f(this,Q,i),f(this,dt,e=>{f(this,J,t(this,J)-i[e]),i[e]=0;}),f(this,It,(e,r,a,o)=>{if(h(this,n,v).call(this,r))return 0;if(!at(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(r,e),!at(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,bt,(e,r,a)=>{if(i[e]=r,t(this,P)){let o=t(this,P)-i[e];for(;t(this,J)>o;)h(this,n,Vt).call(this,true);}f(this,J,t(this,J)+i[e]),a&&(a.entrySize=r,a.totalCalculatedSize=t(this,J));});},dt=new WeakMap,bt=new WeakMap,It=new WeakMap,ot=function*({allowStale:i=this.allowStale}={}){if(t(this,C))for(let e=t(this,D);!(!h(this,n,Ht).call(this,e)||((i||!t(this,H).call(this,e))&&(yield e),e===t(this,M)));)e=t(this,Y)[e];},nt=function*({allowStale:i=this.allowStale}={}){if(t(this,C))for(let e=t(this,M);!(!h(this,n,Ht).call(this,e)||((i||!t(this,H).call(this,e))&&(yield e),e===t(this,D)));)e=t(this,V)[e];},Ht=function(i){return i!==void 0&&t(this,R).get(t(this,w)[i])===i},Vt=function(i){var o;let e=t(this,M),r=t(this,w)[e],a=t(this,g)[e];return t(this,ht)&&h(this,n,v).call(this,a)?a.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((o=t(this,k))==null||o.call(this,a,r,"evict")),t(this,L)&&t(this,N)?.push([a,r,"evict"])),t(this,dt).call(this,e),t(this,W)?.[e]&&(clearTimeout(t(this,W)[e]),t(this,W)[e]=void 0),i&&(t(this,w)[e]=void 0,t(this,g)[e]=void 0,t(this,q).push(e)),t(this,C)===1?(f(this,M,f(this,D,0)),t(this,q).length=0):f(this,M,t(this,V)[e]),t(this,R).delete(r),Mt(this,C)._--,e},Lt=function(i,e,r,a){let o=e===void 0?void 0:t(this,g)[e];if(h(this,n,v).call(this,o))return o;let s=new Ut,{signal:l}=r;l?.addEventListener("abort",()=>s.abort(l.reason),{signal:s.signal});let u={signal:s.signal,options:r,context:a},E=(A,O=false)=>{let{aborted:p}=s.signal,F=r.ignoreFetchAbort&&A!==void 0,U=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&A!==void 0);if(r.status&&(p&&!O?(r.status.fetchAborted=true,r.status.fetchError=s.signal.reason,F&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),p&&!F&&!O)return d(s.signal.reason,U);let G=y,x=t(this,g)[e];return (x===y||F&&O&&x===void 0)&&(A===void 0?G.__staleWhileFetching!==void 0?t(this,g)[e]=G.__staleWhileFetching:h(this,n,lt).call(this,i,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(i,A,u.options))),A},I=A=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=A),d(A,false)),d=(A,O)=>{let{aborted:p}=s.signal,F=p&&r.allowStaleOnFetchAbort,U=F||r.allowStaleOnFetchRejection,G=U||r.noDeleteOnFetchRejection,x=y;if(t(this,g)[e]===y&&(!G||!O&&x.__staleWhileFetching===void 0?h(this,n,lt).call(this,i,"fetch"):F||(t(this,g)[e]=x.__staleWhileFetching)),U)return r.status&&x.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw A},b=(A,O)=>{var F;let p=(F=t(this,Et))==null?void 0:F.call(this,i,o,u);p&&p instanceof Promise&&p.then(U=>A(U===void 0?void 0:U),O),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(A(void 0),r.allowStaleOnFetchAbort&&(A=U=>E(U,true)));});};r.status&&(r.status.fetchDispatched=true);let y=new Promise(b).then(E,I),T=Object.assign(y,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return e===void 0?(this.set(i,T,{...u.options,status:void 0}),e=t(this,R).get(i)):t(this,g)[e]=T,T},v=function(i){if(!t(this,ht))return false;let e=i;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ut},$t=function(i,e){t(this,Y)[e]=i,t(this,V)[i]=e;},Rt=function(i){i!==t(this,D)&&(i===t(this,M)?f(this,M,t(this,V)[i]):h(this,n,$t).call(this,t(this,Y)[i],t(this,V)[i]),h(this,n,$t).call(this,t(this,D),i),f(this,D,i));},lt=function(i,e){var a,o;let r=false;if(t(this,C)!==0){let s=t(this,R).get(i);if(s!==void 0)if(t(this,W)?.[s]&&(clearTimeout(t(this,W)?.[s]),t(this,W)[s]=void 0),r=true,t(this,C)===1)h(this,n,jt).call(this,e);else {t(this,dt).call(this,s);let l=t(this,g)[s];if(h(this,n,v).call(this,l)?l.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((a=t(this,k))==null||a.call(this,l,i,e)),t(this,L)&&t(this,N)?.push([l,i,e])),t(this,R).delete(i),t(this,w)[s]=void 0,t(this,g)[s]=void 0,s===t(this,D))f(this,D,t(this,Y)[s]);else if(s===t(this,M))f(this,M,t(this,V)[s]);else {let u=t(this,Y)[s];t(this,V)[u]=t(this,V)[s];let E=t(this,V)[s];t(this,Y)[E]=t(this,Y)[s];}Mt(this,C)._--,t(this,q).push(s);}}if(t(this,L)&&t(this,N)?.length){let s=t(this,N),l;for(;l=s?.shift();)(o=t(this,B))==null||o.call(this,...l);}return r},jt=function(i){var e,r;for(let a of h(this,n,nt).call(this,{allowStale:true})){let o=t(this,g)[a];if(h(this,n,v).call(this,o))o.__abortController.abort(new Error("deleted"));else {let s=t(this,w)[a];t(this,tt)&&((e=t(this,k))==null||e.call(this,o,s,i)),t(this,L)&&t(this,N)?.push([o,s,i]);}}if(t(this,R).clear(),t(this,g).fill(void 0),t(this,w).fill(void 0),t(this,K)&&t(this,Z)){t(this,K).fill(0),t(this,Z).fill(0);for(let a of t(this,W)??[])a!==void 0&&clearTimeout(a);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),f(this,M,0),f(this,D,0),t(this,q).length=0,f(this,J,0),f(this,C,0),t(this,L)&&t(this,N)){let a=t(this,N),o;for(;o=a?.shift();)(r=t(this,B))==null||r.call(this,...o);}},At);var ct=class{constructor(i){_(this,"cache");_(this,"map",new Map);this.cache=new ie({max:i.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(i){let e=this.map.delete(i);return e&&this.cache.delete(i),e}get forEach(){return this.map.forEach}get(i){let e=this.cache.get(i);return e||this.map.get(i)}has(i){return this.map.has(i)}set(i,e){return this.map.set(i,e),this.cache.set(i,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var et;(a=>(a.log=(o,...s)=>console.log(`[Pixi\u2019VN] ${o}`,...s),a.warn=(o,...s)=>console.warn(`[Pixi\u2019VN] ${o}`,...s),a.error=(o,...s)=>console.error(`[Pixi\u2019VN] ${o}`,...s),a.info=(o,...s)=>console.info(`[Pixi\u2019VN] ${o}`,...s)))(et||(et={}));function Dt(c){try{if(typeof c>"u")return c;let i=JSON.stringify(c);return JSON.parse(i)}catch(i){throw et.error("Error creating exportable element",c,i),new core.PixiError("not_json_serializable","Error creating exportable element")}}var kt;(d=>{d.storage=new ct({cacheSize:50}),d.defaultStorage=new ct({cacheSize:10}),d.tempStorageDeadlines=new Map;let r;function a(b){d.tempStorageDeadlines.forEach((y,T)=>{y>b&&(d.storage.delete(`${ut}:${T}`),r?.onClearOldTempVariable?.(T),d.tempStorageDeadlines.delete(T));});}d.clearOldTempVariables=a;function o(b){r=b;}d.setExternalStoreHandler=o;function s(b,y,T){T==null?d.storage.delete(`${b}:${y}`):d.storage.set(`${b}:${y}`,T),r?.onSetVariable?.(y,T);}d.setVariable=s;function l(b,y){let T=d.storage.get(`${b}:${y}`);return Dt(T)}d.getVariable=l;function u(b,y){d.storage.delete(`${b}:${y}`),r?.onRemoveVariable?.(y);}d.removeVariable=u;function E(b,y){let T=d.storage.get(Ft)||[];if(y)T.includes(b)||T.push(b);else {let A=T.indexOf(b);A>-1&&T.splice(A,1);}d.storage.set(Ft,T);}d.setFlag=E;function I(b){return (d.storage.get(Ft)||[]).includes(b)}d.getFlag=I;})(kt||(kt={}));var S=kt;var Ot=class{constructor(i,e){_(this,"id");_(this,"categoryId");this.categoryId=i,this.id=e,this.migrateOldStorage();}migrateOldStorage(i=this.categoryId){let e=S.getVariable(st,i);e&&(Object.entries(e).forEach(([r,a])=>{typeof a=="object"&&a!==null&&Object.entries(a).forEach(([o,s])=>{S.setVariable(this.categoryId,`${r}:${o}`,s);});}),S.removeVariable(st,i));}setStorageProperty(i,e){S.setVariable(this.categoryId,`${this.id}:${i}`,e);}getStorageProperty(i,e=this.id){return S.getVariable(this.categoryId,`${e}:${i}`)}};var ue="@",vt=class extends Ot{constructor(e,r=""){super(z.CHARACTER_CATEGORY_KEY,e+(r?ue+r:""));_(this,"sourceId");this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var zt=class extends vt{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);_(this,"defaultName");_(this,"defaultSurname");_(this,"defaultAge");_(this,"icon");_(this,"color");this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}};var wt=new ct({cacheSize:10}),Bt;(o=>{function c(s){try{let l=wt.get(s);if(!l){et.warn(`Character "${s}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return l}catch(l){et.error(`Error while getting Character "${s}"`,l);return}}o.get=c;function i(s){if(Array.isArray(s)){s.forEach(l=>{i(l);});return}wt.get(s.id)&&et.info(`Character id "${s.id}" already exists, it will be overwritten`),wt.set(s.id,s);}o.add=i;function e(){return Array.from(wt.values())}o.values=e;function r(s){return wt.has(s)}o.has=r;function a(){return Array.from(wt.keys())}o.keys=a;})(Bt||(Bt={}));var fe=Bt;exports.CharacterBaseModel=zt;exports.CharacterStoredClass=vt;exports.RegisteredCharacters=fe;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');var se=Object.defineProperty;var kt=c=>{throw TypeError(c)};var ae=(c,i,e)=>i in c?se(c,i,{enumerable:true,configurable:true,writable:true,value:e}):c[i]=e;var _=(c,i,e)=>ae(c,typeof i!="symbol"?i+"":i,e),Yt=(c,i,e)=>i.has(c)||kt("Cannot "+e);var t=(c,i,e)=>(Yt(c,i,"read from private field"),e?e.call(c):i.get(c)),m=(c,i,e)=>i.has(c)?kt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(c):i.set(c,e),f=(c,i,e,r)=>(Yt(c,i,"write to private field"),i.set(c,e),e),h=(c,i,e)=>(Yt(c,i,"access private method"),e);var Mt=(c,i,e,r)=>({set _(a){f(c,i,a);},get _(){return t(c,i,r)}});var st="storage",ut="temp",Ft="flags",z={CHARACTER_CATEGORY_KEY:"character"};var oe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,qt=new Set,Kt=typeof process=="object"&&process?process:{},Qt=(c,i,e,r)=>{typeof Kt.emitWarning=="function"?Kt.emitWarning(c,i,e,r):console.error(`[${e}] ${i}: ${c}`);},Ut=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Ut>"u"){Bt=class{constructor(){_(this,"onabort");_(this,"_onabort",[]);_(this,"reason");_(this,"aborted",false);}addEventListener(e,r){this._onabort.push(r);}},Ut=class{constructor(){_(this,"signal",new Bt);i();}abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=true;for(let r of this.signal._onabort)r(e);this.signal.onabort?.(e);}}};let c=Kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",i=()=>{c&&(c=false,Qt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",i));};}var ne=c=>!qt.has(c);var at=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),Zt=c=>at(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?Gt:null:null,Gt=class extends Array{constructor(c){super(c),this.fill(0);}},et,St,le=(et=class{constructor(i,e){_(this,"heap");_(this,"length");if(!t(et,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(i),this.length=0;}static create(i){let e=Zt(i);if(!e)return [];f(et,St,true);let r=new et(i,e);return f(et,St,false),r}push(i){this.heap[this.length++]=i;}pop(){return this.heap[--this.length]}},St=new WeakMap,m(et,St,false),et),Xt,Jt,j,P,k,ft,B,Et,Tt,X,C,J,R,w,g,V,Y,M,D,q,N,Q,Z,K,W,tt,ht,L,yt,n,Wt,gt,rt,Ct,H,ee,dt,bt,It,ot,nt,Ht,Vt,Lt,v,$t,Rt,lt,jt,At,te=(At=class{constructor(i){m(this,n);m(this,j);m(this,P);m(this,k);m(this,ft);m(this,B);m(this,Et);m(this,Tt);m(this,X);_(this,"ttl");_(this,"ttlResolution");_(this,"ttlAutopurge");_(this,"updateAgeOnGet");_(this,"updateAgeOnHas");_(this,"allowStale");_(this,"noDisposeOnSet");_(this,"noUpdateTTL");_(this,"maxEntrySize");_(this,"sizeCalculation");_(this,"noDeleteOnFetchRejection");_(this,"noDeleteOnStaleGet");_(this,"allowStaleOnFetchAbort");_(this,"allowStaleOnFetchRejection");_(this,"ignoreFetchAbort");m(this,C);m(this,J);m(this,R);m(this,w);m(this,g);m(this,V);m(this,Y);m(this,M);m(this,D);m(this,q);m(this,N);m(this,Q);m(this,Z);m(this,K);m(this,W);m(this,tt);m(this,ht);m(this,L);m(this,yt);m(this,gt,()=>{});m(this,rt,()=>{});m(this,Ct,()=>{});m(this,H,()=>false);m(this,dt,i=>{});m(this,bt,(i,e,r)=>{});m(this,It,(i,e,r,a)=>{if(r||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});_(this,Xt,"LRUCache");let{max:e=0,ttl:r,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:u,dispose:E,onInsert:I,disposeAfter:d,noDisposeOnSet:b,noUpdateTTL:y,maxSize:T=0,maxEntrySize:A=0,sizeCalculation:O,fetchMethod:p,memoMethod:F,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:xt,ignoreFetchAbort:pt,perf:_t}=i;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,_t??oe),e!==0&&!at(e))throw new TypeError("max option must be a nonnegative integer");let mt=e?Zt(e):Array;if(!mt)throw new Error("invalid max value: "+e);if(f(this,j,e),f(this,P,T),this.maxEntrySize=A||t(this,P),this.sizeCalculation=O,this.sizeCalculation){if(!t(this,P)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(F!==void 0&&typeof F!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,Tt,F),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,Et,p),f(this,ht,!!p),f(this,R,new Map),f(this,w,new Array(e).fill(void 0)),f(this,g,new Array(e).fill(void 0)),f(this,V,new mt(e)),f(this,Y,new mt(e)),f(this,M,0),f(this,D,0),f(this,q,le.create(e)),f(this,C,0),f(this,J,0),typeof E=="function"&&f(this,k,E),typeof I=="function"&&f(this,ft,I),typeof d=="function"?(f(this,B,d),f(this,N,[])):(f(this,B,void 0),f(this,N,void 0)),f(this,tt,!!t(this,k)),f(this,yt,!!t(this,ft)),f(this,L,!!t(this,B)),this.noDisposeOnSet=!!b,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!pt,this.maxEntrySize!==0){if(t(this,P)!==0&&!at(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,n,ee).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=at(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,n,Wt).call(this);}if(t(this,j)===0&&this.ttl===0&&t(this,P)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,j)&&!t(this,P)){let Pt="LRU_CACHE_UNBOUNDED";ne(Pt)&&(qt.add(Pt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,At));}}get perf(){return t(this,X)}static unsafeExposeInternals(i){return {starts:t(i,Z),ttls:t(i,K),autopurgeTimers:t(i,W),sizes:t(i,Q),keyMap:t(i,R),keyList:t(i,w),valList:t(i,g),next:t(i,V),prev:t(i,Y),get head(){return t(i,M)},get tail(){return t(i,D)},free:t(i,q),isBackgroundFetch:e=>{var r;return h(r=i,n,v).call(r,e)},backgroundFetch:(e,r,a,o)=>{var s;return h(s=i,n,Lt).call(s,e,r,a,o)},moveToTail:e=>{var r;return h(r=i,n,Rt).call(r,e)},indexes:e=>{var r;return h(r=i,n,ot).call(r,e)},rindexes:e=>{var r;return h(r=i,n,nt).call(r,e)},isStale:e=>{var r;return t(r=i,H).call(r,e)}}}get max(){return t(this,j)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,J)}get size(){return t(this,C)}get fetchMethod(){return t(this,Et)}get memoMethod(){return t(this,Tt)}get dispose(){return t(this,k)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,B)}getRemainingTTL(i){return t(this,R).has(i)?1/0:0}*entries(){for(let i of h(this,n,ot).call(this))t(this,g)[i]!==void 0&&t(this,w)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield [t(this,w)[i],t(this,g)[i]]);}*rentries(){for(let i of h(this,n,nt).call(this))t(this,g)[i]!==void 0&&t(this,w)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield [t(this,w)[i],t(this,g)[i]]);}*keys(){for(let i of h(this,n,ot).call(this)){let e=t(this,w)[i];e!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield e);}}*rkeys(){for(let i of h(this,n,nt).call(this)){let e=t(this,w)[i];e!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield e);}}*values(){for(let i of h(this,n,ot).call(this))t(this,g)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield t(this,g)[i]);}*rvalues(){for(let i of h(this,n,nt).call(this))t(this,g)[i]!==void 0&&!h(this,n,v).call(this,t(this,g)[i])&&(yield t(this,g)[i]);}[(Jt=Symbol.iterator,Xt=Symbol.toStringTag,Jt)](){return this.entries()}find(i,e={}){for(let r of h(this,n,ot).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;if(o!==void 0&&i(o,t(this,w)[r],this))return this.get(t(this,w)[r],e)}}forEach(i,e=this){for(let r of h(this,n,ot).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&i.call(e,o,t(this,w)[r],this);}}rforEach(i,e=this){for(let r of h(this,n,nt).call(this)){let a=t(this,g)[r],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&i.call(e,o,t(this,w)[r],this);}}purgeStale(){let i=false;for(let e of h(this,n,nt).call(this,{allowStale:true}))t(this,H).call(this,e)&&(h(this,n,lt).call(this,t(this,w)[e],"expire"),i=true);return i}info(i){let e=t(this,R).get(i);if(e===void 0)return;let r=t(this,g)[e],a=h(this,n,v).call(this,r)?r.__staleWhileFetching:r;if(a===void 0)return;let o={value:a};if(t(this,K)&&t(this,Z)){let s=t(this,K)[e],l=t(this,Z)[e];if(s&&l){let u=s-(t(this,X).now()-l);o.ttl=u,o.start=Date.now();}}return t(this,Q)&&(o.size=t(this,Q)[e]),o}dump(){let i=[];for(let e of h(this,n,ot).call(this,{allowStale:true})){let r=t(this,w)[e],a=t(this,g)[e],o=h(this,n,v).call(this,a)?a.__staleWhileFetching:a;if(o===void 0||r===void 0)continue;let s={value:o};if(t(this,K)&&t(this,Z)){s.ttl=t(this,K)[e];let l=t(this,X).now()-t(this,Z)[e];s.start=Math.floor(Date.now()-l);}t(this,Q)&&(s.size=t(this,Q)[e]),i.unshift([r,s]);}return i}load(i){this.clear();for(let[e,r]of i){if(r.start){let a=Date.now()-r.start;r.start=t(this,X).now()-a;}this.set(e,r.value,r);}}set(i,e,r={}){var b,y,T,A;if(e===void 0)return this.delete(i),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=r,{noUpdateTTL:E=this.noUpdateTTL}=r,I=t(this,It).call(this,i,e,r.size||0,l);if(this.maxEntrySize&&I>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,n,lt).call(this,i,"set"),this;let d=t(this,C)===0?void 0:t(this,R).get(i);if(d===void 0)d=t(this,C)===0?t(this,D):t(this,q).length!==0?t(this,q).pop():t(this,C)===t(this,j)?h(this,n,Vt).call(this,false):t(this,C),t(this,w)[d]=i,t(this,g)[d]=e,t(this,R).set(i,d),t(this,V)[t(this,D)]=d,t(this,Y)[d]=t(this,D),f(this,D,d),Mt(this,C)._++,t(this,bt).call(this,d,I,u),u&&(u.set="add"),E=false,t(this,yt)&&((b=t(this,ft))==null||b.call(this,e,i,"add"));else {h(this,n,Rt).call(this,d);let O=t(this,g)[d];if(e!==O){if(t(this,ht)&&h(this,n,v).call(this,O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=O;p!==void 0&&!s&&(t(this,tt)&&((y=t(this,k))==null||y.call(this,p,i,"set")),t(this,L)&&t(this,N)?.push([p,i,"set"]));}else s||(t(this,tt)&&((T=t(this,k))==null||T.call(this,O,i,"set")),t(this,L)&&t(this,N)?.push([O,i,"set"]));if(t(this,dt).call(this,d),t(this,bt).call(this,d,I,u),t(this,g)[d]=e,u){u.set="replace";let p=O&&h(this,n,v).call(this,O)?O.__staleWhileFetching:O;p!==void 0&&(u.oldValue=p);}}else u&&(u.set="update");t(this,yt)&&this.onInsert?.(e,i,e===O?"update":"replace");}if(a!==0&&!t(this,K)&&h(this,n,Wt).call(this),t(this,K)&&(E||t(this,Ct).call(this,d,a,o),u&&t(this,rt).call(this,u,d)),!s&&t(this,L)&&t(this,N)){let O=t(this,N),p;for(;p=O?.shift();)(A=t(this,B))==null||A.call(this,...p);}return this}pop(){var i;try{for(;t(this,C);){let e=t(this,g)[t(this,M)];if(h(this,n,Vt).call(this,!0),h(this,n,v).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(t(this,L)&&t(this,N)){let e=t(this,N),r;for(;r=e?.shift();)(i=t(this,B))==null||i.call(this,...r);}}}has(i,e={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:a}=e,o=t(this,R).get(i);if(o!==void 0){let s=t(this,g)[o];if(h(this,n,v).call(this,s)&&s.__staleWhileFetching===void 0)return false;if(t(this,H).call(this,o))a&&(a.has="stale",t(this,rt).call(this,a,o));else return r&&t(this,gt).call(this,o),a&&(a.has="hit",t(this,rt).call(this,a,o)),true}else a&&(a.has="miss");return false}peek(i,e={}){let{allowStale:r=this.allowStale}=e,a=t(this,R).get(i);if(a===void 0||!r&&t(this,H).call(this,a))return;let o=t(this,g)[a];return h(this,n,v).call(this,o)?o.__staleWhileFetching:o}async fetch(i,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:A,forceRefresh:O=false,status:p,signal:F}=e;if(!t(this,ht))return p&&(p.fetch="get"),this.get(i,{allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:p});let U={allowStale:r,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:l,size:u,sizeCalculation:E,noUpdateTTL:I,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:T,ignoreFetchAbort:y,status:p,signal:F},G=t(this,R).get(i);if(G===void 0){p&&(p.fetch="miss");let x=h(this,n,Lt).call(this,i,G,U,A);return x.__returned=x}else {let x=t(this,g)[G];if(h(this,n,v).call(this,x)){let mt=r&&x.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",mt&&(p.returnedStale=true)),mt?x.__staleWhileFetching:x.__returned=x}let xt=t(this,H).call(this,G);if(!O&&!xt)return p&&(p.fetch="hit"),h(this,n,Rt).call(this,G),a&&t(this,gt).call(this,G),p&&t(this,rt).call(this,p,G),x;let pt=h(this,n,Lt).call(this,i,G,U,A),_t=pt.__staleWhileFetching!==void 0&&r;return p&&(p.fetch=xt?"stale":"refresh",_t&&xt&&(p.returnedStale=true)),_t?pt.__staleWhileFetching:pt.__returned=pt}}async forceFetch(i,e={}){let r=await this.fetch(i,e);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(i,e={}){let r=t(this,Tt);if(!r)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...s}=e,l=this.get(i,s);if(!o&&l!==void 0)return l;let u=r(i,l,{options:s,context:a});return this.set(i,u,s),u}get(i,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=e,l=t(this,R).get(i);if(l!==void 0){let u=t(this,g)[l],E=h(this,n,v).call(this,u);return s&&t(this,rt).call(this,s,l),t(this,H).call(this,l)?(s&&(s.get="stale"),E?(s&&r&&u.__staleWhileFetching!==void 0&&(s.returnedStale=true),r?u.__staleWhileFetching:void 0):(o||h(this,n,lt).call(this,i,"expire"),s&&r&&(s.returnedStale=true),r?u:void 0)):(s&&(s.get="hit"),E?u.__staleWhileFetching:(h(this,n,Rt).call(this,l),a&&t(this,gt).call(this,l),u))}else s&&(s.get="miss");}delete(i){return h(this,n,lt).call(this,i,"delete")}clear(){return h(this,n,jt).call(this,"delete")}},j=new WeakMap,P=new WeakMap,k=new WeakMap,ft=new WeakMap,B=new WeakMap,Et=new WeakMap,Tt=new WeakMap,X=new WeakMap,C=new WeakMap,J=new WeakMap,R=new WeakMap,w=new WeakMap,g=new WeakMap,V=new WeakMap,Y=new WeakMap,M=new WeakMap,D=new WeakMap,q=new WeakMap,N=new WeakMap,Q=new WeakMap,Z=new WeakMap,K=new WeakMap,W=new WeakMap,tt=new WeakMap,ht=new WeakMap,L=new WeakMap,yt=new WeakMap,n=new WeakSet,Wt=function(){let i=new Gt(t(this,j)),e=new Gt(t(this,j));f(this,K,i),f(this,Z,e);let r=this.ttlAutopurge?new Array(t(this,j)):void 0;f(this,W,r),f(this,Ct,(l,u,E=t(this,X).now())=>{e[l]=u!==0?E:0,i[l]=u,a(l,u);}),f(this,gt,l=>{e[l]=i[l]!==0?t(this,X).now():0,a(l,i[l]);});let a=this.ttlAutopurge?(l,u)=>{if(r?.[l]&&(clearTimeout(r[l]),r[l]=void 0),u&&u!==0&&r){let E=setTimeout(()=>{t(this,H).call(this,l)&&h(this,n,lt).call(this,t(this,w)[l],"expire");},u+1);E.unref&&E.unref(),r[l]=E;}}:()=>{};f(this,rt,(l,u)=>{if(i[u]){let E=i[u],I=e[u];if(!E||!I)return;l.ttl=E,l.start=I,l.now=o||s();let d=l.now-I;l.remainingTTL=E-d;}});let o=0,s=()=>{let l=t(this,X).now();if(this.ttlResolution>0){o=l;let u=setTimeout(()=>o=0,this.ttlResolution);u.unref&&u.unref();}return l};this.getRemainingTTL=l=>{let u=t(this,R).get(l);if(u===void 0)return 0;let E=i[u],I=e[u];if(!E||!I)return 1/0;let d=(o||s())-I;return E-d},f(this,H,l=>{let u=e[l],E=i[l];return !!E&&!!u&&(o||s())-u>E});},gt=new WeakMap,rt=new WeakMap,Ct=new WeakMap,H=new WeakMap,ee=function(){let i=new Gt(t(this,j));f(this,J,0),f(this,Q,i),f(this,dt,e=>{f(this,J,t(this,J)-i[e]),i[e]=0;}),f(this,It,(e,r,a,o)=>{if(h(this,n,v).call(this,r))return 0;if(!at(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(r,e),!at(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,bt,(e,r,a)=>{if(i[e]=r,t(this,P)){let o=t(this,P)-i[e];for(;t(this,J)>o;)h(this,n,Vt).call(this,true);}f(this,J,t(this,J)+i[e]),a&&(a.entrySize=r,a.totalCalculatedSize=t(this,J));});},dt=new WeakMap,bt=new WeakMap,It=new WeakMap,ot=function*({allowStale:i=this.allowStale}={}){if(t(this,C))for(let e=t(this,D);!(!h(this,n,Ht).call(this,e)||((i||!t(this,H).call(this,e))&&(yield e),e===t(this,M)));)e=t(this,Y)[e];},nt=function*({allowStale:i=this.allowStale}={}){if(t(this,C))for(let e=t(this,M);!(!h(this,n,Ht).call(this,e)||((i||!t(this,H).call(this,e))&&(yield e),e===t(this,D)));)e=t(this,V)[e];},Ht=function(i){return i!==void 0&&t(this,R).get(t(this,w)[i])===i},Vt=function(i){var o;let e=t(this,M),r=t(this,w)[e],a=t(this,g)[e];return t(this,ht)&&h(this,n,v).call(this,a)?a.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((o=t(this,k))==null||o.call(this,a,r,"evict")),t(this,L)&&t(this,N)?.push([a,r,"evict"])),t(this,dt).call(this,e),t(this,W)?.[e]&&(clearTimeout(t(this,W)[e]),t(this,W)[e]=void 0),i&&(t(this,w)[e]=void 0,t(this,g)[e]=void 0,t(this,q).push(e)),t(this,C)===1?(f(this,M,f(this,D,0)),t(this,q).length=0):f(this,M,t(this,V)[e]),t(this,R).delete(r),Mt(this,C)._--,e},Lt=function(i,e,r,a){let o=e===void 0?void 0:t(this,g)[e];if(h(this,n,v).call(this,o))return o;let s=new Ut,{signal:l}=r;l?.addEventListener("abort",()=>s.abort(l.reason),{signal:s.signal});let u={signal:s.signal,options:r,context:a},E=(A,O=false)=>{let{aborted:p}=s.signal,F=r.ignoreFetchAbort&&A!==void 0,U=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&A!==void 0);if(r.status&&(p&&!O?(r.status.fetchAborted=true,r.status.fetchError=s.signal.reason,F&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),p&&!F&&!O)return d(s.signal.reason,U);let G=y,x=t(this,g)[e];return (x===y||F&&O&&x===void 0)&&(A===void 0?G.__staleWhileFetching!==void 0?t(this,g)[e]=G.__staleWhileFetching:h(this,n,lt).call(this,i,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(i,A,u.options))),A},I=A=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=A),d(A,false)),d=(A,O)=>{let{aborted:p}=s.signal,F=p&&r.allowStaleOnFetchAbort,U=F||r.allowStaleOnFetchRejection,G=U||r.noDeleteOnFetchRejection,x=y;if(t(this,g)[e]===y&&(!G||!O&&x.__staleWhileFetching===void 0?h(this,n,lt).call(this,i,"fetch"):F||(t(this,g)[e]=x.__staleWhileFetching)),U)return r.status&&x.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw A},b=(A,O)=>{var F;let p=(F=t(this,Et))==null?void 0:F.call(this,i,o,u);p&&p instanceof Promise&&p.then(U=>A(U===void 0?void 0:U),O),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(A(void 0),r.allowStaleOnFetchAbort&&(A=U=>E(U,true)));});};r.status&&(r.status.fetchDispatched=true);let y=new Promise(b).then(E,I),T=Object.assign(y,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return e===void 0?(this.set(i,T,{...u.options,status:void 0}),e=t(this,R).get(i)):t(this,g)[e]=T,T},v=function(i){if(!t(this,ht))return false;let e=i;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ut},$t=function(i,e){t(this,Y)[e]=i,t(this,V)[i]=e;},Rt=function(i){i!==t(this,D)&&(i===t(this,M)?f(this,M,t(this,V)[i]):h(this,n,$t).call(this,t(this,Y)[i],t(this,V)[i]),h(this,n,$t).call(this,t(this,D),i),f(this,D,i));},lt=function(i,e){var a,o;let r=false;if(t(this,C)!==0){let s=t(this,R).get(i);if(s!==void 0)if(t(this,W)?.[s]&&(clearTimeout(t(this,W)?.[s]),t(this,W)[s]=void 0),r=true,t(this,C)===1)h(this,n,jt).call(this,e);else {t(this,dt).call(this,s);let l=t(this,g)[s];if(h(this,n,v).call(this,l)?l.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((a=t(this,k))==null||a.call(this,l,i,e)),t(this,L)&&t(this,N)?.push([l,i,e])),t(this,R).delete(i),t(this,w)[s]=void 0,t(this,g)[s]=void 0,s===t(this,D))f(this,D,t(this,Y)[s]);else if(s===t(this,M))f(this,M,t(this,V)[s]);else {let u=t(this,Y)[s];t(this,V)[u]=t(this,V)[s];let E=t(this,V)[s];t(this,Y)[E]=t(this,Y)[s];}Mt(this,C)._--,t(this,q).push(s);}}if(t(this,L)&&t(this,N)?.length){let s=t(this,N),l;for(;l=s?.shift();)(o=t(this,B))==null||o.call(this,...l);}return r},jt=function(i){var e,r;for(let a of h(this,n,nt).call(this,{allowStale:true})){let o=t(this,g)[a];if(h(this,n,v).call(this,o))o.__abortController.abort(new Error("deleted"));else {let s=t(this,w)[a];t(this,tt)&&((e=t(this,k))==null||e.call(this,o,s,i)),t(this,L)&&t(this,N)?.push([o,s,i]);}}if(t(this,R).clear(),t(this,g).fill(void 0),t(this,w).fill(void 0),t(this,K)&&t(this,Z)){t(this,K).fill(0),t(this,Z).fill(0);for(let a of t(this,W)??[])a!==void 0&&clearTimeout(a);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),f(this,M,0),f(this,D,0),t(this,q).length=0,f(this,J,0),f(this,C,0),t(this,L)&&t(this,N)){let a=t(this,N),o;for(;o=a?.shift();)(r=t(this,B))==null||r.call(this,...o);}},At);var ct=class{constructor(i){_(this,"cache");_(this,"map",new Map);this.cache=new te({max:i.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(i){let e=this.map.delete(i);return e&&this.cache.delete(i),e}get forEach(){return this.map.forEach}get(i){let e=this.cache.get(i);return e||this.map.get(i)}has(i){return this.map.has(i)}set(i,e){return this.map.set(i,e),this.cache.set(i,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var it;(a=>(a.log=(o,...s)=>console.log(`[Pixi\u2019VN] ${o}`,...s),a.warn=(o,...s)=>console.warn(`[Pixi\u2019VN] ${o}`,...s),a.error=(o,...s)=>console.error(`[Pixi\u2019VN] ${o}`,...s),a.info=(o,...s)=>console.info(`[Pixi\u2019VN] ${o}`,...s)))(it||={});function Dt(c){try{if(typeof c>"u")return c;let i=JSON.stringify(c);return JSON.parse(i)}catch(i){throw it.error("Error creating exportable element",c,i),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ie;(d=>{d.storage=new ct({cacheSize:50}),d.defaultStorage=new ct({cacheSize:10}),d.tempStorageDeadlines=new Map;let r;function a(b){d.tempStorageDeadlines.forEach((y,T)=>{y>b&&(d.storage.delete(`${ut}:${T}`),r?.onClearOldTempVariable?.(T),d.tempStorageDeadlines.delete(T));});}d.clearOldTempVariables=a;function o(b){r=b;}d.setExternalStoreHandler=o;function s(b,y,T){T==null?d.storage.delete(`${b}:${y}`):d.storage.set(`${b}:${y}`,T),r?.onSetVariable?.(y,T);}d.setVariable=s;function l(b,y){let T=d.storage.get(`${b}:${y}`);return Dt(T)}d.getVariable=l;function u(b,y){d.storage.delete(`${b}:${y}`),r?.onRemoveVariable?.(y);}d.removeVariable=u;function E(b,y){let T=d.storage.get(Ft)||[];if(y)T.includes(b)||T.push(b);else {let A=T.indexOf(b);A>-1&&T.splice(A,1);}d.storage.set(Ft,T);}d.setFlag=E;function I(b){return (d.storage.get(Ft)||[]).includes(b)}d.getFlag=I;})(ie||={});var S=ie;var Ot=class{constructor(i,e){_(this,"id");_(this,"categoryId");this.categoryId=i,this.id=e,this.migrateOldStorage();}migrateOldStorage(i=this.categoryId){let e=S.getVariable(st,i);e&&(Object.entries(e).forEach(([r,a])=>{typeof a=="object"&&a!==null&&Object.entries(a).forEach(([o,s])=>{S.setVariable(this.categoryId,`${r}:${o}`,s);});}),S.removeVariable(st,i));}setStorageProperty(i,e){S.setVariable(this.categoryId,`${this.id}:${i}`,e);}getStorageProperty(i,e=this.id){return S.getVariable(this.categoryId,`${e}:${i}`)}};var ue="@",vt=class extends Ot{constructor(e,r=""){super(z.CHARACTER_CATEGORY_KEY,e+(r?ue+r:""));_(this,"sourceId");this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var zt=class extends vt{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);_(this,"defaultName");_(this,"defaultSurname");_(this,"defaultAge");_(this,"icon");_(this,"color");this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}};var wt=new ct({cacheSize:10}),re;(o=>{function c(s){try{let l=wt.get(s);if(!l){it.warn(`Character "${s}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return l}catch(l){it.error(`Error while getting Character "${s}"`,l);return}}o.get=c;function i(s){if(Array.isArray(s)){s.forEach(l=>{i(l);});return}wt.get(s.id)&&it.info(`Character id "${s.id}" already exists, it will be overwritten`),wt.set(s.id,s);}o.add=i;function e(){return Array.from(wt.values())}o.values=e;function r(s){return wt.has(s)}o.has=r;function a(){return Array.from(wt.keys())}o.keys=a;})(re||={});var fe=re;exports.CharacterBaseModel=zt;exports.CharacterStoredClass=vt;exports.RegisteredCharacters=fe;
|
package/dist/characters.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StoredClassModel } from './StoredClassModel-
|
|
1
|
+
import { S as StoredClassModel } from './StoredClassModel-Bykjdn8S.cjs';
|
|
2
2
|
import { CharacterInterface as CharacterInterface$1 } from '@drincs/pixi-vn';
|
|
3
3
|
import './StorageElementType-C7ETezlL.cjs';
|
|
4
4
|
|
|
@@ -112,7 +112,7 @@ declare namespace RegisteredCharacters {
|
|
|
112
112
|
* @param id is the id of the character
|
|
113
113
|
* @returns the character
|
|
114
114
|
* @example
|
|
115
|
-
* ```
|
|
115
|
+
* ```ts
|
|
116
116
|
* const liam = RegisteredCharacters.get('liam');
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
@@ -122,7 +122,7 @@ declare namespace RegisteredCharacters {
|
|
|
122
122
|
* @param character is the character to save
|
|
123
123
|
* @returns
|
|
124
124
|
* @example
|
|
125
|
-
* ```
|
|
125
|
+
* ```ts
|
|
126
126
|
* export const liam = new CharacterBaseModel('liam', { name: 'Liam'});
|
|
127
127
|
* export const alice = new CharacterBaseModel('alice', { name: 'Alice'});
|
|
128
128
|
* RegisteredCharacters.add([liam, alice]);
|
|
@@ -133,7 +133,7 @@ declare namespace RegisteredCharacters {
|
|
|
133
133
|
* is a function that returns all characters
|
|
134
134
|
* @returns all characters
|
|
135
135
|
* @example
|
|
136
|
-
* ```
|
|
136
|
+
* ```ts
|
|
137
137
|
* const allCharacters = RegisteredCharacters.values();
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
@@ -156,7 +156,7 @@ declare namespace RegisteredCharacters {
|
|
|
156
156
|
* So if you want to create your own Character, you must override this interface, implement or extend it and extend the {@link CharacterStoredClass} class.
|
|
157
157
|
* You can override this interface to add your own props.
|
|
158
158
|
* @example
|
|
159
|
-
* ```
|
|
159
|
+
* ```ts
|
|
160
160
|
* // pixi-vn.d.ts
|
|
161
161
|
* declare module '@drincs/pixi-vn' {
|
|
162
162
|
* interface CharacterInterface {
|
package/dist/characters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StoredClassModel } from './StoredClassModel-
|
|
1
|
+
import { S as StoredClassModel } from './StoredClassModel-uMifeNzV.js';
|
|
2
2
|
import { CharacterInterface as CharacterInterface$1 } from '@drincs/pixi-vn';
|
|
3
3
|
import './StorageElementType-C7ETezlL.js';
|
|
4
4
|
|
|
@@ -112,7 +112,7 @@ declare namespace RegisteredCharacters {
|
|
|
112
112
|
* @param id is the id of the character
|
|
113
113
|
* @returns the character
|
|
114
114
|
* @example
|
|
115
|
-
* ```
|
|
115
|
+
* ```ts
|
|
116
116
|
* const liam = RegisteredCharacters.get('liam');
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
@@ -122,7 +122,7 @@ declare namespace RegisteredCharacters {
|
|
|
122
122
|
* @param character is the character to save
|
|
123
123
|
* @returns
|
|
124
124
|
* @example
|
|
125
|
-
* ```
|
|
125
|
+
* ```ts
|
|
126
126
|
* export const liam = new CharacterBaseModel('liam', { name: 'Liam'});
|
|
127
127
|
* export const alice = new CharacterBaseModel('alice', { name: 'Alice'});
|
|
128
128
|
* RegisteredCharacters.add([liam, alice]);
|
|
@@ -133,7 +133,7 @@ declare namespace RegisteredCharacters {
|
|
|
133
133
|
* is a function that returns all characters
|
|
134
134
|
* @returns all characters
|
|
135
135
|
* @example
|
|
136
|
-
* ```
|
|
136
|
+
* ```ts
|
|
137
137
|
* const allCharacters = RegisteredCharacters.values();
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
@@ -156,7 +156,7 @@ declare namespace RegisteredCharacters {
|
|
|
156
156
|
* So if you want to create your own Character, you must override this interface, implement or extend it and extend the {@link CharacterStoredClass} class.
|
|
157
157
|
* You can override this interface to add your own props.
|
|
158
158
|
* @example
|
|
159
|
-
* ```
|
|
159
|
+
* ```ts
|
|
160
160
|
* // pixi-vn.d.ts
|
|
161
161
|
* declare module '@drincs/pixi-vn' {
|
|
162
162
|
* interface CharacterInterface {
|
package/dist/characters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-BQRPDCUT.mjs';import {n}from'./chunk-IWAXXFXE.mjs';import {e,f,d as d$1}from'./chunk-3M6A7TU2.mjs';var l="@",o=class extends b{constructor(e,r=""){super(n.CHARACTER_CATEGORY_KEY,e+(r?l+r:""));d$1(this,"sourceId");this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var d=class extends o{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);d$1(this,"defaultName");d$1(this,"defaultSurname");d$1(this,"defaultAge");d$1(this,"icon");d$1(this,"color");this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}};var s=new e({cacheSize:10}),h;(C=>{function f$1(t){try{let n=s.get(t);if(!n){f.warn(`Character "${t}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return n}catch(n){f.error(`Error while getting Character "${t}"`,n);return}}C.get=f$1;function u(t){if(Array.isArray(t)){t.forEach(n=>{u(n);});return}s.get(t.id)&&f.info(`Character id "${t.id}" already exists, it will be overwritten`),s.set(t.id,t);}C.add=u;function e(){return Array.from(s.values())}C.values=e;function r(t){return s.has(t)}C.has=r;function y(){return Array.from(s.keys())}C.keys=y;})(h||={});var p=h;export{d as CharacterBaseModel,o as CharacterStoredClass,p as RegisteredCharacters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {PixiError}from'@drincs/pixi-vn/core';var Kt=Object.create;var Tt=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Gt=l=>{throw TypeError(l)};var Xt=(l,e,i)=>e in l?Tt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var ie=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var se=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var Yt=(l,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of Bt(e))!qt.call(l,h)&&h!==i&&Tt(l,h,{get:()=>e[h],enumerable:!(s=$t(e,h))||s.enumerable});return l};var he=(l,e,i)=>(i=l!=null?Kt(Jt(l)):{},Yt(e||!l||!l.__esModule?Tt(i,"default",{value:l,enumerable:true}):i,l));var S=(l,e,i)=>Xt(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Gt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),g=(l,e,i)=>e.has(l)?Gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,i),f=(l,e,i,s)=>(zt(l,e,"write to private field"),e.set(l,i),i),a=(l,e,i)=>(zt(l,e,"access private method"),i);var yt=(l,e,i,s)=>({set _(h){f(l,e,h);},get _(){return t(l,e,s)}});var Qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,It=new Set,Rt=typeof process=="object"&&process?process:{},Vt=(l,e,i,s)=>{typeof Rt.emitWarning=="function"?Rt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ft=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Ft>"u"){jt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){S(this,"signal",new jt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let l=Rt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,Vt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Zt=l=>!It.has(l);var tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Pt=l=>tt(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?_t:null:null,_t=class extends Array{constructor(l){super(l),this.fill(0);}},Y,ct,te=(Y=class{constructor(e,i){S(this,"heap");S(this,"length");if(!t(Y,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=Pt(e);if(!i)return [];f(Y,ct,true);let s=new Y(e,i);return f(Y,ct,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,g(Y,ct,false),Y),Mt,Nt,V,U,P,ot,k,ft,dt,H,F,K,O,y,d,W,G,z,E,$,x,B,J,j,M,q,ht,D,pt,n,Ct,rt,Q,vt,N,Ht,nt,gt,bt,et,it,Wt,At,Ot,b,Dt,St,st,Lt,wt,kt=(wt=class{constructor(e){g(this,n);g(this,V);g(this,U);g(this,P);g(this,ot);g(this,k);g(this,ft);g(this,dt);g(this,H);S(this,"ttl");S(this,"ttlResolution");S(this,"ttlAutopurge");S(this,"updateAgeOnGet");S(this,"updateAgeOnHas");S(this,"allowStale");S(this,"noDisposeOnSet");S(this,"noUpdateTTL");S(this,"maxEntrySize");S(this,"sizeCalculation");S(this,"noDeleteOnFetchRejection");S(this,"noDeleteOnStaleGet");S(this,"allowStaleOnFetchAbort");S(this,"allowStaleOnFetchRejection");S(this,"ignoreFetchAbort");g(this,F);g(this,K);g(this,O);g(this,y);g(this,d);g(this,W);g(this,G);g(this,z);g(this,E);g(this,$);g(this,x);g(this,B);g(this,J);g(this,j);g(this,M);g(this,q);g(this,ht);g(this,D);g(this,pt);g(this,rt,()=>{});g(this,Q,()=>{});g(this,vt,()=>{});g(this,N,()=>false);g(this,nt,e=>{});g(this,gt,(e,i,s)=>{});g(this,bt,(e,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Mt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:T,disposeAfter:m,noDisposeOnSet:Z,noUpdateTTL:I,maxSize:X=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:p,memoMethod:R,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:mt,ignoreFetchAbort:lt,perf:at}=e;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,H,at??Qt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?Pt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(f(this,V,i),f(this,U,X),this.maxEntrySize=_||t(this,U),this.sizeCalculation=v,this.sizeCalculation){if(!t(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,dt,R),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ft,p),f(this,ht,!!p),f(this,O,new Map),f(this,y,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,W,new ut(i)),f(this,G,new ut(i)),f(this,z,0),f(this,E,0),f(this,$,te.create(i)),f(this,F,0),f(this,K,0),typeof w=="function"&&f(this,P,w),typeof T=="function"&&f(this,ot,T),typeof m=="function"?(f(this,k,m),f(this,x,[])):(f(this,k,void 0),f(this,x,void 0)),f(this,q,!!t(this,P)),f(this,pt,!!t(this,ot)),f(this,D,!!t(this,k)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(t(this,U)!==0&&!tt(t(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");a(this,n,Ht).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(h)||h===0?h:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");a(this,n,Ct).call(this);}if(t(this,V)===0&&this.ttl===0&&t(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,V)&&!t(this,U)){let xt="LRU_CACHE_UNBOUNDED";Zt(xt)&&(It.add(xt),Vt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",xt,wt));}}get perf(){return t(this,H)}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,j),autopurgeTimers:t(e,M),sizes:t(e,B),keyMap:t(e,O),keyList:t(e,y),valList:t(e,d),next:t(e,W),prev:t(e,G),get head(){return t(e,z)},get tail(){return t(e,E)},free:t(e,$),isBackgroundFetch:i=>{var s;return a(s=e,n,b).call(s,i)},backgroundFetch:(i,s,h,r)=>{var o;return a(o=e,n,Ot).call(o,i,s,h,r)},moveToTail:i=>{var s;return a(s=e,n,St).call(s,i)},indexes:i=>{var s;return a(s=e,n,et).call(s,i)},rindexes:i=>{var s;return a(s=e,n,it).call(s,i)},isStale:i=>{var s;return t(s=e,N).call(s,i)}}}get max(){return t(this,V)}get maxSize(){return t(this,U)}get calculatedSize(){return t(this,K)}get size(){return t(this,F)}get fetchMethod(){return t(this,ft)}get memoMethod(){return t(this,dt)}get dispose(){return t(this,P)}get onInsert(){return t(this,ot)}get disposeAfter(){return t(this,k)}getRemainingTTL(e){return t(this,O).has(e)?1/0:0}*entries(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*rentries(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*keys(){for(let e of a(this,n,et).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of a(this,n,it).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(Nt=Symbol.iterator,Mt=Symbol.toStringTag,Nt)](){return this.entries()}find(e,i={}){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r!==void 0&&e(r,t(this,y)[s],this))return this.get(t(this,y)[s],i)}}forEach(e,i=this){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}rforEach(e,i=this){for(let s of a(this,n,it).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}purgeStale(){let e=false;for(let i of a(this,n,it).call(this,{allowStale:true}))t(this,N).call(this,i)&&(a(this,n,st).call(this,t(this,y)[i],"expire"),e=true);return e}info(e){let i=t(this,O).get(e);if(i===void 0)return;let s=t(this,d)[i],h=a(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let r={value:h};if(t(this,j)&&t(this,J)){let o=t(this,j)[i],u=t(this,J)[i];if(o&&u){let c=o-(t(this,H).now()-u);r.ttl=c,r.start=Date.now();}}return t(this,B)&&(r.size=t(this,B)[i]),r}dump(){let e=[];for(let i of a(this,n,et).call(this,{allowStale:true})){let s=t(this,y)[i],h=t(this,d)[i],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r===void 0||s===void 0)continue;let o={value:r};if(t(this,j)&&t(this,J)){o.ttl=t(this,j)[i];let u=t(this,H).now()-t(this,J)[i];o.start=Math.floor(Date.now()-u);}t(this,B)&&(o.size=t(this,B)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let h=Date.now()-s.start;s.start=t(this,H).now()-h;}this.set(i,s.value,s);}}set(e,i,s={}){var Z,I,X,_;if(i===void 0)return this.delete(e),this;let{ttl:h=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,T=t(this,bt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&T>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),a(this,n,st).call(this,e,"set"),this;let m=t(this,F)===0?void 0:t(this,O).get(e);if(m===void 0)m=t(this,F)===0?t(this,E):t(this,$).length!==0?t(this,$).pop():t(this,F)===t(this,V)?a(this,n,At).call(this,false):t(this,F),t(this,y)[m]=e,t(this,d)[m]=i,t(this,O).set(e,m),t(this,W)[t(this,E)]=m,t(this,G)[m]=t(this,E),f(this,E,m),yt(this,F)._++,t(this,gt).call(this,m,T,c),c&&(c.set="add"),w=false,t(this,pt)&&((Z=t(this,ot))==null||Z.call(this,i,e,"add"));else {a(this,n,St).call(this,m);let v=t(this,d)[m];if(i!==v){if(t(this,ht)&&a(this,n,b).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=v;p!==void 0&&!o&&(t(this,q)&&((I=t(this,P))==null||I.call(this,p,e,"set")),t(this,D)&&t(this,x)?.push([p,e,"set"]));}else o||(t(this,q)&&((X=t(this,P))==null||X.call(this,v,e,"set")),t(this,D)&&t(this,x)?.push([v,e,"set"]));if(t(this,nt).call(this,m),t(this,gt).call(this,m,T,c),t(this,d)[m]=i,c){c.set="replace";let p=v&&a(this,n,b).call(this,v)?v.__staleWhileFetching:v;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,pt)&&this.onInsert?.(i,e,i===v?"update":"replace");}if(h!==0&&!t(this,j)&&a(this,n,Ct).call(this),t(this,j)&&(w||t(this,vt).call(this,m,h,r),c&&t(this,Q).call(this,c,m)),!o&&t(this,D)&&t(this,x)){let v=t(this,x),p;for(;p=v?.shift();)(_=t(this,k))==null||_.call(this,...p);}return this}pop(){var e;try{for(;t(this,F);){let i=t(this,d)[t(this,z)];if(a(this,n,At).call(this,!0),a(this,n,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,D)&&t(this,x)){let i=t(this,x),s;for(;s=i?.shift();)(e=t(this,k))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,r=t(this,O).get(e);if(r!==void 0){let o=t(this,d)[r];if(a(this,n,b).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,N).call(this,r))h&&(h.has="stale",t(this,Q).call(this,h,r));else return s&&t(this,rt).call(this,r),h&&(h.has="hit",t(this,Q).call(this,h,r)),true}else h&&(h.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,h=t(this,O).get(e);if(h===void 0||!s&&t(this,N).call(this,h))return;let r=t(this,d)[h];return a(this,n,b).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:T=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,context:_,forceRefresh:v=false,status:p,signal:R}=i;if(!t(this,ht))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,status:p});let L={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:T,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:X,ignoreFetchAbort:I,status:p,signal:R},C=t(this,O).get(e);if(C===void 0){p&&(p.fetch="miss");let A=a(this,n,Ot).call(this,e,C,L,_);return A.__returned=A}else {let A=t(this,d)[C];if(a(this,n,b).call(this,A)){let ut=s&&A.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",ut&&(p.returnedStale=true)),ut?A.__staleWhileFetching:A.__returned=A}let mt=t(this,N).call(this,C);if(!v&&!mt)return p&&(p.fetch="hit"),a(this,n,St).call(this,C),h&&t(this,rt).call(this,C),p&&t(this,Q).call(this,p,C),A;let lt=a(this,n,Ot).call(this,e,C,L,_),at=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=mt?"stale":"refresh",at&&mt&&(p.returnedStale=true)),at?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:r,...o}=i,u=this.get(e,o);if(!r&&u!==void 0)return u;let c=s(e,u,{options:o,context:h});return this.set(e,c,o),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=i,u=t(this,O).get(e);if(u!==void 0){let c=t(this,d)[u],w=a(this,n,b).call(this,c);return o&&t(this,Q).call(this,o,u),t(this,N).call(this,u)?(o&&(o.get="stale"),w?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||a(this,n,st).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c:void 0)):(o&&(o.get="hit"),w?c.__staleWhileFetching:(a(this,n,St).call(this,u),h&&t(this,rt).call(this,u),c))}else o&&(o.get="miss");}delete(e){return a(this,n,st).call(this,e,"delete")}clear(){return a(this,n,Lt).call(this,"delete")}},V=new WeakMap,U=new WeakMap,P=new WeakMap,ot=new WeakMap,k=new WeakMap,ft=new WeakMap,dt=new WeakMap,H=new WeakMap,F=new WeakMap,K=new WeakMap,O=new WeakMap,y=new WeakMap,d=new WeakMap,W=new WeakMap,G=new WeakMap,z=new WeakMap,E=new WeakMap,$=new WeakMap,x=new WeakMap,B=new WeakMap,J=new WeakMap,j=new WeakMap,M=new WeakMap,q=new WeakMap,ht=new WeakMap,D=new WeakMap,pt=new WeakMap,n=new WeakSet,Ct=function(){let e=new _t(t(this,V)),i=new _t(t(this,V));f(this,j,e),f(this,J,i);let s=this.ttlAutopurge?new Array(t(this,V)):void 0;f(this,M,s),f(this,vt,(u,c,w=t(this,H).now())=>{i[u]=c!==0?w:0,e[u]=c,h(u,c);}),f(this,rt,u=>{i[u]=e[u]!==0?t(this,H).now():0,h(u,e[u]);});let h=this.ttlAutopurge?(u,c)=>{if(s?.[u]&&(clearTimeout(s[u]),s[u]=void 0),c&&c!==0&&s){let w=setTimeout(()=>{t(this,N).call(this,u)&&a(this,n,st).call(this,t(this,y)[u],"expire");},c+1);w.unref&&w.unref(),s[u]=w;}}:()=>{};f(this,Q,(u,c)=>{if(e[c]){let w=e[c],T=i[c];if(!w||!T)return;u.ttl=w,u.start=T,u.now=r||o();let m=u.now-T;u.remainingTTL=w-m;}});let r=0,o=()=>{let u=t(this,H).now();if(this.ttlResolution>0){r=u;let c=setTimeout(()=>r=0,this.ttlResolution);c.unref&&c.unref();}return u};this.getRemainingTTL=u=>{let c=t(this,O).get(u);if(c===void 0)return 0;let w=e[c],T=i[c];if(!w||!T)return 1/0;let m=(r||o())-T;return w-m},f(this,N,u=>{let c=i[u],w=e[u];return !!w&&!!c&&(r||o())-c>w});},rt=new WeakMap,Q=new WeakMap,vt=new WeakMap,N=new WeakMap,Ht=function(){let e=new _t(t(this,V));f(this,K,0),f(this,B,e),f(this,nt,i=>{f(this,K,t(this,K)-e[i]),e[i]=0;}),f(this,bt,(i,s,h,r)=>{if(a(this,n,b).call(this,s))return 0;if(!tt(h))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(h=r(s,i),!tt(h))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h}),f(this,gt,(i,s,h)=>{if(e[i]=s,t(this,U)){let r=t(this,U)-e[i];for(;t(this,K)>r;)a(this,n,At).call(this,true);}f(this,K,t(this,K)+e[i]),h&&(h.entrySize=s,h.totalCalculatedSize=t(this,K));});},nt=new WeakMap,gt=new WeakMap,bt=new WeakMap,et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,E);!(!a(this,n,Wt).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,z)));)i=t(this,G)[i];},it=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,z);!(!a(this,n,Wt).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,E)));)i=t(this,W)[i];},Wt=function(e){return e!==void 0&&t(this,O).get(t(this,y)[e])===e},At=function(e){var r;let i=t(this,z),s=t(this,y)[i],h=t(this,d)[i];return t(this,ht)&&a(this,n,b).call(this,h)?h.__abortController.abort(new Error("evicted")):(t(this,q)||t(this,D))&&(t(this,q)&&((r=t(this,P))==null||r.call(this,h,s,"evict")),t(this,D)&&t(this,x)?.push([h,s,"evict"])),t(this,nt).call(this,i),t(this,M)?.[i]&&(clearTimeout(t(this,M)[i]),t(this,M)[i]=void 0),e&&(t(this,y)[i]=void 0,t(this,d)[i]=void 0,t(this,$).push(i)),t(this,F)===1?(f(this,z,f(this,E,0)),t(this,$).length=0):f(this,z,t(this,W)[i]),t(this,O).delete(s),yt(this,F)._--,i},Ot=function(e,i,s,h){let r=i===void 0?void 0:t(this,d)[i];if(a(this,n,b).call(this,r))return r;let o=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:h},w=(_,v=false)=>{let{aborted:p}=o.signal,R=s.ignoreFetchAbort&&_!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&_!==void 0);if(s.status&&(p&&!v?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!R&&!v)return m(o.signal.reason,L);let C=I,A=t(this,d)[i];return (A===I||R&&v&&A===void 0)&&(_===void 0?C.__staleWhileFetching!==void 0?t(this,d)[i]=C.__staleWhileFetching:a(this,n,st).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,_,c.options))),_},T=_=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=_),m(_,false)),m=(_,v)=>{let{aborted:p}=o.signal,R=p&&s.allowStaleOnFetchAbort,L=R||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,A=I;if(t(this,d)[i]===I&&(!C||!v&&A.__staleWhileFetching===void 0?a(this,n,st).call(this,e,"fetch"):R||(t(this,d)[i]=A.__staleWhileFetching)),L)return s.status&&A.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),A.__staleWhileFetching;if(A.__returned===A)throw _},Z=(_,v)=>{var R;let p=(R=t(this,ft))==null?void 0:R.call(this,e,r,c);p&&p instanceof Promise&&p.then(L=>_(L===void 0?void 0:L),v),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(_(void 0),s.allowStaleOnFetchAbort&&(_=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(Z).then(w,T),X=Object.assign(I,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,X,{...c.options,status:void 0}),i=t(this,O).get(e)):t(this,d)[i]=X,X},b=function(e){if(!t(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Dt=function(e,i){t(this,G)[i]=e,t(this,W)[e]=i;},St=function(e){e!==t(this,E)&&(e===t(this,z)?f(this,z,t(this,W)[e]):a(this,n,Dt).call(this,t(this,G)[e],t(this,W)[e]),a(this,n,Dt).call(this,t(this,E),e),f(this,E,e));},st=function(e,i){var h,r;let s=false;if(t(this,F)!==0){let o=t(this,O).get(e);if(o!==void 0)if(t(this,M)?.[o]&&(clearTimeout(t(this,M)?.[o]),t(this,M)[o]=void 0),s=true,t(this,F)===1)a(this,n,Lt).call(this,i);else {t(this,nt).call(this,o);let u=t(this,d)[o];if(a(this,n,b).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,q)||t(this,D))&&(t(this,q)&&((h=t(this,P))==null||h.call(this,u,e,i)),t(this,D)&&t(this,x)?.push([u,e,i])),t(this,O).delete(e),t(this,y)[o]=void 0,t(this,d)[o]=void 0,o===t(this,E))f(this,E,t(this,G)[o]);else if(o===t(this,z))f(this,z,t(this,W)[o]);else {let c=t(this,G)[o];t(this,W)[c]=t(this,W)[o];let w=t(this,W)[o];t(this,G)[w]=t(this,G)[o];}yt(this,F)._--,t(this,$).push(o);}}if(t(this,D)&&t(this,x)?.length){let o=t(this,x),u;for(;u=o?.shift();)(r=t(this,k))==null||r.call(this,...u);}return s},Lt=function(e){var i,s;for(let h of a(this,n,it).call(this,{allowStale:true})){let r=t(this,d)[h];if(a(this,n,b).call(this,r))r.__abortController.abort(new Error("deleted"));else {let o=t(this,y)[h];t(this,q)&&((i=t(this,P))==null||i.call(this,r,o,e)),t(this,D)&&t(this,x)?.push([r,o,e]);}}if(t(this,O).clear(),t(this,d).fill(void 0),t(this,y).fill(void 0),t(this,j)&&t(this,J)){t(this,j).fill(0),t(this,J).fill(0);for(let h of t(this,M)??[])h!==void 0&&clearTimeout(h);t(this,M)?.fill(void 0);}if(t(this,B)&&t(this,B).fill(0),f(this,z,0),f(this,E,0),t(this,$).length=0,f(this,K,0),f(this,F,0),t(this,D)&&t(this,x)){let h=t(this,x),r;for(;r=h?.shift();)(s=t(this,k))==null||s.call(this,...r);}},wt);var Ut=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new kt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Et;(h=>(h.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),h.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),h.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),h.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(Et||(Et={}));function me(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Et.error("Error creating exportable element",l,e),new PixiError("not_json_serializable","Error creating exportable element")}}export{ie as a,se as b,he as c,S as d,Ut as e,Et as f,me as g};
|
|
1
|
+
import {PixiError}from'@drincs/pixi-vn/core';var Kt=Object.create;var xt=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Gt=l=>{throw TypeError(l)};var Xt=(l,e,i)=>e in l?xt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var ie=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var se=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var Yt=(l,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of Bt(e))!qt.call(l,h)&&h!==i&&xt(l,h,{get:()=>e[h],enumerable:!(s=$t(e,h))||s.enumerable});return l};var he=(l,e,i)=>(i=l!=null?Kt(Jt(l)):{},Yt(e||!l||!l.__esModule?xt(i,"default",{value:l,enumerable:true}):i,l));var S=(l,e,i)=>Xt(l,typeof e!="symbol"?e+"":e,i),Tt=(l,e,i)=>e.has(l)||Gt("Cannot "+i);var t=(l,e,i)=>(Tt(l,e,"read from private field"),i?i.call(l):e.get(l)),g=(l,e,i)=>e.has(l)?Gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,i),f=(l,e,i,s)=>(Tt(l,e,"write to private field"),e.set(l,i),i),a=(l,e,i)=>(Tt(l,e,"access private method"),i);var yt=(l,e,i,s)=>({set _(h){f(l,e,h);},get _(){return t(l,e,s)}});var Qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,It=new Set,zt=typeof process=="object"&&process?process:{},Vt=(l,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ft=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Ft>"u"){jt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){S(this,"signal",new jt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let l=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,Vt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Zt=l=>!It.has(l);var tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Pt=l=>tt(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?_t:null:null,_t=class extends Array{constructor(l){super(l),this.fill(0);}},Y,ct,te=(Y=class{constructor(e,i){S(this,"heap");S(this,"length");if(!t(Y,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=Pt(e);if(!i)return [];f(Y,ct,true);let s=new Y(e,i);return f(Y,ct,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,g(Y,ct,false),Y),Mt,Nt,V,U,P,ot,k,ft,dt,H,F,K,O,y,d,W,G,z,E,$,x,B,J,j,M,q,ht,D,pt,n,Rt,rt,Q,vt,N,Ht,nt,gt,bt,et,it,Ct,At,Ot,b,Wt,St,st,Dt,wt,kt=(wt=class{constructor(e){g(this,n);g(this,V);g(this,U);g(this,P);g(this,ot);g(this,k);g(this,ft);g(this,dt);g(this,H);S(this,"ttl");S(this,"ttlResolution");S(this,"ttlAutopurge");S(this,"updateAgeOnGet");S(this,"updateAgeOnHas");S(this,"allowStale");S(this,"noDisposeOnSet");S(this,"noUpdateTTL");S(this,"maxEntrySize");S(this,"sizeCalculation");S(this,"noDeleteOnFetchRejection");S(this,"noDeleteOnStaleGet");S(this,"allowStaleOnFetchAbort");S(this,"allowStaleOnFetchRejection");S(this,"ignoreFetchAbort");g(this,F);g(this,K);g(this,O);g(this,y);g(this,d);g(this,W);g(this,G);g(this,z);g(this,E);g(this,$);g(this,x);g(this,B);g(this,J);g(this,j);g(this,M);g(this,q);g(this,ht);g(this,D);g(this,pt);g(this,rt,()=>{});g(this,Q,()=>{});g(this,vt,()=>{});g(this,N,()=>false);g(this,nt,e=>{});g(this,gt,(e,i,s)=>{});g(this,bt,(e,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Mt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:T,disposeAfter:m,noDisposeOnSet:Z,noUpdateTTL:I,maxSize:X=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:p,memoMethod:R,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:mt,ignoreFetchAbort:lt,perf:at}=e;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,H,at??Qt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?Pt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(f(this,V,i),f(this,U,X),this.maxEntrySize=_||t(this,U),this.sizeCalculation=v,this.sizeCalculation){if(!t(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,dt,R),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ft,p),f(this,ht,!!p),f(this,O,new Map),f(this,y,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,W,new ut(i)),f(this,G,new ut(i)),f(this,z,0),f(this,E,0),f(this,$,te.create(i)),f(this,F,0),f(this,K,0),typeof w=="function"&&f(this,P,w),typeof T=="function"&&f(this,ot,T),typeof m=="function"?(f(this,k,m),f(this,x,[])):(f(this,k,void 0),f(this,x,void 0)),f(this,q,!!t(this,P)),f(this,pt,!!t(this,ot)),f(this,D,!!t(this,k)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(t(this,U)!==0&&!tt(t(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");a(this,n,Ht).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(h)||h===0?h:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");a(this,n,Rt).call(this);}if(t(this,V)===0&&this.ttl===0&&t(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,V)&&!t(this,U)){let Et="LRU_CACHE_UNBOUNDED";Zt(Et)&&(It.add(Et),Vt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Et,wt));}}get perf(){return t(this,H)}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,j),autopurgeTimers:t(e,M),sizes:t(e,B),keyMap:t(e,O),keyList:t(e,y),valList:t(e,d),next:t(e,W),prev:t(e,G),get head(){return t(e,z)},get tail(){return t(e,E)},free:t(e,$),isBackgroundFetch:i=>{var s;return a(s=e,n,b).call(s,i)},backgroundFetch:(i,s,h,r)=>{var o;return a(o=e,n,Ot).call(o,i,s,h,r)},moveToTail:i=>{var s;return a(s=e,n,St).call(s,i)},indexes:i=>{var s;return a(s=e,n,et).call(s,i)},rindexes:i=>{var s;return a(s=e,n,it).call(s,i)},isStale:i=>{var s;return t(s=e,N).call(s,i)}}}get max(){return t(this,V)}get maxSize(){return t(this,U)}get calculatedSize(){return t(this,K)}get size(){return t(this,F)}get fetchMethod(){return t(this,ft)}get memoMethod(){return t(this,dt)}get dispose(){return t(this,P)}get onInsert(){return t(this,ot)}get disposeAfter(){return t(this,k)}getRemainingTTL(e){return t(this,O).has(e)?1/0:0}*entries(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*rentries(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*keys(){for(let e of a(this,n,et).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of a(this,n,it).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of a(this,n,et).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of a(this,n,it).call(this))t(this,d)[e]!==void 0&&!a(this,n,b).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(Nt=Symbol.iterator,Mt=Symbol.toStringTag,Nt)](){return this.entries()}find(e,i={}){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r!==void 0&&e(r,t(this,y)[s],this))return this.get(t(this,y)[s],i)}}forEach(e,i=this){for(let s of a(this,n,et).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}rforEach(e,i=this){for(let s of a(this,n,it).call(this)){let h=t(this,d)[s],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;r!==void 0&&e.call(i,r,t(this,y)[s],this);}}purgeStale(){let e=false;for(let i of a(this,n,it).call(this,{allowStale:true}))t(this,N).call(this,i)&&(a(this,n,st).call(this,t(this,y)[i],"expire"),e=true);return e}info(e){let i=t(this,O).get(e);if(i===void 0)return;let s=t(this,d)[i],h=a(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let r={value:h};if(t(this,j)&&t(this,J)){let o=t(this,j)[i],u=t(this,J)[i];if(o&&u){let c=o-(t(this,H).now()-u);r.ttl=c,r.start=Date.now();}}return t(this,B)&&(r.size=t(this,B)[i]),r}dump(){let e=[];for(let i of a(this,n,et).call(this,{allowStale:true})){let s=t(this,y)[i],h=t(this,d)[i],r=a(this,n,b).call(this,h)?h.__staleWhileFetching:h;if(r===void 0||s===void 0)continue;let o={value:r};if(t(this,j)&&t(this,J)){o.ttl=t(this,j)[i];let u=t(this,H).now()-t(this,J)[i];o.start=Math.floor(Date.now()-u);}t(this,B)&&(o.size=t(this,B)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let h=Date.now()-s.start;s.start=t(this,H).now()-h;}this.set(i,s.value,s);}}set(e,i,s={}){var Z,I,X,_;if(i===void 0)return this.delete(e),this;let{ttl:h=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,T=t(this,bt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&T>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),a(this,n,st).call(this,e,"set"),this;let m=t(this,F)===0?void 0:t(this,O).get(e);if(m===void 0)m=t(this,F)===0?t(this,E):t(this,$).length!==0?t(this,$).pop():t(this,F)===t(this,V)?a(this,n,At).call(this,false):t(this,F),t(this,y)[m]=e,t(this,d)[m]=i,t(this,O).set(e,m),t(this,W)[t(this,E)]=m,t(this,G)[m]=t(this,E),f(this,E,m),yt(this,F)._++,t(this,gt).call(this,m,T,c),c&&(c.set="add"),w=false,t(this,pt)&&((Z=t(this,ot))==null||Z.call(this,i,e,"add"));else {a(this,n,St).call(this,m);let v=t(this,d)[m];if(i!==v){if(t(this,ht)&&a(this,n,b).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=v;p!==void 0&&!o&&(t(this,q)&&((I=t(this,P))==null||I.call(this,p,e,"set")),t(this,D)&&t(this,x)?.push([p,e,"set"]));}else o||(t(this,q)&&((X=t(this,P))==null||X.call(this,v,e,"set")),t(this,D)&&t(this,x)?.push([v,e,"set"]));if(t(this,nt).call(this,m),t(this,gt).call(this,m,T,c),t(this,d)[m]=i,c){c.set="replace";let p=v&&a(this,n,b).call(this,v)?v.__staleWhileFetching:v;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,pt)&&this.onInsert?.(i,e,i===v?"update":"replace");}if(h!==0&&!t(this,j)&&a(this,n,Rt).call(this),t(this,j)&&(w||t(this,vt).call(this,m,h,r),c&&t(this,Q).call(this,c,m)),!o&&t(this,D)&&t(this,x)){let v=t(this,x),p;for(;p=v?.shift();)(_=t(this,k))==null||_.call(this,...p);}return this}pop(){var e;try{for(;t(this,F);){let i=t(this,d)[t(this,z)];if(a(this,n,At).call(this,!0),a(this,n,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,D)&&t(this,x)){let i=t(this,x),s;for(;s=i?.shift();)(e=t(this,k))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,r=t(this,O).get(e);if(r!==void 0){let o=t(this,d)[r];if(a(this,n,b).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,N).call(this,r))h&&(h.has="stale",t(this,Q).call(this,h,r));else return s&&t(this,rt).call(this,r),h&&(h.has="hit",t(this,Q).call(this,h,r)),true}else h&&(h.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,h=t(this,O).get(e);if(h===void 0||!s&&t(this,N).call(this,h))return;let r=t(this,d)[h];return a(this,n,b).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:T=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,context:_,forceRefresh:v=false,status:p,signal:R}=i;if(!t(this,ht))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,status:p});let L={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:T,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:X,ignoreFetchAbort:I,status:p,signal:R},C=t(this,O).get(e);if(C===void 0){p&&(p.fetch="miss");let A=a(this,n,Ot).call(this,e,C,L,_);return A.__returned=A}else {let A=t(this,d)[C];if(a(this,n,b).call(this,A)){let ut=s&&A.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",ut&&(p.returnedStale=true)),ut?A.__staleWhileFetching:A.__returned=A}let mt=t(this,N).call(this,C);if(!v&&!mt)return p&&(p.fetch="hit"),a(this,n,St).call(this,C),h&&t(this,rt).call(this,C),p&&t(this,Q).call(this,p,C),A;let lt=a(this,n,Ot).call(this,e,C,L,_),at=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=mt?"stale":"refresh",at&&mt&&(p.returnedStale=true)),at?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:r,...o}=i,u=this.get(e,o);if(!r&&u!==void 0)return u;let c=s(e,u,{options:o,context:h});return this.set(e,c,o),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=i,u=t(this,O).get(e);if(u!==void 0){let c=t(this,d)[u],w=a(this,n,b).call(this,c);return o&&t(this,Q).call(this,o,u),t(this,N).call(this,u)?(o&&(o.get="stale"),w?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||a(this,n,st).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c:void 0)):(o&&(o.get="hit"),w?c.__staleWhileFetching:(a(this,n,St).call(this,u),h&&t(this,rt).call(this,u),c))}else o&&(o.get="miss");}delete(e){return a(this,n,st).call(this,e,"delete")}clear(){return a(this,n,Dt).call(this,"delete")}},V=new WeakMap,U=new WeakMap,P=new WeakMap,ot=new WeakMap,k=new WeakMap,ft=new WeakMap,dt=new WeakMap,H=new WeakMap,F=new WeakMap,K=new WeakMap,O=new WeakMap,y=new WeakMap,d=new WeakMap,W=new WeakMap,G=new WeakMap,z=new WeakMap,E=new WeakMap,$=new WeakMap,x=new WeakMap,B=new WeakMap,J=new WeakMap,j=new WeakMap,M=new WeakMap,q=new WeakMap,ht=new WeakMap,D=new WeakMap,pt=new WeakMap,n=new WeakSet,Rt=function(){let e=new _t(t(this,V)),i=new _t(t(this,V));f(this,j,e),f(this,J,i);let s=this.ttlAutopurge?new Array(t(this,V)):void 0;f(this,M,s),f(this,vt,(u,c,w=t(this,H).now())=>{i[u]=c!==0?w:0,e[u]=c,h(u,c);}),f(this,rt,u=>{i[u]=e[u]!==0?t(this,H).now():0,h(u,e[u]);});let h=this.ttlAutopurge?(u,c)=>{if(s?.[u]&&(clearTimeout(s[u]),s[u]=void 0),c&&c!==0&&s){let w=setTimeout(()=>{t(this,N).call(this,u)&&a(this,n,st).call(this,t(this,y)[u],"expire");},c+1);w.unref&&w.unref(),s[u]=w;}}:()=>{};f(this,Q,(u,c)=>{if(e[c]){let w=e[c],T=i[c];if(!w||!T)return;u.ttl=w,u.start=T,u.now=r||o();let m=u.now-T;u.remainingTTL=w-m;}});let r=0,o=()=>{let u=t(this,H).now();if(this.ttlResolution>0){r=u;let c=setTimeout(()=>r=0,this.ttlResolution);c.unref&&c.unref();}return u};this.getRemainingTTL=u=>{let c=t(this,O).get(u);if(c===void 0)return 0;let w=e[c],T=i[c];if(!w||!T)return 1/0;let m=(r||o())-T;return w-m},f(this,N,u=>{let c=i[u],w=e[u];return !!w&&!!c&&(r||o())-c>w});},rt=new WeakMap,Q=new WeakMap,vt=new WeakMap,N=new WeakMap,Ht=function(){let e=new _t(t(this,V));f(this,K,0),f(this,B,e),f(this,nt,i=>{f(this,K,t(this,K)-e[i]),e[i]=0;}),f(this,bt,(i,s,h,r)=>{if(a(this,n,b).call(this,s))return 0;if(!tt(h))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(h=r(s,i),!tt(h))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h}),f(this,gt,(i,s,h)=>{if(e[i]=s,t(this,U)){let r=t(this,U)-e[i];for(;t(this,K)>r;)a(this,n,At).call(this,true);}f(this,K,t(this,K)+e[i]),h&&(h.entrySize=s,h.totalCalculatedSize=t(this,K));});},nt=new WeakMap,gt=new WeakMap,bt=new WeakMap,et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,E);!(!a(this,n,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,z)));)i=t(this,G)[i];},it=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,z);!(!a(this,n,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,E)));)i=t(this,W)[i];},Ct=function(e){return e!==void 0&&t(this,O).get(t(this,y)[e])===e},At=function(e){var r;let i=t(this,z),s=t(this,y)[i],h=t(this,d)[i];return t(this,ht)&&a(this,n,b).call(this,h)?h.__abortController.abort(new Error("evicted")):(t(this,q)||t(this,D))&&(t(this,q)&&((r=t(this,P))==null||r.call(this,h,s,"evict")),t(this,D)&&t(this,x)?.push([h,s,"evict"])),t(this,nt).call(this,i),t(this,M)?.[i]&&(clearTimeout(t(this,M)[i]),t(this,M)[i]=void 0),e&&(t(this,y)[i]=void 0,t(this,d)[i]=void 0,t(this,$).push(i)),t(this,F)===1?(f(this,z,f(this,E,0)),t(this,$).length=0):f(this,z,t(this,W)[i]),t(this,O).delete(s),yt(this,F)._--,i},Ot=function(e,i,s,h){let r=i===void 0?void 0:t(this,d)[i];if(a(this,n,b).call(this,r))return r;let o=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:h},w=(_,v=false)=>{let{aborted:p}=o.signal,R=s.ignoreFetchAbort&&_!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&_!==void 0);if(s.status&&(p&&!v?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!R&&!v)return m(o.signal.reason,L);let C=I,A=t(this,d)[i];return (A===I||R&&v&&A===void 0)&&(_===void 0?C.__staleWhileFetching!==void 0?t(this,d)[i]=C.__staleWhileFetching:a(this,n,st).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,_,c.options))),_},T=_=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=_),m(_,false)),m=(_,v)=>{let{aborted:p}=o.signal,R=p&&s.allowStaleOnFetchAbort,L=R||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,A=I;if(t(this,d)[i]===I&&(!C||!v&&A.__staleWhileFetching===void 0?a(this,n,st).call(this,e,"fetch"):R||(t(this,d)[i]=A.__staleWhileFetching)),L)return s.status&&A.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),A.__staleWhileFetching;if(A.__returned===A)throw _},Z=(_,v)=>{var R;let p=(R=t(this,ft))==null?void 0:R.call(this,e,r,c);p&&p instanceof Promise&&p.then(L=>_(L===void 0?void 0:L),v),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(_(void 0),s.allowStaleOnFetchAbort&&(_=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(Z).then(w,T),X=Object.assign(I,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,X,{...c.options,status:void 0}),i=t(this,O).get(e)):t(this,d)[i]=X,X},b=function(e){if(!t(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Wt=function(e,i){t(this,G)[i]=e,t(this,W)[e]=i;},St=function(e){e!==t(this,E)&&(e===t(this,z)?f(this,z,t(this,W)[e]):a(this,n,Wt).call(this,t(this,G)[e],t(this,W)[e]),a(this,n,Wt).call(this,t(this,E),e),f(this,E,e));},st=function(e,i){var h,r;let s=false;if(t(this,F)!==0){let o=t(this,O).get(e);if(o!==void 0)if(t(this,M)?.[o]&&(clearTimeout(t(this,M)?.[o]),t(this,M)[o]=void 0),s=true,t(this,F)===1)a(this,n,Dt).call(this,i);else {t(this,nt).call(this,o);let u=t(this,d)[o];if(a(this,n,b).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,q)||t(this,D))&&(t(this,q)&&((h=t(this,P))==null||h.call(this,u,e,i)),t(this,D)&&t(this,x)?.push([u,e,i])),t(this,O).delete(e),t(this,y)[o]=void 0,t(this,d)[o]=void 0,o===t(this,E))f(this,E,t(this,G)[o]);else if(o===t(this,z))f(this,z,t(this,W)[o]);else {let c=t(this,G)[o];t(this,W)[c]=t(this,W)[o];let w=t(this,W)[o];t(this,G)[w]=t(this,G)[o];}yt(this,F)._--,t(this,$).push(o);}}if(t(this,D)&&t(this,x)?.length){let o=t(this,x),u;for(;u=o?.shift();)(r=t(this,k))==null||r.call(this,...u);}return s},Dt=function(e){var i,s;for(let h of a(this,n,it).call(this,{allowStale:true})){let r=t(this,d)[h];if(a(this,n,b).call(this,r))r.__abortController.abort(new Error("deleted"));else {let o=t(this,y)[h];t(this,q)&&((i=t(this,P))==null||i.call(this,r,o,e)),t(this,D)&&t(this,x)?.push([r,o,e]);}}if(t(this,O).clear(),t(this,d).fill(void 0),t(this,y).fill(void 0),t(this,j)&&t(this,J)){t(this,j).fill(0),t(this,J).fill(0);for(let h of t(this,M)??[])h!==void 0&&clearTimeout(h);t(this,M)?.fill(void 0);}if(t(this,B)&&t(this,B).fill(0),f(this,z,0),f(this,E,0),t(this,$).length=0,f(this,K,0),f(this,F,0),t(this,D)&&t(this,x)){let h=t(this,x),r;for(;r=h?.shift();)(s=t(this,k))==null||s.call(this,...r);}},wt);var Lt=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new kt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut;(h=>(h.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),h.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),h.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),h.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(Ut||={});function me(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Ut.error("Error creating exportable element",l,e),new PixiError("not_json_serializable","Error creating exportable element")}}export{ie as a,se as b,he as c,S as d,Lt as e,Ut as f,me as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {k as k$1,m,j,l,n}from'./chunk-IWAXXFXE.mjs';import {e,g,f as f$1,d}from'./chunk-3M6A7TU2.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var x;(n=>{n.storage=new e({cacheSize:50}),n.defaultStorage=new e({cacheSize:10}),n.tempStorageDeadlines=new Map;let s;function c(r){n.tempStorageDeadlines.forEach((l,o)=>{l>r&&(n.storage.delete(`${k$1}:${o}`),s?.onClearOldTempVariable?.(o),n.tempStorageDeadlines.delete(o));});}n.clearOldTempVariables=c;function h(r){s=r;}n.setExternalStoreHandler=h;function y(r,l,o){o==null?n.storage.delete(`${r}:${l}`):n.storage.set(`${r}:${l}`,o),s?.onSetVariable?.(l,o);}n.setVariable=y;function O(r,l){let o=n.storage.get(`${r}:${l}`);return g(o)}n.getVariable=O;function M(r,l){n.storage.delete(`${r}:${l}`),s?.onRemoveVariable?.(l);}n.removeVariable=M;function D(r,l){let o=n.storage.get(m)||[];if(l)o.includes(r)||o.push(r);else {let V=o.indexOf(r);V>-1&&o.splice(V,1);}n.storage.set(m,o);}n.setFlag=D;function R(r){return (n.storage.get(m)||[]).includes(r)}n.getFlag=R;})(x||={});var a=x;var S=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,s])=>{a.defaultStorage.map.set(e,s);});}set(t,e){return a.setVariable(j,t,e)}get(t){let e=a.getVariable(k$1,t);return e===void 0&&(e=a.getVariable(j,t)),e===void 0&&(e=g(a.defaultStorage.get(t))),e}remove(t){return this.removeTempVariable(t),a.removeVariable(j,t)}setTempVariable(t,e){if(e==null){this.removeTempVariable(t);return}else a.setVariable(k$1,t,e),this.tempStorageDeadlines.has(t)||this.tempStorageDeadlines.set(t,GameUnifier.openedLabels);}removeTempVariable(t){a.removeVariable(k$1,t),this.tempStorageDeadlines.has(t)&&this.tempStorageDeadlines.delete(t);}setFlag(t,e){return a.setFlag(t,e)}getFlag(t){return a.getFlag(t)}setStorageHandler(t){a.setExternalStoreHandler(t);}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let t=[];[...this.base.keys()].forEach(s=>{t.push({key:s,value:this.base.get(s)});});let e=[];return [...a.tempStorageDeadlines.keys()].forEach(s=>{e.push({key:s,value:this.tempStorageDeadlines.get(s)});}),g({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(l,n.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(l,n.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(l,n.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(l,n.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(l,n.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(l,n.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(l,n.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(l,n.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(l,n.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(l,n.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(l,n.LAST_STEP_GLUED,e.value);break;default:a.setVariable(j,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(k$1,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.tempStorageDeadlines.set(e.key,e.value);})):f$1.warn("No storage data found");}catch(e){f$1.error("Error importing data",e);}}};var f=class{constructor(t,e){d(this,"id");d(this,"categoryId");this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(j,t);e&&(Object.entries(e).forEach(([s,c])=>{typeof c=="object"&&c!==null&&Object.entries(c).forEach(([h,y])=>{a.setVariable(this.categoryId,`${s}:${h}`,y);});}),a.removeVariable(j,t));}setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var k=new S;export{a,f as b,k as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-3M6A7TU2.mjs';var L=b((S,I)=>{(function(w,o){typeof S=="object"?I.exports=S=o():typeof define=="function"&&define.amd?define([],o):w.CryptoJS=o();})(S,function(){var w=w||(function(o,x){var a$1;if(typeof window<"u"&&window.crypto&&(a$1=window.crypto),typeof self<"u"&&self.crypto&&(a$1=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a$1=globalThis.crypto),!a$1&&typeof window<"u"&&window.msCrypto&&(a$1=window.msCrypto),!a$1&&typeof global<"u"&&global.crypto&&(a$1=global.crypto),!a$1&&typeof a=="function")try{a$1=a("crypto");}catch{}var _=function(){if(a$1){if(typeof a$1.getRandomValues=="function")try{return a$1.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a$1.randomBytes=="function")try{return a$1.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}})(),d={},B=d.lib={},u=B.Base=(function(){return {extend:function(t){var e=C(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments);}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),l=B.WordArray=u.extend({init:function(t,e){t=this.words=t||[],e!=x?this.sigBytes=e:this.sigBytes=t.length*4;},toString:function(t){return (t||v).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,f=t.sigBytes;if(this.clamp(),r%4)for(var c=0;c<f;c++){var z=n[c>>>2]>>>24-c%4*8&255;e[r+c>>>2]|=z<<24-(r+c)%4*8;}else for(var g=0;g<f;g+=4)e[r+g>>>2]=n[g>>>2];return this.sigBytes+=f,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=o.ceil(e/4);},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(_());return new l.init(e,t)}}),i=d.enc={},v=i.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push((c>>>4).toString(16)),r.push((c&15).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=i.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push(String.fromCharCode(c));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,e)}},p=i.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},y=B.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(t){typeof t=="string"&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e,n=this._data,r=n.words,f=n.sigBytes,c=this.blockSize,z=c*4,g=f/z;t?g=o.ceil(g):g=o.max((g|0)-this._minBufferSize,0);var b=g*c,R=o.min(b*4,f);if(b){for(var A=0;A<b;A+=c)this._doProcessBlock(r,A);e=r.splice(0,b),n.sigBytes-=R;}return new l.init(e,R)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});B.Hasher=y.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:512/32,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new s.HMAC.init(t,n).finalize(e)}}});var s=d.algo={};return d})(Math);return w});});var T=b((H,P)=>{(function(w,o){typeof H=="object"?P.exports=H=o(L()):typeof define=="function"&&define.amd?define(["./core"],o):o(w.CryptoJS);})(H,function(w){return (function(){var o=w,x=o.lib,a=x.WordArray,_=x.Hasher,C=o.algo,d=[],B=C.SHA1=_.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var i=this._hash.words,v=i[0],h=i[1],p=i[2],y=i[3],m=i[4],s=0;s<80;s++){if(s<16)d[s]=u[l+s]|0;else {var t=d[s-3]^d[s-8]^d[s-14]^d[s-16];d[s]=t<<1|t>>>31;}var e=(v<<5|v>>>27)+m+d[s];s<20?e+=(h&p|~h&y)+1518500249:s<40?e+=(h^p^y)+1859775393:s<60?e+=(h&p|h&y|p&y)-1894007588:e+=(h^p^y)-899497514,m=y,y=p,p=h<<30|h>>>2,h=v,v=e;}i[0]=i[0]+v|0,i[1]=i[1]+h|0,i[2]=i[2]+p|0,i[3]=i[3]+y|0,i[4]=i[4]+m|0;},_doFinalize:function(){var u=this._data,l=u.words,i=this._nDataBytes*8,v=u.sigBytes*8;return l[v>>>5]|=128<<24-v%32,l[(v+64>>>9<<4)+14]=Math.floor(i/4294967296),l[(v+64>>>9<<4)+15]=i,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=_.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=_._createHelper(B),o.HmacSHA1=_._createHmacHelper(B);})(),w.SHA1});});export{T as a};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var u=Object.defineProperty;var
|
|
1
|
+
'use strict';var u=Object.defineProperty;var g=(l,t,r)=>t in l?u(l,t,{enumerable:true,configurable:true,writable:true,value:r}):l[t]=r;var n=(l,t,r)=>g(l,typeof t!="symbol"?t+"":t,r);var i;(m=>(m.log=(o,...s)=>console.log(`[Pixi\u2019VN] ${o}`,...s),m.warn=(o,...s)=>console.warn(`[Pixi\u2019VN] ${o}`,...s),m.error=(o,...s)=>console.error(`[Pixi\u2019VN] ${o}`,...s),m.info=(o,...s)=>console.info(`[Pixi\u2019VN] ${o}`,...s)))(i||={});var a=class extends Error{constructor(r,d,m,o,s){super(`[Pixi\u2019VN] ${d}`);n(this,"code");n(this,"canvasElementInfo");n(this,"parent");this.code=r,m==="canvas"&&(this.canvasElementInfo=o,this.parent=s);}};var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(r=>r!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(r=>r()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let r=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=r.newValue,await r.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(r=>r!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,r){for(let d of e._onErrorHandlers.slice())try{await d(t,r);}catch(m){i.error("Error in onError handler",m);}}static get animate(){return e._animate}};n(e,"_navigate",()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),n(e,"_getStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getCurrentGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_restoreGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getOpenedLabels",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onPreContinueHandlers",[]),n(e,"navigationRequestsCount",0),n(e,"processNavigationLock",Promise.resolve()),n(e,"_processNavigationRequests",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_removeVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_getFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_setFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"_onLabelClosing",()=>{}),n(e,"_addHistoryItem",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),n(e,"runningStepsCount",0),n(e,"_getCharacter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented.")}),n(e,"onEnd"),n(e,"_onErrorHandlers",[]),n(e,"_animate",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")});var p=e;exports.GameUnifier=p;exports.PixiError=a;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,120 +1,11 @@
|
|
|
1
|
-
import { StepLabelProps,
|
|
2
|
-
import {
|
|
1
|
+
import { StepLabelProps, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
+
import { CanvasBaseInterface, CanvasBaseItemMemory, CanvasBaseItem } from '@drincs/pixi-vn/canvas';
|
|
3
|
+
import { UPDATE_PRIORITY, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
|
|
4
|
+
import { S as StepLabelPropsType, a as StepLabelResultType, b as StepLabelType } from './StepLabelType-CN97wZzm.cjs';
|
|
5
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
3
6
|
|
|
4
7
|
type ErrorCodeType = "obsolete_save" | "unknown_element" | "unregistered_element" | "unregistered_asset" | "not_json_serializable" | "not_implemented" | "invalid_usage" | "unhandled_error";
|
|
5
8
|
|
|
6
|
-
declare global {
|
|
7
|
-
const __VITE__: boolean | undefined;
|
|
8
|
-
const __ROLLUP_PLUGIN__: boolean | undefined;
|
|
9
|
-
const __webpack_require__: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This class is used to create a canvas element to add into a Pixi Application.
|
|
14
|
-
* You can use {@link canvas.add()} to add this element into the application.
|
|
15
|
-
* This class should be implemented and the memory method should be overridden.
|
|
16
|
-
* You must use the {@link canvasComponentDecorator} to register the canvas in the game.
|
|
17
|
-
* In Ren'Py is a displayable.
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const CANVAS_EXAMPLE_ID = "CanvasExample";
|
|
21
|
-
*
|
|
22
|
-
* \@canvasComponentDecorator({
|
|
23
|
-
* name: CANVAS_EXAMPLE_ID,
|
|
24
|
-
* })
|
|
25
|
-
* export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
|
|
26
|
-
* get memory(): Memory {
|
|
27
|
-
* return {
|
|
28
|
-
* pixivnId: CANVAS_EXAMPLE_ID,
|
|
29
|
-
* // ... other properties
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
* async setMemory(value: Memory) {
|
|
33
|
-
* // ... set other properties
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
39
|
-
constructor(..._options: any);
|
|
40
|
-
/**
|
|
41
|
-
* This method return the memory of the canvas element.
|
|
42
|
-
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
43
|
-
*/
|
|
44
|
-
get memory(): T2;
|
|
45
|
-
/**
|
|
46
|
-
* This method set the memory of the canvas element.
|
|
47
|
-
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
48
|
-
*/
|
|
49
|
-
setMemory(_value: T2): Promise<void> | void;
|
|
50
|
-
/**
|
|
51
|
-
* Get the id of the canvas element. This variable is used in the system to get the canvas element by id
|
|
52
|
-
*/
|
|
53
|
-
pixivnId: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Interface for the canvas base memory
|
|
58
|
-
*/
|
|
59
|
-
interface CanvasBaseItemMemory {
|
|
60
|
-
pixivnId: string;
|
|
61
|
-
/**
|
|
62
|
-
* The index of the container in its parent, if it has one
|
|
63
|
-
*/
|
|
64
|
-
index?: number;
|
|
65
|
-
/**
|
|
66
|
-
* The label of the parent container, if it has one
|
|
67
|
-
*/
|
|
68
|
-
parentLabel?: string;
|
|
69
|
-
label?: string;
|
|
70
|
-
zIndex?: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface CanvasBaseInterface<T2 extends CanvasBaseItemMemory> extends CanvasBaseItem<T2>, Container {
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Result of a {@link StepLabelType} execution.
|
|
78
|
-
*
|
|
79
|
-
* - `StepLabelResult`: a structured result consumed by the narration engine.
|
|
80
|
-
* - `void`: the step completed without returning an explicit result.
|
|
81
|
-
* - `string`: a simple token or message interpreted by higher-level logic.
|
|
82
|
-
*
|
|
83
|
-
* Prefer returning a well-typed {@link StepLabelResult} for anything that
|
|
84
|
-
* needs to be consumed programmatically. Use plain strings only where a
|
|
85
|
-
* lightweight, convention-based signal is sufficient and clearly documented
|
|
86
|
-
* by the surrounding game logic.
|
|
87
|
-
*/
|
|
88
|
-
type StepLabelResultType = StepLabelResult | void | string;
|
|
89
|
-
type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
|
|
90
|
-
/**
|
|
91
|
-
* StepLabel is a function that will be executed as the game continues.
|
|
92
|
-
*/
|
|
93
|
-
type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
94
|
-
/**
|
|
95
|
-
* The id of the label.
|
|
96
|
-
*/
|
|
97
|
-
labelId: string;
|
|
98
|
-
}) => StepLabelResultType | Promise<StepLabelResultType>;
|
|
99
|
-
|
|
100
|
-
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
101
|
-
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
102
|
-
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
103
|
-
[key: string | number | symbol]: NonFunctionStorage;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* StorageElementType are all the types that can be stored in the storage
|
|
107
|
-
*/
|
|
108
|
-
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
109
|
-
[key: string | number | symbol]: StorageElementType;
|
|
110
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
111
|
-
[key: string | number | symbol]: NonFunctionStorage;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* StorageObjectType are all the types that can be stored in the storage
|
|
115
|
-
*/
|
|
116
|
-
type StorageObjectType = Record<string | number | symbol, StorageElementType>;
|
|
117
|
-
|
|
118
9
|
/**
|
|
119
10
|
* Type for on-error handlers. Handlers accept the error object and the step
|
|
120
11
|
* props; they may be synchronous or asynchronous.
|