@drincs/pixi-vn 1.3.19 → 1.3.21

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.
@@ -1 +1 @@
1
- 'use strict';require('@drincs/pixi-vn/unifier');var ee=Object.defineProperty;var $t=l=>{throw TypeError(l)};var ie=(l,t,e)=>t in l?ee(l,t,{enumerable:true,configurable:true,writable:true,value:e}):l[t]=e;var g=(l,t,e)=>ie(l,typeof t!="symbol"?t+"":t,e),Lt=(l,t,e)=>t.has(l)||$t("Cannot "+e);var i=(l,t,e)=>(Lt(l,t,"read from private field"),e?e.call(l):t.get(l)),m=(l,t,e)=>t.has(l)?$t("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(l):t.set(l,e),f=(l,t,e,s)=>(Lt(l,t,"write to private field"),t.set(l,e),e),h=(l,t,e)=>(Lt(l,t,"access private method"),e);var xt=(l,t,e,s)=>({set _(n){f(l,t,n);},get _(){return i(l,t,s)}});var W;(n=>(n.log=(r,...a)=>console.log(`[Pixi\u2019VN] ${r}`,...a),n.warn=(r,...a)=>console.warn(`[Pixi\u2019VN] ${r}`,...a),n.error=(r,...a)=>console.error(`[Pixi\u2019VN] ${r}`,...a),n.info=(r,...a)=>console.info(`[Pixi\u2019VN] ${r}`,...a)))(W||(W={}));function vt(l){try{if(typeof l>"u")return l;let t=JSON.stringify(l);return JSON.parse(t)}catch(t){throw W.error("Error creating exportable element",l,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var ut=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,Nt=typeof process=="object"&&process?process:{},Qt=(l,t,e,s)=>{typeof Nt.emitWarning=="function"?Nt.emitWarning(l,t,e,s):console.error(`[${e}] ${t}: ${l}`);},Dt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Dt>"u"){Bt=class{constructor(){g(this,"onabort");g(this,"_onabort",[]);g(this,"reason");g(this,"aborted",false);}addEventListener(s,n){this._onabort.push(n);}},Dt=class{constructor(){g(this,"signal",new Bt);t();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let n of this.signal._onabort)n(s);this.signal.onabort?.(s);}}};let l=Nt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=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",t));};}var se=l=>!Jt.has(l),tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Zt=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?dt:null:null,dt=class extends Array{constructor(t){super(t),this.fill(0);}},gt,at=class at{constructor(t,e){g(this,"heap");g(this,"length");if(!i(at,gt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0;}static create(t){let e=Zt(t);if(!e)return [];f(at,gt,true);let s=new at(t,e);return f(at,gt,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};gt=new WeakMap,m(at,gt,false);var Pt=at,Xt,qt,Y,G,K,ot,j,pt,_t,R,H,w,E,p,F,L,I,C,$,x,B,X,N,q,rt,D,mt,o,Vt,ht,Z,wt,P,kt,lt,St,At,et,it,Ut,It,Ft,S,Wt,Tt,st,Yt,Kt=class Kt{constructor(t){m(this,o);m(this,Y);m(this,G);m(this,K);m(this,ot);m(this,j);m(this,pt);m(this,_t);g(this,"ttl");g(this,"ttlResolution");g(this,"ttlAutopurge");g(this,"updateAgeOnGet");g(this,"updateAgeOnHas");g(this,"allowStale");g(this,"noDisposeOnSet");g(this,"noUpdateTTL");g(this,"maxEntrySize");g(this,"sizeCalculation");g(this,"noDeleteOnFetchRejection");g(this,"noDeleteOnStaleGet");g(this,"allowStaleOnFetchAbort");g(this,"allowStaleOnFetchRejection");g(this,"ignoreFetchAbort");m(this,R);m(this,H);m(this,w);m(this,E);m(this,p);m(this,F);m(this,L);m(this,I);m(this,C);m(this,$);m(this,x);m(this,B);m(this,X);m(this,N);m(this,q);m(this,rt);m(this,D);m(this,mt);m(this,ht,()=>{});m(this,Z,()=>{});m(this,wt,()=>{});m(this,P,()=>false);m(this,lt,t=>{});m(this,St,(t,e,s)=>{});m(this,At,(t,e,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});g(this,Xt,"LRUCache");let{max:e=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:c,dispose:O,onInsert:J,disposeAfter:b,noDisposeOnSet:k,noUpdateTTL:V,maxSize:Q=0,maxEntrySize:T=0,sizeCalculation:y,fetchMethod:_,memoMethod:z,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:yt,ignoreFetchAbort:ft}=t;if(e!==0&&!tt(e))throw new TypeError("max option must be a nonnegative integer");let Ct=e?Zt(e):Array;if(!Ct)throw new Error("invalid max value: "+e);if(f(this,Y,e),f(this,G,Q),this.maxEntrySize=T||i(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!i(this,G)&&!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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,pt,_),f(this,rt,!!_),f(this,w,new Map),f(this,E,new Array(e).fill(void 0)),f(this,p,new Array(e).fill(void 0)),f(this,F,new Ct(e)),f(this,L,new Ct(e)),f(this,I,0),f(this,C,0),f(this,$,Pt.create(e)),f(this,R,0),f(this,H,0),typeof O=="function"&&f(this,K,O),typeof J=="function"&&f(this,ot,J),typeof b=="function"?(f(this,j,b),f(this,x,[])):(f(this,j,void 0),f(this,x,void 0)),f(this,q,!!i(this,K)),f(this,mt,!!i(this,ot)),f(this,D,!!i(this,j)),this.noDisposeOnSet=!!k,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!U,this.allowStaleOnFetchAbort=!!yt,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(i(this,G)!==0&&!tt(i(this,G)))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");h(this,o,kt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=tt(n)||n===0?n: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");h(this,o,Vt).call(this);}if(i(this,Y)===0&&this.ttl===0&&i(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!i(this,Y)&&!i(this,G)){let ct="LRU_CACHE_UNBOUNDED";se(ct)&&(Jt.add(ct),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ct,Kt));}}static unsafeExposeInternals(t){return {starts:i(t,X),ttls:i(t,N),sizes:i(t,B),keyMap:i(t,w),keyList:i(t,E),valList:i(t,p),next:i(t,F),prev:i(t,L),get head(){return i(t,I)},get tail(){return i(t,C)},free:i(t,$),isBackgroundFetch:e=>{var s;return h(s=t,o,S).call(s,e)},backgroundFetch:(e,s,n,r)=>{var a;return h(a=t,o,Ft).call(a,e,s,n,r)},moveToTail:e=>{var s;return h(s=t,o,Tt).call(s,e)},indexes:e=>{var s;return h(s=t,o,et).call(s,e)},rindexes:e=>{var s;return h(s=t,o,it).call(s,e)},isStale:e=>{var s;return i(s=t,P).call(s,e)}}}get max(){return i(this,Y)}get maxSize(){return i(this,G)}get calculatedSize(){return i(this,H)}get size(){return i(this,R)}get fetchMethod(){return i(this,pt)}get memoMethod(){return i(this,_t)}get dispose(){return i(this,K)}get onInsert(){return i(this,ot)}get disposeAfter(){return i(this,j)}getRemainingTTL(t){return i(this,w).has(t)?1/0:0}*entries(){for(let t of h(this,o,et).call(this))i(this,p)[t]!==void 0&&i(this,E)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield [i(this,E)[t],i(this,p)[t]]);}*rentries(){for(let t of h(this,o,it).call(this))i(this,p)[t]!==void 0&&i(this,E)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield [i(this,E)[t],i(this,p)[t]]);}*keys(){for(let t of h(this,o,et).call(this)){let e=i(this,E)[t];e!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield e);}}*rkeys(){for(let t of h(this,o,it).call(this)){let e=i(this,E)[t];e!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield e);}}*values(){for(let t of h(this,o,et).call(this))i(this,p)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield i(this,p)[t]);}*rvalues(){for(let t of h(this,o,it).call(this))i(this,p)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield i(this,p)[t]);}[(qt=Symbol.iterator,Xt=Symbol.toStringTag,qt)](){return this.entries()}find(t,e={}){for(let s of h(this,o,et).call(this)){let n=i(this,p)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r!==void 0&&t(r,i(this,E)[s],this))return this.get(i(this,E)[s],e)}}forEach(t,e=this){for(let s of h(this,o,et).call(this)){let n=i(this,p)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,i(this,E)[s],this);}}rforEach(t,e=this){for(let s of h(this,o,it).call(this)){let n=i(this,p)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,i(this,E)[s],this);}}purgeStale(){let t=false;for(let e of h(this,o,it).call(this,{allowStale:true}))i(this,P).call(this,e)&&(h(this,o,st).call(this,i(this,E)[e],"expire"),t=true);return t}info(t){let e=i(this,w).get(t);if(e===void 0)return;let s=i(this,p)[e],n=h(this,o,S).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;let r={value:n};if(i(this,N)&&i(this,X)){let a=i(this,N)[e],d=i(this,X)[e];if(a&&d){let c=a-(ut.now()-d);r.ttl=c,r.start=Date.now();}}return i(this,B)&&(r.size=i(this,B)[e]),r}dump(){let t=[];for(let e of h(this,o,et).call(this,{allowStale:true})){let s=i(this,E)[e],n=i(this,p)[e],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r===void 0||s===void 0)continue;let a={value:r};if(i(this,N)&&i(this,X)){a.ttl=i(this,N)[e];let d=ut.now()-i(this,X)[e];a.start=Math.floor(Date.now()-d);}i(this,B)&&(a.size=i(this,B)[e]),t.unshift([s,a]);}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let n=Date.now()-s.start;s.start=ut.now()-n;}this.set(e,s.value,s);}}set(t,e,s={}){var k,V,Q,T;if(e===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c}=s,{noUpdateTTL:O=this.noUpdateTTL}=s,J=i(this,At).call(this,t,e,s.size||0,d);if(this.maxEntrySize&&J>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,o,st).call(this,t,"set"),this;let b=i(this,R)===0?void 0:i(this,w).get(t);if(b===void 0)b=i(this,R)===0?i(this,C):i(this,$).length!==0?i(this,$).pop():i(this,R)===i(this,Y)?h(this,o,It).call(this,false):i(this,R),i(this,E)[b]=t,i(this,p)[b]=e,i(this,w).set(t,b),i(this,F)[i(this,C)]=b,i(this,L)[b]=i(this,C),f(this,C,b),xt(this,R)._++,i(this,St).call(this,b,J,c),c&&(c.set="add"),O=false,i(this,mt)&&((k=i(this,ot))==null||k.call(this,e,t,"add"));else {h(this,o,Tt).call(this,b);let y=i(this,p)[b];if(e!==y){if(i(this,rt)&&h(this,o,S).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=y;_!==void 0&&!a&&(i(this,q)&&((V=i(this,K))==null||V.call(this,_,t,"set")),i(this,D)&&i(this,x)?.push([_,t,"set"]));}else a||(i(this,q)&&((Q=i(this,K))==null||Q.call(this,y,t,"set")),i(this,D)&&i(this,x)?.push([y,t,"set"]));if(i(this,lt).call(this,b),i(this,St).call(this,b,J,c),i(this,p)[b]=e,c){c.set="replace";let _=y&&h(this,o,S).call(this,y)?y.__staleWhileFetching:y;_!==void 0&&(c.oldValue=_);}}else c&&(c.set="update");i(this,mt)&&this.onInsert?.(e,t,e===y?"update":"replace");}if(n!==0&&!i(this,N)&&h(this,o,Vt).call(this),i(this,N)&&(O||i(this,wt).call(this,b,n,r),c&&i(this,Z).call(this,c,b)),!a&&i(this,D)&&i(this,x)){let y=i(this,x),_;for(;_=y?.shift();)(T=i(this,j))==null||T.call(this,..._);}return this}pop(){var t;try{for(;i(this,R);){let e=i(this,p)[i(this,I)];if(h(this,o,It).call(this,!0),h(this,o,S).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(i(this,D)&&i(this,x)){let e=i(this,x),s;for(;s=e?.shift();)(t=i(this,j))==null||t.call(this,...s);}}}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=e,r=i(this,w).get(t);if(r!==void 0){let a=i(this,p)[r];if(h(this,o,S).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(i(this,P).call(this,r))n&&(n.has="stale",i(this,Z).call(this,n,r));else return s&&i(this,ht).call(this,r),n&&(n.has="hit",i(this,Z).call(this,n,r)),true}else n&&(n.has="miss");return false}peek(t,e={}){let{allowStale:s=this.allowStale}=e,n=i(this,w).get(t);if(n===void 0||!s&&i(this,P).call(this,n))return;let r=i(this,p)[n];return h(this,o,S).call(this,r)?r.__staleWhileFetching:r}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:J=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:k=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:Q=this.allowStaleOnFetchAbort,context:T,forceRefresh:y=false,status:_,signal:z}=e;if(!i(this,rt))return _&&(_.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:_});let M={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:d,size:c,sizeCalculation:O,noUpdateTTL:J,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:Q,ignoreFetchAbort:V,status:_,signal:z},v=i(this,w).get(t);if(v===void 0){_&&(_.fetch="miss");let U=h(this,o,Ft).call(this,t,v,M,T);return U.__returned=U}else {let U=i(this,p)[v];if(h(this,o,S).call(this,U)){let Gt=s&&U.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",Gt&&(_.returnedStale=true)),Gt?U.__staleWhileFetching:U.__returned=U}let yt=i(this,P).call(this,v);if(!y&&!yt)return _&&(_.fetch="hit"),h(this,o,Tt).call(this,v),n&&i(this,ht).call(this,v),_&&i(this,Z).call(this,_,v),U;let ft=h(this,o,Ft).call(this,t,v,M,T),ct=ft.__staleWhileFetching!==void 0&&s;return _&&(_.fetch=yt?"stale":"refresh",ct&&yt&&(_.returnedStale=true)),ct?ft.__staleWhileFetching:ft.__returned=ft}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=i(this,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...a}=e,d=this.get(t,a);if(!r&&d!==void 0)return d;let c=s(t,d,{options:a,context:n});return this.set(t,c,a),c}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=e,d=i(this,w).get(t);if(d!==void 0){let c=i(this,p)[d],O=h(this,o,S).call(this,c);return a&&i(this,Z).call(this,a,d),i(this,P).call(this,d)?(a&&(a.get="stale"),O?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||h(this,o,st).call(this,t,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),O?c.__staleWhileFetching:(h(this,o,Tt).call(this,d),n&&i(this,ht).call(this,d),c))}else a&&(a.get="miss");}delete(t){return h(this,o,st).call(this,t,"delete")}clear(){return h(this,o,Yt).call(this,"delete")}};Y=new WeakMap,G=new WeakMap,K=new WeakMap,ot=new WeakMap,j=new WeakMap,pt=new WeakMap,_t=new WeakMap,R=new WeakMap,H=new WeakMap,w=new WeakMap,E=new WeakMap,p=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,C=new WeakMap,$=new WeakMap,x=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,q=new WeakMap,rt=new WeakMap,D=new WeakMap,mt=new WeakMap,o=new WeakSet,Vt=function(){let t=new dt(i(this,Y)),e=new dt(i(this,Y));f(this,N,t),f(this,X,e),f(this,wt,(r,a,d=ut.now())=>{if(e[r]=a!==0?d:0,t[r]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{i(this,P).call(this,r)&&h(this,o,st).call(this,i(this,E)[r],"expire");},a+1);c.unref&&c.unref();}}),f(this,ht,r=>{e[r]=t[r]!==0?ut.now():0;}),f(this,Z,(r,a)=>{if(t[a]){let d=t[a],c=e[a];if(!d||!c)return;r.ttl=d,r.start=c,r.now=s||n();let O=r.now-c;r.remainingTTL=d-O;}});let s=0,n=()=>{let r=ut.now();if(this.ttlResolution>0){s=r;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=i(this,w).get(r);if(a===void 0)return 0;let d=t[a],c=e[a];if(!d||!c)return 1/0;let O=(s||n())-c;return d-O},f(this,P,r=>{let a=e[r],d=t[r];return !!d&&!!a&&(s||n())-a>d});},ht=new WeakMap,Z=new WeakMap,wt=new WeakMap,P=new WeakMap,kt=function(){let t=new dt(i(this,Y));f(this,H,0),f(this,B,t),f(this,lt,e=>{f(this,H,i(this,H)-t[e]),t[e]=0;}),f(this,At,(e,s,n,r)=>{if(h(this,o,S).call(this,s))return 0;if(!tt(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(s,e),!tt(n))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 n}),f(this,St,(e,s,n)=>{if(t[e]=s,i(this,G)){let r=i(this,G)-t[e];for(;i(this,H)>r;)h(this,o,It).call(this,true);}f(this,H,i(this,H)+t[e]),n&&(n.entrySize=s,n.totalCalculatedSize=i(this,H));});},lt=new WeakMap,St=new WeakMap,At=new WeakMap,et=function*({allowStale:t=this.allowStale}={}){if(i(this,R))for(let e=i(this,C);!(!h(this,o,Ut).call(this,e)||((t||!i(this,P).call(this,e))&&(yield e),e===i(this,I)));)e=i(this,L)[e];},it=function*({allowStale:t=this.allowStale}={}){if(i(this,R))for(let e=i(this,I);!(!h(this,o,Ut).call(this,e)||((t||!i(this,P).call(this,e))&&(yield e),e===i(this,C)));)e=i(this,F)[e];},Ut=function(t){return t!==void 0&&i(this,w).get(i(this,E)[t])===t},It=function(t){var r;let e=i(this,I),s=i(this,E)[e],n=i(this,p)[e];return i(this,rt)&&h(this,o,S).call(this,n)?n.__abortController.abort(new Error("evicted")):(i(this,q)||i(this,D))&&(i(this,q)&&((r=i(this,K))==null||r.call(this,n,s,"evict")),i(this,D)&&i(this,x)?.push([n,s,"evict"])),i(this,lt).call(this,e),t&&(i(this,E)[e]=void 0,i(this,p)[e]=void 0,i(this,$).push(e)),i(this,R)===1?(f(this,I,f(this,C,0)),i(this,$).length=0):f(this,I,i(this,F)[e]),i(this,w).delete(s),xt(this,R)._--,e},Ft=function(t,e,s,n){let r=e===void 0?void 0:i(this,p)[e];if(h(this,o,S).call(this,r))return r;let a=new Dt,{signal:d}=s;d?.addEventListener("abort",()=>a.abort(d.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:n},O=(T,y=false)=>{let{aborted:_}=a.signal,z=s.ignoreFetchAbort&&T!==void 0;if(s.status&&(_&&!y?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),_&&!z&&!y)return b(a.signal.reason);let M=V;return i(this,p)[e]===V&&(T===void 0?M.__staleWhileFetching?i(this,p)[e]=M.__staleWhileFetching:h(this,o,st).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,T,c.options))),T},J=T=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=T),b(T)),b=T=>{let{aborted:y}=a.signal,_=y&&s.allowStaleOnFetchAbort,z=_||s.allowStaleOnFetchRejection,M=z||s.noDeleteOnFetchRejection,v=V;if(i(this,p)[e]===V&&(!M||v.__staleWhileFetching===void 0?h(this,o,st).call(this,t,"fetch"):_||(i(this,p)[e]=v.__staleWhileFetching)),z)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw T},k=(T,y)=>{var z;let _=(z=i(this,pt))==null?void 0:z.call(this,t,r,c);_&&_ instanceof Promise&&_.then(M=>T(M===void 0?void 0:M),y),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(T(void 0),s.allowStaleOnFetchAbort&&(T=M=>O(M,true)));});};s.status&&(s.status.fetchDispatched=true);let V=new Promise(k).then(O,J),Q=Object.assign(V,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,Q,{...c.options,status:void 0}),e=i(this,w).get(t)):i(this,p)[e]=Q,Q},S=function(t){if(!i(this,rt))return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Dt},Wt=function(t,e){i(this,L)[e]=t,i(this,F)[t]=e;},Tt=function(t){t!==i(this,C)&&(t===i(this,I)?f(this,I,i(this,F)[t]):h(this,o,Wt).call(this,i(this,L)[t],i(this,F)[t]),h(this,o,Wt).call(this,i(this,C),t),f(this,C,t));},st=function(t,e){var n,r;let s=false;if(i(this,R)!==0){let a=i(this,w).get(t);if(a!==void 0)if(s=true,i(this,R)===1)h(this,o,Yt).call(this,e);else {i(this,lt).call(this,a);let d=i(this,p)[a];if(h(this,o,S).call(this,d)?d.__abortController.abort(new Error("deleted")):(i(this,q)||i(this,D))&&(i(this,q)&&((n=i(this,K))==null||n.call(this,d,t,e)),i(this,D)&&i(this,x)?.push([d,t,e])),i(this,w).delete(t),i(this,E)[a]=void 0,i(this,p)[a]=void 0,a===i(this,C))f(this,C,i(this,L)[a]);else if(a===i(this,I))f(this,I,i(this,F)[a]);else {let c=i(this,L)[a];i(this,F)[c]=i(this,F)[a];let O=i(this,F)[a];i(this,L)[O]=i(this,L)[a];}xt(this,R)._--,i(this,$).push(a);}}if(i(this,D)&&i(this,x)?.length){let a=i(this,x),d;for(;d=a?.shift();)(r=i(this,j))==null||r.call(this,...d);}return s},Yt=function(t){var e,s;for(let n of h(this,o,it).call(this,{allowStale:true})){let r=i(this,p)[n];if(h(this,o,S).call(this,r))r.__abortController.abort(new Error("deleted"));else {let a=i(this,E)[n];i(this,q)&&((e=i(this,K))==null||e.call(this,r,a,t)),i(this,D)&&i(this,x)?.push([r,a,t]);}}if(i(this,w).clear(),i(this,p).fill(void 0),i(this,E).fill(void 0),i(this,N)&&i(this,X)&&(i(this,N).fill(0),i(this,X).fill(0)),i(this,B)&&i(this,B).fill(0),f(this,I,0),f(this,C,0),i(this,$).length=0,f(this,H,0),f(this,R,0),i(this,D)&&i(this,x)){let n=i(this,x),r;for(;r=n?.shift();)(s=i(this,j))==null||s.call(this,...r);}};var zt=Kt;var nt=class{constructor(t){g(this,"cache");g(this,"map",new Map);this.cache=new zt({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var A=class A{constructor(){}static clearOldTempVariables(t){A.tempStorageDeadlines.forEach((e,s)=>{e>t&&(A.tempStorage.delete(s),A.tempStorageDeadlines.delete(s),A.storage.cache.delete(s));});}static setVariable(t,e){let s=A.tempStorage.has(t);e==null?(A.storage.map.delete(t),!s&&A.storage.cache.delete(t)):(A.storage.map.set(t,e),!s&&A.storage.cache.set(t,e));}static getVariable(t){let e=A.storage.cache.get(t);return e===void 0&&(e=A.tempStorage.get(t)),e===void 0&&(e=A.storage.map.get(t)),vt(e)}static removeVariable(t){A.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let s=this.flags.indexOf(t);s>-1&&this.flags.splice(s,1);}}static getFlag(t){return this.flags.includes(t)}};g(A,"storage",new nt({cacheSize:20})),g(A,"startingStorage",[]),g(A,"flags",Array()),g(A,"tempStorage",new Map),g(A,"tempStorageDeadlines",new Map);var u=A;var Et=class{constructor(t,e){g(this,"_id");g(this,"categoryId");this.categoryId=t,this._id=e;}get id(){return this._id}setStorageProperty(t,e){let s=u.getVariable(this.categoryId);s||(s={}),s.hasOwnProperty(this.id)||(s[this.id]={}),e==null?s[this.id].hasOwnProperty(t)&&delete s[this.id][t]:s[this.id]={...s[this.id],[t]:e},Object.keys(s[this.id]).length===0&&delete s[this.id],u.setVariable(this.categoryId,s);}getStorageProperty(t,e=this.id){let s=u.getVariable(this.categoryId);if(s&&s.hasOwnProperty(e)&&s[e].hasOwnProperty(t))return s[e][t]}};var jt={CHARACTER_CATEGORY_KEY:"___character___"};var re="@",bt=class extends Et{constructor(e,s=""){super(jt.CHARACTER_CATEGORY_KEY,e+(s?re+s:""));g(this,"sourceId");this.sourceId=e;}getStorageProperty(e){let s=super.getStorageProperty(e);return s===void 0&&(s=super.getStorageProperty(e,this.sourceId)),s}};var Mt=class extends bt{constructor(e,s){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);g(this,"defaultName");g(this,"defaultSurname");g(this,"defaultAge");g(this,"_icon");g(this,"_color");this.defaultName=s.name,this.defaultSurname=s.surname,this.defaultAge=s.age,this._icon=s.icon,this._color=s.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);}get icon(){return this._icon}get color(){return this._color}};var Rt=new nt({cacheSize:10}),Ht;(n=>{function l(r){try{let a=Rt.get(r);if(!a){W.warn(`Character "${r}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return a}catch(a){W.error(`Error while getting Character "${r}"`,a);return}}n.get=l;function t(r){if(Array.isArray(r)){r.forEach(a=>t(a));return}Rt.get(r.id)&&W.info(`Character id "${r.id}" already exists, it will be overwritten`),Rt.set(r.id,r);}n.add=t;function e(){return Array.from(Rt.values())}n.values=e;function s(r){return Rt.has(r)}n.has=s;})(Ht||(Ht={}));var ne=Ht;exports.CharacterBaseModel=Mt;exports.CharacterStoredClass=bt;exports.RegisteredCharacters=ne;
1
+ 'use strict';require('@drincs/pixi-vn/unifier');var ee=Object.defineProperty;var $t=l=>{throw TypeError(l)};var ie=(l,t,e)=>t in l?ee(l,t,{enumerable:true,configurable:true,writable:true,value:e}):l[t]=e;var g=(l,t,e)=>ie(l,typeof t!="symbol"?t+"":t,e),Lt=(l,t,e)=>t.has(l)||$t("Cannot "+e);var i=(l,t,e)=>(Lt(l,t,"read from private field"),e?e.call(l):t.get(l)),m=(l,t,e)=>t.has(l)?$t("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(l):t.set(l,e),f=(l,t,e,s)=>(Lt(l,t,"write to private field"),t.set(l,e),e),h=(l,t,e)=>(Lt(l,t,"access private method"),e);var Ct=(l,t,e,s)=>({set _(r){f(l,t,r);},get _(){return i(l,t,s)}});var W;(r=>(r.log=(n,...a)=>console.log(`[Pixi\u2019VN] ${n}`,...a),r.warn=(n,...a)=>console.warn(`[Pixi\u2019VN] ${n}`,...a),r.error=(n,...a)=>console.error(`[Pixi\u2019VN] ${n}`,...a),r.info=(n,...a)=>console.info(`[Pixi\u2019VN] ${n}`,...a)))(W||(W={}));function vt(l){try{if(typeof l>"u")return l;let t=JSON.stringify(l);return JSON.parse(t)}catch(t){throw W.error("Error creating exportable element",l,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var ut=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,Nt=typeof process=="object"&&process?process:{},Qt=(l,t,e,s)=>{typeof Nt.emitWarning=="function"?Nt.emitWarning(l,t,e,s):console.error(`[${e}] ${t}: ${l}`);},Dt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Dt>"u"){Bt=class{constructor(){g(this,"onabort");g(this,"_onabort",[]);g(this,"reason");g(this,"aborted",false);}addEventListener(s,r){this._onabort.push(r);}},Dt=class{constructor(){g(this,"signal",new Bt);t();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let r of this.signal._onabort)r(s);this.signal.onabort?.(s);}}};let l=Nt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=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",t));};}var se=l=>!Jt.has(l),tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Zt=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?dt:null:null,dt=class extends Array{constructor(t){super(t),this.fill(0);}},gt,at=class at{constructor(t,e){g(this,"heap");g(this,"length");if(!i(at,gt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0;}static create(t){let e=Zt(t);if(!e)return [];f(at,gt,true);let s=new at(t,e);return f(at,gt,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};gt=new WeakMap,m(at,gt,false);var Pt=at,Xt,qt,Y,G,K,ot,j,pt,_t,R,H,w,E,p,F,L,I,x,$,C,B,X,N,q,rt,D,mt,o,Vt,ht,Z,wt,P,kt,lt,St,At,et,it,Ut,It,Ft,S,Wt,Tt,st,Yt,Kt=class Kt{constructor(t){m(this,o);m(this,Y);m(this,G);m(this,K);m(this,ot);m(this,j);m(this,pt);m(this,_t);g(this,"ttl");g(this,"ttlResolution");g(this,"ttlAutopurge");g(this,"updateAgeOnGet");g(this,"updateAgeOnHas");g(this,"allowStale");g(this,"noDisposeOnSet");g(this,"noUpdateTTL");g(this,"maxEntrySize");g(this,"sizeCalculation");g(this,"noDeleteOnFetchRejection");g(this,"noDeleteOnStaleGet");g(this,"allowStaleOnFetchAbort");g(this,"allowStaleOnFetchRejection");g(this,"ignoreFetchAbort");m(this,R);m(this,H);m(this,w);m(this,E);m(this,p);m(this,F);m(this,L);m(this,I);m(this,x);m(this,$);m(this,C);m(this,B);m(this,X);m(this,N);m(this,q);m(this,rt);m(this,D);m(this,mt);m(this,ht,()=>{});m(this,Z,()=>{});m(this,wt,()=>{});m(this,P,()=>false);m(this,lt,t=>{});m(this,St,(t,e,s)=>{});m(this,At,(t,e,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});g(this,Xt,"LRUCache");let{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:c,dispose:O,onInsert:J,disposeAfter:b,noDisposeOnSet:k,noUpdateTTL:V,maxSize:Q=0,maxEntrySize:T=0,sizeCalculation:y,fetchMethod:_,memoMethod:z,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:yt,ignoreFetchAbort:ft}=t;if(e!==0&&!tt(e))throw new TypeError("max option must be a nonnegative integer");let xt=e?Zt(e):Array;if(!xt)throw new Error("invalid max value: "+e);if(f(this,Y,e),f(this,G,Q),this.maxEntrySize=T||i(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!i(this,G)&&!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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,pt,_),f(this,rt,!!_),f(this,w,new Map),f(this,E,new Array(e).fill(void 0)),f(this,p,new Array(e).fill(void 0)),f(this,F,new xt(e)),f(this,L,new xt(e)),f(this,I,0),f(this,x,0),f(this,$,Pt.create(e)),f(this,R,0),f(this,H,0),typeof O=="function"&&f(this,K,O),typeof J=="function"&&f(this,ot,J),typeof b=="function"?(f(this,j,b),f(this,C,[])):(f(this,j,void 0),f(this,C,void 0)),f(this,q,!!i(this,K)),f(this,mt,!!i(this,ot)),f(this,D,!!i(this,j)),this.noDisposeOnSet=!!k,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!U,this.allowStaleOnFetchAbort=!!yt,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(i(this,G)!==0&&!tt(i(this,G)))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");h(this,o,kt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=tt(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,o,Vt).call(this);}if(i(this,Y)===0&&this.ttl===0&&i(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!i(this,Y)&&!i(this,G)){let ct="LRU_CACHE_UNBOUNDED";se(ct)&&(Jt.add(ct),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ct,Kt));}}static unsafeExposeInternals(t){return {starts:i(t,X),ttls:i(t,N),sizes:i(t,B),keyMap:i(t,w),keyList:i(t,E),valList:i(t,p),next:i(t,F),prev:i(t,L),get head(){return i(t,I)},get tail(){return i(t,x)},free:i(t,$),isBackgroundFetch:e=>{var s;return h(s=t,o,S).call(s,e)},backgroundFetch:(e,s,r,n)=>{var a;return h(a=t,o,Ft).call(a,e,s,r,n)},moveToTail:e=>{var s;return h(s=t,o,Tt).call(s,e)},indexes:e=>{var s;return h(s=t,o,et).call(s,e)},rindexes:e=>{var s;return h(s=t,o,it).call(s,e)},isStale:e=>{var s;return i(s=t,P).call(s,e)}}}get max(){return i(this,Y)}get maxSize(){return i(this,G)}get calculatedSize(){return i(this,H)}get size(){return i(this,R)}get fetchMethod(){return i(this,pt)}get memoMethod(){return i(this,_t)}get dispose(){return i(this,K)}get onInsert(){return i(this,ot)}get disposeAfter(){return i(this,j)}getRemainingTTL(t){return i(this,w).has(t)?1/0:0}*entries(){for(let t of h(this,o,et).call(this))i(this,p)[t]!==void 0&&i(this,E)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield [i(this,E)[t],i(this,p)[t]]);}*rentries(){for(let t of h(this,o,it).call(this))i(this,p)[t]!==void 0&&i(this,E)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield [i(this,E)[t],i(this,p)[t]]);}*keys(){for(let t of h(this,o,et).call(this)){let e=i(this,E)[t];e!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield e);}}*rkeys(){for(let t of h(this,o,it).call(this)){let e=i(this,E)[t];e!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield e);}}*values(){for(let t of h(this,o,et).call(this))i(this,p)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield i(this,p)[t]);}*rvalues(){for(let t of h(this,o,it).call(this))i(this,p)[t]!==void 0&&!h(this,o,S).call(this,i(this,p)[t])&&(yield i(this,p)[t]);}[(qt=Symbol.iterator,Xt=Symbol.toStringTag,qt)](){return this.entries()}find(t,e={}){for(let s of h(this,o,et).call(this)){let r=i(this,p)[s],n=h(this,o,S).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,i(this,E)[s],this))return this.get(i(this,E)[s],e)}}forEach(t,e=this){for(let s of h(this,o,et).call(this)){let r=i(this,p)[s],n=h(this,o,S).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,i(this,E)[s],this);}}rforEach(t,e=this){for(let s of h(this,o,it).call(this)){let r=i(this,p)[s],n=h(this,o,S).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,i(this,E)[s],this);}}purgeStale(){let t=false;for(let e of h(this,o,it).call(this,{allowStale:true}))i(this,P).call(this,e)&&(h(this,o,st).call(this,i(this,E)[e],"expire"),t=true);return t}info(t){let e=i(this,w).get(t);if(e===void 0)return;let s=i(this,p)[e],r=h(this,o,S).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(i(this,N)&&i(this,X)){let a=i(this,N)[e],d=i(this,X)[e];if(a&&d){let c=a-(ut.now()-d);n.ttl=c,n.start=Date.now();}}return i(this,B)&&(n.size=i(this,B)[e]),n}dump(){let t=[];for(let e of h(this,o,et).call(this,{allowStale:true})){let s=i(this,E)[e],r=i(this,p)[e],n=h(this,o,S).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let a={value:n};if(i(this,N)&&i(this,X)){a.ttl=i(this,N)[e];let d=ut.now()-i(this,X)[e];a.start=Math.floor(Date.now()-d);}i(this,B)&&(a.size=i(this,B)[e]),t.unshift([s,a]);}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let r=Date.now()-s.start;s.start=ut.now()-r;}this.set(e,s.value,s);}}set(t,e,s={}){var k,V,Q,T;if(e===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c}=s,{noUpdateTTL:O=this.noUpdateTTL}=s,J=i(this,At).call(this,t,e,s.size||0,d);if(this.maxEntrySize&&J>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,o,st).call(this,t,"set"),this;let b=i(this,R)===0?void 0:i(this,w).get(t);if(b===void 0)b=i(this,R)===0?i(this,x):i(this,$).length!==0?i(this,$).pop():i(this,R)===i(this,Y)?h(this,o,It).call(this,false):i(this,R),i(this,E)[b]=t,i(this,p)[b]=e,i(this,w).set(t,b),i(this,F)[i(this,x)]=b,i(this,L)[b]=i(this,x),f(this,x,b),Ct(this,R)._++,i(this,St).call(this,b,J,c),c&&(c.set="add"),O=false,i(this,mt)&&((k=i(this,ot))==null||k.call(this,e,t,"add"));else {h(this,o,Tt).call(this,b);let y=i(this,p)[b];if(e!==y){if(i(this,rt)&&h(this,o,S).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=y;_!==void 0&&!a&&(i(this,q)&&((V=i(this,K))==null||V.call(this,_,t,"set")),i(this,D)&&i(this,C)?.push([_,t,"set"]));}else a||(i(this,q)&&((Q=i(this,K))==null||Q.call(this,y,t,"set")),i(this,D)&&i(this,C)?.push([y,t,"set"]));if(i(this,lt).call(this,b),i(this,St).call(this,b,J,c),i(this,p)[b]=e,c){c.set="replace";let _=y&&h(this,o,S).call(this,y)?y.__staleWhileFetching:y;_!==void 0&&(c.oldValue=_);}}else c&&(c.set="update");i(this,mt)&&this.onInsert?.(e,t,e===y?"update":"replace");}if(r!==0&&!i(this,N)&&h(this,o,Vt).call(this),i(this,N)&&(O||i(this,wt).call(this,b,r,n),c&&i(this,Z).call(this,c,b)),!a&&i(this,D)&&i(this,C)){let y=i(this,C),_;for(;_=y?.shift();)(T=i(this,j))==null||T.call(this,..._);}return this}pop(){var t;try{for(;i(this,R);){let e=i(this,p)[i(this,I)];if(h(this,o,It).call(this,!0),h(this,o,S).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(i(this,D)&&i(this,C)){let e=i(this,C),s;for(;s=e?.shift();)(t=i(this,j))==null||t.call(this,...s);}}}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=e,n=i(this,w).get(t);if(n!==void 0){let a=i(this,p)[n];if(h(this,o,S).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(i(this,P).call(this,n))r&&(r.has="stale",i(this,Z).call(this,r,n));else return s&&i(this,ht).call(this,n),r&&(r.has="hit",i(this,Z).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(t,e={}){let{allowStale:s=this.allowStale}=e,r=i(this,w).get(t);if(r===void 0||!s&&i(this,P).call(this,r))return;let n=i(this,p)[r];return h(this,o,S).call(this,n)?n.__staleWhileFetching:n}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:J=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:k=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:Q=this.allowStaleOnFetchAbort,context:T,forceRefresh:y=false,status:_,signal:z}=e;if(!i(this,rt))return _&&(_.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:_});let M={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:d,size:c,sizeCalculation:O,noUpdateTTL:J,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:Q,ignoreFetchAbort:V,status:_,signal:z},v=i(this,w).get(t);if(v===void 0){_&&(_.fetch="miss");let U=h(this,o,Ft).call(this,t,v,M,T);return U.__returned=U}else {let U=i(this,p)[v];if(h(this,o,S).call(this,U)){let Gt=s&&U.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",Gt&&(_.returnedStale=true)),Gt?U.__staleWhileFetching:U.__returned=U}let yt=i(this,P).call(this,v);if(!y&&!yt)return _&&(_.fetch="hit"),h(this,o,Tt).call(this,v),r&&i(this,ht).call(this,v),_&&i(this,Z).call(this,_,v),U;let ft=h(this,o,Ft).call(this,t,v,M,T),ct=ft.__staleWhileFetching!==void 0&&s;return _&&(_.fetch=yt?"stale":"refresh",ct&&yt&&(_.returnedStale=true)),ct?ft.__staleWhileFetching:ft.__returned=ft}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=i(this,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...a}=e,d=this.get(t,a);if(!n&&d!==void 0)return d;let c=s(t,d,{options:a,context:r});return this.set(t,c,a),c}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=e,d=i(this,w).get(t);if(d!==void 0){let c=i(this,p)[d],O=h(this,o,S).call(this,c);return a&&i(this,Z).call(this,a,d),i(this,P).call(this,d)?(a&&(a.get="stale"),O?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(n||h(this,o,st).call(this,t,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),O?c.__staleWhileFetching:(h(this,o,Tt).call(this,d),r&&i(this,ht).call(this,d),c))}else a&&(a.get="miss");}delete(t){return h(this,o,st).call(this,t,"delete")}clear(){return h(this,o,Yt).call(this,"delete")}};Y=new WeakMap,G=new WeakMap,K=new WeakMap,ot=new WeakMap,j=new WeakMap,pt=new WeakMap,_t=new WeakMap,R=new WeakMap,H=new WeakMap,w=new WeakMap,E=new WeakMap,p=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,x=new WeakMap,$=new WeakMap,C=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,q=new WeakMap,rt=new WeakMap,D=new WeakMap,mt=new WeakMap,o=new WeakSet,Vt=function(){let t=new dt(i(this,Y)),e=new dt(i(this,Y));f(this,N,t),f(this,X,e),f(this,wt,(n,a,d=ut.now())=>{if(e[n]=a!==0?d:0,t[n]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{i(this,P).call(this,n)&&h(this,o,st).call(this,i(this,E)[n],"expire");},a+1);c.unref&&c.unref();}}),f(this,ht,n=>{e[n]=t[n]!==0?ut.now():0;}),f(this,Z,(n,a)=>{if(t[a]){let d=t[a],c=e[a];if(!d||!c)return;n.ttl=d,n.start=c,n.now=s||r();let O=n.now-c;n.remainingTTL=d-O;}});let s=0,r=()=>{let n=ut.now();if(this.ttlResolution>0){s=n;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref();}return n};this.getRemainingTTL=n=>{let a=i(this,w).get(n);if(a===void 0)return 0;let d=t[a],c=e[a];if(!d||!c)return 1/0;let O=(s||r())-c;return d-O},f(this,P,n=>{let a=e[n],d=t[n];return !!d&&!!a&&(s||r())-a>d});},ht=new WeakMap,Z=new WeakMap,wt=new WeakMap,P=new WeakMap,kt=function(){let t=new dt(i(this,Y));f(this,H,0),f(this,B,t),f(this,lt,e=>{f(this,H,i(this,H)-t[e]),t[e]=0;}),f(this,At,(e,s,r,n)=>{if(h(this,o,S).call(this,s))return 0;if(!tt(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,e),!tt(r))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 r}),f(this,St,(e,s,r)=>{if(t[e]=s,i(this,G)){let n=i(this,G)-t[e];for(;i(this,H)>n;)h(this,o,It).call(this,true);}f(this,H,i(this,H)+t[e]),r&&(r.entrySize=s,r.totalCalculatedSize=i(this,H));});},lt=new WeakMap,St=new WeakMap,At=new WeakMap,et=function*({allowStale:t=this.allowStale}={}){if(i(this,R))for(let e=i(this,x);!(!h(this,o,Ut).call(this,e)||((t||!i(this,P).call(this,e))&&(yield e),e===i(this,I)));)e=i(this,L)[e];},it=function*({allowStale:t=this.allowStale}={}){if(i(this,R))for(let e=i(this,I);!(!h(this,o,Ut).call(this,e)||((t||!i(this,P).call(this,e))&&(yield e),e===i(this,x)));)e=i(this,F)[e];},Ut=function(t){return t!==void 0&&i(this,w).get(i(this,E)[t])===t},It=function(t){var n;let e=i(this,I),s=i(this,E)[e],r=i(this,p)[e];return i(this,rt)&&h(this,o,S).call(this,r)?r.__abortController.abort(new Error("evicted")):(i(this,q)||i(this,D))&&(i(this,q)&&((n=i(this,K))==null||n.call(this,r,s,"evict")),i(this,D)&&i(this,C)?.push([r,s,"evict"])),i(this,lt).call(this,e),t&&(i(this,E)[e]=void 0,i(this,p)[e]=void 0,i(this,$).push(e)),i(this,R)===1?(f(this,I,f(this,x,0)),i(this,$).length=0):f(this,I,i(this,F)[e]),i(this,w).delete(s),Ct(this,R)._--,e},Ft=function(t,e,s,r){let n=e===void 0?void 0:i(this,p)[e];if(h(this,o,S).call(this,n))return n;let a=new Dt,{signal:d}=s;d?.addEventListener("abort",()=>a.abort(d.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:r},O=(T,y=false)=>{let{aborted:_}=a.signal,z=s.ignoreFetchAbort&&T!==void 0;if(s.status&&(_&&!y?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),_&&!z&&!y)return b(a.signal.reason);let M=V;return i(this,p)[e]===V&&(T===void 0?M.__staleWhileFetching?i(this,p)[e]=M.__staleWhileFetching:h(this,o,st).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,T,c.options))),T},J=T=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=T),b(T)),b=T=>{let{aborted:y}=a.signal,_=y&&s.allowStaleOnFetchAbort,z=_||s.allowStaleOnFetchRejection,M=z||s.noDeleteOnFetchRejection,v=V;if(i(this,p)[e]===V&&(!M||v.__staleWhileFetching===void 0?h(this,o,st).call(this,t,"fetch"):_||(i(this,p)[e]=v.__staleWhileFetching)),z)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw T},k=(T,y)=>{var z;let _=(z=i(this,pt))==null?void 0:z.call(this,t,n,c);_&&_ instanceof Promise&&_.then(M=>T(M===void 0?void 0:M),y),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(T(void 0),s.allowStaleOnFetchAbort&&(T=M=>O(M,true)));});};s.status&&(s.status.fetchDispatched=true);let V=new Promise(k).then(O,J),Q=Object.assign(V,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,Q,{...c.options,status:void 0}),e=i(this,w).get(t)):i(this,p)[e]=Q,Q},S=function(t){if(!i(this,rt))return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Dt},Wt=function(t,e){i(this,L)[e]=t,i(this,F)[t]=e;},Tt=function(t){t!==i(this,x)&&(t===i(this,I)?f(this,I,i(this,F)[t]):h(this,o,Wt).call(this,i(this,L)[t],i(this,F)[t]),h(this,o,Wt).call(this,i(this,x),t),f(this,x,t));},st=function(t,e){var r,n;let s=false;if(i(this,R)!==0){let a=i(this,w).get(t);if(a!==void 0)if(s=true,i(this,R)===1)h(this,o,Yt).call(this,e);else {i(this,lt).call(this,a);let d=i(this,p)[a];if(h(this,o,S).call(this,d)?d.__abortController.abort(new Error("deleted")):(i(this,q)||i(this,D))&&(i(this,q)&&((r=i(this,K))==null||r.call(this,d,t,e)),i(this,D)&&i(this,C)?.push([d,t,e])),i(this,w).delete(t),i(this,E)[a]=void 0,i(this,p)[a]=void 0,a===i(this,x))f(this,x,i(this,L)[a]);else if(a===i(this,I))f(this,I,i(this,F)[a]);else {let c=i(this,L)[a];i(this,F)[c]=i(this,F)[a];let O=i(this,F)[a];i(this,L)[O]=i(this,L)[a];}Ct(this,R)._--,i(this,$).push(a);}}if(i(this,D)&&i(this,C)?.length){let a=i(this,C),d;for(;d=a?.shift();)(n=i(this,j))==null||n.call(this,...d);}return s},Yt=function(t){var e,s;for(let r of h(this,o,it).call(this,{allowStale:true})){let n=i(this,p)[r];if(h(this,o,S).call(this,n))n.__abortController.abort(new Error("deleted"));else {let a=i(this,E)[r];i(this,q)&&((e=i(this,K))==null||e.call(this,n,a,t)),i(this,D)&&i(this,C)?.push([n,a,t]);}}if(i(this,w).clear(),i(this,p).fill(void 0),i(this,E).fill(void 0),i(this,N)&&i(this,X)&&(i(this,N).fill(0),i(this,X).fill(0)),i(this,B)&&i(this,B).fill(0),f(this,I,0),f(this,x,0),i(this,$).length=0,f(this,H,0),f(this,R,0),i(this,D)&&i(this,C)){let r=i(this,C),n;for(;n=r?.shift();)(s=i(this,j))==null||s.call(this,...n);}};var zt=Kt;var nt=class{constructor(t){g(this,"cache");g(this,"map",new Map);this.cache=new zt({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var A=class A{constructor(){}static clearOldTempVariables(t){A.tempStorageDeadlines.forEach((e,s)=>{e>t&&(A.tempStorage.delete(s),A.tempStorageDeadlines.delete(s),A.storage.cache.delete(s));});}static setVariable(t,e){let s=A.tempStorage.has(t);e==null?(A.storage.map.delete(t),!s&&A.storage.cache.delete(t)):(A.storage.map.set(t,e),!s&&A.storage.cache.set(t,e));}static getVariable(t){let e=A.storage.cache.get(t);return e===void 0&&(e=A.tempStorage.get(t)),e===void 0&&(e=A.storage.map.get(t)),vt(e)}static removeVariable(t){A.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let s=this.flags.indexOf(t);s>-1&&this.flags.splice(s,1);}}static getFlag(t){return this.flags.includes(t)}};g(A,"storage",new nt({cacheSize:20})),g(A,"startingStorage",[]),g(A,"flags",Array()),g(A,"tempStorage",new Map),g(A,"tempStorageDeadlines",new Map);var u=A;var Et=class{constructor(t,e){g(this,"_id");g(this,"categoryId");this.categoryId=t,this._id=e;}get id(){return this._id}setStorageProperty(t,e){let s=u.getVariable(this.categoryId);s||(s={}),s.hasOwnProperty(this.id)||(s[this.id]={}),e==null?s[this.id].hasOwnProperty(t)&&delete s[this.id][t]:s[this.id]={...s[this.id],[t]:e},Object.keys(s[this.id]).length===0&&delete s[this.id],u.setVariable(this.categoryId,s);}getStorageProperty(t,e=this.id){let s=u.getVariable(this.categoryId);if(s&&s.hasOwnProperty(e)&&s[e].hasOwnProperty(t))return s[e][t]}};var jt={CHARACTER_CATEGORY_KEY:"___character___"};var re="@",bt=class extends Et{constructor(e,s=""){super(jt.CHARACTER_CATEGORY_KEY,e+(s?re+s:""));g(this,"sourceId");this.sourceId=e;}getStorageProperty(e){let s=super.getStorageProperty(e);return s===void 0&&(s=super.getStorageProperty(e,this.sourceId)),s}};var Mt=class extends bt{constructor(e,s){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);g(this,"defaultName");g(this,"defaultSurname");g(this,"defaultAge");g(this,"_icon");g(this,"_color");this.defaultName=s.name,this.defaultSurname=s.surname,this.defaultAge=s.age,this._icon=s.icon,this._color=s.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);}get icon(){return this._icon}get color(){return this._color}};var Rt=new nt({cacheSize:10}),Ht;(r=>{function l(n){try{let a=Rt.get(n);if(!a){W.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return a}catch(a){W.error(`Error while getting Character "${n}"`,a);return}}r.get=l;function t(n){if(Array.isArray(n)){n.forEach(a=>t(a));return}Rt.get(n.id)&&W.info(`Character id "${n.id}" already exists, it will be overwritten`),Rt.set(n.id,n);}r.add=t;function e(){return Array.from(Rt.values())}r.values=e;function s(n){return Rt.has(n)}r.has=s;})(Ht||(Ht={}));var ne=Ht;exports.CharacterBaseModel=Mt;exports.CharacterStoredClass=bt;exports.RegisteredCharacters=ne;
@@ -1 +1 @@
1
- import {b}from'./chunk-FVGPQDTP.mjs';import {a as a$1}from'./chunk-6GO4XVS7.mjs';import {a}from'./chunk-JYY377ML.mjs';import {j,d as d$1}from'./chunk-GNJIUFU2.mjs';var l="@",i=class extends b{constructor(e,r=""){super(a$1.CHARACTER_CATEGORY_KEY,e+(r?l+r:""));d$1(this,"sourceId");this.sourceId=e;}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var u=class extends i{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);}get icon(){return this._icon}get color(){return this._color}};var s=new a({cacheSize:10}),d;(C=>{function f(t){try{let n=s.get(t);if(!n){j.warn(`Character "${t}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return n}catch(n){j.error(`Error while getting Character "${t}"`,n);return}}C.get=f;function g(t){if(Array.isArray(t)){t.forEach(n=>g(n));return}s.get(t.id)&&j.info(`Character id "${t.id}" already exists, it will be overwritten`),s.set(t.id,t);}C.add=g;function e(){return Array.from(s.values())}C.values=e;function r(t){return s.has(t)}C.has=r;})(d||(d={}));var p=d;export{u as CharacterBaseModel,i as CharacterStoredClass,p as RegisteredCharacters};
1
+ import {b}from'./chunk-ROWTJPTX.mjs';import {a as a$1}from'./chunk-6GO4XVS7.mjs';import {a}from'./chunk-JYY377ML.mjs';import {j,d as d$1}from'./chunk-GNJIUFU2.mjs';var l="@",i=class extends b{constructor(e,r=""){super(a$1.CHARACTER_CATEGORY_KEY,e+(r?l+r:""));d$1(this,"sourceId");this.sourceId=e;}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var u=class extends i{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);}get icon(){return this._icon}get color(){return this._color}};var s=new a({cacheSize:10}),d;(C=>{function f(t){try{let n=s.get(t);if(!n){j.warn(`Character "${t}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return n}catch(n){j.error(`Error while getting Character "${t}"`,n);return}}C.get=f;function g(t){if(Array.isArray(t)){t.forEach(n=>g(n));return}s.get(t.id)&&j.info(`Character id "${t.id}" already exists, it will be overwritten`),s.set(t.id,t);}C.add=g;function e(){return Array.from(s.values())}C.values=e;function r(t){return s.has(t)}C.has=r;})(d||(d={}));var p=d;export{u as CharacterBaseModel,i as CharacterStoredClass,p as RegisteredCharacters};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-JYY377ML.mjs';import {d,k,j}from'./chunk-GNJIUFU2.mjs';import {GameUnifier}from'@drincs/pixi-vn/unifier';var o=class o{constructor(){}static clearOldTempVariables(e){o.tempStorageDeadlines.forEach((t,a)=>{t>e&&(o.tempStorage.delete(a),o.tempStorageDeadlines.delete(a),o.storage.cache.delete(a));});}static setVariable(e,t){let a=o.tempStorage.has(e);t==null?(o.storage.map.delete(e),!a&&o.storage.cache.delete(e)):(o.storage.map.set(e,t),!a&&o.storage.cache.set(e,t));}static getVariable(e){let t=o.storage.cache.get(e);return t===void 0&&(t=o.tempStorage.get(e)),t===void 0&&(t=o.storage.map.get(e)),k(t)}static removeVariable(e){o.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let a=this.flags.indexOf(e);a>-1&&this.flags.splice(a,1);}}static getFlag(e){return this.flags.includes(e)}};d(o,"storage",new a({cacheSize:20})),d(o,"startingStorage",[]),d(o,"flags",Array()),d(o,"tempStorage",new Map),d(o,"tempStorageDeadlines",new Map);var r=o;var n=class{get storage(){return r.storage.map}get cache(){return r.storage.cache}get flags(){return r.flags}get tempStorage(){return r.tempStorage}get tempStorageDeadlines(){return r.tempStorageDeadlines}set startingStorage(e){let t=GameUnifier.stepCounter===0;Object.entries(e).forEach(([a,s])=>{r.startingStorage.push({key:a,value:s}),t&&r.storage.set(a,s);});}set(e,t){return r.setVariable(e,t)}setVariable(e,t){return this.set(e,t)}get(e){return r.getVariable(e)}getVariable(e){return this.get(e)}removeVariable(e){return r.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else r.tempStorage.set(e,t),r.storage.cache.set(e,t),r.tempStorageDeadlines.has(e)||r.tempStorageDeadlines.set(e,GameUnifier.openedLabels);}removeTempVariable(e){r.tempStorage.has(e)&&(r.tempStorage.delete(e),r.tempStorageDeadlines.delete(e),r.storage.cache.delete(e));}setFlag(e,t){return r.setFlag(e,t)}getFlag(e){return r.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),r.flags=[],r.tempStorage.clear(),r.tempStorageDeadlines.clear(),r.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...r.tempStorage.keys()].forEach(s=>{t.push({key:s,value:r.tempStorage.get(s)});});let a=[];return [...r.tempStorageDeadlines.keys()].forEach(s=>{a.push({key:s,value:r.tempStorageDeadlines.get(s)});}),k({base:e,temp:t,tempDeadlines:a,flags:r.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let a=t.value;Object.entries(a).forEach(([s,g])=>{r.tempStorage.set(s,g);});}else if(t.key==="___temp_storage_deadlines___"){let a=t.value;Object.entries(a).forEach(([s,g])=>{r.tempStorageDeadlines.set(s,g);});}else t.key==="___flags___"?t.value.forEach(s=>{r.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{r.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{r.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,a])=>{t==="___temp_storage___"?Object.entries(a).forEach(([s,g])=>{r.tempStorage.set(s,g);}):t==="___temp_storage_deadlines___"?Object.entries(a).forEach(([s,g])=>{r.tempStorageDeadlines.set(s,g);}):t==="___flags___"?a.forEach(s=>{r.flags.push(s);}):this.storage.set(t,a);})):j.warn("No storage data found");}catch(t){j.error("Error importing data",t);}}};var p=class{constructor(e,t){d(this,"_id");d(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let a=r.getVariable(this.categoryId);a||(a={}),a.hasOwnProperty(this.id)||(a[this.id]={}),t==null?a[this.id].hasOwnProperty(e)&&delete a[this.id][e]:a[this.id]={...a[this.id],[e]:t},Object.keys(a[this.id]).length===0&&delete a[this.id],r.setVariable(this.categoryId,a);}getStorageProperty(e,t=this.id){let a=r.getVariable(this.categoryId);if(a&&a.hasOwnProperty(t)&&a[t].hasOwnProperty(e))return a[t][e]}};var v=new n;export{r as a,p as b,v as c};
@@ -137,7 +137,7 @@ interface HistoryManagerInterface {
137
137
  }
138
138
 
139
139
  declare class HistoryManagerStatic {
140
- static _diffHistory: CachedMap<number, Difference[] | deepDiff.Diff<GameStepState, GameStepState>[]>;
140
+ static _diffHistory: CachedMap<number, deepDiff.Diff<GameStepState, GameStepState>[] | Difference[]>;
141
141
  static _stepsInfoHistory: CachedMap<number, Omit<HistoryStep, "diff">>;
142
142
  static _narrationHistory: CachedMap<number, NarrationHistory>;
143
143
  static stepLimitSaved: number;
package/dist/history.d.ts CHANGED
@@ -137,7 +137,7 @@ interface HistoryManagerInterface {
137
137
  }
138
138
 
139
139
  declare class HistoryManagerStatic {
140
- static _diffHistory: CachedMap<number, Difference[] | deepDiff.Diff<GameStepState, GameStepState>[]>;
140
+ static _diffHistory: CachedMap<number, deepDiff.Diff<GameStepState, GameStepState>[] | Difference[]>;
141
141
  static _stepsInfoHistory: CachedMap<number, Omit<HistoryStep, "diff">>;
142
142
  static _narrationHistory: CachedMap<number, NarrationHistory>;
143
143
  static stepLimitSaved: number;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var I=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),Z=require('@drincs/pixi-vn/history'),D=require('@drincs/pixi-vn/narration'),pixi_js=require('@drincs/pixi-vn/pixi.js'),ot=require('@drincs/pixi-vn/sound'),N=require('@drincs/pixi-vn/storage'),unifier=require('@drincs/pixi-vn/unifier');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var I__namespace=/*#__PURE__*/_interopNamespace(I);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var Z__namespace=/*#__PURE__*/_interopNamespace(Z);var D__namespace=/*#__PURE__*/_interopNamespace(D);var ot__namespace=/*#__PURE__*/_interopNamespace(ot);var N__namespace=/*#__PURE__*/_interopNamespace(N);var Xt=Object.defineProperty;var Jt=l=>{throw TypeError(l)};var he=(l,e,i)=>e in l?Xt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var le=(l,e)=>{for(var i in e)Xt(l,i,{get:e[i],enumerable:true});};var S=(l,e,i)=>he(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Jt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),_=(l,e,i)=>e.has(l)?Jt("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),h=(l,e,i)=>(zt(l,e,"access private method"),i);var Ut=(l,e,i,s)=>({set _(o){f(l,e,o);},get _(){return t(l,e,s)}});var dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Lt=typeof process=="object"&&process?process:{},ie=(l,e,i,s)=>{typeof Lt.emitWarning=="function"?Lt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ct=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Ct>"u"){Qt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(s,o){this._onabort.push(o);}},Ct=class{constructor(){S(this,"signal",new Qt);e();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let l=Lt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,ie("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 ce=l=>!ee.has(l),et=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),se=l=>et(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?pt:null:null,pt=class extends Array{constructor(e){super(e),this.fill(0);}},mt,at=class at{constructor(e,i){S(this,"heap");S(this,"length");if(!t(at,mt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=se(e);if(!i)return [];f(at,mt,true);let s=new at(e,i);return f(at,mt,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};mt=new WeakMap,_(at,mt,false);var Nt=at,Zt,te,q,P,K,ht,$,gt,_t,E,Y,A,x,p,R,V,F,U,B,T,X,J,M,Q,rt,j,vt,a,Pt,lt,tt,xt,G,ne,ct,yt,wt,it,st,Vt,Tt,Ot,b,Mt,bt,nt,Gt,Wt=class Wt{constructor(e){_(this,a);_(this,q);_(this,P);_(this,K);_(this,ht);_(this,$);_(this,gt);_(this,_t);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");_(this,E);_(this,Y);_(this,A);_(this,x);_(this,p);_(this,R);_(this,V);_(this,F);_(this,U);_(this,B);_(this,T);_(this,X);_(this,J);_(this,M);_(this,Q);_(this,rt);_(this,j);_(this,vt);_(this,lt,()=>{});_(this,tt,()=>{});_(this,xt,()=>{});_(this,G,()=>false);_(this,ct,e=>{});_(this,yt,(e,i,s)=>{});_(this,wt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:d,allowStale:u,dispose:w,onInsert:k,disposeAfter:c,noDisposeOnSet:W,noUpdateTTL:O,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:m,memoMethod:z,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:St,ignoreFetchAbort:ft}=e;if(i!==0&&!et(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?se(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,q,i),f(this,P,g),this.maxEntrySize=v||t(this,P),this.sizeCalculation=y,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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,m),f(this,rt,!!m),f(this,A,new Map),f(this,x,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new Et(i)),f(this,V,new Et(i)),f(this,F,0),f(this,U,0),f(this,B,Nt.create(i)),f(this,E,0),f(this,Y,0),typeof w=="function"&&f(this,K,w),typeof k=="function"&&f(this,ht,k),typeof c=="function"?(f(this,$,c),f(this,T,[])):(f(this,$,void 0),f(this,T,void 0)),f(this,Q,!!t(this,K)),f(this,vt,!!t(this,ht)),f(this,j,!!t(this,$)),this.noDisposeOnSet=!!W,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!St,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(t(this,P)!==0&&!et(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!et(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,a,ne).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!d,this.ttlResolution=et(o)||o===0?o:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!et(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,a,Pt).call(this);}if(t(this,q)===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,q)&&!t(this,P)){let ut="LRU_CACHE_UNBOUNDED";ce(ut)&&(ee.add(ut),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ut,Wt));}}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,M),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,x),valList:t(e,p),next:t(e,R),prev:t(e,V),get head(){return t(e,F)},get tail(){return t(e,U)},free:t(e,B),isBackgroundFetch:i=>{var s;return h(s=e,a,b).call(s,i)},backgroundFetch:(i,s,o,n)=>{var r;return h(r=e,a,Ot).call(r,i,s,o,n)},moveToTail:i=>{var s;return h(s=e,a,bt).call(s,i)},indexes:i=>{var s;return h(s=e,a,it).call(s,i)},rindexes:i=>{var s;return h(s=e,a,st).call(s,i)},isStale:i=>{var s;return t(s=e,G).call(s,i)}}}get max(){return t(this,q)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,Y)}get size(){return t(this,E)}get fetchMethod(){return t(this,gt)}get memoMethod(){return t(this,_t)}get dispose(){return t(this,K)}get onInsert(){return t(this,ht)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*rentries(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*keys(){for(let e of h(this,a,it).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of h(this,a,st).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n!==void 0&&e(n,t(this,x)[s],this))return this.get(t(this,x)[s],i)}}forEach(e,i=this){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}rforEach(e,i=this){for(let s of h(this,a,st).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}purgeStale(){let e=false;for(let i of h(this,a,st).call(this,{allowStale:true}))t(this,G).call(this,i)&&(h(this,a,nt).call(this,t(this,x)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,p)[i],o=h(this,a,b).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let n={value:o};if(t(this,M)&&t(this,J)){let r=t(this,M)[i],d=t(this,J)[i];if(r&&d){let u=r-(dt.now()-d);n.ttl=u,n.start=Date.now();}}return t(this,X)&&(n.size=t(this,X)[i]),n}dump(){let e=[];for(let i of h(this,a,it).call(this,{allowStale:true})){let s=t(this,x)[i],o=t(this,p)[i],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n===void 0||s===void 0)continue;let r={value:n};if(t(this,M)&&t(this,J)){r.ttl=t(this,M)[i];let d=dt.now()-t(this,J)[i];r.start=Math.floor(Date.now()-d);}t(this,X)&&(r.size=t(this,X)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let o=Date.now()-s.start;s.start=dt.now()-o;}this.set(i,s.value,s);}}set(e,i,s={}){var W,O,g,v;if(i===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:u}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,k=t(this,wt).call(this,e,i,s.size||0,d);if(this.maxEntrySize&&k>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,a,nt).call(this,e,"set"),this;let c=t(this,E)===0?void 0:t(this,A).get(e);if(c===void 0)c=t(this,E)===0?t(this,U):t(this,B).length!==0?t(this,B).pop():t(this,E)===t(this,q)?h(this,a,Tt).call(this,false):t(this,E),t(this,x)[c]=e,t(this,p)[c]=i,t(this,A).set(e,c),t(this,R)[t(this,U)]=c,t(this,V)[c]=t(this,U),f(this,U,c),Ut(this,E)._++,t(this,yt).call(this,c,k,u),u&&(u.set="add"),w=false,t(this,vt)&&((W=t(this,ht))==null||W.call(this,i,e,"add"));else {h(this,a,bt).call(this,c);let y=t(this,p)[c];if(i!==y){if(t(this,rt)&&h(this,a,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=y;m!==void 0&&!r&&(t(this,Q)&&((O=t(this,K))==null||O.call(this,m,e,"set")),t(this,j)&&t(this,T)?.push([m,e,"set"]));}else r||(t(this,Q)&&((g=t(this,K))==null||g.call(this,y,e,"set")),t(this,j)&&t(this,T)?.push([y,e,"set"]));if(t(this,ct).call(this,c),t(this,yt).call(this,c,k,u),t(this,p)[c]=i,u){u.set="replace";let m=y&&h(this,a,b).call(this,y)?y.__staleWhileFetching:y;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");t(this,vt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(o!==0&&!t(this,M)&&h(this,a,Pt).call(this),t(this,M)&&(w||t(this,xt).call(this,c,o,n),u&&t(this,tt).call(this,u,c)),!r&&t(this,j)&&t(this,T)){let y=t(this,T),m;for(;m=y?.shift();)(v=t(this,$))==null||v.call(this,...m);}return this}pop(){var e;try{for(;t(this,E);){let i=t(this,p)[t(this,F)];if(h(this,a,Tt).call(this,!0),h(this,a,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,T)){let i=t(this,T),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,n=t(this,A).get(e);if(n!==void 0){let r=t(this,p)[n];if(h(this,a,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(t(this,G).call(this,n))o&&(o.has="stale",t(this,tt).call(this,o,n));else return s&&t(this,lt).call(this,n),o&&(o.has="hit",t(this,tt).call(this,o,n)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,G).call(this,o))return;let n=t(this,p)[o];return h(this,a,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:u=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:W=this.allowStaleOnFetchRejection,ignoreFetchAbort:O=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=false,status:m,signal:z}=i;if(!t(this,rt))return m&&(m.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,status:m});let L={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:d,size:u,sizeCalculation:w,noUpdateTTL:k,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:g,ignoreFetchAbort:O,status:m,signal:z},C=t(this,A).get(e);if(C===void 0){m&&(m.fetch="miss");let H=h(this,a,Ot).call(this,e,C,L,v);return H.__returned=H}else {let H=t(this,p)[C];if(h(this,a,b).call(this,H)){let It=s&&H.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",It&&(m.returnedStale=true)),It?H.__staleWhileFetching:H.__returned=H}let St=t(this,G).call(this,C);if(!y&&!St)return m&&(m.fetch="hit"),h(this,a,bt).call(this,C),o&&t(this,lt).call(this,C),m&&t(this,tt).call(this,m,C),H;let ft=h(this,a,Ot).call(this,e,C,L,v),ut=ft.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=St?"stale":"refresh",ut&&St&&(m.returnedStale=true)),ut?ft.__staleWhileFetching:ft.__returned=ft}}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,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:n,...r}=i,d=this.get(e,r);if(!n&&d!==void 0)return d;let u=s(e,d,{options:r,context:o});return this.set(e,u,r),u}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=i,d=t(this,A).get(e);if(d!==void 0){let u=t(this,p)[d],w=h(this,a,b).call(this,u);return r&&t(this,tt).call(this,r,d),t(this,G).call(this,d)?(r&&(r.get="stale"),w?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(n||h(this,a,nt).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),w?u.__staleWhileFetching:(h(this,a,bt).call(this,d),o&&t(this,lt).call(this,d),u))}else r&&(r.get="miss");}delete(e){return h(this,a,nt).call(this,e,"delete")}clear(){return h(this,a,Gt).call(this,"delete")}};q=new WeakMap,P=new WeakMap,K=new WeakMap,ht=new WeakMap,$=new WeakMap,gt=new WeakMap,_t=new WeakMap,E=new WeakMap,Y=new WeakMap,A=new WeakMap,x=new WeakMap,p=new WeakMap,R=new WeakMap,V=new WeakMap,F=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,X=new WeakMap,J=new WeakMap,M=new WeakMap,Q=new WeakMap,rt=new WeakMap,j=new WeakMap,vt=new WeakMap,a=new WeakSet,Pt=function(){let e=new pt(t(this,q)),i=new pt(t(this,q));f(this,M,e),f(this,J,i),f(this,xt,(n,r,d=dt.now())=>{if(i[n]=r!==0?d:0,e[n]=r,r!==0&&this.ttlAutopurge){let u=setTimeout(()=>{t(this,G).call(this,n)&&h(this,a,nt).call(this,t(this,x)[n],"expire");},r+1);u.unref&&u.unref();}}),f(this,lt,n=>{i[n]=e[n]!==0?dt.now():0;}),f(this,tt,(n,r)=>{if(e[r]){let d=e[r],u=i[r];if(!d||!u)return;n.ttl=d,n.start=u,n.now=s||o();let w=n.now-u;n.remainingTTL=d-w;}});let s=0,o=()=>{let n=dt.now();if(this.ttlResolution>0){s=n;let r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=t(this,A).get(n);if(r===void 0)return 0;let d=e[r],u=i[r];if(!d||!u)return 1/0;let w=(s||o())-u;return d-w},f(this,G,n=>{let r=i[n],d=e[n];return !!d&&!!r&&(s||o())-r>d});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,G=new WeakMap,ne=function(){let e=new pt(t(this,q));f(this,Y,0),f(this,X,e),f(this,ct,i=>{f(this,Y,t(this,Y)-e[i]),e[i]=0;}),f(this,wt,(i,s,o,n)=>{if(h(this,a,b).call(this,s))return 0;if(!et(o))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(o=n(s,i),!et(o))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 o}),f(this,yt,(i,s,o)=>{if(e[i]=s,t(this,P)){let n=t(this,P)-e[i];for(;t(this,Y)>n;)h(this,a,Tt).call(this,true);}f(this,Y,t(this,Y)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,Y));});},ct=new WeakMap,yt=new WeakMap,wt=new WeakMap,it=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,U);!(!h(this,a,Vt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,V)[i];},st=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,F);!(!h(this,a,Vt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,U)));)i=t(this,R)[i];},Vt=function(e){return e!==void 0&&t(this,A).get(t(this,x)[e])===e},Tt=function(e){var n;let i=t(this,F),s=t(this,x)[i],o=t(this,p)[i];return t(this,rt)&&h(this,a,b).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((n=t(this,K))==null||n.call(this,o,s,"evict")),t(this,j)&&t(this,T)?.push([o,s,"evict"])),t(this,ct).call(this,i),e&&(t(this,x)[i]=void 0,t(this,p)[i]=void 0,t(this,B).push(i)),t(this,E)===1?(f(this,F,f(this,U,0)),t(this,B).length=0):f(this,F,t(this,R)[i]),t(this,A).delete(s),Ut(this,E)._--,i},Ot=function(e,i,s,o){let n=i===void 0?void 0:t(this,p)[i];if(h(this,a,b).call(this,n))return n;let r=new Ct,{signal:d}=s;d?.addEventListener("abort",()=>r.abort(d.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:o},w=(v,y=false)=>{let{aborted:m}=r.signal,z=s.ignoreFetchAbort&&v!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),m&&!z&&!y)return c(r.signal.reason);let L=O;return t(this,p)[i]===O&&(v===void 0?L.__staleWhileFetching?t(this,p)[i]=L.__staleWhileFetching:h(this,a,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,v,u.options))),v},k=v=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=v),c(v)),c=v=>{let{aborted:y}=r.signal,m=y&&s.allowStaleOnFetchAbort,z=m||s.allowStaleOnFetchRejection,L=z||s.noDeleteOnFetchRejection,C=O;if(t(this,p)[i]===O&&(!L||C.__staleWhileFetching===void 0?h(this,a,nt).call(this,e,"fetch"):m||(t(this,p)[i]=C.__staleWhileFetching)),z)return s.status&&C.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),C.__staleWhileFetching;if(C.__returned===C)throw v},W=(v,y)=>{var z;let m=(z=t(this,gt))==null?void 0:z.call(this,e,n,u);m&&m instanceof Promise&&m.then(L=>v(L===void 0?void 0:L),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(v(void 0),s.allowStaleOnFetchAbort&&(v=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let O=new Promise(W).then(w,k),g=Object.assign(O,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,g,{...u.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=g,g},b=function(e){if(!t(this,rt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ct},Mt=function(e,i){t(this,V)[i]=e,t(this,R)[e]=i;},bt=function(e){e!==t(this,U)&&(e===t(this,F)?f(this,F,t(this,R)[e]):h(this,a,Mt).call(this,t(this,V)[e],t(this,R)[e]),h(this,a,Mt).call(this,t(this,U),e),f(this,U,e));},nt=function(e,i){var o,n;let s=false;if(t(this,E)!==0){let r=t(this,A).get(e);if(r!==void 0)if(s=true,t(this,E)===1)h(this,a,Gt).call(this,i);else {t(this,ct).call(this,r);let d=t(this,p)[r];if(h(this,a,b).call(this,d)?d.__abortController.abort(new Error("deleted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((o=t(this,K))==null||o.call(this,d,e,i)),t(this,j)&&t(this,T)?.push([d,e,i])),t(this,A).delete(e),t(this,x)[r]=void 0,t(this,p)[r]=void 0,r===t(this,U))f(this,U,t(this,V)[r]);else if(r===t(this,F))f(this,F,t(this,R)[r]);else {let u=t(this,V)[r];t(this,R)[u]=t(this,R)[r];let w=t(this,R)[r];t(this,V)[w]=t(this,V)[r];}Ut(this,E)._--,t(this,B).push(r);}}if(t(this,j)&&t(this,T)?.length){let r=t(this,T),d;for(;d=r?.shift();)(n=t(this,$))==null||n.call(this,...d);}return s},Gt=function(e){var i,s;for(let o of h(this,a,st).call(this,{allowStale:true})){let n=t(this,p)[o];if(h(this,a,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let r=t(this,x)[o];t(this,Q)&&((i=t(this,K))==null||i.call(this,n,r,e)),t(this,j)&&t(this,T)?.push([n,r,e]);}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,x).fill(void 0),t(this,M)&&t(this,J)&&(t(this,M).fill(0),t(this,J).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,F,0),f(this,U,0),t(this,B).length=0,f(this,Y,0),f(this,E,0),t(this,j)&&t(this,T)){let o=t(this,T),n;for(;n=o?.shift();)(s=t(this,$))==null||s.call(this,...n);}};var Dt=Wt;var Ft=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new Dt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return 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 At="1.3.19";var Ht="repeat";function kt(l){return {type:"pause",duration:l}}var qt="__game_layer__";var re={};var Kt={};le(Kt,{createExportableElement:()=>oe});var Rt;(o=>(o.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),o.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),o.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),o.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(Rt||(Rt={}));function oe(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Rt.error("Error creating exportable element",l,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function ae(){console.info(`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var I=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),Z=require('@drincs/pixi-vn/history'),D=require('@drincs/pixi-vn/narration'),pixi_js=require('@drincs/pixi-vn/pixi.js'),ot=require('@drincs/pixi-vn/sound'),N=require('@drincs/pixi-vn/storage'),unifier=require('@drincs/pixi-vn/unifier');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var I__namespace=/*#__PURE__*/_interopNamespace(I);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var Z__namespace=/*#__PURE__*/_interopNamespace(Z);var D__namespace=/*#__PURE__*/_interopNamespace(D);var ot__namespace=/*#__PURE__*/_interopNamespace(ot);var N__namespace=/*#__PURE__*/_interopNamespace(N);var Xt=Object.defineProperty;var Jt=l=>{throw TypeError(l)};var he=(l,e,i)=>e in l?Xt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var le=(l,e)=>{for(var i in e)Xt(l,i,{get:e[i],enumerable:true});};var S=(l,e,i)=>he(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Jt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),_=(l,e,i)=>e.has(l)?Jt("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),h=(l,e,i)=>(zt(l,e,"access private method"),i);var Ut=(l,e,i,s)=>({set _(o){f(l,e,o);},get _(){return t(l,e,s)}});var dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Lt=typeof process=="object"&&process?process:{},ie=(l,e,i,s)=>{typeof Lt.emitWarning=="function"?Lt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ct=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Ct>"u"){Qt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(s,o){this._onabort.push(o);}},Ct=class{constructor(){S(this,"signal",new Qt);e();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let l=Lt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,ie("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 ce=l=>!ee.has(l),et=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),se=l=>et(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?pt:null:null,pt=class extends Array{constructor(e){super(e),this.fill(0);}},mt,at=class at{constructor(e,i){S(this,"heap");S(this,"length");if(!t(at,mt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=se(e);if(!i)return [];f(at,mt,true);let s=new at(e,i);return f(at,mt,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};mt=new WeakMap,_(at,mt,false);var Nt=at,Zt,te,q,P,K,ht,$,gt,_t,E,Y,A,x,p,R,M,F,U,B,T,X,J,V,Q,rt,j,vt,a,Pt,lt,tt,xt,G,ne,ct,yt,wt,it,st,Mt,Tt,Ot,b,Vt,bt,nt,Gt,Wt=class Wt{constructor(e){_(this,a);_(this,q);_(this,P);_(this,K);_(this,ht);_(this,$);_(this,gt);_(this,_t);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");_(this,E);_(this,Y);_(this,A);_(this,x);_(this,p);_(this,R);_(this,M);_(this,F);_(this,U);_(this,B);_(this,T);_(this,X);_(this,J);_(this,V);_(this,Q);_(this,rt);_(this,j);_(this,vt);_(this,lt,()=>{});_(this,tt,()=>{});_(this,xt,()=>{});_(this,G,()=>false);_(this,ct,e=>{});_(this,yt,(e,i,s)=>{});_(this,wt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:d,allowStale:u,dispose:w,onInsert:k,disposeAfter:c,noDisposeOnSet:W,noUpdateTTL:O,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:m,memoMethod:z,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:St,ignoreFetchAbort:ft}=e;if(i!==0&&!et(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?se(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,q,i),f(this,P,g),this.maxEntrySize=v||t(this,P),this.sizeCalculation=y,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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,m),f(this,rt,!!m),f(this,A,new Map),f(this,x,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new Et(i)),f(this,M,new Et(i)),f(this,F,0),f(this,U,0),f(this,B,Nt.create(i)),f(this,E,0),f(this,Y,0),typeof w=="function"&&f(this,K,w),typeof k=="function"&&f(this,ht,k),typeof c=="function"?(f(this,$,c),f(this,T,[])):(f(this,$,void 0),f(this,T,void 0)),f(this,Q,!!t(this,K)),f(this,vt,!!t(this,ht)),f(this,j,!!t(this,$)),this.noDisposeOnSet=!!W,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!St,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(t(this,P)!==0&&!et(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!et(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,a,ne).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!d,this.ttlResolution=et(o)||o===0?o:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!et(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,a,Pt).call(this);}if(t(this,q)===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,q)&&!t(this,P)){let ut="LRU_CACHE_UNBOUNDED";ce(ut)&&(ee.add(ut),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ut,Wt));}}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,V),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,x),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,F)},get tail(){return t(e,U)},free:t(e,B),isBackgroundFetch:i=>{var s;return h(s=e,a,b).call(s,i)},backgroundFetch:(i,s,o,n)=>{var r;return h(r=e,a,Ot).call(r,i,s,o,n)},moveToTail:i=>{var s;return h(s=e,a,bt).call(s,i)},indexes:i=>{var s;return h(s=e,a,it).call(s,i)},rindexes:i=>{var s;return h(s=e,a,st).call(s,i)},isStale:i=>{var s;return t(s=e,G).call(s,i)}}}get max(){return t(this,q)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,Y)}get size(){return t(this,E)}get fetchMethod(){return t(this,gt)}get memoMethod(){return t(this,_t)}get dispose(){return t(this,K)}get onInsert(){return t(this,ht)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*rentries(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*keys(){for(let e of h(this,a,it).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of h(this,a,st).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n!==void 0&&e(n,t(this,x)[s],this))return this.get(t(this,x)[s],i)}}forEach(e,i=this){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}rforEach(e,i=this){for(let s of h(this,a,st).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}purgeStale(){let e=false;for(let i of h(this,a,st).call(this,{allowStale:true}))t(this,G).call(this,i)&&(h(this,a,nt).call(this,t(this,x)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,p)[i],o=h(this,a,b).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let n={value:o};if(t(this,V)&&t(this,J)){let r=t(this,V)[i],d=t(this,J)[i];if(r&&d){let u=r-(dt.now()-d);n.ttl=u,n.start=Date.now();}}return t(this,X)&&(n.size=t(this,X)[i]),n}dump(){let e=[];for(let i of h(this,a,it).call(this,{allowStale:true})){let s=t(this,x)[i],o=t(this,p)[i],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n===void 0||s===void 0)continue;let r={value:n};if(t(this,V)&&t(this,J)){r.ttl=t(this,V)[i];let d=dt.now()-t(this,J)[i];r.start=Math.floor(Date.now()-d);}t(this,X)&&(r.size=t(this,X)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let o=Date.now()-s.start;s.start=dt.now()-o;}this.set(i,s.value,s);}}set(e,i,s={}){var W,O,g,v;if(i===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:u}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,k=t(this,wt).call(this,e,i,s.size||0,d);if(this.maxEntrySize&&k>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,a,nt).call(this,e,"set"),this;let c=t(this,E)===0?void 0:t(this,A).get(e);if(c===void 0)c=t(this,E)===0?t(this,U):t(this,B).length!==0?t(this,B).pop():t(this,E)===t(this,q)?h(this,a,Tt).call(this,false):t(this,E),t(this,x)[c]=e,t(this,p)[c]=i,t(this,A).set(e,c),t(this,R)[t(this,U)]=c,t(this,M)[c]=t(this,U),f(this,U,c),Ut(this,E)._++,t(this,yt).call(this,c,k,u),u&&(u.set="add"),w=false,t(this,vt)&&((W=t(this,ht))==null||W.call(this,i,e,"add"));else {h(this,a,bt).call(this,c);let y=t(this,p)[c];if(i!==y){if(t(this,rt)&&h(this,a,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=y;m!==void 0&&!r&&(t(this,Q)&&((O=t(this,K))==null||O.call(this,m,e,"set")),t(this,j)&&t(this,T)?.push([m,e,"set"]));}else r||(t(this,Q)&&((g=t(this,K))==null||g.call(this,y,e,"set")),t(this,j)&&t(this,T)?.push([y,e,"set"]));if(t(this,ct).call(this,c),t(this,yt).call(this,c,k,u),t(this,p)[c]=i,u){u.set="replace";let m=y&&h(this,a,b).call(this,y)?y.__staleWhileFetching:y;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");t(this,vt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(o!==0&&!t(this,V)&&h(this,a,Pt).call(this),t(this,V)&&(w||t(this,xt).call(this,c,o,n),u&&t(this,tt).call(this,u,c)),!r&&t(this,j)&&t(this,T)){let y=t(this,T),m;for(;m=y?.shift();)(v=t(this,$))==null||v.call(this,...m);}return this}pop(){var e;try{for(;t(this,E);){let i=t(this,p)[t(this,F)];if(h(this,a,Tt).call(this,!0),h(this,a,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,T)){let i=t(this,T),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,n=t(this,A).get(e);if(n!==void 0){let r=t(this,p)[n];if(h(this,a,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(t(this,G).call(this,n))o&&(o.has="stale",t(this,tt).call(this,o,n));else return s&&t(this,lt).call(this,n),o&&(o.has="hit",t(this,tt).call(this,o,n)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,G).call(this,o))return;let n=t(this,p)[o];return h(this,a,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:u=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:W=this.allowStaleOnFetchRejection,ignoreFetchAbort:O=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=false,status:m,signal:z}=i;if(!t(this,rt))return m&&(m.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,status:m});let L={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:d,size:u,sizeCalculation:w,noUpdateTTL:k,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:g,ignoreFetchAbort:O,status:m,signal:z},C=t(this,A).get(e);if(C===void 0){m&&(m.fetch="miss");let H=h(this,a,Ot).call(this,e,C,L,v);return H.__returned=H}else {let H=t(this,p)[C];if(h(this,a,b).call(this,H)){let It=s&&H.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",It&&(m.returnedStale=true)),It?H.__staleWhileFetching:H.__returned=H}let St=t(this,G).call(this,C);if(!y&&!St)return m&&(m.fetch="hit"),h(this,a,bt).call(this,C),o&&t(this,lt).call(this,C),m&&t(this,tt).call(this,m,C),H;let ft=h(this,a,Ot).call(this,e,C,L,v),ut=ft.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=St?"stale":"refresh",ut&&St&&(m.returnedStale=true)),ut?ft.__staleWhileFetching:ft.__returned=ft}}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,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:n,...r}=i,d=this.get(e,r);if(!n&&d!==void 0)return d;let u=s(e,d,{options:r,context:o});return this.set(e,u,r),u}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=i,d=t(this,A).get(e);if(d!==void 0){let u=t(this,p)[d],w=h(this,a,b).call(this,u);return r&&t(this,tt).call(this,r,d),t(this,G).call(this,d)?(r&&(r.get="stale"),w?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(n||h(this,a,nt).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),w?u.__staleWhileFetching:(h(this,a,bt).call(this,d),o&&t(this,lt).call(this,d),u))}else r&&(r.get="miss");}delete(e){return h(this,a,nt).call(this,e,"delete")}clear(){return h(this,a,Gt).call(this,"delete")}};q=new WeakMap,P=new WeakMap,K=new WeakMap,ht=new WeakMap,$=new WeakMap,gt=new WeakMap,_t=new WeakMap,E=new WeakMap,Y=new WeakMap,A=new WeakMap,x=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,F=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,X=new WeakMap,J=new WeakMap,V=new WeakMap,Q=new WeakMap,rt=new WeakMap,j=new WeakMap,vt=new WeakMap,a=new WeakSet,Pt=function(){let e=new pt(t(this,q)),i=new pt(t(this,q));f(this,V,e),f(this,J,i),f(this,xt,(n,r,d=dt.now())=>{if(i[n]=r!==0?d:0,e[n]=r,r!==0&&this.ttlAutopurge){let u=setTimeout(()=>{t(this,G).call(this,n)&&h(this,a,nt).call(this,t(this,x)[n],"expire");},r+1);u.unref&&u.unref();}}),f(this,lt,n=>{i[n]=e[n]!==0?dt.now():0;}),f(this,tt,(n,r)=>{if(e[r]){let d=e[r],u=i[r];if(!d||!u)return;n.ttl=d,n.start=u,n.now=s||o();let w=n.now-u;n.remainingTTL=d-w;}});let s=0,o=()=>{let n=dt.now();if(this.ttlResolution>0){s=n;let r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=t(this,A).get(n);if(r===void 0)return 0;let d=e[r],u=i[r];if(!d||!u)return 1/0;let w=(s||o())-u;return d-w},f(this,G,n=>{let r=i[n],d=e[n];return !!d&&!!r&&(s||o())-r>d});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,G=new WeakMap,ne=function(){let e=new pt(t(this,q));f(this,Y,0),f(this,X,e),f(this,ct,i=>{f(this,Y,t(this,Y)-e[i]),e[i]=0;}),f(this,wt,(i,s,o,n)=>{if(h(this,a,b).call(this,s))return 0;if(!et(o))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(o=n(s,i),!et(o))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 o}),f(this,yt,(i,s,o)=>{if(e[i]=s,t(this,P)){let n=t(this,P)-e[i];for(;t(this,Y)>n;)h(this,a,Tt).call(this,true);}f(this,Y,t(this,Y)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,Y));});},ct=new WeakMap,yt=new WeakMap,wt=new WeakMap,it=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,U);!(!h(this,a,Mt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,M)[i];},st=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,F);!(!h(this,a,Mt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,U)));)i=t(this,R)[i];},Mt=function(e){return e!==void 0&&t(this,A).get(t(this,x)[e])===e},Tt=function(e){var n;let i=t(this,F),s=t(this,x)[i],o=t(this,p)[i];return t(this,rt)&&h(this,a,b).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((n=t(this,K))==null||n.call(this,o,s,"evict")),t(this,j)&&t(this,T)?.push([o,s,"evict"])),t(this,ct).call(this,i),e&&(t(this,x)[i]=void 0,t(this,p)[i]=void 0,t(this,B).push(i)),t(this,E)===1?(f(this,F,f(this,U,0)),t(this,B).length=0):f(this,F,t(this,R)[i]),t(this,A).delete(s),Ut(this,E)._--,i},Ot=function(e,i,s,o){let n=i===void 0?void 0:t(this,p)[i];if(h(this,a,b).call(this,n))return n;let r=new Ct,{signal:d}=s;d?.addEventListener("abort",()=>r.abort(d.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:o},w=(v,y=false)=>{let{aborted:m}=r.signal,z=s.ignoreFetchAbort&&v!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),m&&!z&&!y)return c(r.signal.reason);let L=O;return t(this,p)[i]===O&&(v===void 0?L.__staleWhileFetching?t(this,p)[i]=L.__staleWhileFetching:h(this,a,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,v,u.options))),v},k=v=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=v),c(v)),c=v=>{let{aborted:y}=r.signal,m=y&&s.allowStaleOnFetchAbort,z=m||s.allowStaleOnFetchRejection,L=z||s.noDeleteOnFetchRejection,C=O;if(t(this,p)[i]===O&&(!L||C.__staleWhileFetching===void 0?h(this,a,nt).call(this,e,"fetch"):m||(t(this,p)[i]=C.__staleWhileFetching)),z)return s.status&&C.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),C.__staleWhileFetching;if(C.__returned===C)throw v},W=(v,y)=>{var z;let m=(z=t(this,gt))==null?void 0:z.call(this,e,n,u);m&&m instanceof Promise&&m.then(L=>v(L===void 0?void 0:L),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(v(void 0),s.allowStaleOnFetchAbort&&(v=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let O=new Promise(W).then(w,k),g=Object.assign(O,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,g,{...u.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=g,g},b=function(e){if(!t(this,rt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ct},Vt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i;},bt=function(e){e!==t(this,U)&&(e===t(this,F)?f(this,F,t(this,R)[e]):h(this,a,Vt).call(this,t(this,M)[e],t(this,R)[e]),h(this,a,Vt).call(this,t(this,U),e),f(this,U,e));},nt=function(e,i){var o,n;let s=false;if(t(this,E)!==0){let r=t(this,A).get(e);if(r!==void 0)if(s=true,t(this,E)===1)h(this,a,Gt).call(this,i);else {t(this,ct).call(this,r);let d=t(this,p)[r];if(h(this,a,b).call(this,d)?d.__abortController.abort(new Error("deleted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((o=t(this,K))==null||o.call(this,d,e,i)),t(this,j)&&t(this,T)?.push([d,e,i])),t(this,A).delete(e),t(this,x)[r]=void 0,t(this,p)[r]=void 0,r===t(this,U))f(this,U,t(this,M)[r]);else if(r===t(this,F))f(this,F,t(this,R)[r]);else {let u=t(this,M)[r];t(this,R)[u]=t(this,R)[r];let w=t(this,R)[r];t(this,M)[w]=t(this,M)[r];}Ut(this,E)._--,t(this,B).push(r);}}if(t(this,j)&&t(this,T)?.length){let r=t(this,T),d;for(;d=r?.shift();)(n=t(this,$))==null||n.call(this,...d);}return s},Gt=function(e){var i,s;for(let o of h(this,a,st).call(this,{allowStale:true})){let n=t(this,p)[o];if(h(this,a,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let r=t(this,x)[o];t(this,Q)&&((i=t(this,K))==null||i.call(this,n,r,e)),t(this,j)&&t(this,T)?.push([n,r,e]);}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,x).fill(void 0),t(this,V)&&t(this,J)&&(t(this,V).fill(0),t(this,J).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,F,0),f(this,U,0),t(this,B).length=0,f(this,Y,0),f(this,E,0),t(this,j)&&t(this,T)){let o=t(this,T),n;for(;n=o?.shift();)(s=t(this,$))==null||s.call(this,...n);}};var Dt=Wt;var Ft=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new Dt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return 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 At="1.3.21";var Ht="repeat";function kt(l){return {type:"pause",duration:l}}var qt="__game_layer__";var re={};var Kt={};le(Kt,{createExportableElement:()=>oe});var Rt;(o=>(o.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),o.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),o.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),o.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(Rt||(Rt={}));function oe(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Rt.error("Error creating exportable element",l,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function ae(){console.info(`
2
2
  _______ _ _ _ ____ ____ ____ _____
3
3
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
4
4
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
@@ -6,4 +6,4 @@
6
6
  _| |_ | | > ' < | | \\ ' / _| |_\\ |_
7
7
  |_____| [___][__]\`\\_][___] \\_/ |_____|\\____|
8
8
 
9
- `);}function $t(){let l=window.location.pathname+window.location.hash;return l.includes("#")&&(l=l.split("#")[1]),l}exports.Game=void 0;(k=>{async function l(c,W,O){return unifier.GameUnifier.init({getCurrentGameStepState:()=>({path:$t(),storage:N__namespace.storage.export(),canvas:I__namespace.canvas.export(),sound:ot__namespace.sound.export(),labelIndex:D__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:D__namespace.narration.openedLabels}),restoreGameStepState:async(g,v)=>{Z__namespace.HistoryManagerStatic._originalStepData=g,D__namespace.NarrationManagerStatic.openedLabels=g.openedLabels,N__namespace.storage.restore(g.storage),await I__namespace.canvas.restore(g.canvas),ot__namespace.sound.restore(g.sound),v(g.path);},getStepCounter:()=>D__namespace.narration.stepCounter,setStepCounter:g=>{D__namespace.NarrationManagerStatic._stepCounter=g;},getOpenedLabels:()=>D__namespace.narration.openedLabels.length,addHistoryItem:(g,v)=>Z__namespace.stepHistory.add(g,v),getCurrentStepsRunningNumber:()=>D__namespace.NarrationManagerStatic.stepsRunning,getCharacter:g=>Bt__namespace.RegisteredCharacters.get(g),onGoNextEnd:async()=>{let g=I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.map(({id:y})=>I__namespace.canvas.forceCompletionOfTicker(y)),v=I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias.map(({alias:y,id:m})=>I__namespace.canvas.forceCompletionOfTicker(m,y));await Promise.all([...g,...v]),I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};},getVariable:g=>N__namespace.storage.getVariable(g),setVariable:(g,v)=>N__namespace.storage.setVariable(g,v),removeVariable:g=>N__namespace.storage.removeVariable(g),getFlag:g=>N__namespace.storage.getFlag(g),setFlag:(g,v)=>N__namespace.storage.setFlag(g,v),onLabelClosing:g=>N__namespace.StorageManagerStatic.clearOldTempVariables(g)}),ae(),await I__namespace.canvas.init(c,W,O)}k.init=l;function e(){N__namespace.storage.clear(),I__namespace.canvas.clear(),ot__namespace.sound.clear(),D__namespace.narration.clear(),Z__namespace.stepHistory.clear();}k.clear=e;function i(){return {pixivn_version:At,stepData:D__namespace.narration.export(),storageData:N__namespace.storage.export(),canvasData:I__namespace.canvas.export(),soundData:ot__namespace.sound.export(),historyData:Z__namespace.stepHistory.export(),path:$t()}}k.exportGameState=i;async function s(c,W){c.stepData.hasOwnProperty("stepsHistory")&&c.stepData.stepsHistory&&(c.historyData.stepsHistory=c.stepData.stepsHistory),c.stepData.hasOwnProperty("originalStepData")&&c.stepData.originalStepData&&(c.historyData.originalStepData=c.stepData.originalStepData),Z__namespace.stepHistory.restore(c.historyData);let O=Z__namespace.stepHistory.lastKey;if(typeof O=="number"){let g=Z__namespace.stepHistory.stepsInfoMap.get(O)||null;await D__namespace.narration.restore(c.stepData,g);}N__namespace.storage.restore(c.storageData),await I__namespace.canvas.restore(c.canvasData),ot__namespace.sound.restore(c.soundData),await W(c.path);}k.restoreGameState=s;function o(c){return JSON.parse(c)}k.jsonToGameState=o;function n(c){unifier.GameUnifier.onEnd=c;}k.onEnd=n;function r(c){unifier.GameUnifier.onError=c;}k.onError=r;function d(c){D__namespace.NarrationManagerStatic.onStepStart=c;}k.onStepStart=d;function u(c){D__namespace.NarrationManagerStatic.onLoadingLabel=c;}k.onLoadingLabel=u;function w(c){D__namespace.NarrationManagerStatic.onStepEnd=c;}k.onStepEnd=w;})(exports.Game||(exports.Game={}));var Me={Assets:pixi_js.Assets,Rectangle:pixi_js.Rectangle,characterUtils:Bt__namespace,canvasUtils:I__namespace,narrationUtils:D__namespace,soundUtils:ot__namespace,CANVAS_APP_GAME_LAYER_ALIAS:qt,Pause:kt,Repeat:Ht,PIXIVN_VERSION:At,...Kt,...re,canvas:I__namespace.canvas,narration:D__namespace.narration,sound:ot__namespace.sound,storage:N__namespace.storage,history:Z__namespace.stepHistory,Game:exports.Game,GameUnifier:unifier.GameUnifier};Object.defineProperty(exports,"Assets",{enumerable:true,get:function(){return pixi_js.Assets}});Object.defineProperty(exports,"Rectangle",{enumerable:true,get:function(){return pixi_js.Rectangle}});Object.defineProperty(exports,"Texture",{enumerable:true,get:function(){return pixi_js.Texture}});Object.defineProperty(exports,"UPDATE_PRIORITY",{enumerable:true,get:function(){return pixi_js.UPDATE_PRIORITY}});exports.CANVAS_APP_GAME_LAYER_ALIAS=qt;exports.CachedMap=Ft;exports.PIXIVN_VERSION=At;exports.Pause=kt;exports.Repeat=Ht;exports.createExportableElement=oe;exports.default=Me;Object.keys(I).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return I[k]}})});Object.keys(Bt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Bt[k]}})});Object.keys(Z).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Z[k]}})});Object.keys(D).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return D[k]}})});Object.keys(ot).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return ot[k]}})});Object.keys(N).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return N[k]}})});Object.keys(unifier).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return unifier[k]}})});
9
+ `);}function $t(){let l=window.location.pathname+window.location.hash;return l.includes("#")&&(l=l.split("#")[1]),l}exports.Game=void 0;(k=>{async function l(c,W,O){return unifier.GameUnifier.init({getCurrentGameStepState:()=>({path:$t(),storage:N__namespace.storage.export(),canvas:I__namespace.canvas.export(),sound:ot__namespace.sound.export(),labelIndex:D__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:D__namespace.narration.openedLabels}),restoreGameStepState:async(g,v)=>{Z__namespace.HistoryManagerStatic._originalStepData=g,D__namespace.NarrationManagerStatic.openedLabels=g.openedLabels,N__namespace.storage.restore(g.storage),await I__namespace.canvas.restore(g.canvas),ot__namespace.sound.restore(g.sound),v(g.path);},getStepCounter:()=>D__namespace.narration.stepCounter,setStepCounter:g=>{D__namespace.NarrationManagerStatic._stepCounter=g;},getOpenedLabels:()=>D__namespace.narration.openedLabels.length,addHistoryItem:(g,v)=>Z__namespace.stepHistory.add(g,v),getCurrentStepsRunningNumber:()=>D__namespace.NarrationManagerStatic.stepsRunning,getCharacter:g=>Bt__namespace.RegisteredCharacters.get(g),onGoNextEnd:async()=>{let g=I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.map(({id:y})=>I__namespace.canvas.forceCompletionOfTicker(y)),v=I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias.map(({alias:y,id:m})=>I__namespace.canvas.forceCompletionOfTicker(m,y));await Promise.all([...g,...v]),I__namespace.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};},getVariable:g=>N__namespace.storage.get(g),setVariable:(g,v)=>N__namespace.storage.set(g,v),removeVariable:g=>N__namespace.storage.removeVariable(g),getFlag:g=>N__namespace.storage.getFlag(g),setFlag:(g,v)=>N__namespace.storage.setFlag(g,v),onLabelClosing:g=>N__namespace.StorageManagerStatic.clearOldTempVariables(g)}),ae(),await I__namespace.canvas.init(c,W,O)}k.init=l;function e(){N__namespace.storage.clear(),I__namespace.canvas.clear(),ot__namespace.sound.clear(),D__namespace.narration.clear(),Z__namespace.stepHistory.clear();}k.clear=e;function i(){return {pixivn_version:At,stepData:D__namespace.narration.export(),storageData:N__namespace.storage.export(),canvasData:I__namespace.canvas.export(),soundData:ot__namespace.sound.export(),historyData:Z__namespace.stepHistory.export(),path:$t()}}k.exportGameState=i;async function s(c,W){c.stepData.hasOwnProperty("stepsHistory")&&c.stepData.stepsHistory&&(c.historyData.stepsHistory=c.stepData.stepsHistory),c.stepData.hasOwnProperty("originalStepData")&&c.stepData.originalStepData&&(c.historyData.originalStepData=c.stepData.originalStepData),Z__namespace.stepHistory.restore(c.historyData);let O=Z__namespace.stepHistory.lastKey;if(typeof O=="number"){let g=Z__namespace.stepHistory.stepsInfoMap.get(O)||null;await D__namespace.narration.restore(c.stepData,g);}N__namespace.storage.restore(c.storageData),await I__namespace.canvas.restore(c.canvasData),ot__namespace.sound.restore(c.soundData),await W(c.path);}k.restoreGameState=s;function o(c){return JSON.parse(c)}k.jsonToGameState=o;function n(c){unifier.GameUnifier.onEnd=c;}k.onEnd=n;function r(c){unifier.GameUnifier.onError=c;}k.onError=r;function d(c){D__namespace.NarrationManagerStatic.onStepStart=c;}k.onStepStart=d;function u(c){D__namespace.NarrationManagerStatic.onLoadingLabel=c;}k.onLoadingLabel=u;function w(c){D__namespace.NarrationManagerStatic.onStepEnd=c;}k.onStepEnd=w;})(exports.Game||(exports.Game={}));var Ve={Assets:pixi_js.Assets,Rectangle:pixi_js.Rectangle,characterUtils:Bt__namespace,canvasUtils:I__namespace,narrationUtils:D__namespace,soundUtils:ot__namespace,CANVAS_APP_GAME_LAYER_ALIAS:qt,Pause:kt,Repeat:Ht,PIXIVN_VERSION:At,...Kt,...re,canvas:I__namespace.canvas,narration:D__namespace.narration,sound:ot__namespace.sound,storage:N__namespace.storage,history:Z__namespace.stepHistory,Game:exports.Game,GameUnifier:unifier.GameUnifier};Object.defineProperty(exports,"Assets",{enumerable:true,get:function(){return pixi_js.Assets}});Object.defineProperty(exports,"Rectangle",{enumerable:true,get:function(){return pixi_js.Rectangle}});Object.defineProperty(exports,"Texture",{enumerable:true,get:function(){return pixi_js.Texture}});Object.defineProperty(exports,"UPDATE_PRIORITY",{enumerable:true,get:function(){return pixi_js.UPDATE_PRIORITY}});exports.CANVAS_APP_GAME_LAYER_ALIAS=qt;exports.CachedMap=Ft;exports.PIXIVN_VERSION=At;exports.Pause=kt;exports.Repeat=Ht;exports.createExportableElement=oe;exports.default=Ve;Object.keys(I).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return I[k]}})});Object.keys(Bt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Bt[k]}})});Object.keys(Z).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Z[k]}})});Object.keys(D).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return D[k]}})});Object.keys(ot).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return ot[k]}})});Object.keys(N).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return N[k]}})});Object.keys(unifier).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return unifier[k]}})});
package/dist/index.d.cts CHANGED
@@ -356,7 +356,7 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
356
356
  elements: CanvasBaseItemMemory[];
357
357
  }
358
358
 
359
- var version = "1.3.19";
359
+ var version = "1.3.21";
360
360
 
361
361
  declare const Repeat: RepeatType;
362
362
  /**
package/dist/index.d.ts CHANGED
@@ -356,7 +356,7 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
356
356
  elements: CanvasBaseItemMemory[];
357
357
  }
358
358
 
359
- var version = "1.3.19";
359
+ var version = "1.3.21";
360
360
 
361
361
  declare const Repeat: RepeatType;
362
362
  /**
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import*as I from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as Bt from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import*as Z from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as D from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import {Rectangle,Assets}from'@drincs/pixi-vn/pixi.js';export{Assets,Rectangle,Texture,UPDATE_PRIORITY}from'@drincs/pixi-vn/pixi.js';import*as ot from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as N from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {GameUnifier}from'@drincs/pixi-vn/unifier';export*from'@drincs/pixi-vn/unifier';var Xt=Object.defineProperty;var Jt=l=>{throw TypeError(l)};var he=(l,e,i)=>e in l?Xt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var le=(l,e)=>{for(var i in e)Xt(l,i,{get:e[i],enumerable:true});};var S=(l,e,i)=>he(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Jt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),_=(l,e,i)=>e.has(l)?Jt("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),h=(l,e,i)=>(zt(l,e,"access private method"),i);var Ut=(l,e,i,s)=>({set _(o){f(l,e,o);},get _(){return t(l,e,s)}});var dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Lt=typeof process=="object"&&process?process:{},ie=(l,e,i,s)=>{typeof Lt.emitWarning=="function"?Lt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ct=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Ct>"u"){Qt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(s,o){this._onabort.push(o);}},Ct=class{constructor(){S(this,"signal",new Qt);e();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let l=Lt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,ie("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 ce=l=>!ee.has(l),et=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),se=l=>et(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?pt:null:null,pt=class extends Array{constructor(e){super(e),this.fill(0);}},mt,at=class at{constructor(e,i){S(this,"heap");S(this,"length");if(!t(at,mt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=se(e);if(!i)return [];f(at,mt,true);let s=new at(e,i);return f(at,mt,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};mt=new WeakMap,_(at,mt,false);var Nt=at,Zt,te,q,P,K,ht,$,gt,_t,E,Y,A,x,p,R,V,F,U,B,T,X,J,M,Q,rt,j,vt,a,Pt,lt,tt,xt,G,ne,ct,yt,wt,it,st,Vt,Tt,Ot,b,Mt,bt,nt,Gt,Wt=class Wt{constructor(e){_(this,a);_(this,q);_(this,P);_(this,K);_(this,ht);_(this,$);_(this,gt);_(this,_t);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");_(this,E);_(this,Y);_(this,A);_(this,x);_(this,p);_(this,R);_(this,V);_(this,F);_(this,U);_(this,B);_(this,T);_(this,X);_(this,J);_(this,M);_(this,Q);_(this,rt);_(this,j);_(this,vt);_(this,lt,()=>{});_(this,tt,()=>{});_(this,xt,()=>{});_(this,G,()=>false);_(this,ct,e=>{});_(this,yt,(e,i,s)=>{});_(this,wt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:d,allowStale:u,dispose:w,onInsert:k,disposeAfter:c,noDisposeOnSet:W,noUpdateTTL:O,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:m,memoMethod:z,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:St,ignoreFetchAbort:ft}=e;if(i!==0&&!et(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?se(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,q,i),f(this,P,g),this.maxEntrySize=v||t(this,P),this.sizeCalculation=y,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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,m),f(this,rt,!!m),f(this,A,new Map),f(this,x,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new Et(i)),f(this,V,new Et(i)),f(this,F,0),f(this,U,0),f(this,B,Nt.create(i)),f(this,E,0),f(this,Y,0),typeof w=="function"&&f(this,K,w),typeof k=="function"&&f(this,ht,k),typeof c=="function"?(f(this,$,c),f(this,T,[])):(f(this,$,void 0),f(this,T,void 0)),f(this,Q,!!t(this,K)),f(this,vt,!!t(this,ht)),f(this,j,!!t(this,$)),this.noDisposeOnSet=!!W,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!St,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(t(this,P)!==0&&!et(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!et(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,a,ne).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!d,this.ttlResolution=et(o)||o===0?o:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!et(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,a,Pt).call(this);}if(t(this,q)===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,q)&&!t(this,P)){let ut="LRU_CACHE_UNBOUNDED";ce(ut)&&(ee.add(ut),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ut,Wt));}}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,M),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,x),valList:t(e,p),next:t(e,R),prev:t(e,V),get head(){return t(e,F)},get tail(){return t(e,U)},free:t(e,B),isBackgroundFetch:i=>{var s;return h(s=e,a,b).call(s,i)},backgroundFetch:(i,s,o,n)=>{var r;return h(r=e,a,Ot).call(r,i,s,o,n)},moveToTail:i=>{var s;return h(s=e,a,bt).call(s,i)},indexes:i=>{var s;return h(s=e,a,it).call(s,i)},rindexes:i=>{var s;return h(s=e,a,st).call(s,i)},isStale:i=>{var s;return t(s=e,G).call(s,i)}}}get max(){return t(this,q)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,Y)}get size(){return t(this,E)}get fetchMethod(){return t(this,gt)}get memoMethod(){return t(this,_t)}get dispose(){return t(this,K)}get onInsert(){return t(this,ht)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*rentries(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*keys(){for(let e of h(this,a,it).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of h(this,a,st).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n!==void 0&&e(n,t(this,x)[s],this))return this.get(t(this,x)[s],i)}}forEach(e,i=this){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}rforEach(e,i=this){for(let s of h(this,a,st).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}purgeStale(){let e=false;for(let i of h(this,a,st).call(this,{allowStale:true}))t(this,G).call(this,i)&&(h(this,a,nt).call(this,t(this,x)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,p)[i],o=h(this,a,b).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let n={value:o};if(t(this,M)&&t(this,J)){let r=t(this,M)[i],d=t(this,J)[i];if(r&&d){let u=r-(dt.now()-d);n.ttl=u,n.start=Date.now();}}return t(this,X)&&(n.size=t(this,X)[i]),n}dump(){let e=[];for(let i of h(this,a,it).call(this,{allowStale:true})){let s=t(this,x)[i],o=t(this,p)[i],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n===void 0||s===void 0)continue;let r={value:n};if(t(this,M)&&t(this,J)){r.ttl=t(this,M)[i];let d=dt.now()-t(this,J)[i];r.start=Math.floor(Date.now()-d);}t(this,X)&&(r.size=t(this,X)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let o=Date.now()-s.start;s.start=dt.now()-o;}this.set(i,s.value,s);}}set(e,i,s={}){var W,O,g,v;if(i===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:u}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,k=t(this,wt).call(this,e,i,s.size||0,d);if(this.maxEntrySize&&k>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,a,nt).call(this,e,"set"),this;let c=t(this,E)===0?void 0:t(this,A).get(e);if(c===void 0)c=t(this,E)===0?t(this,U):t(this,B).length!==0?t(this,B).pop():t(this,E)===t(this,q)?h(this,a,Tt).call(this,false):t(this,E),t(this,x)[c]=e,t(this,p)[c]=i,t(this,A).set(e,c),t(this,R)[t(this,U)]=c,t(this,V)[c]=t(this,U),f(this,U,c),Ut(this,E)._++,t(this,yt).call(this,c,k,u),u&&(u.set="add"),w=false,t(this,vt)&&((W=t(this,ht))==null||W.call(this,i,e,"add"));else {h(this,a,bt).call(this,c);let y=t(this,p)[c];if(i!==y){if(t(this,rt)&&h(this,a,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=y;m!==void 0&&!r&&(t(this,Q)&&((O=t(this,K))==null||O.call(this,m,e,"set")),t(this,j)&&t(this,T)?.push([m,e,"set"]));}else r||(t(this,Q)&&((g=t(this,K))==null||g.call(this,y,e,"set")),t(this,j)&&t(this,T)?.push([y,e,"set"]));if(t(this,ct).call(this,c),t(this,yt).call(this,c,k,u),t(this,p)[c]=i,u){u.set="replace";let m=y&&h(this,a,b).call(this,y)?y.__staleWhileFetching:y;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");t(this,vt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(o!==0&&!t(this,M)&&h(this,a,Pt).call(this),t(this,M)&&(w||t(this,xt).call(this,c,o,n),u&&t(this,tt).call(this,u,c)),!r&&t(this,j)&&t(this,T)){let y=t(this,T),m;for(;m=y?.shift();)(v=t(this,$))==null||v.call(this,...m);}return this}pop(){var e;try{for(;t(this,E);){let i=t(this,p)[t(this,F)];if(h(this,a,Tt).call(this,!0),h(this,a,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,T)){let i=t(this,T),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,n=t(this,A).get(e);if(n!==void 0){let r=t(this,p)[n];if(h(this,a,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(t(this,G).call(this,n))o&&(o.has="stale",t(this,tt).call(this,o,n));else return s&&t(this,lt).call(this,n),o&&(o.has="hit",t(this,tt).call(this,o,n)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,G).call(this,o))return;let n=t(this,p)[o];return h(this,a,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:u=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:W=this.allowStaleOnFetchRejection,ignoreFetchAbort:O=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=false,status:m,signal:z}=i;if(!t(this,rt))return m&&(m.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,status:m});let L={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:d,size:u,sizeCalculation:w,noUpdateTTL:k,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:g,ignoreFetchAbort:O,status:m,signal:z},C=t(this,A).get(e);if(C===void 0){m&&(m.fetch="miss");let H=h(this,a,Ot).call(this,e,C,L,v);return H.__returned=H}else {let H=t(this,p)[C];if(h(this,a,b).call(this,H)){let It=s&&H.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",It&&(m.returnedStale=true)),It?H.__staleWhileFetching:H.__returned=H}let St=t(this,G).call(this,C);if(!y&&!St)return m&&(m.fetch="hit"),h(this,a,bt).call(this,C),o&&t(this,lt).call(this,C),m&&t(this,tt).call(this,m,C),H;let ft=h(this,a,Ot).call(this,e,C,L,v),ut=ft.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=St?"stale":"refresh",ut&&St&&(m.returnedStale=true)),ut?ft.__staleWhileFetching:ft.__returned=ft}}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,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:n,...r}=i,d=this.get(e,r);if(!n&&d!==void 0)return d;let u=s(e,d,{options:r,context:o});return this.set(e,u,r),u}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=i,d=t(this,A).get(e);if(d!==void 0){let u=t(this,p)[d],w=h(this,a,b).call(this,u);return r&&t(this,tt).call(this,r,d),t(this,G).call(this,d)?(r&&(r.get="stale"),w?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(n||h(this,a,nt).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),w?u.__staleWhileFetching:(h(this,a,bt).call(this,d),o&&t(this,lt).call(this,d),u))}else r&&(r.get="miss");}delete(e){return h(this,a,nt).call(this,e,"delete")}clear(){return h(this,a,Gt).call(this,"delete")}};q=new WeakMap,P=new WeakMap,K=new WeakMap,ht=new WeakMap,$=new WeakMap,gt=new WeakMap,_t=new WeakMap,E=new WeakMap,Y=new WeakMap,A=new WeakMap,x=new WeakMap,p=new WeakMap,R=new WeakMap,V=new WeakMap,F=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,X=new WeakMap,J=new WeakMap,M=new WeakMap,Q=new WeakMap,rt=new WeakMap,j=new WeakMap,vt=new WeakMap,a=new WeakSet,Pt=function(){let e=new pt(t(this,q)),i=new pt(t(this,q));f(this,M,e),f(this,J,i),f(this,xt,(n,r,d=dt.now())=>{if(i[n]=r!==0?d:0,e[n]=r,r!==0&&this.ttlAutopurge){let u=setTimeout(()=>{t(this,G).call(this,n)&&h(this,a,nt).call(this,t(this,x)[n],"expire");},r+1);u.unref&&u.unref();}}),f(this,lt,n=>{i[n]=e[n]!==0?dt.now():0;}),f(this,tt,(n,r)=>{if(e[r]){let d=e[r],u=i[r];if(!d||!u)return;n.ttl=d,n.start=u,n.now=s||o();let w=n.now-u;n.remainingTTL=d-w;}});let s=0,o=()=>{let n=dt.now();if(this.ttlResolution>0){s=n;let r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=t(this,A).get(n);if(r===void 0)return 0;let d=e[r],u=i[r];if(!d||!u)return 1/0;let w=(s||o())-u;return d-w},f(this,G,n=>{let r=i[n],d=e[n];return !!d&&!!r&&(s||o())-r>d});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,G=new WeakMap,ne=function(){let e=new pt(t(this,q));f(this,Y,0),f(this,X,e),f(this,ct,i=>{f(this,Y,t(this,Y)-e[i]),e[i]=0;}),f(this,wt,(i,s,o,n)=>{if(h(this,a,b).call(this,s))return 0;if(!et(o))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(o=n(s,i),!et(o))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 o}),f(this,yt,(i,s,o)=>{if(e[i]=s,t(this,P)){let n=t(this,P)-e[i];for(;t(this,Y)>n;)h(this,a,Tt).call(this,true);}f(this,Y,t(this,Y)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,Y));});},ct=new WeakMap,yt=new WeakMap,wt=new WeakMap,it=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,U);!(!h(this,a,Vt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,V)[i];},st=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,F);!(!h(this,a,Vt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,U)));)i=t(this,R)[i];},Vt=function(e){return e!==void 0&&t(this,A).get(t(this,x)[e])===e},Tt=function(e){var n;let i=t(this,F),s=t(this,x)[i],o=t(this,p)[i];return t(this,rt)&&h(this,a,b).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((n=t(this,K))==null||n.call(this,o,s,"evict")),t(this,j)&&t(this,T)?.push([o,s,"evict"])),t(this,ct).call(this,i),e&&(t(this,x)[i]=void 0,t(this,p)[i]=void 0,t(this,B).push(i)),t(this,E)===1?(f(this,F,f(this,U,0)),t(this,B).length=0):f(this,F,t(this,R)[i]),t(this,A).delete(s),Ut(this,E)._--,i},Ot=function(e,i,s,o){let n=i===void 0?void 0:t(this,p)[i];if(h(this,a,b).call(this,n))return n;let r=new Ct,{signal:d}=s;d?.addEventListener("abort",()=>r.abort(d.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:o},w=(v,y=false)=>{let{aborted:m}=r.signal,z=s.ignoreFetchAbort&&v!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),m&&!z&&!y)return c(r.signal.reason);let L=O;return t(this,p)[i]===O&&(v===void 0?L.__staleWhileFetching?t(this,p)[i]=L.__staleWhileFetching:h(this,a,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,v,u.options))),v},k=v=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=v),c(v)),c=v=>{let{aborted:y}=r.signal,m=y&&s.allowStaleOnFetchAbort,z=m||s.allowStaleOnFetchRejection,L=z||s.noDeleteOnFetchRejection,C=O;if(t(this,p)[i]===O&&(!L||C.__staleWhileFetching===void 0?h(this,a,nt).call(this,e,"fetch"):m||(t(this,p)[i]=C.__staleWhileFetching)),z)return s.status&&C.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),C.__staleWhileFetching;if(C.__returned===C)throw v},W=(v,y)=>{var z;let m=(z=t(this,gt))==null?void 0:z.call(this,e,n,u);m&&m instanceof Promise&&m.then(L=>v(L===void 0?void 0:L),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(v(void 0),s.allowStaleOnFetchAbort&&(v=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let O=new Promise(W).then(w,k),g=Object.assign(O,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,g,{...u.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=g,g},b=function(e){if(!t(this,rt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ct},Mt=function(e,i){t(this,V)[i]=e,t(this,R)[e]=i;},bt=function(e){e!==t(this,U)&&(e===t(this,F)?f(this,F,t(this,R)[e]):h(this,a,Mt).call(this,t(this,V)[e],t(this,R)[e]),h(this,a,Mt).call(this,t(this,U),e),f(this,U,e));},nt=function(e,i){var o,n;let s=false;if(t(this,E)!==0){let r=t(this,A).get(e);if(r!==void 0)if(s=true,t(this,E)===1)h(this,a,Gt).call(this,i);else {t(this,ct).call(this,r);let d=t(this,p)[r];if(h(this,a,b).call(this,d)?d.__abortController.abort(new Error("deleted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((o=t(this,K))==null||o.call(this,d,e,i)),t(this,j)&&t(this,T)?.push([d,e,i])),t(this,A).delete(e),t(this,x)[r]=void 0,t(this,p)[r]=void 0,r===t(this,U))f(this,U,t(this,V)[r]);else if(r===t(this,F))f(this,F,t(this,R)[r]);else {let u=t(this,V)[r];t(this,R)[u]=t(this,R)[r];let w=t(this,R)[r];t(this,V)[w]=t(this,V)[r];}Ut(this,E)._--,t(this,B).push(r);}}if(t(this,j)&&t(this,T)?.length){let r=t(this,T),d;for(;d=r?.shift();)(n=t(this,$))==null||n.call(this,...d);}return s},Gt=function(e){var i,s;for(let o of h(this,a,st).call(this,{allowStale:true})){let n=t(this,p)[o];if(h(this,a,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let r=t(this,x)[o];t(this,Q)&&((i=t(this,K))==null||i.call(this,n,r,e)),t(this,j)&&t(this,T)?.push([n,r,e]);}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,x).fill(void 0),t(this,M)&&t(this,J)&&(t(this,M).fill(0),t(this,J).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,F,0),f(this,U,0),t(this,B).length=0,f(this,Y,0),f(this,E,0),t(this,j)&&t(this,T)){let o=t(this,T),n;for(;n=o?.shift();)(s=t(this,$))==null||s.call(this,...n);}};var Dt=Wt;var Ft=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new Dt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return 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 At="1.3.19";var Ht="repeat";function kt(l){return {type:"pause",duration:l}}var qt="__game_layer__";var re={};var Kt={};le(Kt,{createExportableElement:()=>oe});var Rt;(o=>(o.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),o.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),o.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),o.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(Rt||(Rt={}));function oe(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Rt.error("Error creating exportable element",l,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function ae(){console.info(`
1
+ import*as I from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as Bt from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import*as Z from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as D from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import {Rectangle,Assets}from'@drincs/pixi-vn/pixi.js';export{Assets,Rectangle,Texture,UPDATE_PRIORITY}from'@drincs/pixi-vn/pixi.js';import*as ot from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as N from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {GameUnifier}from'@drincs/pixi-vn/unifier';export*from'@drincs/pixi-vn/unifier';var Xt=Object.defineProperty;var Jt=l=>{throw TypeError(l)};var he=(l,e,i)=>e in l?Xt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var le=(l,e)=>{for(var i in e)Xt(l,i,{get:e[i],enumerable:true});};var S=(l,e,i)=>he(l,typeof e!="symbol"?e+"":e,i),zt=(l,e,i)=>e.has(l)||Jt("Cannot "+i);var t=(l,e,i)=>(zt(l,e,"read from private field"),i?i.call(l):e.get(l)),_=(l,e,i)=>e.has(l)?Jt("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),h=(l,e,i)=>(zt(l,e,"access private method"),i);var Ut=(l,e,i,s)=>({set _(o){f(l,e,o);},get _(){return t(l,e,s)}});var dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Lt=typeof process=="object"&&process?process:{},ie=(l,e,i,s)=>{typeof Lt.emitWarning=="function"?Lt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ct=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Ct>"u"){Qt=class{constructor(){S(this,"onabort");S(this,"_onabort",[]);S(this,"reason");S(this,"aborted",false);}addEventListener(s,o){this._onabort.push(o);}},Ct=class{constructor(){S(this,"signal",new Qt);e();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let l=Lt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,ie("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 ce=l=>!ee.has(l),et=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),se=l=>et(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?pt:null:null,pt=class extends Array{constructor(e){super(e),this.fill(0);}},mt,at=class at{constructor(e,i){S(this,"heap");S(this,"length");if(!t(at,mt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=se(e);if(!i)return [];f(at,mt,true);let s=new at(e,i);return f(at,mt,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};mt=new WeakMap,_(at,mt,false);var Nt=at,Zt,te,q,P,K,ht,$,gt,_t,E,Y,A,x,p,R,M,F,U,B,T,X,J,V,Q,rt,j,vt,a,Pt,lt,tt,xt,G,ne,ct,yt,wt,it,st,Mt,Tt,Ot,b,Vt,bt,nt,Gt,Wt=class Wt{constructor(e){_(this,a);_(this,q);_(this,P);_(this,K);_(this,ht);_(this,$);_(this,gt);_(this,_t);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");_(this,E);_(this,Y);_(this,A);_(this,x);_(this,p);_(this,R);_(this,M);_(this,F);_(this,U);_(this,B);_(this,T);_(this,X);_(this,J);_(this,V);_(this,Q);_(this,rt);_(this,j);_(this,vt);_(this,lt,()=>{});_(this,tt,()=>{});_(this,xt,()=>{});_(this,G,()=>false);_(this,ct,e=>{});_(this,yt,(e,i,s)=>{});_(this,wt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});S(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:d,allowStale:u,dispose:w,onInsert:k,disposeAfter:c,noDisposeOnSet:W,noUpdateTTL:O,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:m,memoMethod:z,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:St,ignoreFetchAbort:ft}=e;if(i!==0&&!et(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?se(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,q,i),f(this,P,g),this.maxEntrySize=v||t(this,P),this.sizeCalculation=y,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(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,_t,z),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,m),f(this,rt,!!m),f(this,A,new Map),f(this,x,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new Et(i)),f(this,M,new Et(i)),f(this,F,0),f(this,U,0),f(this,B,Nt.create(i)),f(this,E,0),f(this,Y,0),typeof w=="function"&&f(this,K,w),typeof k=="function"&&f(this,ht,k),typeof c=="function"?(f(this,$,c),f(this,T,[])):(f(this,$,void 0),f(this,T,void 0)),f(this,Q,!!t(this,K)),f(this,vt,!!t(this,ht)),f(this,j,!!t(this,$)),this.noDisposeOnSet=!!W,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!St,this.ignoreFetchAbort=!!ft,this.maxEntrySize!==0){if(t(this,P)!==0&&!et(t(this,P)))throw new TypeError("maxSize must be a positive integer if specified");if(!et(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,a,ne).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!d,this.ttlResolution=et(o)||o===0?o:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!et(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,a,Pt).call(this);}if(t(this,q)===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,q)&&!t(this,P)){let ut="LRU_CACHE_UNBOUNDED";ce(ut)&&(ee.add(ut),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ut,Wt));}}static unsafeExposeInternals(e){return {starts:t(e,J),ttls:t(e,V),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,x),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,F)},get tail(){return t(e,U)},free:t(e,B),isBackgroundFetch:i=>{var s;return h(s=e,a,b).call(s,i)},backgroundFetch:(i,s,o,n)=>{var r;return h(r=e,a,Ot).call(r,i,s,o,n)},moveToTail:i=>{var s;return h(s=e,a,bt).call(s,i)},indexes:i=>{var s;return h(s=e,a,it).call(s,i)},rindexes:i=>{var s;return h(s=e,a,st).call(s,i)},isStale:i=>{var s;return t(s=e,G).call(s,i)}}}get max(){return t(this,q)}get maxSize(){return t(this,P)}get calculatedSize(){return t(this,Y)}get size(){return t(this,E)}get fetchMethod(){return t(this,gt)}get memoMethod(){return t(this,_t)}get dispose(){return t(this,K)}get onInsert(){return t(this,ht)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*rentries(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&t(this,x)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield [t(this,x)[e],t(this,p)[e]]);}*keys(){for(let e of h(this,a,it).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of h(this,a,st).call(this)){let i=t(this,x)[e];i!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of h(this,a,it).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of h(this,a,st).call(this))t(this,p)[e]!==void 0&&!h(this,a,b).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n!==void 0&&e(n,t(this,x)[s],this))return this.get(t(this,x)[s],i)}}forEach(e,i=this){for(let s of h(this,a,it).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}rforEach(e,i=this){for(let s of h(this,a,st).call(this)){let o=t(this,p)[s],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;n!==void 0&&e.call(i,n,t(this,x)[s],this);}}purgeStale(){let e=false;for(let i of h(this,a,st).call(this,{allowStale:true}))t(this,G).call(this,i)&&(h(this,a,nt).call(this,t(this,x)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,p)[i],o=h(this,a,b).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let n={value:o};if(t(this,V)&&t(this,J)){let r=t(this,V)[i],d=t(this,J)[i];if(r&&d){let u=r-(dt.now()-d);n.ttl=u,n.start=Date.now();}}return t(this,X)&&(n.size=t(this,X)[i]),n}dump(){let e=[];for(let i of h(this,a,it).call(this,{allowStale:true})){let s=t(this,x)[i],o=t(this,p)[i],n=h(this,a,b).call(this,o)?o.__staleWhileFetching:o;if(n===void 0||s===void 0)continue;let r={value:n};if(t(this,V)&&t(this,J)){r.ttl=t(this,V)[i];let d=dt.now()-t(this,J)[i];r.start=Math.floor(Date.now()-d);}t(this,X)&&(r.size=t(this,X)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let o=Date.now()-s.start;s.start=dt.now()-o;}this.set(i,s.value,s);}}set(e,i,s={}){var W,O,g,v;if(i===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:u}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,k=t(this,wt).call(this,e,i,s.size||0,d);if(this.maxEntrySize&&k>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),h(this,a,nt).call(this,e,"set"),this;let c=t(this,E)===0?void 0:t(this,A).get(e);if(c===void 0)c=t(this,E)===0?t(this,U):t(this,B).length!==0?t(this,B).pop():t(this,E)===t(this,q)?h(this,a,Tt).call(this,false):t(this,E),t(this,x)[c]=e,t(this,p)[c]=i,t(this,A).set(e,c),t(this,R)[t(this,U)]=c,t(this,M)[c]=t(this,U),f(this,U,c),Ut(this,E)._++,t(this,yt).call(this,c,k,u),u&&(u.set="add"),w=false,t(this,vt)&&((W=t(this,ht))==null||W.call(this,i,e,"add"));else {h(this,a,bt).call(this,c);let y=t(this,p)[c];if(i!==y){if(t(this,rt)&&h(this,a,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=y;m!==void 0&&!r&&(t(this,Q)&&((O=t(this,K))==null||O.call(this,m,e,"set")),t(this,j)&&t(this,T)?.push([m,e,"set"]));}else r||(t(this,Q)&&((g=t(this,K))==null||g.call(this,y,e,"set")),t(this,j)&&t(this,T)?.push([y,e,"set"]));if(t(this,ct).call(this,c),t(this,yt).call(this,c,k,u),t(this,p)[c]=i,u){u.set="replace";let m=y&&h(this,a,b).call(this,y)?y.__staleWhileFetching:y;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");t(this,vt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(o!==0&&!t(this,V)&&h(this,a,Pt).call(this),t(this,V)&&(w||t(this,xt).call(this,c,o,n),u&&t(this,tt).call(this,u,c)),!r&&t(this,j)&&t(this,T)){let y=t(this,T),m;for(;m=y?.shift();)(v=t(this,$))==null||v.call(this,...m);}return this}pop(){var e;try{for(;t(this,E);){let i=t(this,p)[t(this,F)];if(h(this,a,Tt).call(this,!0),h(this,a,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,T)){let i=t(this,T),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,n=t(this,A).get(e);if(n!==void 0){let r=t(this,p)[n];if(h(this,a,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(t(this,G).call(this,n))o&&(o.has="stale",t(this,tt).call(this,o,n));else return s&&t(this,lt).call(this,n),o&&(o.has="hit",t(this,tt).call(this,o,n)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,G).call(this,o))return;let n=t(this,p)[o];return h(this,a,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:u=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:W=this.allowStaleOnFetchRejection,ignoreFetchAbort:O=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=false,status:m,signal:z}=i;if(!t(this,rt))return m&&(m.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,status:m});let L={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:d,size:u,sizeCalculation:w,noUpdateTTL:k,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:g,ignoreFetchAbort:O,status:m,signal:z},C=t(this,A).get(e);if(C===void 0){m&&(m.fetch="miss");let H=h(this,a,Ot).call(this,e,C,L,v);return H.__returned=H}else {let H=t(this,p)[C];if(h(this,a,b).call(this,H)){let It=s&&H.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",It&&(m.returnedStale=true)),It?H.__staleWhileFetching:H.__returned=H}let St=t(this,G).call(this,C);if(!y&&!St)return m&&(m.fetch="hit"),h(this,a,bt).call(this,C),o&&t(this,lt).call(this,C),m&&t(this,tt).call(this,m,C),H;let ft=h(this,a,Ot).call(this,e,C,L,v),ut=ft.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=St?"stale":"refresh",ut&&St&&(m.returnedStale=true)),ut?ft.__staleWhileFetching:ft.__returned=ft}}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,_t);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:n,...r}=i,d=this.get(e,r);if(!n&&d!==void 0)return d;let u=s(e,d,{options:r,context:o});return this.set(e,u,r),u}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=i,d=t(this,A).get(e);if(d!==void 0){let u=t(this,p)[d],w=h(this,a,b).call(this,u);return r&&t(this,tt).call(this,r,d),t(this,G).call(this,d)?(r&&(r.get="stale"),w?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(n||h(this,a,nt).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),w?u.__staleWhileFetching:(h(this,a,bt).call(this,d),o&&t(this,lt).call(this,d),u))}else r&&(r.get="miss");}delete(e){return h(this,a,nt).call(this,e,"delete")}clear(){return h(this,a,Gt).call(this,"delete")}};q=new WeakMap,P=new WeakMap,K=new WeakMap,ht=new WeakMap,$=new WeakMap,gt=new WeakMap,_t=new WeakMap,E=new WeakMap,Y=new WeakMap,A=new WeakMap,x=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,F=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,X=new WeakMap,J=new WeakMap,V=new WeakMap,Q=new WeakMap,rt=new WeakMap,j=new WeakMap,vt=new WeakMap,a=new WeakSet,Pt=function(){let e=new pt(t(this,q)),i=new pt(t(this,q));f(this,V,e),f(this,J,i),f(this,xt,(n,r,d=dt.now())=>{if(i[n]=r!==0?d:0,e[n]=r,r!==0&&this.ttlAutopurge){let u=setTimeout(()=>{t(this,G).call(this,n)&&h(this,a,nt).call(this,t(this,x)[n],"expire");},r+1);u.unref&&u.unref();}}),f(this,lt,n=>{i[n]=e[n]!==0?dt.now():0;}),f(this,tt,(n,r)=>{if(e[r]){let d=e[r],u=i[r];if(!d||!u)return;n.ttl=d,n.start=u,n.now=s||o();let w=n.now-u;n.remainingTTL=d-w;}});let s=0,o=()=>{let n=dt.now();if(this.ttlResolution>0){s=n;let r=setTimeout(()=>s=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=t(this,A).get(n);if(r===void 0)return 0;let d=e[r],u=i[r];if(!d||!u)return 1/0;let w=(s||o())-u;return d-w},f(this,G,n=>{let r=i[n],d=e[n];return !!d&&!!r&&(s||o())-r>d});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,G=new WeakMap,ne=function(){let e=new pt(t(this,q));f(this,Y,0),f(this,X,e),f(this,ct,i=>{f(this,Y,t(this,Y)-e[i]),e[i]=0;}),f(this,wt,(i,s,o,n)=>{if(h(this,a,b).call(this,s))return 0;if(!et(o))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(o=n(s,i),!et(o))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 o}),f(this,yt,(i,s,o)=>{if(e[i]=s,t(this,P)){let n=t(this,P)-e[i];for(;t(this,Y)>n;)h(this,a,Tt).call(this,true);}f(this,Y,t(this,Y)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,Y));});},ct=new WeakMap,yt=new WeakMap,wt=new WeakMap,it=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,U);!(!h(this,a,Mt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,M)[i];},st=function*({allowStale:e=this.allowStale}={}){if(t(this,E))for(let i=t(this,F);!(!h(this,a,Mt).call(this,i)||((e||!t(this,G).call(this,i))&&(yield i),i===t(this,U)));)i=t(this,R)[i];},Mt=function(e){return e!==void 0&&t(this,A).get(t(this,x)[e])===e},Tt=function(e){var n;let i=t(this,F),s=t(this,x)[i],o=t(this,p)[i];return t(this,rt)&&h(this,a,b).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((n=t(this,K))==null||n.call(this,o,s,"evict")),t(this,j)&&t(this,T)?.push([o,s,"evict"])),t(this,ct).call(this,i),e&&(t(this,x)[i]=void 0,t(this,p)[i]=void 0,t(this,B).push(i)),t(this,E)===1?(f(this,F,f(this,U,0)),t(this,B).length=0):f(this,F,t(this,R)[i]),t(this,A).delete(s),Ut(this,E)._--,i},Ot=function(e,i,s,o){let n=i===void 0?void 0:t(this,p)[i];if(h(this,a,b).call(this,n))return n;let r=new Ct,{signal:d}=s;d?.addEventListener("abort",()=>r.abort(d.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:o},w=(v,y=false)=>{let{aborted:m}=r.signal,z=s.ignoreFetchAbort&&v!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,z&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),m&&!z&&!y)return c(r.signal.reason);let L=O;return t(this,p)[i]===O&&(v===void 0?L.__staleWhileFetching?t(this,p)[i]=L.__staleWhileFetching:h(this,a,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,v,u.options))),v},k=v=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=v),c(v)),c=v=>{let{aborted:y}=r.signal,m=y&&s.allowStaleOnFetchAbort,z=m||s.allowStaleOnFetchRejection,L=z||s.noDeleteOnFetchRejection,C=O;if(t(this,p)[i]===O&&(!L||C.__staleWhileFetching===void 0?h(this,a,nt).call(this,e,"fetch"):m||(t(this,p)[i]=C.__staleWhileFetching)),z)return s.status&&C.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),C.__staleWhileFetching;if(C.__returned===C)throw v},W=(v,y)=>{var z;let m=(z=t(this,gt))==null?void 0:z.call(this,e,n,u);m&&m instanceof Promise&&m.then(L=>v(L===void 0?void 0:L),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(v(void 0),s.allowStaleOnFetchAbort&&(v=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let O=new Promise(W).then(w,k),g=Object.assign(O,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,g,{...u.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=g,g},b=function(e){if(!t(this,rt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ct},Vt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i;},bt=function(e){e!==t(this,U)&&(e===t(this,F)?f(this,F,t(this,R)[e]):h(this,a,Vt).call(this,t(this,M)[e],t(this,R)[e]),h(this,a,Vt).call(this,t(this,U),e),f(this,U,e));},nt=function(e,i){var o,n;let s=false;if(t(this,E)!==0){let r=t(this,A).get(e);if(r!==void 0)if(s=true,t(this,E)===1)h(this,a,Gt).call(this,i);else {t(this,ct).call(this,r);let d=t(this,p)[r];if(h(this,a,b).call(this,d)?d.__abortController.abort(new Error("deleted")):(t(this,Q)||t(this,j))&&(t(this,Q)&&((o=t(this,K))==null||o.call(this,d,e,i)),t(this,j)&&t(this,T)?.push([d,e,i])),t(this,A).delete(e),t(this,x)[r]=void 0,t(this,p)[r]=void 0,r===t(this,U))f(this,U,t(this,M)[r]);else if(r===t(this,F))f(this,F,t(this,R)[r]);else {let u=t(this,M)[r];t(this,R)[u]=t(this,R)[r];let w=t(this,R)[r];t(this,M)[w]=t(this,M)[r];}Ut(this,E)._--,t(this,B).push(r);}}if(t(this,j)&&t(this,T)?.length){let r=t(this,T),d;for(;d=r?.shift();)(n=t(this,$))==null||n.call(this,...d);}return s},Gt=function(e){var i,s;for(let o of h(this,a,st).call(this,{allowStale:true})){let n=t(this,p)[o];if(h(this,a,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let r=t(this,x)[o];t(this,Q)&&((i=t(this,K))==null||i.call(this,n,r,e)),t(this,j)&&t(this,T)?.push([n,r,e]);}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,x).fill(void 0),t(this,V)&&t(this,J)&&(t(this,V).fill(0),t(this,J).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,F,0),f(this,U,0),t(this,B).length=0,f(this,Y,0),f(this,E,0),t(this,j)&&t(this,T)){let o=t(this,T),n;for(;n=o?.shift();)(s=t(this,$))==null||s.call(this,...n);}};var Dt=Wt;var Ft=class{constructor(e){S(this,"cache");S(this,"map",new Map);this.cache=new Dt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return 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 At="1.3.21";var Ht="repeat";function kt(l){return {type:"pause",duration:l}}var qt="__game_layer__";var re={};var Kt={};le(Kt,{createExportableElement:()=>oe});var Rt;(o=>(o.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),o.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),o.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),o.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(Rt||(Rt={}));function oe(l){try{if(typeof l>"u")return l;let e=JSON.stringify(l);return JSON.parse(e)}catch(e){throw Rt.error("Error creating exportable element",l,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function ae(){console.info(`
2
2
  _______ _ _ _ ____ ____ ____ _____
3
3
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
4
4
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
@@ -6,4 +6,4 @@ import*as I from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';imp
6
6
  _| |_ | | > ' < | | \\ ' / _| |_\\ |_
7
7
  |_____| [___][__]\`\\_][___] \\_/ |_____|\\____|
8
8
 
9
- `);}function $t(){let l=window.location.pathname+window.location.hash;return l.includes("#")&&(l=l.split("#")[1]),l}var Yt;(k=>{async function l(c,W,O){return GameUnifier.init({getCurrentGameStepState:()=>({path:$t(),storage:N.storage.export(),canvas:I.canvas.export(),sound:ot.sound.export(),labelIndex:D.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:D.narration.openedLabels}),restoreGameStepState:async(g,v)=>{Z.HistoryManagerStatic._originalStepData=g,D.NarrationManagerStatic.openedLabels=g.openedLabels,N.storage.restore(g.storage),await I.canvas.restore(g.canvas),ot.sound.restore(g.sound),v(g.path);},getStepCounter:()=>D.narration.stepCounter,setStepCounter:g=>{D.NarrationManagerStatic._stepCounter=g;},getOpenedLabels:()=>D.narration.openedLabels.length,addHistoryItem:(g,v)=>Z.stepHistory.add(g,v),getCurrentStepsRunningNumber:()=>D.NarrationManagerStatic.stepsRunning,getCharacter:g=>Bt.RegisteredCharacters.get(g),onGoNextEnd:async()=>{let g=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.map(({id:y})=>I.canvas.forceCompletionOfTicker(y)),v=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias.map(({alias:y,id:m})=>I.canvas.forceCompletionOfTicker(m,y));await Promise.all([...g,...v]),I.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};},getVariable:g=>N.storage.getVariable(g),setVariable:(g,v)=>N.storage.setVariable(g,v),removeVariable:g=>N.storage.removeVariable(g),getFlag:g=>N.storage.getFlag(g),setFlag:(g,v)=>N.storage.setFlag(g,v),onLabelClosing:g=>N.StorageManagerStatic.clearOldTempVariables(g)}),ae(),await I.canvas.init(c,W,O)}k.init=l;function e(){N.storage.clear(),I.canvas.clear(),ot.sound.clear(),D.narration.clear(),Z.stepHistory.clear();}k.clear=e;function i(){return {pixivn_version:At,stepData:D.narration.export(),storageData:N.storage.export(),canvasData:I.canvas.export(),soundData:ot.sound.export(),historyData:Z.stepHistory.export(),path:$t()}}k.exportGameState=i;async function s(c,W){c.stepData.hasOwnProperty("stepsHistory")&&c.stepData.stepsHistory&&(c.historyData.stepsHistory=c.stepData.stepsHistory),c.stepData.hasOwnProperty("originalStepData")&&c.stepData.originalStepData&&(c.historyData.originalStepData=c.stepData.originalStepData),Z.stepHistory.restore(c.historyData);let O=Z.stepHistory.lastKey;if(typeof O=="number"){let g=Z.stepHistory.stepsInfoMap.get(O)||null;await D.narration.restore(c.stepData,g);}N.storage.restore(c.storageData),await I.canvas.restore(c.canvasData),ot.sound.restore(c.soundData),await W(c.path);}k.restoreGameState=s;function o(c){return JSON.parse(c)}k.jsonToGameState=o;function n(c){GameUnifier.onEnd=c;}k.onEnd=n;function r(c){GameUnifier.onError=c;}k.onError=r;function d(c){D.NarrationManagerStatic.onStepStart=c;}k.onStepStart=d;function u(c){D.NarrationManagerStatic.onLoadingLabel=c;}k.onLoadingLabel=u;function w(c){D.NarrationManagerStatic.onStepEnd=c;}k.onStepEnd=w;})(Yt||(Yt={}));var Me={Assets:Assets,Rectangle:Rectangle,characterUtils:Bt,canvasUtils:I,narrationUtils:D,soundUtils:ot,CANVAS_APP_GAME_LAYER_ALIAS:qt,Pause:kt,Repeat:Ht,PIXIVN_VERSION:At,...Kt,...re,canvas:I.canvas,narration:D.narration,sound:ot.sound,storage:N.storage,history:Z.stepHistory,Game:Yt,GameUnifier:GameUnifier};export{qt as CANVAS_APP_GAME_LAYER_ALIAS,Ft as CachedMap,Yt as Game,At as PIXIVN_VERSION,kt as Pause,Ht as Repeat,oe as createExportableElement,Me as default};
9
+ `);}function $t(){let l=window.location.pathname+window.location.hash;return l.includes("#")&&(l=l.split("#")[1]),l}var Yt;(k=>{async function l(c,W,O){return GameUnifier.init({getCurrentGameStepState:()=>({path:$t(),storage:N.storage.export(),canvas:I.canvas.export(),sound:ot.sound.export(),labelIndex:D.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:D.narration.openedLabels}),restoreGameStepState:async(g,v)=>{Z.HistoryManagerStatic._originalStepData=g,D.NarrationManagerStatic.openedLabels=g.openedLabels,N.storage.restore(g.storage),await I.canvas.restore(g.canvas),ot.sound.restore(g.sound),v(g.path);},getStepCounter:()=>D.narration.stepCounter,setStepCounter:g=>{D.NarrationManagerStatic._stepCounter=g;},getOpenedLabels:()=>D.narration.openedLabels.length,addHistoryItem:(g,v)=>Z.stepHistory.add(g,v),getCurrentStepsRunningNumber:()=>D.NarrationManagerStatic.stepsRunning,getCharacter:g=>Bt.RegisteredCharacters.get(g),onGoNextEnd:async()=>{let g=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.map(({id:y})=>I.canvas.forceCompletionOfTicker(y)),v=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias.map(({alias:y,id:m})=>I.canvas.forceCompletionOfTicker(m,y));await Promise.all([...g,...v]),I.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};},getVariable:g=>N.storage.get(g),setVariable:(g,v)=>N.storage.set(g,v),removeVariable:g=>N.storage.removeVariable(g),getFlag:g=>N.storage.getFlag(g),setFlag:(g,v)=>N.storage.setFlag(g,v),onLabelClosing:g=>N.StorageManagerStatic.clearOldTempVariables(g)}),ae(),await I.canvas.init(c,W,O)}k.init=l;function e(){N.storage.clear(),I.canvas.clear(),ot.sound.clear(),D.narration.clear(),Z.stepHistory.clear();}k.clear=e;function i(){return {pixivn_version:At,stepData:D.narration.export(),storageData:N.storage.export(),canvasData:I.canvas.export(),soundData:ot.sound.export(),historyData:Z.stepHistory.export(),path:$t()}}k.exportGameState=i;async function s(c,W){c.stepData.hasOwnProperty("stepsHistory")&&c.stepData.stepsHistory&&(c.historyData.stepsHistory=c.stepData.stepsHistory),c.stepData.hasOwnProperty("originalStepData")&&c.stepData.originalStepData&&(c.historyData.originalStepData=c.stepData.originalStepData),Z.stepHistory.restore(c.historyData);let O=Z.stepHistory.lastKey;if(typeof O=="number"){let g=Z.stepHistory.stepsInfoMap.get(O)||null;await D.narration.restore(c.stepData,g);}N.storage.restore(c.storageData),await I.canvas.restore(c.canvasData),ot.sound.restore(c.soundData),await W(c.path);}k.restoreGameState=s;function o(c){return JSON.parse(c)}k.jsonToGameState=o;function n(c){GameUnifier.onEnd=c;}k.onEnd=n;function r(c){GameUnifier.onError=c;}k.onError=r;function d(c){D.NarrationManagerStatic.onStepStart=c;}k.onStepStart=d;function u(c){D.NarrationManagerStatic.onLoadingLabel=c;}k.onLoadingLabel=u;function w(c){D.NarrationManagerStatic.onStepEnd=c;}k.onStepEnd=w;})(Yt||(Yt={}));var Ve={Assets:Assets,Rectangle:Rectangle,characterUtils:Bt,canvasUtils:I,narrationUtils:D,soundUtils:ot,CANVAS_APP_GAME_LAYER_ALIAS:qt,Pause:kt,Repeat:Ht,PIXIVN_VERSION:At,...Kt,...re,canvas:I.canvas,narration:D.narration,sound:ot.sound,storage:N.storage,history:Z.stepHistory,Game:Yt,GameUnifier:GameUnifier};export{qt as CANVAS_APP_GAME_LAYER_ALIAS,Ft as CachedMap,Yt as Game,At as PIXIVN_VERSION,kt as Pause,Ht as Repeat,oe as createExportableElement,Ve as default};
package/dist/storage.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var unifier=require('@drincs/pixi-vn/unifier');var Jt=Object.defineProperty;var Pt=l=>{throw TypeError(l)};var Qt=(l,t,i)=>t in l?Jt(l,t,{enumerable:true,configurable:true,writable:true,value:i}):l[t]=i;var _=(l,t,i)=>Qt(l,typeof t!="symbol"?t+"":t,i),Ct=(l,t,i)=>t.has(l)||Pt("Cannot "+i);var e=(l,t,i)=>(Ct(l,t,"read from private field"),i?i.call(l):t.get(l)),m=(l,t,i)=>t.has(l)?Pt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(l):t.set(l,i),f=(l,t,i,s)=>(Ct(l,t,"write to private field"),t.set(l,i),i),h=(l,t,i)=>(Ct(l,t,"access private method"),i);var Ot=(l,t,i,s)=>({set _(n){f(l,t,n);},get _(){return e(l,t,s)}});var nt;(n=>(n.log=(r,...a)=>console.log(`[Pixi\u2019VN] ${r}`,...a),n.warn=(r,...a)=>console.warn(`[Pixi\u2019VN] ${r}`,...a),n.error=(r,...a)=>console.error(`[Pixi\u2019VN] ${r}`,...a),n.info=(r,...a)=>console.info(`[Pixi\u2019VN] ${r}`,...a)))(nt||(nt={}));function Rt(l){try{if(typeof l>"u")return l;let t=JSON.stringify(l);return JSON.parse(t)}catch(t){throw nt.error("Error creating exportable element",l,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var ct=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ht=new Set,Mt=typeof process=="object"&&process?process:{},$t=(l,t,i,s)=>{typeof Mt.emitWarning=="function"?Mt.emitWarning(l,t,i,s):console.error(`[${i}] ${t}: ${l}`);},vt=globalThis.AbortController,Yt=globalThis.AbortSignal;if(typeof vt>"u"){Yt=class{constructor(){_(this,"onabort");_(this,"_onabort",[]);_(this,"reason");_(this,"aborted",false);}addEventListener(s,n){this._onabort.push(n);}},vt=class{constructor(){_(this,"signal",new Yt);t();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let n of this.signal._onabort)n(s);this.signal.onabort?.(s);}}};let l=Mt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=false,$t("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",t));};}var Zt=l=>!Ht.has(l),k=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Bt=l=>k(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?ut:null:null,ut=class extends Array{constructor(t){super(t),this.fill(0);}},dt,rt=class rt{constructor(t,i){_(this,"heap");_(this,"length");if(!e(rt,dt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Bt(t);if(!i)return [];f(rt,dt,true);let s=new rt(t,i);return f(rt,dt,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};dt=new WeakMap,m(rt,dt,false);var Lt=rt,jt,Kt,P,L,Y,at,j,gt,pt,R,K,T,E,g,I,G,x,F,H,D,$,B,N,X,st,z,_t,o,Gt,ot,Q,wt,U,Xt,ht,mt,yt,tt,et,Nt,Ft,Dt,S,Ut,bt,it,Vt,Wt=class Wt{constructor(t){m(this,o);m(this,P);m(this,L);m(this,Y);m(this,at);m(this,j);m(this,gt);m(this,pt);_(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,R);m(this,K);m(this,T);m(this,E);m(this,g);m(this,I);m(this,G);m(this,x);m(this,F);m(this,H);m(this,D);m(this,$);m(this,B);m(this,N);m(this,X);m(this,st);m(this,z);m(this,_t);m(this,ot,()=>{});m(this,Q,()=>{});m(this,wt,()=>{});m(this,U,()=>false);m(this,ht,t=>{});m(this,mt,(t,i,s)=>{});m(this,yt,(t,i,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});_(this,jt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:c,dispose:O,onInsert:q,disposeAfter:b,noDisposeOnSet:Z,noUpdateTTL:V,maxSize:J=0,maxEntrySize:y=0,sizeCalculation:w,fetchMethod:p,memoMethod:C,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:Et,ignoreFetchAbort:lt}=t;if(i!==0&&!k(i))throw new TypeError("max option must be a nonnegative integer");let At=i?Bt(i):Array;if(!At)throw new Error("invalid max value: "+i);if(f(this,P,i),f(this,L,J),this.maxEntrySize=y||e(this,L),this.sizeCalculation=w,this.sizeCalculation){if(!e(this,L)&&!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(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,pt,C),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,p),f(this,st,!!p),f(this,T,new Map),f(this,E,new Array(i).fill(void 0)),f(this,g,new Array(i).fill(void 0)),f(this,I,new At(i)),f(this,G,new At(i)),f(this,x,0),f(this,F,0),f(this,H,Lt.create(i)),f(this,R,0),f(this,K,0),typeof O=="function"&&f(this,Y,O),typeof q=="function"&&f(this,at,q),typeof b=="function"?(f(this,j,b),f(this,D,[])):(f(this,j,void 0),f(this,D,void 0)),f(this,X,!!e(this,Y)),f(this,_t,!!e(this,at)),f(this,z,!!e(this,j)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!Et,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(e(this,L)!==0&&!k(e(this,L)))throw new TypeError("maxSize must be a positive integer if specified");if(!k(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,o,Xt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=k(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!k(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,o,Gt).call(this);}if(e(this,P)===0&&this.ttl===0&&e(this,L)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,P)&&!e(this,L)){let ft="LRU_CACHE_UNBOUNDED";Zt(ft)&&(Ht.add(ft),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ft,Wt));}}static unsafeExposeInternals(t){return {starts:e(t,B),ttls:e(t,N),sizes:e(t,$),keyMap:e(t,T),keyList:e(t,E),valList:e(t,g),next:e(t,I),prev:e(t,G),get head(){return e(t,x)},get tail(){return e(t,F)},free:e(t,H),isBackgroundFetch:i=>{var s;return h(s=t,o,S).call(s,i)},backgroundFetch:(i,s,n,r)=>{var a;return h(a=t,o,Dt).call(a,i,s,n,r)},moveToTail:i=>{var s;return h(s=t,o,bt).call(s,i)},indexes:i=>{var s;return h(s=t,o,tt).call(s,i)},rindexes:i=>{var s;return h(s=t,o,et).call(s,i)},isStale:i=>{var s;return e(s=t,U).call(s,i)}}}get max(){return e(this,P)}get maxSize(){return e(this,L)}get calculatedSize(){return e(this,K)}get size(){return e(this,R)}get fetchMethod(){return e(this,gt)}get memoMethod(){return e(this,pt)}get dispose(){return e(this,Y)}get onInsert(){return e(this,at)}get disposeAfter(){return e(this,j)}getRemainingTTL(t){return e(this,T).has(t)?1/0:0}*entries(){for(let t of h(this,o,tt).call(this))e(this,g)[t]!==void 0&&e(this,E)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield [e(this,E)[t],e(this,g)[t]]);}*rentries(){for(let t of h(this,o,et).call(this))e(this,g)[t]!==void 0&&e(this,E)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield [e(this,E)[t],e(this,g)[t]]);}*keys(){for(let t of h(this,o,tt).call(this)){let i=e(this,E)[t];i!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield i);}}*rkeys(){for(let t of h(this,o,et).call(this)){let i=e(this,E)[t];i!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield i);}}*values(){for(let t of h(this,o,tt).call(this))e(this,g)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}*rvalues(){for(let t of h(this,o,et).call(this))e(this,g)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}[(Kt=Symbol.iterator,jt=Symbol.toStringTag,Kt)](){return this.entries()}find(t,i={}){for(let s of h(this,o,tt).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r!==void 0&&t(r,e(this,E)[s],this))return this.get(e(this,E)[s],i)}}forEach(t,i=this){for(let s of h(this,o,tt).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(i,r,e(this,E)[s],this);}}rforEach(t,i=this){for(let s of h(this,o,et).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(i,r,e(this,E)[s],this);}}purgeStale(){let t=false;for(let i of h(this,o,et).call(this,{allowStale:true}))e(this,U).call(this,i)&&(h(this,o,it).call(this,e(this,E)[i],"expire"),t=true);return t}info(t){let i=e(this,T).get(t);if(i===void 0)return;let s=e(this,g)[i],n=h(this,o,S).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;let r={value:n};if(e(this,N)&&e(this,B)){let a=e(this,N)[i],d=e(this,B)[i];if(a&&d){let c=a-(ct.now()-d);r.ttl=c,r.start=Date.now();}}return e(this,$)&&(r.size=e(this,$)[i]),r}dump(){let t=[];for(let i of h(this,o,tt).call(this,{allowStale:true})){let s=e(this,E)[i],n=e(this,g)[i],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r===void 0||s===void 0)continue;let a={value:r};if(e(this,N)&&e(this,B)){a.ttl=e(this,N)[i];let d=ct.now()-e(this,B)[i];a.start=Math.floor(Date.now()-d);}e(this,$)&&(a.size=e(this,$)[i]),t.unshift([s,a]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let n=Date.now()-s.start;s.start=ct.now()-n;}this.set(i,s.value,s);}}set(t,i,s={}){var Z,V,J,y;if(i===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c}=s,{noUpdateTTL:O=this.noUpdateTTL}=s,q=e(this,yt).call(this,t,i,s.size||0,d);if(this.maxEntrySize&&q>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,o,it).call(this,t,"set"),this;let b=e(this,R)===0?void 0:e(this,T).get(t);if(b===void 0)b=e(this,R)===0?e(this,F):e(this,H).length!==0?e(this,H).pop():e(this,R)===e(this,P)?h(this,o,Ft).call(this,false):e(this,R),e(this,E)[b]=t,e(this,g)[b]=i,e(this,T).set(t,b),e(this,I)[e(this,F)]=b,e(this,G)[b]=e(this,F),f(this,F,b),Ot(this,R)._++,e(this,mt).call(this,b,q,c),c&&(c.set="add"),O=false,e(this,_t)&&((Z=e(this,at))==null||Z.call(this,i,t,"add"));else {h(this,o,bt).call(this,b);let w=e(this,g)[b];if(i!==w){if(e(this,st)&&h(this,o,S).call(this,w)){w.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=w;p!==void 0&&!a&&(e(this,X)&&((V=e(this,Y))==null||V.call(this,p,t,"set")),e(this,z)&&e(this,D)?.push([p,t,"set"]));}else a||(e(this,X)&&((J=e(this,Y))==null||J.call(this,w,t,"set")),e(this,z)&&e(this,D)?.push([w,t,"set"]));if(e(this,ht).call(this,b),e(this,mt).call(this,b,q,c),e(this,g)[b]=i,c){c.set="replace";let p=w&&h(this,o,S).call(this,w)?w.__staleWhileFetching:w;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");e(this,_t)&&this.onInsert?.(i,t,i===w?"update":"replace");}if(n!==0&&!e(this,N)&&h(this,o,Gt).call(this),e(this,N)&&(O||e(this,wt).call(this,b,n,r),c&&e(this,Q).call(this,c,b)),!a&&e(this,z)&&e(this,D)){let w=e(this,D),p;for(;p=w?.shift();)(y=e(this,j))==null||y.call(this,...p);}return this}pop(){var t;try{for(;e(this,R);){let i=e(this,g)[e(this,x)];if(h(this,o,Ft).call(this,!0),h(this,o,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,z)&&e(this,D)){let i=e(this,D),s;for(;s=i?.shift();)(t=e(this,j))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=i,r=e(this,T).get(t);if(r!==void 0){let a=e(this,g)[r];if(h(this,o,S).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(e(this,U).call(this,r))n&&(n.has="stale",e(this,Q).call(this,n,r));else return s&&e(this,ot).call(this,r),n&&(n.has="hit",e(this,Q).call(this,n,r)),true}else n&&(n.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,n=e(this,T).get(t);if(n===void 0||!s&&e(this,U).call(this,n))return;let r=e(this,g)[n];return h(this,o,S).call(this,r)?r.__staleWhileFetching:r}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:q=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:y,forceRefresh:w=false,status:p,signal:C}=i;if(!e(this,st))return p&&(p.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:p});let M={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:d,size:c,sizeCalculation:O,noUpdateTTL:q,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:J,ignoreFetchAbort:V,status:p,signal:C},v=e(this,T).get(t);if(v===void 0){p&&(p.fetch="miss");let W=h(this,o,Dt).call(this,t,v,M,y);return W.__returned=W}else {let W=e(this,g)[v];if(h(this,o,S).call(this,W)){let zt=s&&W.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",zt&&(p.returnedStale=true)),zt?W.__staleWhileFetching:W.__returned=W}let Et=e(this,U).call(this,v);if(!w&&!Et)return p&&(p.fetch="hit"),h(this,o,bt).call(this,v),n&&e(this,ot).call(this,v),p&&e(this,Q).call(this,p,v),W;let lt=h(this,o,Dt).call(this,t,v,M,y),ft=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=Et?"stale":"refresh",ft&&Et&&(p.returnedStale=true)),ft?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=e(this,pt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...a}=i,d=this.get(t,a);if(!r&&d!==void 0)return d;let c=s(t,d,{options:a,context:n});return this.set(t,c,a),c}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,d=e(this,T).get(t);if(d!==void 0){let c=e(this,g)[d],O=h(this,o,S).call(this,c);return a&&e(this,Q).call(this,a,d),e(this,U).call(this,d)?(a&&(a.get="stale"),O?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||h(this,o,it).call(this,t,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),O?c.__staleWhileFetching:(h(this,o,bt).call(this,d),n&&e(this,ot).call(this,d),c))}else a&&(a.get="miss");}delete(t){return h(this,o,it).call(this,t,"delete")}clear(){return h(this,o,Vt).call(this,"delete")}};P=new WeakMap,L=new WeakMap,Y=new WeakMap,at=new WeakMap,j=new WeakMap,gt=new WeakMap,pt=new WeakMap,R=new WeakMap,K=new WeakMap,T=new WeakMap,E=new WeakMap,g=new WeakMap,I=new WeakMap,G=new WeakMap,x=new WeakMap,F=new WeakMap,H=new WeakMap,D=new WeakMap,$=new WeakMap,B=new WeakMap,N=new WeakMap,X=new WeakMap,st=new WeakMap,z=new WeakMap,_t=new WeakMap,o=new WeakSet,Gt=function(){let t=new ut(e(this,P)),i=new ut(e(this,P));f(this,N,t),f(this,B,i),f(this,wt,(r,a,d=ct.now())=>{if(i[r]=a!==0?d:0,t[r]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{e(this,U).call(this,r)&&h(this,o,it).call(this,e(this,E)[r],"expire");},a+1);c.unref&&c.unref();}}),f(this,ot,r=>{i[r]=t[r]!==0?ct.now():0;}),f(this,Q,(r,a)=>{if(t[a]){let d=t[a],c=i[a];if(!d||!c)return;r.ttl=d,r.start=c,r.now=s||n();let O=r.now-c;r.remainingTTL=d-O;}});let s=0,n=()=>{let r=ct.now();if(this.ttlResolution>0){s=r;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=e(this,T).get(r);if(a===void 0)return 0;let d=t[a],c=i[a];if(!d||!c)return 1/0;let O=(s||n())-c;return d-O},f(this,U,r=>{let a=i[r],d=t[r];return !!d&&!!a&&(s||n())-a>d});},ot=new WeakMap,Q=new WeakMap,wt=new WeakMap,U=new WeakMap,Xt=function(){let t=new ut(e(this,P));f(this,K,0),f(this,$,t),f(this,ht,i=>{f(this,K,e(this,K)-t[i]),t[i]=0;}),f(this,yt,(i,s,n,r)=>{if(h(this,o,S).call(this,s))return 0;if(!k(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(s,i),!k(n))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 n}),f(this,mt,(i,s,n)=>{if(t[i]=s,e(this,L)){let r=e(this,L)-t[i];for(;e(this,K)>r;)h(this,o,Ft).call(this,true);}f(this,K,e(this,K)+t[i]),n&&(n.entrySize=s,n.totalCalculatedSize=e(this,K));});},ht=new WeakMap,mt=new WeakMap,yt=new WeakMap,tt=function*({allowStale:t=this.allowStale}={}){if(e(this,R))for(let i=e(this,F);!(!h(this,o,Nt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,x)));)i=e(this,G)[i];},et=function*({allowStale:t=this.allowStale}={}){if(e(this,R))for(let i=e(this,x);!(!h(this,o,Nt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,F)));)i=e(this,I)[i];},Nt=function(t){return t!==void 0&&e(this,T).get(e(this,E)[t])===t},Ft=function(t){var r;let i=e(this,x),s=e(this,E)[i],n=e(this,g)[i];return e(this,st)&&h(this,o,S).call(this,n)?n.__abortController.abort(new Error("evicted")):(e(this,X)||e(this,z))&&(e(this,X)&&((r=e(this,Y))==null||r.call(this,n,s,"evict")),e(this,z)&&e(this,D)?.push([n,s,"evict"])),e(this,ht).call(this,i),t&&(e(this,E)[i]=void 0,e(this,g)[i]=void 0,e(this,H).push(i)),e(this,R)===1?(f(this,x,f(this,F,0)),e(this,H).length=0):f(this,x,e(this,I)[i]),e(this,T).delete(s),Ot(this,R)._--,i},Dt=function(t,i,s,n){let r=i===void 0?void 0:e(this,g)[i];if(h(this,o,S).call(this,r))return r;let a=new vt,{signal:d}=s;d?.addEventListener("abort",()=>a.abort(d.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:n},O=(y,w=false)=>{let{aborted:p}=a.signal,C=s.ignoreFetchAbort&&y!==void 0;if(s.status&&(p&&!w?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,C&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!C&&!w)return b(a.signal.reason);let M=V;return e(this,g)[i]===V&&(y===void 0?M.__staleWhileFetching?e(this,g)[i]=M.__staleWhileFetching:h(this,o,it).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,y,c.options))),y},q=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),b(y)),b=y=>{let{aborted:w}=a.signal,p=w&&s.allowStaleOnFetchAbort,C=p||s.allowStaleOnFetchRejection,M=C||s.noDeleteOnFetchRejection,v=V;if(e(this,g)[i]===V&&(!M||v.__staleWhileFetching===void 0?h(this,o,it).call(this,t,"fetch"):p||(e(this,g)[i]=v.__staleWhileFetching)),C)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw y},Z=(y,w)=>{var C;let p=(C=e(this,gt))==null?void 0:C.call(this,t,r,c);p&&p instanceof Promise&&p.then(M=>y(M===void 0?void 0:M),w),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=M=>O(M,true)));});};s.status&&(s.status.fetchDispatched=true);let V=new Promise(Z).then(O,q),J=Object.assign(V,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(t,J,{...c.options,status:void 0}),i=e(this,T).get(t)):e(this,g)[i]=J,J},S=function(t){if(!e(this,st))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof vt},Ut=function(t,i){e(this,G)[i]=t,e(this,I)[t]=i;},bt=function(t){t!==e(this,F)&&(t===e(this,x)?f(this,x,e(this,I)[t]):h(this,o,Ut).call(this,e(this,G)[t],e(this,I)[t]),h(this,o,Ut).call(this,e(this,F),t),f(this,F,t));},it=function(t,i){var n,r;let s=false;if(e(this,R)!==0){let a=e(this,T).get(t);if(a!==void 0)if(s=true,e(this,R)===1)h(this,o,Vt).call(this,i);else {e(this,ht).call(this,a);let d=e(this,g)[a];if(h(this,o,S).call(this,d)?d.__abortController.abort(new Error("deleted")):(e(this,X)||e(this,z))&&(e(this,X)&&((n=e(this,Y))==null||n.call(this,d,t,i)),e(this,z)&&e(this,D)?.push([d,t,i])),e(this,T).delete(t),e(this,E)[a]=void 0,e(this,g)[a]=void 0,a===e(this,F))f(this,F,e(this,G)[a]);else if(a===e(this,x))f(this,x,e(this,I)[a]);else {let c=e(this,G)[a];e(this,I)[c]=e(this,I)[a];let O=e(this,I)[a];e(this,G)[O]=e(this,G)[a];}Ot(this,R)._--,e(this,H).push(a);}}if(e(this,z)&&e(this,D)?.length){let a=e(this,D),d;for(;d=a?.shift();)(r=e(this,j))==null||r.call(this,...d);}return s},Vt=function(t){var i,s;for(let n of h(this,o,et).call(this,{allowStale:true})){let r=e(this,g)[n];if(h(this,o,S).call(this,r))r.__abortController.abort(new Error("deleted"));else {let a=e(this,E)[n];e(this,X)&&((i=e(this,Y))==null||i.call(this,r,a,t)),e(this,z)&&e(this,D)?.push([r,a,t]);}}if(e(this,T).clear(),e(this,g).fill(void 0),e(this,E).fill(void 0),e(this,N)&&e(this,B)&&(e(this,N).fill(0),e(this,B).fill(0)),e(this,$)&&e(this,$).fill(0),f(this,x,0),f(this,F,0),e(this,H).length=0,f(this,K,0),f(this,R,0),e(this,z)&&e(this,D)){let n=e(this,D),r;for(;r=n?.shift();)(s=e(this,j))==null||s.call(this,...r);}};var xt=Wt;var St=class{constructor(t){_(this,"cache");_(this,"map",new Map);this.cache=new xt({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let i=this.map.delete(t);return i&&this.cache.delete(t),i}get forEach(){return this.map.forEach}get(t){let i=this.cache.get(t);return i||this.map.get(t)}has(t){return this.map.has(t)}set(t,i){return this.map.set(t,i),this.cache.set(t,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var A=class A{constructor(){}static clearOldTempVariables(t){A.tempStorageDeadlines.forEach((i,s)=>{i>t&&(A.tempStorage.delete(s),A.tempStorageDeadlines.delete(s),A.storage.cache.delete(s));});}static setVariable(t,i){let s=A.tempStorage.has(t);i==null?(A.storage.map.delete(t),!s&&A.storage.cache.delete(t)):(A.storage.map.set(t,i),!s&&A.storage.cache.set(t,i));}static getVariable(t){let i=A.storage.cache.get(t);return i===void 0&&(i=A.tempStorage.get(t)),i===void 0&&(i=A.storage.map.get(t)),Rt(i)}static removeVariable(t){A.storage.delete(t);}static setFlag(t,i){if(i)this.flags.includes(t)||this.flags.push(t);else {let s=this.flags.indexOf(t);s>-1&&this.flags.splice(s,1);}}static getFlag(t){return this.flags.includes(t)}};_(A,"storage",new St({cacheSize:20})),_(A,"startingStorage",[]),_(A,"flags",Array()),_(A,"tempStorage",new Map),_(A,"tempStorageDeadlines",new Map);var u=A;var Tt=class{get storage(){return u.storage.map}get cache(){return u.storage.cache}get flags(){return u.flags}get tempStorage(){return u.tempStorage}get tempStorageDeadlines(){return u.tempStorageDeadlines}set startingStorage(t){let i=[],s=unifier.GameUnifier.stepCounter===0;Object.entries(t).forEach(([n,r])=>{i.push({key:n,value:r}),s&&u.storage.set(n,r);}),u.startingStorage=i;}setVariable(t,i){return u.setVariable(t,i)}getVariable(t){return u.getVariable(t)}removeVariable(t){return u.removeVariable(t)}setTempVariable(t,i){if(i==null){this.removeTempVariable(t);return}else u.tempStorage.set(t,i),u.storage.cache.set(t,i),u.tempStorageDeadlines.has(t)||u.tempStorageDeadlines.set(t,unifier.GameUnifier.openedLabels);}removeTempVariable(t){u.tempStorage.has(t)&&(u.tempStorage.delete(t),u.tempStorageDeadlines.delete(t),u.storage.cache.delete(t));}setFlag(t,i){return u.setFlag(t,i)}getFlag(t){return u.getFlag(t)}clear(){this.storage.clear(),this.cache.clear(),u.flags=[],u.tempStorage.clear(),u.tempStorageDeadlines.clear(),u.startingStorage.forEach(({key:t,value:i})=>{this.storage.set(t,i);});}export(){let t=[];[...this.storage.keys()].forEach(n=>{t.push({key:n,value:this.storage.get(n)});});let i=[];[...u.tempStorage.keys()].forEach(n=>{i.push({key:n,value:u.tempStorage.get(n)});});let s=[];return [...u.tempStorageDeadlines.keys()].forEach(n=>{s.push({key:n,value:u.tempStorageDeadlines.get(n)});}),Rt({base:t,temp:i,tempDeadlines:s,flags:u.flags})}restore(t){this.clear();try{t?(Array.isArray(t)&&t.forEach(i=>{if(i.key==="___temp_storage___"){let s=i.value;Object.entries(s).forEach(([n,r])=>{u.tempStorage.set(n,r);});}else if(i.key==="___temp_storage_deadlines___"){let s=i.value;Object.entries(s).forEach(([n,r])=>{u.tempStorageDeadlines.set(n,r);});}else i.key==="___flags___"?i.value.forEach(n=>{u.flags.push(n);}):this.storage.set(i.key,i.value);}),"base"in t&&"temp"in t&&"tempDeadlines"in t?(t.base?.forEach(i=>{this.storage.set(i.key,i.value);}),t.temp?.forEach(i=>{u.tempStorage.set(i.key,i.value);}),t.tempDeadlines?.forEach(i=>{u.tempStorageDeadlines.set(i.key,i.value);})):Object.entries(t).forEach(([i,s])=>{i==="___temp_storage___"?Object.entries(s).forEach(([n,r])=>{u.tempStorage.set(n,r);}):i==="___temp_storage_deadlines___"?Object.entries(s).forEach(([n,r])=>{u.tempStorageDeadlines.set(n,r);}):i==="___flags___"?s.forEach(n=>{u.flags.push(n);}):this.storage.set(i,s);})):nt.warn("No storage data found");}catch(i){nt.error("Error importing data",i);}}};var It=class{constructor(t,i){_(this,"_id");_(this,"categoryId");this.categoryId=t,this._id=i;}get id(){return this._id}setStorageProperty(t,i){let s=u.getVariable(this.categoryId);s||(s={}),s.hasOwnProperty(this.id)||(s[this.id]={}),i==null?s[this.id].hasOwnProperty(t)&&delete s[this.id][t]:s[this.id]={...s[this.id],[t]:i},Object.keys(s[this.id]).length===0&&delete s[this.id],u.setVariable(this.categoryId,s);}getStorageProperty(t,i=this.id){let s=u.getVariable(this.categoryId);if(s&&s.hasOwnProperty(i)&&s[i].hasOwnProperty(t))return s[i][t]}};var kt={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var De=new Tt;exports.SYSTEM_RESERVED_STORAGE_KEYS=kt;exports.StorageManagerStatic=u;exports.StoredClassModel=It;exports.storage=De;
1
+ 'use strict';var unifier=require('@drincs/pixi-vn/unifier');var Jt=Object.defineProperty;var Pt=l=>{throw TypeError(l)};var Qt=(l,t,i)=>t in l?Jt(l,t,{enumerable:true,configurable:true,writable:true,value:i}):l[t]=i;var _=(l,t,i)=>Qt(l,typeof t!="symbol"?t+"":t,i),Ct=(l,t,i)=>t.has(l)||Pt("Cannot "+i);var e=(l,t,i)=>(Ct(l,t,"read from private field"),i?i.call(l):t.get(l)),m=(l,t,i)=>t.has(l)?Pt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(l):t.set(l,i),f=(l,t,i,s)=>(Ct(l,t,"write to private field"),t.set(l,i),i),h=(l,t,i)=>(Ct(l,t,"access private method"),i);var Ot=(l,t,i,s)=>({set _(n){f(l,t,n);},get _(){return e(l,t,s)}});var nt;(n=>(n.log=(r,...a)=>console.log(`[Pixi\u2019VN] ${r}`,...a),n.warn=(r,...a)=>console.warn(`[Pixi\u2019VN] ${r}`,...a),n.error=(r,...a)=>console.error(`[Pixi\u2019VN] ${r}`,...a),n.info=(r,...a)=>console.info(`[Pixi\u2019VN] ${r}`,...a)))(nt||(nt={}));function Rt(l){try{if(typeof l>"u")return l;let t=JSON.stringify(l);return JSON.parse(t)}catch(t){throw nt.error("Error creating exportable element",l,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var ct=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ht=new Set,Mt=typeof process=="object"&&process?process:{},$t=(l,t,i,s)=>{typeof Mt.emitWarning=="function"?Mt.emitWarning(l,t,i,s):console.error(`[${i}] ${t}: ${l}`);},vt=globalThis.AbortController,Yt=globalThis.AbortSignal;if(typeof vt>"u"){Yt=class{constructor(){_(this,"onabort");_(this,"_onabort",[]);_(this,"reason");_(this,"aborted",false);}addEventListener(s,n){this._onabort.push(n);}},vt=class{constructor(){_(this,"signal",new Yt);t();}abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let n of this.signal._onabort)n(s);this.signal.onabort?.(s);}}};let l=Mt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=false,$t("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",t));};}var Zt=l=>!Ht.has(l),k=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Bt=l=>k(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?ut:null:null,ut=class extends Array{constructor(t){super(t),this.fill(0);}},dt,rt=class rt{constructor(t,i){_(this,"heap");_(this,"length");if(!e(rt,dt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Bt(t);if(!i)return [];f(rt,dt,true);let s=new rt(t,i);return f(rt,dt,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};dt=new WeakMap,m(rt,dt,false);var Lt=rt,jt,Kt,P,L,Y,at,j,gt,pt,R,K,T,E,g,z,G,x,F,H,D,$,B,N,X,st,I,_t,o,Gt,ot,Q,yt,U,Xt,ht,mt,wt,tt,et,Nt,Ft,Dt,S,Ut,bt,it,Vt,Wt=class Wt{constructor(t){m(this,o);m(this,P);m(this,L);m(this,Y);m(this,at);m(this,j);m(this,gt);m(this,pt);_(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,R);m(this,K);m(this,T);m(this,E);m(this,g);m(this,z);m(this,G);m(this,x);m(this,F);m(this,H);m(this,D);m(this,$);m(this,B);m(this,N);m(this,X);m(this,st);m(this,I);m(this,_t);m(this,ot,()=>{});m(this,Q,()=>{});m(this,yt,()=>{});m(this,U,()=>false);m(this,ht,t=>{});m(this,mt,(t,i,s)=>{});m(this,wt,(t,i,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});_(this,jt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:c,dispose:O,onInsert:q,disposeAfter:b,noDisposeOnSet:Z,noUpdateTTL:V,maxSize:J=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:p,memoMethod:C,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:Et,ignoreFetchAbort:lt}=t;if(i!==0&&!k(i))throw new TypeError("max option must be a nonnegative integer");let At=i?Bt(i):Array;if(!At)throw new Error("invalid max value: "+i);if(f(this,P,i),f(this,L,J),this.maxEntrySize=w||e(this,L),this.sizeCalculation=y,this.sizeCalculation){if(!e(this,L)&&!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(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,pt,C),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,gt,p),f(this,st,!!p),f(this,T,new Map),f(this,E,new Array(i).fill(void 0)),f(this,g,new Array(i).fill(void 0)),f(this,z,new At(i)),f(this,G,new At(i)),f(this,x,0),f(this,F,0),f(this,H,Lt.create(i)),f(this,R,0),f(this,K,0),typeof O=="function"&&f(this,Y,O),typeof q=="function"&&f(this,at,q),typeof b=="function"?(f(this,j,b),f(this,D,[])):(f(this,j,void 0),f(this,D,void 0)),f(this,X,!!e(this,Y)),f(this,_t,!!e(this,at)),f(this,I,!!e(this,j)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!Et,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(e(this,L)!==0&&!k(e(this,L)))throw new TypeError("maxSize must be a positive integer if specified");if(!k(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,o,Xt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=k(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!k(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,o,Gt).call(this);}if(e(this,P)===0&&this.ttl===0&&e(this,L)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,P)&&!e(this,L)){let ft="LRU_CACHE_UNBOUNDED";Zt(ft)&&(Ht.add(ft),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ft,Wt));}}static unsafeExposeInternals(t){return {starts:e(t,B),ttls:e(t,N),sizes:e(t,$),keyMap:e(t,T),keyList:e(t,E),valList:e(t,g),next:e(t,z),prev:e(t,G),get head(){return e(t,x)},get tail(){return e(t,F)},free:e(t,H),isBackgroundFetch:i=>{var s;return h(s=t,o,S).call(s,i)},backgroundFetch:(i,s,n,r)=>{var a;return h(a=t,o,Dt).call(a,i,s,n,r)},moveToTail:i=>{var s;return h(s=t,o,bt).call(s,i)},indexes:i=>{var s;return h(s=t,o,tt).call(s,i)},rindexes:i=>{var s;return h(s=t,o,et).call(s,i)},isStale:i=>{var s;return e(s=t,U).call(s,i)}}}get max(){return e(this,P)}get maxSize(){return e(this,L)}get calculatedSize(){return e(this,K)}get size(){return e(this,R)}get fetchMethod(){return e(this,gt)}get memoMethod(){return e(this,pt)}get dispose(){return e(this,Y)}get onInsert(){return e(this,at)}get disposeAfter(){return e(this,j)}getRemainingTTL(t){return e(this,T).has(t)?1/0:0}*entries(){for(let t of h(this,o,tt).call(this))e(this,g)[t]!==void 0&&e(this,E)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield [e(this,E)[t],e(this,g)[t]]);}*rentries(){for(let t of h(this,o,et).call(this))e(this,g)[t]!==void 0&&e(this,E)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield [e(this,E)[t],e(this,g)[t]]);}*keys(){for(let t of h(this,o,tt).call(this)){let i=e(this,E)[t];i!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield i);}}*rkeys(){for(let t of h(this,o,et).call(this)){let i=e(this,E)[t];i!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield i);}}*values(){for(let t of h(this,o,tt).call(this))e(this,g)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}*rvalues(){for(let t of h(this,o,et).call(this))e(this,g)[t]!==void 0&&!h(this,o,S).call(this,e(this,g)[t])&&(yield e(this,g)[t]);}[(Kt=Symbol.iterator,jt=Symbol.toStringTag,Kt)](){return this.entries()}find(t,i={}){for(let s of h(this,o,tt).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r!==void 0&&t(r,e(this,E)[s],this))return this.get(e(this,E)[s],i)}}forEach(t,i=this){for(let s of h(this,o,tt).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(i,r,e(this,E)[s],this);}}rforEach(t,i=this){for(let s of h(this,o,et).call(this)){let n=e(this,g)[s],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;r!==void 0&&t.call(i,r,e(this,E)[s],this);}}purgeStale(){let t=false;for(let i of h(this,o,et).call(this,{allowStale:true}))e(this,U).call(this,i)&&(h(this,o,it).call(this,e(this,E)[i],"expire"),t=true);return t}info(t){let i=e(this,T).get(t);if(i===void 0)return;let s=e(this,g)[i],n=h(this,o,S).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;let r={value:n};if(e(this,N)&&e(this,B)){let a=e(this,N)[i],d=e(this,B)[i];if(a&&d){let c=a-(ct.now()-d);r.ttl=c,r.start=Date.now();}}return e(this,$)&&(r.size=e(this,$)[i]),r}dump(){let t=[];for(let i of h(this,o,tt).call(this,{allowStale:true})){let s=e(this,E)[i],n=e(this,g)[i],r=h(this,o,S).call(this,n)?n.__staleWhileFetching:n;if(r===void 0||s===void 0)continue;let a={value:r};if(e(this,N)&&e(this,B)){a.ttl=e(this,N)[i];let d=ct.now()-e(this,B)[i];a.start=Math.floor(Date.now()-d);}e(this,$)&&(a.size=e(this,$)[i]),t.unshift([s,a]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let n=Date.now()-s.start;s.start=ct.now()-n;}this.set(i,s.value,s);}}set(t,i,s={}){var Z,V,J,w;if(i===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c}=s,{noUpdateTTL:O=this.noUpdateTTL}=s,q=e(this,wt).call(this,t,i,s.size||0,d);if(this.maxEntrySize&&q>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,o,it).call(this,t,"set"),this;let b=e(this,R)===0?void 0:e(this,T).get(t);if(b===void 0)b=e(this,R)===0?e(this,F):e(this,H).length!==0?e(this,H).pop():e(this,R)===e(this,P)?h(this,o,Ft).call(this,false):e(this,R),e(this,E)[b]=t,e(this,g)[b]=i,e(this,T).set(t,b),e(this,z)[e(this,F)]=b,e(this,G)[b]=e(this,F),f(this,F,b),Ot(this,R)._++,e(this,mt).call(this,b,q,c),c&&(c.set="add"),O=false,e(this,_t)&&((Z=e(this,at))==null||Z.call(this,i,t,"add"));else {h(this,o,bt).call(this,b);let y=e(this,g)[b];if(i!==y){if(e(this,st)&&h(this,o,S).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=y;p!==void 0&&!a&&(e(this,X)&&((V=e(this,Y))==null||V.call(this,p,t,"set")),e(this,I)&&e(this,D)?.push([p,t,"set"]));}else a||(e(this,X)&&((J=e(this,Y))==null||J.call(this,y,t,"set")),e(this,I)&&e(this,D)?.push([y,t,"set"]));if(e(this,ht).call(this,b),e(this,mt).call(this,b,q,c),e(this,g)[b]=i,c){c.set="replace";let p=y&&h(this,o,S).call(this,y)?y.__staleWhileFetching:y;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");e(this,_t)&&this.onInsert?.(i,t,i===y?"update":"replace");}if(n!==0&&!e(this,N)&&h(this,o,Gt).call(this),e(this,N)&&(O||e(this,yt).call(this,b,n,r),c&&e(this,Q).call(this,c,b)),!a&&e(this,I)&&e(this,D)){let y=e(this,D),p;for(;p=y?.shift();)(w=e(this,j))==null||w.call(this,...p);}return this}pop(){var t;try{for(;e(this,R);){let i=e(this,g)[e(this,x)];if(h(this,o,Ft).call(this,!0),h(this,o,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,I)&&e(this,D)){let i=e(this,D),s;for(;s=i?.shift();)(t=e(this,j))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=i,r=e(this,T).get(t);if(r!==void 0){let a=e(this,g)[r];if(h(this,o,S).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(e(this,U).call(this,r))n&&(n.has="stale",e(this,Q).call(this,n,r));else return s&&e(this,ot).call(this,r),n&&(n.has="hit",e(this,Q).call(this,n,r)),true}else n&&(n.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,n=e(this,T).get(t);if(n===void 0||!s&&e(this,U).call(this,n))return;let r=e(this,g)[n];return h(this,o,S).call(this,r)?r.__staleWhileFetching:r}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:q=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:p,signal:C}=i;if(!e(this,st))return p&&(p.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:p});let M={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:d,size:c,sizeCalculation:O,noUpdateTTL:q,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:J,ignoreFetchAbort:V,status:p,signal:C},v=e(this,T).get(t);if(v===void 0){p&&(p.fetch="miss");let W=h(this,o,Dt).call(this,t,v,M,w);return W.__returned=W}else {let W=e(this,g)[v];if(h(this,o,S).call(this,W)){let It=s&&W.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",It&&(p.returnedStale=true)),It?W.__staleWhileFetching:W.__returned=W}let Et=e(this,U).call(this,v);if(!y&&!Et)return p&&(p.fetch="hit"),h(this,o,bt).call(this,v),n&&e(this,ot).call(this,v),p&&e(this,Q).call(this,p,v),W;let lt=h(this,o,Dt).call(this,t,v,M,w),ft=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=Et?"stale":"refresh",ft&&Et&&(p.returnedStale=true)),ft?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=e(this,pt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...a}=i,d=this.get(t,a);if(!r&&d!==void 0)return d;let c=s(t,d,{options:a,context:n});return this.set(t,c,a),c}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,d=e(this,T).get(t);if(d!==void 0){let c=e(this,g)[d],O=h(this,o,S).call(this,c);return a&&e(this,Q).call(this,a,d),e(this,U).call(this,d)?(a&&(a.get="stale"),O?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(r||h(this,o,it).call(this,t,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),O?c.__staleWhileFetching:(h(this,o,bt).call(this,d),n&&e(this,ot).call(this,d),c))}else a&&(a.get="miss");}delete(t){return h(this,o,it).call(this,t,"delete")}clear(){return h(this,o,Vt).call(this,"delete")}};P=new WeakMap,L=new WeakMap,Y=new WeakMap,at=new WeakMap,j=new WeakMap,gt=new WeakMap,pt=new WeakMap,R=new WeakMap,K=new WeakMap,T=new WeakMap,E=new WeakMap,g=new WeakMap,z=new WeakMap,G=new WeakMap,x=new WeakMap,F=new WeakMap,H=new WeakMap,D=new WeakMap,$=new WeakMap,B=new WeakMap,N=new WeakMap,X=new WeakMap,st=new WeakMap,I=new WeakMap,_t=new WeakMap,o=new WeakSet,Gt=function(){let t=new ut(e(this,P)),i=new ut(e(this,P));f(this,N,t),f(this,B,i),f(this,yt,(r,a,d=ct.now())=>{if(i[r]=a!==0?d:0,t[r]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{e(this,U).call(this,r)&&h(this,o,it).call(this,e(this,E)[r],"expire");},a+1);c.unref&&c.unref();}}),f(this,ot,r=>{i[r]=t[r]!==0?ct.now():0;}),f(this,Q,(r,a)=>{if(t[a]){let d=t[a],c=i[a];if(!d||!c)return;r.ttl=d,r.start=c,r.now=s||n();let O=r.now-c;r.remainingTTL=d-O;}});let s=0,n=()=>{let r=ct.now();if(this.ttlResolution>0){s=r;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=e(this,T).get(r);if(a===void 0)return 0;let d=t[a],c=i[a];if(!d||!c)return 1/0;let O=(s||n())-c;return d-O},f(this,U,r=>{let a=i[r],d=t[r];return !!d&&!!a&&(s||n())-a>d});},ot=new WeakMap,Q=new WeakMap,yt=new WeakMap,U=new WeakMap,Xt=function(){let t=new ut(e(this,P));f(this,K,0),f(this,$,t),f(this,ht,i=>{f(this,K,e(this,K)-t[i]),t[i]=0;}),f(this,wt,(i,s,n,r)=>{if(h(this,o,S).call(this,s))return 0;if(!k(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(s,i),!k(n))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 n}),f(this,mt,(i,s,n)=>{if(t[i]=s,e(this,L)){let r=e(this,L)-t[i];for(;e(this,K)>r;)h(this,o,Ft).call(this,true);}f(this,K,e(this,K)+t[i]),n&&(n.entrySize=s,n.totalCalculatedSize=e(this,K));});},ht=new WeakMap,mt=new WeakMap,wt=new WeakMap,tt=function*({allowStale:t=this.allowStale}={}){if(e(this,R))for(let i=e(this,F);!(!h(this,o,Nt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,x)));)i=e(this,G)[i];},et=function*({allowStale:t=this.allowStale}={}){if(e(this,R))for(let i=e(this,x);!(!h(this,o,Nt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,F)));)i=e(this,z)[i];},Nt=function(t){return t!==void 0&&e(this,T).get(e(this,E)[t])===t},Ft=function(t){var r;let i=e(this,x),s=e(this,E)[i],n=e(this,g)[i];return e(this,st)&&h(this,o,S).call(this,n)?n.__abortController.abort(new Error("evicted")):(e(this,X)||e(this,I))&&(e(this,X)&&((r=e(this,Y))==null||r.call(this,n,s,"evict")),e(this,I)&&e(this,D)?.push([n,s,"evict"])),e(this,ht).call(this,i),t&&(e(this,E)[i]=void 0,e(this,g)[i]=void 0,e(this,H).push(i)),e(this,R)===1?(f(this,x,f(this,F,0)),e(this,H).length=0):f(this,x,e(this,z)[i]),e(this,T).delete(s),Ot(this,R)._--,i},Dt=function(t,i,s,n){let r=i===void 0?void 0:e(this,g)[i];if(h(this,o,S).call(this,r))return r;let a=new vt,{signal:d}=s;d?.addEventListener("abort",()=>a.abort(d.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:n},O=(w,y=false)=>{let{aborted:p}=a.signal,C=s.ignoreFetchAbort&&w!==void 0;if(s.status&&(p&&!y?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,C&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!C&&!y)return b(a.signal.reason);let M=V;return e(this,g)[i]===V&&(w===void 0?M.__staleWhileFetching?e(this,g)[i]=M.__staleWhileFetching:h(this,o,it).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,w,c.options))),w},q=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),b(w)),b=w=>{let{aborted:y}=a.signal,p=y&&s.allowStaleOnFetchAbort,C=p||s.allowStaleOnFetchRejection,M=C||s.noDeleteOnFetchRejection,v=V;if(e(this,g)[i]===V&&(!M||v.__staleWhileFetching===void 0?h(this,o,it).call(this,t,"fetch"):p||(e(this,g)[i]=v.__staleWhileFetching)),C)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw w},Z=(w,y)=>{var C;let p=(C=e(this,gt))==null?void 0:C.call(this,t,r,c);p&&p instanceof Promise&&p.then(M=>w(M===void 0?void 0:M),y),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=M=>O(M,true)));});};s.status&&(s.status.fetchDispatched=true);let V=new Promise(Z).then(O,q),J=Object.assign(V,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(t,J,{...c.options,status:void 0}),i=e(this,T).get(t)):e(this,g)[i]=J,J},S=function(t){if(!e(this,st))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof vt},Ut=function(t,i){e(this,G)[i]=t,e(this,z)[t]=i;},bt=function(t){t!==e(this,F)&&(t===e(this,x)?f(this,x,e(this,z)[t]):h(this,o,Ut).call(this,e(this,G)[t],e(this,z)[t]),h(this,o,Ut).call(this,e(this,F),t),f(this,F,t));},it=function(t,i){var n,r;let s=false;if(e(this,R)!==0){let a=e(this,T).get(t);if(a!==void 0)if(s=true,e(this,R)===1)h(this,o,Vt).call(this,i);else {e(this,ht).call(this,a);let d=e(this,g)[a];if(h(this,o,S).call(this,d)?d.__abortController.abort(new Error("deleted")):(e(this,X)||e(this,I))&&(e(this,X)&&((n=e(this,Y))==null||n.call(this,d,t,i)),e(this,I)&&e(this,D)?.push([d,t,i])),e(this,T).delete(t),e(this,E)[a]=void 0,e(this,g)[a]=void 0,a===e(this,F))f(this,F,e(this,G)[a]);else if(a===e(this,x))f(this,x,e(this,z)[a]);else {let c=e(this,G)[a];e(this,z)[c]=e(this,z)[a];let O=e(this,z)[a];e(this,G)[O]=e(this,G)[a];}Ot(this,R)._--,e(this,H).push(a);}}if(e(this,I)&&e(this,D)?.length){let a=e(this,D),d;for(;d=a?.shift();)(r=e(this,j))==null||r.call(this,...d);}return s},Vt=function(t){var i,s;for(let n of h(this,o,et).call(this,{allowStale:true})){let r=e(this,g)[n];if(h(this,o,S).call(this,r))r.__abortController.abort(new Error("deleted"));else {let a=e(this,E)[n];e(this,X)&&((i=e(this,Y))==null||i.call(this,r,a,t)),e(this,I)&&e(this,D)?.push([r,a,t]);}}if(e(this,T).clear(),e(this,g).fill(void 0),e(this,E).fill(void 0),e(this,N)&&e(this,B)&&(e(this,N).fill(0),e(this,B).fill(0)),e(this,$)&&e(this,$).fill(0),f(this,x,0),f(this,F,0),e(this,H).length=0,f(this,K,0),f(this,R,0),e(this,I)&&e(this,D)){let n=e(this,D),r;for(;r=n?.shift();)(s=e(this,j))==null||s.call(this,...r);}};var xt=Wt;var St=class{constructor(t){_(this,"cache");_(this,"map",new Map);this.cache=new xt({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let i=this.map.delete(t);return i&&this.cache.delete(t),i}get forEach(){return this.map.forEach}get(t){let i=this.cache.get(t);return i||this.map.get(t)}has(t){return this.map.has(t)}set(t,i){return this.map.set(t,i),this.cache.set(t,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var A=class A{constructor(){}static clearOldTempVariables(t){A.tempStorageDeadlines.forEach((i,s)=>{i>t&&(A.tempStorage.delete(s),A.tempStorageDeadlines.delete(s),A.storage.cache.delete(s));});}static setVariable(t,i){let s=A.tempStorage.has(t);i==null?(A.storage.map.delete(t),!s&&A.storage.cache.delete(t)):(A.storage.map.set(t,i),!s&&A.storage.cache.set(t,i));}static getVariable(t){let i=A.storage.cache.get(t);return i===void 0&&(i=A.tempStorage.get(t)),i===void 0&&(i=A.storage.map.get(t)),Rt(i)}static removeVariable(t){A.storage.delete(t);}static setFlag(t,i){if(i)this.flags.includes(t)||this.flags.push(t);else {let s=this.flags.indexOf(t);s>-1&&this.flags.splice(s,1);}}static getFlag(t){return this.flags.includes(t)}};_(A,"storage",new St({cacheSize:20})),_(A,"startingStorage",[]),_(A,"flags",Array()),_(A,"tempStorage",new Map),_(A,"tempStorageDeadlines",new Map);var u=A;var Tt=class{get storage(){return u.storage.map}get cache(){return u.storage.cache}get flags(){return u.flags}get tempStorage(){return u.tempStorage}get tempStorageDeadlines(){return u.tempStorageDeadlines}set startingStorage(t){let i=unifier.GameUnifier.stepCounter===0;Object.entries(t).forEach(([s,n])=>{u.startingStorage.push({key:s,value:n}),i&&u.storage.set(s,n);});}set(t,i){return u.setVariable(t,i)}setVariable(t,i){return this.set(t,i)}get(t){return u.getVariable(t)}getVariable(t){return this.get(t)}removeVariable(t){return u.removeVariable(t)}setTempVariable(t,i){if(i==null){this.removeTempVariable(t);return}else u.tempStorage.set(t,i),u.storage.cache.set(t,i),u.tempStorageDeadlines.has(t)||u.tempStorageDeadlines.set(t,unifier.GameUnifier.openedLabels);}removeTempVariable(t){u.tempStorage.has(t)&&(u.tempStorage.delete(t),u.tempStorageDeadlines.delete(t),u.storage.cache.delete(t));}setFlag(t,i){return u.setFlag(t,i)}getFlag(t){return u.getFlag(t)}clear(){this.storage.clear(),this.cache.clear(),u.flags=[],u.tempStorage.clear(),u.tempStorageDeadlines.clear(),u.startingStorage.forEach(({key:t,value:i})=>{this.storage.set(t,i);});}export(){let t=[];[...this.storage.keys()].forEach(n=>{t.push({key:n,value:this.storage.get(n)});});let i=[];[...u.tempStorage.keys()].forEach(n=>{i.push({key:n,value:u.tempStorage.get(n)});});let s=[];return [...u.tempStorageDeadlines.keys()].forEach(n=>{s.push({key:n,value:u.tempStorageDeadlines.get(n)});}),Rt({base:t,temp:i,tempDeadlines:s,flags:u.flags})}restore(t){this.clear();try{t?(Array.isArray(t)&&t.forEach(i=>{if(i.key==="___temp_storage___"){let s=i.value;Object.entries(s).forEach(([n,r])=>{u.tempStorage.set(n,r);});}else if(i.key==="___temp_storage_deadlines___"){let s=i.value;Object.entries(s).forEach(([n,r])=>{u.tempStorageDeadlines.set(n,r);});}else i.key==="___flags___"?i.value.forEach(n=>{u.flags.push(n);}):this.storage.set(i.key,i.value);}),"base"in t&&"temp"in t&&"tempDeadlines"in t?(t.base?.forEach(i=>{this.storage.set(i.key,i.value);}),t.temp?.forEach(i=>{u.tempStorage.set(i.key,i.value);}),t.tempDeadlines?.forEach(i=>{u.tempStorageDeadlines.set(i.key,i.value);})):Object.entries(t).forEach(([i,s])=>{i==="___temp_storage___"?Object.entries(s).forEach(([n,r])=>{u.tempStorage.set(n,r);}):i==="___temp_storage_deadlines___"?Object.entries(s).forEach(([n,r])=>{u.tempStorageDeadlines.set(n,r);}):i==="___flags___"?s.forEach(n=>{u.flags.push(n);}):this.storage.set(i,s);})):nt.warn("No storage data found");}catch(i){nt.error("Error importing data",i);}}};var zt=class{constructor(t,i){_(this,"_id");_(this,"categoryId");this.categoryId=t,this._id=i;}get id(){return this._id}setStorageProperty(t,i){let s=u.getVariable(this.categoryId);s||(s={}),s.hasOwnProperty(this.id)||(s[this.id]={}),i==null?s[this.id].hasOwnProperty(t)&&delete s[this.id][t]:s[this.id]={...s[this.id],[t]:i},Object.keys(s[this.id]).length===0&&delete s[this.id],u.setVariable(this.categoryId,s);}getStorageProperty(t,i=this.id){let s=u.getVariable(this.categoryId);if(s&&s.hasOwnProperty(i)&&s[i].hasOwnProperty(t))return s[i][t]}};var kt={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var De=new Tt;exports.SYSTEM_RESERVED_STORAGE_KEYS=kt;exports.StorageManagerStatic=u;exports.StoredClassModel=zt;exports.storage=De;
@@ -24,7 +24,7 @@ interface StorageManagerInterface {
24
24
  /**
25
25
  * The internal storage. **Do not modify this directly.**
26
26
  *
27
- * ATTENTION: If you edit this directly, the {@link this.cache} will not be updated.
27
+ * ATTENTION: If you edit this directly, the {@link cache} will not be updated.
28
28
  *
29
29
  * You can use Keyv with Pixi’VN by creating a new instance of Keyv and passing the storage object as a parameter.
30
30
  * ```ts
@@ -56,12 +56,20 @@ interface StorageManagerInterface {
56
56
  * @param value The value of the variable. If undefined, the variable will be removed
57
57
  * @returns
58
58
  */
59
+ set(key: string, value: StorageElementType): void;
60
+ /**
61
+ * @deprecated use {@link set} instead
62
+ */
59
63
  setVariable(key: string, value: StorageElementType): void;
60
64
  /**
61
65
  * Get a variable from the storage. If the variable is a temporary variable, it will return the temporary variable
62
66
  * @param key The key of the variable
63
67
  * @returns The value of the variable. If the variable does not exist, it will return undefined
64
68
  */
69
+ get<T extends StorageElementType>(key: string): T | undefined;
70
+ /**
71
+ * @deprecated use {@link get} instead
72
+ */
65
73
  getVariable<T extends StorageElementType>(key: string): T | undefined;
66
74
  /**
67
75
  * Remove a variable from the storage
@@ -71,7 +79,7 @@ interface StorageManagerInterface {
71
79
  removeVariable(key: string): void;
72
80
  /**
73
81
  * Set a variable in the temporary storage. The lifespan of the variable is the number of opened labels.
74
- * To get the temporary variable, use {@link getVariable}
82
+ * To get the temporary variable, use {@link get}
75
83
  * @param key The key of the temporary variable
76
84
  * @param value The value of the temporary variable. If undefined, the variable will be removed
77
85
  * @returns
package/dist/storage.d.ts CHANGED
@@ -24,7 +24,7 @@ interface StorageManagerInterface {
24
24
  /**
25
25
  * The internal storage. **Do not modify this directly.**
26
26
  *
27
- * ATTENTION: If you edit this directly, the {@link this.cache} will not be updated.
27
+ * ATTENTION: If you edit this directly, the {@link cache} will not be updated.
28
28
  *
29
29
  * You can use Keyv with Pixi’VN by creating a new instance of Keyv and passing the storage object as a parameter.
30
30
  * ```ts
@@ -56,12 +56,20 @@ interface StorageManagerInterface {
56
56
  * @param value The value of the variable. If undefined, the variable will be removed
57
57
  * @returns
58
58
  */
59
+ set(key: string, value: StorageElementType): void;
60
+ /**
61
+ * @deprecated use {@link set} instead
62
+ */
59
63
  setVariable(key: string, value: StorageElementType): void;
60
64
  /**
61
65
  * Get a variable from the storage. If the variable is a temporary variable, it will return the temporary variable
62
66
  * @param key The key of the variable
63
67
  * @returns The value of the variable. If the variable does not exist, it will return undefined
64
68
  */
69
+ get<T extends StorageElementType>(key: string): T | undefined;
70
+ /**
71
+ * @deprecated use {@link get} instead
72
+ */
65
73
  getVariable<T extends StorageElementType>(key: string): T | undefined;
66
74
  /**
67
75
  * Remove a variable from the storage
@@ -71,7 +79,7 @@ interface StorageManagerInterface {
71
79
  removeVariable(key: string): void;
72
80
  /**
73
81
  * Set a variable in the temporary storage. The lifespan of the variable is the number of opened labels.
74
- * To get the temporary variable, use {@link getVariable}
82
+ * To get the temporary variable, use {@link get}
75
83
  * @param key The key of the temporary variable
76
84
  * @param value The value of the temporary variable. If undefined, the variable will be removed
77
85
  * @returns
package/dist/storage.mjs CHANGED
@@ -1 +1 @@
1
- export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-FVGPQDTP.mjs';export{a as SYSTEM_RESERVED_STORAGE_KEYS}from'./chunk-6GO4XVS7.mjs';import'./chunk-JYY377ML.mjs';import'./chunk-GNJIUFU2.mjs';
1
+ export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-ROWTJPTX.mjs';export{a as SYSTEM_RESERVED_STORAGE_KEYS}from'./chunk-6GO4XVS7.mjs';import'./chunk-JYY377ML.mjs';import'./chunk-GNJIUFU2.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drincs/pixi-vn",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "type": "module",
5
5
  "description": "Pixi'VN is a npm package that provides various features for creating visual novels.",
6
6
  "main": "./dist/index.cjs",
@@ -1 +0,0 @@
1
- import {a}from'./chunk-JYY377ML.mjs';import {d,k,j}from'./chunk-GNJIUFU2.mjs';import {GameUnifier}from'@drincs/pixi-vn/unifier';var o=class o{constructor(){}static clearOldTempVariables(e){o.tempStorageDeadlines.forEach((t,a)=>{t>e&&(o.tempStorage.delete(a),o.tempStorageDeadlines.delete(a),o.storage.cache.delete(a));});}static setVariable(e,t){let a=o.tempStorage.has(e);t==null?(o.storage.map.delete(e),!a&&o.storage.cache.delete(e)):(o.storage.map.set(e,t),!a&&o.storage.cache.set(e,t));}static getVariable(e){let t=o.storage.cache.get(e);return t===void 0&&(t=o.tempStorage.get(e)),t===void 0&&(t=o.storage.map.get(e)),k(t)}static removeVariable(e){o.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let a=this.flags.indexOf(e);a>-1&&this.flags.splice(a,1);}}static getFlag(e){return this.flags.includes(e)}};d(o,"storage",new a({cacheSize:20})),d(o,"startingStorage",[]),d(o,"flags",Array()),d(o,"tempStorage",new Map),d(o,"tempStorageDeadlines",new Map);var r=o;var n=class{get storage(){return r.storage.map}get cache(){return r.storage.cache}get flags(){return r.flags}get tempStorage(){return r.tempStorage}get tempStorageDeadlines(){return r.tempStorageDeadlines}set startingStorage(e){let t=[],a=GameUnifier.stepCounter===0;Object.entries(e).forEach(([s,i])=>{t.push({key:s,value:i}),a&&r.storage.set(s,i);}),r.startingStorage=t;}setVariable(e,t){return r.setVariable(e,t)}getVariable(e){return r.getVariable(e)}removeVariable(e){return r.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else r.tempStorage.set(e,t),r.storage.cache.set(e,t),r.tempStorageDeadlines.has(e)||r.tempStorageDeadlines.set(e,GameUnifier.openedLabels);}removeTempVariable(e){r.tempStorage.has(e)&&(r.tempStorage.delete(e),r.tempStorageDeadlines.delete(e),r.storage.cache.delete(e));}setFlag(e,t){return r.setFlag(e,t)}getFlag(e){return r.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),r.flags=[],r.tempStorage.clear(),r.tempStorageDeadlines.clear(),r.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...r.tempStorage.keys()].forEach(s=>{t.push({key:s,value:r.tempStorage.get(s)});});let a=[];return [...r.tempStorageDeadlines.keys()].forEach(s=>{a.push({key:s,value:r.tempStorageDeadlines.get(s)});}),k({base:e,temp:t,tempDeadlines:a,flags:r.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let a=t.value;Object.entries(a).forEach(([s,i])=>{r.tempStorage.set(s,i);});}else if(t.key==="___temp_storage_deadlines___"){let a=t.value;Object.entries(a).forEach(([s,i])=>{r.tempStorageDeadlines.set(s,i);});}else t.key==="___flags___"?t.value.forEach(s=>{r.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{r.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{r.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,a])=>{t==="___temp_storage___"?Object.entries(a).forEach(([s,i])=>{r.tempStorage.set(s,i);}):t==="___temp_storage_deadlines___"?Object.entries(a).forEach(([s,i])=>{r.tempStorageDeadlines.set(s,i);}):t==="___flags___"?a.forEach(s=>{r.flags.push(s);}):this.storage.set(t,a);})):j.warn("No storage data found");}catch(t){j.error("Error importing data",t);}}};var m=class{constructor(e,t){d(this,"_id");d(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let a=r.getVariable(this.categoryId);a||(a={}),a.hasOwnProperty(this.id)||(a[this.id]={}),t==null?a[this.id].hasOwnProperty(e)&&delete a[this.id][e]:a[this.id]={...a[this.id],[e]:t},Object.keys(a[this.id]).length===0&&delete a[this.id],r.setVariable(this.categoryId,a);}getStorageProperty(e,t=this.id){let a=r.getVariable(this.categoryId);if(a&&a.hasOwnProperty(t)&&a[t].hasOwnProperty(e))return a[t][e]}};var v=new n;export{r as a,m as b,v as c};