@drincs/pixi-vn 1.8.4 → 1.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ContainerMemory-BjcfYRU7.d.cts +392 -0
- package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
- package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
- package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
- package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
- package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
- package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
- package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
- package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
- package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
- package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
- package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
- package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
- package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
- package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
- package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +54 -464
- package/dist/canvas.d.ts +54 -464
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +5 -5
- package/dist/characters.d.ts +5 -5
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-Z4GZCINS.mjs → chunk-3M6A7TU2.mjs} +1 -1
- package/dist/chunk-BQRPDCUT.mjs +1 -0
- package/dist/{chunk-YCWXA3OR.mjs → chunk-IFPF4NRX.mjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -114
- package/dist/core.d.ts +5 -114
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +7 -11
- package/dist/history.d.ts +7 -11
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +20 -826
- package/dist/index.d.ts +20 -826
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +57 -22
- package/dist/narration.d.ts +57 -22
- package/dist/narration.mjs +1 -1
- package/dist/pixi/index.d.cts +12 -0
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +4 -435
- package/dist/sound.d.ts +4 -435
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +4 -27
- package/dist/storage.d.ts +4 -27
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.d.cts +1 -1
- package/dist/vite-listener.d.ts +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +1 -1
- package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
- package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
- package/dist/chunk-V34PMA2H.mjs +0 -1
package/dist/storage.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var te=Object.defineProperty;var jt=u=>{throw TypeError(u)};var ee=(u,e,i)=>e in u?te(u,e,{enumerable:true,configurable:true,writable:true,value:i}):u[e]=i;var E=(u,e,i)=>ee(u,typeof e!="symbol"?e+"":e,i),Ut=(u,e,i)=>e.has(u)||jt("Cannot "+i);var t=(u,e,i)=>(Ut(u,e,"read from private field"),i?i.call(u):e.get(u)),d=(u,e,i)=>e.has(u)?jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,i),f=(u,e,i,s)=>(Ut(u,e,"write to private field"),e.set(u,i),i),l=(u,e,i)=>(Ut(u,e,"access private method"),i);var It=(u,e,i,s)=>({set _(r){f(u,e,r);},get _(){return t(u,e,s)}});var st="storage",ht="temp",H="narration",Nt="flags",j={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ie=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Xt=new Set,zt=typeof process=="object"&&process?process:{},Jt=(u,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(u,e,i,s):console.error(`[${i}] ${e}: ${u}`);},Gt=globalThis.AbortController,$t=globalThis.AbortSignal;if(typeof Gt>"u"){$t=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Gt=class{constructor(){E(this,"signal",new $t);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let u=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{u&&(u=false,Jt("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 se=u=>!Xt.has(u);var rt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u),qt=u=>rt(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?Ft:null:null,Ft=class extends Array{constructor(u){super(u),this.fill(0);}},et,St,re=(et=class{constructor(e,i){E(this,"heap");E(this,"length");if(!t(et,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=qt(e);if(!i)return [];f(et,St,true);let s=new et(e,i);return f(et,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,d(et,St,false),et),kt,Bt,$,z,k,ct,B,mt,Et,X,D,J,R,v,p,V,Y,C,N,q,F,Q,Z,P,K,tt,lt,L,Tt,n,Yt,ut,it,vt,W,Zt,ft,bt,xt,at,ot,Pt,Ct,Mt,w,Kt,wt,nt,Wt,At,Qt=(At=class{constructor(e){d(this,n);d(this,$);d(this,z);d(this,k);d(this,ct);d(this,B);d(this,mt);d(this,Et);d(this,X);E(this,"ttl");E(this,"ttlResolution");E(this,"ttlAutopurge");E(this,"updateAgeOnGet");E(this,"updateAgeOnHas");E(this,"allowStale");E(this,"noDisposeOnSet");E(this,"noUpdateTTL");E(this,"maxEntrySize");E(this,"sizeCalculation");E(this,"noDeleteOnFetchRejection");E(this,"noDeleteOnStaleGet");E(this,"allowStaleOnFetchAbort");E(this,"allowStaleOnFetchRejection");E(this,"ignoreFetchAbort");d(this,D);d(this,J);d(this,R);d(this,v);d(this,p);d(this,V);d(this,Y);d(this,C);d(this,N);d(this,q);d(this,F);d(this,Q);d(this,Z);d(this,P);d(this,K);d(this,tt);d(this,lt);d(this,L);d(this,Tt);d(this,ut,()=>{});d(this,it,()=>{});d(this,vt,()=>{});d(this,W,()=>false);d(this,ft,e=>{});d(this,bt,(e,i,s)=>{});d(this,xt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});E(this,kt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:m,onInsert:I,disposeAfter:g,noDisposeOnSet:A,noUpdateTTL:b,maxSize:T=0,maxEntrySize:y=0,sizeCalculation:O,fetchMethod:_,memoMethod:M,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:Ot,ignoreFetchAbort:gt,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,_t??ie),i!==0&&!rt(i))throw new TypeError("max option must be a nonnegative integer");let dt=i?qt(i):Array;if(!dt)throw new Error("invalid max value: "+i);if(f(this,$,i),f(this,z,T),this.maxEntrySize=y||t(this,z),this.sizeCalculation=O,this.sizeCalculation){if(!t(this,z)&&!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(M!==void 0&&typeof M!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,Et,M),_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,mt,_),f(this,lt,!!_),f(this,R,new Map),f(this,v,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,V,new dt(i)),f(this,Y,new dt(i)),f(this,C,0),f(this,N,0),f(this,q,re.create(i)),f(this,D,0),f(this,J,0),typeof m=="function"&&f(this,k,m),typeof I=="function"&&f(this,ct,I),typeof g=="function"?(f(this,B,g),f(this,F,[])):(f(this,B,void 0),f(this,F,void 0)),f(this,tt,!!t(this,k)),f(this,Tt,!!t(this,ct)),f(this,L,!!t(this,B)),this.noDisposeOnSet=!!A,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!Ot,this.ignoreFetchAbort=!!gt,this.maxEntrySize!==0){if(t(this,z)!==0&&!rt(t(this,z)))throw new TypeError("maxSize must be a positive integer if specified");if(!rt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,n,Zt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=rt(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!rt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,n,Yt).call(this);}if(t(this,$)===0&&this.ttl===0&&t(this,z)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,$)&&!t(this,z)){let Lt="LRU_CACHE_UNBOUNDED";se(Lt)&&(Xt.add(Lt),Jt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,At));}}get perf(){return t(this,X)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,P),autopurgeTimers:t(e,K),sizes:t(e,Q),keyMap:t(e,R),keyList:t(e,v),valList:t(e,p),next:t(e,V),prev:t(e,Y),get head(){return t(e,C)},get tail(){return t(e,N)},free:t(e,q),isBackgroundFetch:i=>{var s;return l(s=e,n,w).call(s,i)},backgroundFetch:(i,s,r,o)=>{var a;return l(a=e,n,Mt).call(a,i,s,r,o)},moveToTail:i=>{var s;return l(s=e,n,wt).call(s,i)},indexes:i=>{var s;return l(s=e,n,at).call(s,i)},rindexes:i=>{var s;return l(s=e,n,ot).call(s,i)},isStale:i=>{var s;return t(s=e,W).call(s,i)}}}get max(){return t(this,$)}get maxSize(){return t(this,z)}get calculatedSize(){return t(this,J)}get size(){return t(this,D)}get fetchMethod(){return t(this,mt)}get memoMethod(){return t(this,Et)}get dispose(){return t(this,k)}get onInsert(){return t(this,ct)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,R).has(e)?1/0:0}*entries(){for(let e of l(this,n,at).call(this))t(this,p)[e]!==void 0&&t(this,v)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield [t(this,v)[e],t(this,p)[e]]);}*rentries(){for(let e of l(this,n,ot).call(this))t(this,p)[e]!==void 0&&t(this,v)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield [t(this,v)[e],t(this,p)[e]]);}*keys(){for(let e of l(this,n,at).call(this)){let i=t(this,v)[e];i!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of l(this,n,ot).call(this)){let i=t(this,v)[e];i!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of l(this,n,at).call(this))t(this,p)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of l(this,n,ot).call(this))t(this,p)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(Bt=Symbol.iterator,kt=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(let s of l(this,n,at).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&e(o,t(this,v)[s],this))return this.get(t(this,v)[s],i)}}forEach(e,i=this){for(let s of l(this,n,at).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,v)[s],this);}}rforEach(e,i=this){for(let s of l(this,n,ot).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,v)[s],this);}}purgeStale(){let e=false;for(let i of l(this,n,ot).call(this,{allowStale:true}))t(this,W).call(this,i)&&(l(this,n,nt).call(this,t(this,v)[i],"expire"),e=true);return e}info(e){let i=t(this,R).get(e);if(i===void 0)return;let s=t(this,p)[i],r=l(this,n,w).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let o={value:r};if(t(this,P)&&t(this,Z)){let a=t(this,P)[i],h=t(this,Z)[i];if(a&&h){let c=a-(t(this,X).now()-h);o.ttl=c,o.start=Date.now();}}return t(this,Q)&&(o.size=t(this,Q)[i]),o}dump(){let e=[];for(let i of l(this,n,at).call(this,{allowStale:true})){let s=t(this,v)[i],r=t(this,p)[i],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||s===void 0)continue;let a={value:o};if(t(this,P)&&t(this,Z)){a.ttl=t(this,P)[i];let h=t(this,X).now()-t(this,Z)[i];a.start=Math.floor(Date.now()-h);}t(this,Q)&&(a.size=t(this,Q)[i]),e.unshift([s,a]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,X).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var A,b,T,y;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s,{noUpdateTTL:m=this.noUpdateTTL}=s,I=t(this,xt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&I>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),l(this,n,nt).call(this,e,"set"),this;let g=t(this,D)===0?void 0:t(this,R).get(e);if(g===void 0)g=t(this,D)===0?t(this,N):t(this,q).length!==0?t(this,q).pop():t(this,D)===t(this,$)?l(this,n,Ct).call(this,false):t(this,D),t(this,v)[g]=e,t(this,p)[g]=i,t(this,R).set(e,g),t(this,V)[t(this,N)]=g,t(this,Y)[g]=t(this,N),f(this,N,g),It(this,D)._++,t(this,bt).call(this,g,I,c),c&&(c.set="add"),m=false,t(this,Tt)&&((A=t(this,ct))==null||A.call(this,i,e,"add"));else {l(this,n,wt).call(this,g);let O=t(this,p)[g];if(i!==O){if(t(this,lt)&&l(this,n,w).call(this,O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=O;_!==void 0&&!a&&(t(this,tt)&&((b=t(this,k))==null||b.call(this,_,e,"set")),t(this,L)&&t(this,F)?.push([_,e,"set"]));}else a||(t(this,tt)&&((T=t(this,k))==null||T.call(this,O,e,"set")),t(this,L)&&t(this,F)?.push([O,e,"set"]));if(t(this,ft).call(this,g),t(this,bt).call(this,g,I,c),t(this,p)[g]=i,c){c.set="replace";let _=O&&l(this,n,w).call(this,O)?O.__staleWhileFetching:O;_!==void 0&&(c.oldValue=_);}}else c&&(c.set="update");t(this,Tt)&&this.onInsert?.(i,e,i===O?"update":"replace");}if(r!==0&&!t(this,P)&&l(this,n,Yt).call(this),t(this,P)&&(m||t(this,vt).call(this,g,r,o),c&&t(this,it).call(this,c,g)),!a&&t(this,L)&&t(this,F)){let O=t(this,F),_;for(;_=O?.shift();)(y=t(this,B))==null||y.call(this,..._);}return this}pop(){var e;try{for(;t(this,D);){let i=t(this,p)[t(this,C)];if(l(this,n,Ct).call(this,!0),l(this,n,w).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,L)&&t(this,F)){let i=t(this,F),s;for(;s=i?.shift();)(e=t(this,B))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,o=t(this,R).get(e);if(o!==void 0){let a=t(this,p)[o];if(l(this,n,w).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(t(this,W).call(this,o))r&&(r.has="stale",t(this,it).call(this,r,o));else return s&&t(this,ut).call(this,o),r&&(r.has="hit",t(this,it).call(this,r,o)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,R).get(e);if(r===void 0||!s&&t(this,W).call(this,r))return;let o=t(this,p)[r];return l(this,n,w).call(this,o)?o.__staleWhileFetching:o}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:m=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:y,forceRefresh:O=false,status:_,signal:M}=i;if(!t(this,lt))return _&&(_.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:_});let U={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:m,noUpdateTTL:I,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:T,ignoreFetchAbort:b,status:_,signal:M},G=t(this,R).get(e);if(G===void 0){_&&(_.fetch="miss");let x=l(this,n,Mt).call(this,e,G,U,y);return x.__returned=x}else {let x=t(this,p)[G];if(l(this,n,w).call(this,x)){let dt=s&&x.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",dt&&(_.returnedStale=true)),dt?x.__staleWhileFetching:x.__returned=x}let Ot=t(this,W).call(this,G);if(!O&&!Ot)return _&&(_.fetch="hit"),l(this,n,wt).call(this,G),r&&t(this,ut).call(this,G),_&&t(this,it).call(this,_,G),x;let gt=l(this,n,Mt).call(this,e,G,U,y),_t=gt.__staleWhileFetching!==void 0&&s;return _&&(_.fetch=Ot?"stale":"refresh",_t&&Ot&&(_.returnedStale=true)),_t?gt.__staleWhileFetching:gt.__returned=gt}}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,Et);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...a}=i,h=this.get(e,a);if(!o&&h!==void 0)return h;let c=s(e,h,{options:a,context:r});return this.set(e,c,a),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=i,h=t(this,R).get(e);if(h!==void 0){let c=t(this,p)[h],m=l(this,n,w).call(this,c);return a&&t(this,it).call(this,a,h),t(this,W).call(this,h)?(a&&(a.get="stale"),m?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(o||l(this,n,nt).call(this,e,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),m?c.__staleWhileFetching:(l(this,n,wt).call(this,h),r&&t(this,ut).call(this,h),c))}else a&&(a.get="miss");}delete(e){return l(this,n,nt).call(this,e,"delete")}clear(){return l(this,n,Wt).call(this,"delete")}},$=new WeakMap,z=new WeakMap,k=new WeakMap,ct=new WeakMap,B=new WeakMap,mt=new WeakMap,Et=new WeakMap,X=new WeakMap,D=new WeakMap,J=new WeakMap,R=new WeakMap,v=new WeakMap,p=new WeakMap,V=new WeakMap,Y=new WeakMap,C=new WeakMap,N=new WeakMap,q=new WeakMap,F=new WeakMap,Q=new WeakMap,Z=new WeakMap,P=new WeakMap,K=new WeakMap,tt=new WeakMap,lt=new WeakMap,L=new WeakMap,Tt=new WeakMap,n=new WeakSet,Yt=function(){let e=new Ft(t(this,$)),i=new Ft(t(this,$));f(this,P,e),f(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,$)):void 0;f(this,K,s),f(this,vt,(h,c,m=t(this,X).now())=>{i[h]=c!==0?m:0,e[h]=c,r(h,c);}),f(this,ut,h=>{i[h]=e[h]!==0?t(this,X).now():0,r(h,e[h]);});let r=this.ttlAutopurge?(h,c)=>{if(s?.[h]&&(clearTimeout(s[h]),s[h]=void 0),c&&c!==0&&s){let m=setTimeout(()=>{t(this,W).call(this,h)&&l(this,n,nt).call(this,t(this,v)[h],"expire");},c+1);m.unref&&m.unref(),s[h]=m;}}:()=>{};f(this,it,(h,c)=>{if(e[c]){let m=e[c],I=i[c];if(!m||!I)return;h.ttl=m,h.start=I,h.now=o||a();let g=h.now-I;h.remainingTTL=m-g;}});let o=0,a=()=>{let h=t(this,X).now();if(this.ttlResolution>0){o=h;let c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref();}return h};this.getRemainingTTL=h=>{let c=t(this,R).get(h);if(c===void 0)return 0;let m=e[c],I=i[c];if(!m||!I)return 1/0;let g=(o||a())-I;return m-g},f(this,W,h=>{let c=i[h],m=e[h];return !!m&&!!c&&(o||a())-c>m});},ut=new WeakMap,it=new WeakMap,vt=new WeakMap,W=new WeakMap,Zt=function(){let e=new Ft(t(this,$));f(this,J,0),f(this,Q,e),f(this,ft,i=>{f(this,J,t(this,J)-e[i]),e[i]=0;}),f(this,xt,(i,s,r,o)=>{if(l(this,n,w).call(this,s))return 0;if(!rt(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(s,i),!rt(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,bt,(i,s,r)=>{if(e[i]=s,t(this,z)){let o=t(this,z)-e[i];for(;t(this,J)>o;)l(this,n,Ct).call(this,true);}f(this,J,t(this,J)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,J));});},ft=new WeakMap,bt=new WeakMap,xt=new WeakMap,at=function*({allowStale:e=this.allowStale}={}){if(t(this,D))for(let i=t(this,N);!(!l(this,n,Pt).call(this,i)||((e||!t(this,W).call(this,i))&&(yield i),i===t(this,C)));)i=t(this,Y)[i];},ot=function*({allowStale:e=this.allowStale}={}){if(t(this,D))for(let i=t(this,C);!(!l(this,n,Pt).call(this,i)||((e||!t(this,W).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,V)[i];},Pt=function(e){return e!==void 0&&t(this,R).get(t(this,v)[e])===e},Ct=function(e){var o;let i=t(this,C),s=t(this,v)[i],r=t(this,p)[i];return t(this,lt)&&l(this,n,w).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((o=t(this,k))==null||o.call(this,r,s,"evict")),t(this,L)&&t(this,F)?.push([r,s,"evict"])),t(this,ft).call(this,i),t(this,K)?.[i]&&(clearTimeout(t(this,K)[i]),t(this,K)[i]=void 0),e&&(t(this,v)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,D)===1?(f(this,C,f(this,N,0)),t(this,q).length=0):f(this,C,t(this,V)[i]),t(this,R).delete(s),It(this,D)._--,i},Mt=function(e,i,s,r){let o=i===void 0?void 0:t(this,p)[i];if(l(this,n,w).call(this,o))return o;let a=new Gt,{signal:h}=s;h?.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:r},m=(y,O=false)=>{let{aborted:_}=a.signal,M=s.ignoreFetchAbort&&y!==void 0,U=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(_&&!O?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,M&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),_&&!M&&!O)return g(a.signal.reason,U);let G=b,x=t(this,p)[i];return (x===b||M&&O&&x===void 0)&&(y===void 0?G.__staleWhileFetching!==void 0?t(this,p)[i]=G.__staleWhileFetching:l(this,n,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,c.options))),y},I=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),g(y,false)),g=(y,O)=>{let{aborted:_}=a.signal,M=_&&s.allowStaleOnFetchAbort,U=M||s.allowStaleOnFetchRejection,G=U||s.noDeleteOnFetchRejection,x=b;if(t(this,p)[i]===b&&(!G||!O&&x.__staleWhileFetching===void 0?l(this,n,nt).call(this,e,"fetch"):M||(t(this,p)[i]=x.__staleWhileFetching)),U)return s.status&&x.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw y},A=(y,O)=>{var M;let _=(M=t(this,mt))==null?void 0:M.call(this,e,o,c);_&&_ instanceof Promise&&_.then(U=>y(U===void 0?void 0:U),O),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=U=>m(U,true)));});};s.status&&(s.status.fetchDispatched=true);let b=new Promise(A).then(m,I),T=Object.assign(b,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(e,T,{...c.options,status:void 0}),i=t(this,R).get(e)):t(this,p)[i]=T,T},w=function(e){if(!t(this,lt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Gt},Kt=function(e,i){t(this,Y)[i]=e,t(this,V)[e]=i;},wt=function(e){e!==t(this,N)&&(e===t(this,C)?f(this,C,t(this,V)[e]):l(this,n,Kt).call(this,t(this,Y)[e],t(this,V)[e]),l(this,n,Kt).call(this,t(this,N),e),f(this,N,e));},nt=function(e,i){var r,o;let s=false;if(t(this,D)!==0){let a=t(this,R).get(e);if(a!==void 0)if(t(this,K)?.[a]&&(clearTimeout(t(this,K)?.[a]),t(this,K)[a]=void 0),s=true,t(this,D)===1)l(this,n,Wt).call(this,i);else {t(this,ft).call(this,a);let h=t(this,p)[a];if(l(this,n,w).call(this,h)?h.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((r=t(this,k))==null||r.call(this,h,e,i)),t(this,L)&&t(this,F)?.push([h,e,i])),t(this,R).delete(e),t(this,v)[a]=void 0,t(this,p)[a]=void 0,a===t(this,N))f(this,N,t(this,Y)[a]);else if(a===t(this,C))f(this,C,t(this,V)[a]);else {let c=t(this,Y)[a];t(this,V)[c]=t(this,V)[a];let m=t(this,V)[a];t(this,Y)[m]=t(this,Y)[a];}It(this,D)._--,t(this,q).push(a);}}if(t(this,L)&&t(this,F)?.length){let a=t(this,F),h;for(;h=a?.shift();)(o=t(this,B))==null||o.call(this,...h);}return s},Wt=function(e){var i,s;for(let r of l(this,n,ot).call(this,{allowStale:true})){let o=t(this,p)[r];if(l(this,n,w).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=t(this,v)[r];t(this,tt)&&((i=t(this,k))==null||i.call(this,o,a,e)),t(this,L)&&t(this,F)?.push([o,a,e]);}}if(t(this,R).clear(),t(this,p).fill(void 0),t(this,v).fill(void 0),t(this,P)&&t(this,Z)){t(this,P).fill(0),t(this,Z).fill(0);for(let r of t(this,K)??[])r!==void 0&&clearTimeout(r);t(this,K)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),f(this,C,0),f(this,N,0),t(this,q).length=0,f(this,J,0),f(this,D,0),t(this,L)&&t(this,F)){let r=t(this,F),o;for(;o=r?.shift();)(s=t(this,B))==null||s.call(this,...o);}},At);var yt=class{constructor(e){E(this,"cache");E(this,"map",new Map);this.cache=new Qt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var pt;(r=>(r.log=(o,...a)=>console.log(`[Pixi\u2019VN] ${o}`,...a),r.warn=(o,...a)=>console.warn(`[Pixi\u2019VN] ${o}`,...a),r.error=(o,...a)=>console.error(`[Pixi\u2019VN] ${o}`,...a),r.info=(o,...a)=>console.info(`[Pixi\u2019VN] ${o}`,...a)))(pt||(pt={}));function Rt(u){try{if(typeof u>"u")return u;let e=JSON.stringify(u);return JSON.parse(e)}catch(e){throw pt.error("Error creating exportable element",u,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Ht;(g=>{g.storage=new yt({cacheSize:50}),g.defaultStorage=new yt({cacheSize:10}),g.tempStorageDeadlines=new Map;let s;function r(A){g.tempStorageDeadlines.forEach((b,T)=>{b>A&&(g.storage.delete(`${ht}:${T}`),s?.onClearOldTempVariable?.(T),g.tempStorageDeadlines.delete(T));});}g.clearOldTempVariables=r;function o(A){s=A;}g.setExternalStoreHandler=o;function a(A,b,T){T==null?g.storage.delete(`${A}:${b}`):g.storage.set(`${A}:${b}`,T),s?.onSetVariable?.(b,T);}g.setVariable=a;function h(A,b){let T=g.storage.get(`${A}:${b}`);return Rt(T)}g.getVariable=h;function c(A,b){g.storage.delete(`${A}:${b}`),s?.onRemoveVariable?.(b);}g.removeVariable=c;function m(A,b){let T=g.storage.get(Nt)||[];if(b)T.includes(A)||T.push(A);else {let y=T.indexOf(A);y>-1&&T.splice(y,1);}g.storage.set(Nt,T);}g.setFlag=m;function I(A){return (g.storage.get(Nt)||[]).includes(A)}g.getFlag=I;})(Ht||(Ht={}));var S=Ht;var Dt=class{get base(){return S.storage.map}get cache(){return S.storage.cache}get tempStorageDeadlines(){return S.tempStorageDeadlines}set default(e){Object.entries(e).forEach(([i,s])=>{S.defaultStorage.map.set(i,s);});}set(e,i){return S.setVariable(st,e,i)}get(e){let i=S.getVariable(ht,e);return i===void 0&&(i=S.getVariable(st,e)),i===void 0&&(i=Rt(S.defaultStorage.get(e))),i}remove(e){return this.removeTempVariable(e),S.removeVariable(st,e)}setTempVariable(e,i){if(i==null){this.removeTempVariable(e);return}else S.setVariable(ht,e,i),this.tempStorageDeadlines.has(e)||this.tempStorageDeadlines.set(e,core.GameUnifier.openedLabels);}removeTempVariable(e){S.removeVariable(ht,e),this.tempStorageDeadlines.has(e)&&this.tempStorageDeadlines.delete(e);}setFlag(e,i){return S.setFlag(e,i)}getFlag(e){return S.getFlag(e)}setStorageHandler(e){S.setExternalStoreHandler(e);}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let e=[];[...this.base.keys()].forEach(s=>{e.push({key:s,value:this.base.get(s)});});let i=[];return [...S.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:this.tempStorageDeadlines.get(s)});}),Rt({main:e,tempDeadlines:i})}restore(e){this.clear();try{e?(e.base?.forEach(i=>{switch(i.key){case "___current_dialogue_memory___":S.setVariable(H,j.CURRENT_DIALOGUE_MEMORY_KEY,i.value);break;case "___last_dialogue_added_in_step_memory___":S.setVariable(H,j.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_menu_options_memory___":S.setVariable(H,j.CURRENT_MENU_OPTIONS_MEMORY_KEY,i.value);break;case "___last_menu_options_added_in_step_memory___":S.setVariable(H,j.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "_input_value_":S.setVariable(H,j.CURRENT_INPUT_VALUE_MEMORY_KEY,i.value);break;case "___last_input_added_in_step_memory___":S.setVariable(H,j.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_input_info_memory___":S.setVariable(H,j.CURRENT_INPUT_INFO_MEMORY_KEY,i.value);break;case "___opened_labels_counter___":S.setVariable(H,j.OPENED_LABELS_COUNTER_KEY,i.value);break;case "___all_choices_made___":S.setVariable(H,j.ALL_CHOICES_MADE_KEY,i.value);break;case "___current_step_times_counter___":S.setVariable(H,j.CURRENT_STEP_TIMES_COUNTER_KEY,i.value);break;case "___last_step_glued___":S.setVariable(H,j.LAST_STEP_GLUED,i.value);break;default:S.setVariable(st,i.key,i.value);}}),e.temp?.forEach(i=>{S.setVariable(ht,i.key,i.value);}),e.flags?.forEach(i=>{S.setFlag(i,!0);}),e.main?.forEach(i=>{this.base.set(i.key,i.value);}),e.tempDeadlines?.forEach(i=>{this.tempStorageDeadlines.set(i.key,i.value);})):pt.warn("No storage data found");}catch(i){pt.error("Error importing data",i);}}};var Vt=class{constructor(e,i){E(this,"id");E(this,"categoryId");this.categoryId=e,this.id=i,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let i=S.getVariable(st,e);i&&(Object.entries(i).forEach(([s,r])=>{typeof r=="object"&&r!==null&&Object.entries(r).forEach(([o,a])=>{S.setVariable(this.categoryId,`${s}:${o}`,a);});}),S.removeVariable(st,e));}setStorageProperty(e,i){S.setVariable(this.categoryId,`${this.id}:${e}`,i);}getStorageProperty(e,i=this.id){return S.getVariable(this.categoryId,`${i}:${e}`)}};var Ve=new Dt;exports.StorageRegistry=S;exports.StoredClassModel=Vt;exports.storage=Ve;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');var te=Object.defineProperty;var Ht=u=>{throw TypeError(u)};var ee=(u,e,i)=>e in u?te(u,e,{enumerable:true,configurable:true,writable:true,value:i}):u[e]=i;var E=(u,e,i)=>ee(u,typeof e!="symbol"?e+"":e,i),Ut=(u,e,i)=>e.has(u)||Ht("Cannot "+i);var t=(u,e,i)=>(Ut(u,e,"read from private field"),i?i.call(u):e.get(u)),d=(u,e,i)=>e.has(u)?Ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,i),f=(u,e,i,s)=>(Ut(u,e,"write to private field"),e.set(u,i),i),l=(u,e,i)=>(Ut(u,e,"access private method"),i);var It=(u,e,i,s)=>({set _(r){f(u,e,r);},get _(){return t(u,e,s)}});var st="storage",ht="temp",H="narration",Nt="flags",j={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ie=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bt=new Set,zt=typeof process=="object"&&process?process:{},Xt=(u,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(u,e,i,s):console.error(`[${i}] ${e}: ${u}`);},Gt=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Gt>"u"){jt=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Gt=class{constructor(){E(this,"signal",new jt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let u=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{u&&(u=false,Xt("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 se=u=>!Bt.has(u);var rt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u),Jt=u=>rt(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?Ft:null:null,Ft=class extends Array{constructor(u){super(u),this.fill(0);}},et,dt,re=(et=class{constructor(e,i){E(this,"heap");E(this,"length");if(!t(et,dt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=Jt(e);if(!i)return [];f(et,dt,true);let s=new et(e,i);return f(et,dt,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},dt=new WeakMap,d(et,dt,false),et),$t,kt,$,z,k,ct,B,St,mt,X,D,J,R,v,p,V,Y,C,N,q,F,Q,Z,P,K,tt,lt,L,Et,n,Yt,ut,it,vt,W,Qt,ft,Tt,xt,at,ot,Pt,Ct,Mt,w,Kt,wt,nt,Wt,bt,qt=(bt=class{constructor(e){d(this,n);d(this,$);d(this,z);d(this,k);d(this,ct);d(this,B);d(this,St);d(this,mt);d(this,X);E(this,"ttl");E(this,"ttlResolution");E(this,"ttlAutopurge");E(this,"updateAgeOnGet");E(this,"updateAgeOnHas");E(this,"allowStale");E(this,"noDisposeOnSet");E(this,"noUpdateTTL");E(this,"maxEntrySize");E(this,"sizeCalculation");E(this,"noDeleteOnFetchRejection");E(this,"noDeleteOnStaleGet");E(this,"allowStaleOnFetchAbort");E(this,"allowStaleOnFetchRejection");E(this,"ignoreFetchAbort");d(this,D);d(this,J);d(this,R);d(this,v);d(this,p);d(this,V);d(this,Y);d(this,C);d(this,N);d(this,q);d(this,F);d(this,Q);d(this,Z);d(this,P);d(this,K);d(this,tt);d(this,lt);d(this,L);d(this,Et);d(this,ut,()=>{});d(this,it,()=>{});d(this,vt,()=>{});d(this,W,()=>false);d(this,ft,e=>{});d(this,Tt,(e,i,s)=>{});d(this,xt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});E(this,$t,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:m,onInsert:I,disposeAfter:g,noDisposeOnSet:A,noUpdateTTL:b,maxSize:T=0,maxEntrySize:y=0,sizeCalculation:O,fetchMethod:_,memoMethod:M,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:Ot,ignoreFetchAbort:pt,perf:gt}=e;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,gt??ie),i!==0&&!rt(i))throw new TypeError("max option must be a nonnegative integer");let _t=i?Jt(i):Array;if(!_t)throw new Error("invalid max value: "+i);if(f(this,$,i),f(this,z,T),this.maxEntrySize=y||t(this,z),this.sizeCalculation=O,this.sizeCalculation){if(!t(this,z)&&!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(M!==void 0&&typeof M!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,mt,M),_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,St,_),f(this,lt,!!_),f(this,R,new Map),f(this,v,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,V,new _t(i)),f(this,Y,new _t(i)),f(this,C,0),f(this,N,0),f(this,q,re.create(i)),f(this,D,0),f(this,J,0),typeof m=="function"&&f(this,k,m),typeof I=="function"&&f(this,ct,I),typeof g=="function"?(f(this,B,g),f(this,F,[])):(f(this,B,void 0),f(this,F,void 0)),f(this,tt,!!t(this,k)),f(this,Et,!!t(this,ct)),f(this,L,!!t(this,B)),this.noDisposeOnSet=!!A,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!Ot,this.ignoreFetchAbort=!!pt,this.maxEntrySize!==0){if(t(this,z)!==0&&!rt(t(this,z)))throw new TypeError("maxSize must be a positive integer if specified");if(!rt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,n,Qt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=rt(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!rt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,n,Yt).call(this);}if(t(this,$)===0&&this.ttl===0&&t(this,z)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,$)&&!t(this,z)){let Lt="LRU_CACHE_UNBOUNDED";se(Lt)&&(Bt.add(Lt),Xt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,bt));}}get perf(){return t(this,X)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,P),autopurgeTimers:t(e,K),sizes:t(e,Q),keyMap:t(e,R),keyList:t(e,v),valList:t(e,p),next:t(e,V),prev:t(e,Y),get head(){return t(e,C)},get tail(){return t(e,N)},free:t(e,q),isBackgroundFetch:i=>{var s;return l(s=e,n,w).call(s,i)},backgroundFetch:(i,s,r,o)=>{var a;return l(a=e,n,Mt).call(a,i,s,r,o)},moveToTail:i=>{var s;return l(s=e,n,wt).call(s,i)},indexes:i=>{var s;return l(s=e,n,at).call(s,i)},rindexes:i=>{var s;return l(s=e,n,ot).call(s,i)},isStale:i=>{var s;return t(s=e,W).call(s,i)}}}get max(){return t(this,$)}get maxSize(){return t(this,z)}get calculatedSize(){return t(this,J)}get size(){return t(this,D)}get fetchMethod(){return t(this,St)}get memoMethod(){return t(this,mt)}get dispose(){return t(this,k)}get onInsert(){return t(this,ct)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,R).has(e)?1/0:0}*entries(){for(let e of l(this,n,at).call(this))t(this,p)[e]!==void 0&&t(this,v)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield [t(this,v)[e],t(this,p)[e]]);}*rentries(){for(let e of l(this,n,ot).call(this))t(this,p)[e]!==void 0&&t(this,v)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield [t(this,v)[e],t(this,p)[e]]);}*keys(){for(let e of l(this,n,at).call(this)){let i=t(this,v)[e];i!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield i);}}*rkeys(){for(let e of l(this,n,ot).call(this)){let i=t(this,v)[e];i!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield i);}}*values(){for(let e of l(this,n,at).call(this))t(this,p)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}*rvalues(){for(let e of l(this,n,ot).call(this))t(this,p)[e]!==void 0&&!l(this,n,w).call(this,t(this,p)[e])&&(yield t(this,p)[e]);}[(kt=Symbol.iterator,$t=Symbol.toStringTag,kt)](){return this.entries()}find(e,i={}){for(let s of l(this,n,at).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&e(o,t(this,v)[s],this))return this.get(t(this,v)[s],i)}}forEach(e,i=this){for(let s of l(this,n,at).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,v)[s],this);}}rforEach(e,i=this){for(let s of l(this,n,ot).call(this)){let r=t(this,p)[s],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,v)[s],this);}}purgeStale(){let e=false;for(let i of l(this,n,ot).call(this,{allowStale:true}))t(this,W).call(this,i)&&(l(this,n,nt).call(this,t(this,v)[i],"expire"),e=true);return e}info(e){let i=t(this,R).get(e);if(i===void 0)return;let s=t(this,p)[i],r=l(this,n,w).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let o={value:r};if(t(this,P)&&t(this,Z)){let a=t(this,P)[i],h=t(this,Z)[i];if(a&&h){let c=a-(t(this,X).now()-h);o.ttl=c,o.start=Date.now();}}return t(this,Q)&&(o.size=t(this,Q)[i]),o}dump(){let e=[];for(let i of l(this,n,at).call(this,{allowStale:true})){let s=t(this,v)[i],r=t(this,p)[i],o=l(this,n,w).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||s===void 0)continue;let a={value:o};if(t(this,P)&&t(this,Z)){a.ttl=t(this,P)[i];let h=t(this,X).now()-t(this,Z)[i];a.start=Math.floor(Date.now()-h);}t(this,Q)&&(a.size=t(this,Q)[i]),e.unshift([s,a]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,X).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var A,b,T,y;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s,{noUpdateTTL:m=this.noUpdateTTL}=s,I=t(this,xt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&I>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),l(this,n,nt).call(this,e,"set"),this;let g=t(this,D)===0?void 0:t(this,R).get(e);if(g===void 0)g=t(this,D)===0?t(this,N):t(this,q).length!==0?t(this,q).pop():t(this,D)===t(this,$)?l(this,n,Ct).call(this,false):t(this,D),t(this,v)[g]=e,t(this,p)[g]=i,t(this,R).set(e,g),t(this,V)[t(this,N)]=g,t(this,Y)[g]=t(this,N),f(this,N,g),It(this,D)._++,t(this,Tt).call(this,g,I,c),c&&(c.set="add"),m=false,t(this,Et)&&((A=t(this,ct))==null||A.call(this,i,e,"add"));else {l(this,n,wt).call(this,g);let O=t(this,p)[g];if(i!==O){if(t(this,lt)&&l(this,n,w).call(this,O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:_}=O;_!==void 0&&!a&&(t(this,tt)&&((b=t(this,k))==null||b.call(this,_,e,"set")),t(this,L)&&t(this,F)?.push([_,e,"set"]));}else a||(t(this,tt)&&((T=t(this,k))==null||T.call(this,O,e,"set")),t(this,L)&&t(this,F)?.push([O,e,"set"]));if(t(this,ft).call(this,g),t(this,Tt).call(this,g,I,c),t(this,p)[g]=i,c){c.set="replace";let _=O&&l(this,n,w).call(this,O)?O.__staleWhileFetching:O;_!==void 0&&(c.oldValue=_);}}else c&&(c.set="update");t(this,Et)&&this.onInsert?.(i,e,i===O?"update":"replace");}if(r!==0&&!t(this,P)&&l(this,n,Yt).call(this),t(this,P)&&(m||t(this,vt).call(this,g,r,o),c&&t(this,it).call(this,c,g)),!a&&t(this,L)&&t(this,F)){let O=t(this,F),_;for(;_=O?.shift();)(y=t(this,B))==null||y.call(this,..._);}return this}pop(){var e;try{for(;t(this,D);){let i=t(this,p)[t(this,C)];if(l(this,n,Ct).call(this,!0),l(this,n,w).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,L)&&t(this,F)){let i=t(this,F),s;for(;s=i?.shift();)(e=t(this,B))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,o=t(this,R).get(e);if(o!==void 0){let a=t(this,p)[o];if(l(this,n,w).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(t(this,W).call(this,o))r&&(r.has="stale",t(this,it).call(this,r,o));else return s&&t(this,ut).call(this,o),r&&(r.has="hit",t(this,it).call(this,r,o)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,R).get(e);if(r===void 0||!s&&t(this,W).call(this,r))return;let o=t(this,p)[r];return l(this,n,w).call(this,o)?o.__staleWhileFetching:o}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:m=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:y,forceRefresh:O=false,status:_,signal:M}=i;if(!t(this,lt))return _&&(_.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:_});let U={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:m,noUpdateTTL:I,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:T,ignoreFetchAbort:b,status:_,signal:M},G=t(this,R).get(e);if(G===void 0){_&&(_.fetch="miss");let x=l(this,n,Mt).call(this,e,G,U,y);return x.__returned=x}else {let x=t(this,p)[G];if(l(this,n,w).call(this,x)){let _t=s&&x.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",_t&&(_.returnedStale=true)),_t?x.__staleWhileFetching:x.__returned=x}let Ot=t(this,W).call(this,G);if(!O&&!Ot)return _&&(_.fetch="hit"),l(this,n,wt).call(this,G),r&&t(this,ut).call(this,G),_&&t(this,it).call(this,_,G),x;let pt=l(this,n,Mt).call(this,e,G,U,y),gt=pt.__staleWhileFetching!==void 0&&s;return _&&(_.fetch=Ot?"stale":"refresh",gt&&Ot&&(_.returnedStale=true)),gt?pt.__staleWhileFetching:pt.__returned=pt}}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,mt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...a}=i,h=this.get(e,a);if(!o&&h!==void 0)return h;let c=s(e,h,{options:a,context:r});return this.set(e,c,a),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=i,h=t(this,R).get(e);if(h!==void 0){let c=t(this,p)[h],m=l(this,n,w).call(this,c);return a&&t(this,it).call(this,a,h),t(this,W).call(this,h)?(a&&(a.get="stale"),m?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(o||l(this,n,nt).call(this,e,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),m?c.__staleWhileFetching:(l(this,n,wt).call(this,h),r&&t(this,ut).call(this,h),c))}else a&&(a.get="miss");}delete(e){return l(this,n,nt).call(this,e,"delete")}clear(){return l(this,n,Wt).call(this,"delete")}},$=new WeakMap,z=new WeakMap,k=new WeakMap,ct=new WeakMap,B=new WeakMap,St=new WeakMap,mt=new WeakMap,X=new WeakMap,D=new WeakMap,J=new WeakMap,R=new WeakMap,v=new WeakMap,p=new WeakMap,V=new WeakMap,Y=new WeakMap,C=new WeakMap,N=new WeakMap,q=new WeakMap,F=new WeakMap,Q=new WeakMap,Z=new WeakMap,P=new WeakMap,K=new WeakMap,tt=new WeakMap,lt=new WeakMap,L=new WeakMap,Et=new WeakMap,n=new WeakSet,Yt=function(){let e=new Ft(t(this,$)),i=new Ft(t(this,$));f(this,P,e),f(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,$)):void 0;f(this,K,s),f(this,vt,(h,c,m=t(this,X).now())=>{i[h]=c!==0?m:0,e[h]=c,r(h,c);}),f(this,ut,h=>{i[h]=e[h]!==0?t(this,X).now():0,r(h,e[h]);});let r=this.ttlAutopurge?(h,c)=>{if(s?.[h]&&(clearTimeout(s[h]),s[h]=void 0),c&&c!==0&&s){let m=setTimeout(()=>{t(this,W).call(this,h)&&l(this,n,nt).call(this,t(this,v)[h],"expire");},c+1);m.unref&&m.unref(),s[h]=m;}}:()=>{};f(this,it,(h,c)=>{if(e[c]){let m=e[c],I=i[c];if(!m||!I)return;h.ttl=m,h.start=I,h.now=o||a();let g=h.now-I;h.remainingTTL=m-g;}});let o=0,a=()=>{let h=t(this,X).now();if(this.ttlResolution>0){o=h;let c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref();}return h};this.getRemainingTTL=h=>{let c=t(this,R).get(h);if(c===void 0)return 0;let m=e[c],I=i[c];if(!m||!I)return 1/0;let g=(o||a())-I;return m-g},f(this,W,h=>{let c=i[h],m=e[h];return !!m&&!!c&&(o||a())-c>m});},ut=new WeakMap,it=new WeakMap,vt=new WeakMap,W=new WeakMap,Qt=function(){let e=new Ft(t(this,$));f(this,J,0),f(this,Q,e),f(this,ft,i=>{f(this,J,t(this,J)-e[i]),e[i]=0;}),f(this,xt,(i,s,r,o)=>{if(l(this,n,w).call(this,s))return 0;if(!rt(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(s,i),!rt(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,Tt,(i,s,r)=>{if(e[i]=s,t(this,z)){let o=t(this,z)-e[i];for(;t(this,J)>o;)l(this,n,Ct).call(this,true);}f(this,J,t(this,J)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,J));});},ft=new WeakMap,Tt=new WeakMap,xt=new WeakMap,at=function*({allowStale:e=this.allowStale}={}){if(t(this,D))for(let i=t(this,N);!(!l(this,n,Pt).call(this,i)||((e||!t(this,W).call(this,i))&&(yield i),i===t(this,C)));)i=t(this,Y)[i];},ot=function*({allowStale:e=this.allowStale}={}){if(t(this,D))for(let i=t(this,C);!(!l(this,n,Pt).call(this,i)||((e||!t(this,W).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,V)[i];},Pt=function(e){return e!==void 0&&t(this,R).get(t(this,v)[e])===e},Ct=function(e){var o;let i=t(this,C),s=t(this,v)[i],r=t(this,p)[i];return t(this,lt)&&l(this,n,w).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((o=t(this,k))==null||o.call(this,r,s,"evict")),t(this,L)&&t(this,F)?.push([r,s,"evict"])),t(this,ft).call(this,i),t(this,K)?.[i]&&(clearTimeout(t(this,K)[i]),t(this,K)[i]=void 0),e&&(t(this,v)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,D)===1?(f(this,C,f(this,N,0)),t(this,q).length=0):f(this,C,t(this,V)[i]),t(this,R).delete(s),It(this,D)._--,i},Mt=function(e,i,s,r){let o=i===void 0?void 0:t(this,p)[i];if(l(this,n,w).call(this,o))return o;let a=new Gt,{signal:h}=s;h?.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:r},m=(y,O=false)=>{let{aborted:_}=a.signal,M=s.ignoreFetchAbort&&y!==void 0,U=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(_&&!O?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,M&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),_&&!M&&!O)return g(a.signal.reason,U);let G=b,x=t(this,p)[i];return (x===b||M&&O&&x===void 0)&&(y===void 0?G.__staleWhileFetching!==void 0?t(this,p)[i]=G.__staleWhileFetching:l(this,n,nt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,c.options))),y},I=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),g(y,false)),g=(y,O)=>{let{aborted:_}=a.signal,M=_&&s.allowStaleOnFetchAbort,U=M||s.allowStaleOnFetchRejection,G=U||s.noDeleteOnFetchRejection,x=b;if(t(this,p)[i]===b&&(!G||!O&&x.__staleWhileFetching===void 0?l(this,n,nt).call(this,e,"fetch"):M||(t(this,p)[i]=x.__staleWhileFetching)),U)return s.status&&x.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw y},A=(y,O)=>{var M;let _=(M=t(this,St))==null?void 0:M.call(this,e,o,c);_&&_ instanceof Promise&&_.then(U=>y(U===void 0?void 0:U),O),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=U=>m(U,true)));});};s.status&&(s.status.fetchDispatched=true);let b=new Promise(A).then(m,I),T=Object.assign(b,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(e,T,{...c.options,status:void 0}),i=t(this,R).get(e)):t(this,p)[i]=T,T},w=function(e){if(!t(this,lt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Gt},Kt=function(e,i){t(this,Y)[i]=e,t(this,V)[e]=i;},wt=function(e){e!==t(this,N)&&(e===t(this,C)?f(this,C,t(this,V)[e]):l(this,n,Kt).call(this,t(this,Y)[e],t(this,V)[e]),l(this,n,Kt).call(this,t(this,N),e),f(this,N,e));},nt=function(e,i){var r,o;let s=false;if(t(this,D)!==0){let a=t(this,R).get(e);if(a!==void 0)if(t(this,K)?.[a]&&(clearTimeout(t(this,K)?.[a]),t(this,K)[a]=void 0),s=true,t(this,D)===1)l(this,n,Wt).call(this,i);else {t(this,ft).call(this,a);let h=t(this,p)[a];if(l(this,n,w).call(this,h)?h.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,L))&&(t(this,tt)&&((r=t(this,k))==null||r.call(this,h,e,i)),t(this,L)&&t(this,F)?.push([h,e,i])),t(this,R).delete(e),t(this,v)[a]=void 0,t(this,p)[a]=void 0,a===t(this,N))f(this,N,t(this,Y)[a]);else if(a===t(this,C))f(this,C,t(this,V)[a]);else {let c=t(this,Y)[a];t(this,V)[c]=t(this,V)[a];let m=t(this,V)[a];t(this,Y)[m]=t(this,Y)[a];}It(this,D)._--,t(this,q).push(a);}}if(t(this,L)&&t(this,F)?.length){let a=t(this,F),h;for(;h=a?.shift();)(o=t(this,B))==null||o.call(this,...h);}return s},Wt=function(e){var i,s;for(let r of l(this,n,ot).call(this,{allowStale:true})){let o=t(this,p)[r];if(l(this,n,w).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=t(this,v)[r];t(this,tt)&&((i=t(this,k))==null||i.call(this,o,a,e)),t(this,L)&&t(this,F)?.push([o,a,e]);}}if(t(this,R).clear(),t(this,p).fill(void 0),t(this,v).fill(void 0),t(this,P)&&t(this,Z)){t(this,P).fill(0),t(this,Z).fill(0);for(let r of t(this,K)??[])r!==void 0&&clearTimeout(r);t(this,K)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),f(this,C,0),f(this,N,0),t(this,q).length=0,f(this,J,0),f(this,D,0),t(this,L)&&t(this,F)){let r=t(this,F),o;for(;o=r?.shift();)(s=t(this,B))==null||s.call(this,...o);}},bt);var At=class{constructor(e){E(this,"cache");E(this,"map",new Map);this.cache=new qt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var yt;(r=>(r.log=(o,...a)=>console.log(`[Pixi\u2019VN] ${o}`,...a),r.warn=(o,...a)=>console.warn(`[Pixi\u2019VN] ${o}`,...a),r.error=(o,...a)=>console.error(`[Pixi\u2019VN] ${o}`,...a),r.info=(o,...a)=>console.info(`[Pixi\u2019VN] ${o}`,...a)))(yt||={});function Rt(u){try{if(typeof u>"u")return u;let e=JSON.stringify(u);return JSON.parse(e)}catch(e){throw yt.error("Error creating exportable element",u,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Zt;(g=>{g.storage=new At({cacheSize:50}),g.defaultStorage=new At({cacheSize:10}),g.tempStorageDeadlines=new Map;let s;function r(A){g.tempStorageDeadlines.forEach((b,T)=>{b>A&&(g.storage.delete(`${ht}:${T}`),s?.onClearOldTempVariable?.(T),g.tempStorageDeadlines.delete(T));});}g.clearOldTempVariables=r;function o(A){s=A;}g.setExternalStoreHandler=o;function a(A,b,T){T==null?g.storage.delete(`${A}:${b}`):g.storage.set(`${A}:${b}`,T),s?.onSetVariable?.(b,T);}g.setVariable=a;function h(A,b){let T=g.storage.get(`${A}:${b}`);return Rt(T)}g.getVariable=h;function c(A,b){g.storage.delete(`${A}:${b}`),s?.onRemoveVariable?.(b);}g.removeVariable=c;function m(A,b){let T=g.storage.get(Nt)||[];if(b)T.includes(A)||T.push(A);else {let y=T.indexOf(A);y>-1&&T.splice(y,1);}g.storage.set(Nt,T);}g.setFlag=m;function I(A){return (g.storage.get(Nt)||[]).includes(A)}g.getFlag=I;})(Zt||={});var S=Zt;var Dt=class{get base(){return S.storage.map}get cache(){return S.storage.cache}get tempStorageDeadlines(){return S.tempStorageDeadlines}set default(e){Object.entries(e).forEach(([i,s])=>{S.defaultStorage.map.set(i,s);});}set(e,i){return S.setVariable(st,e,i)}get(e){let i=S.getVariable(ht,e);return i===void 0&&(i=S.getVariable(st,e)),i===void 0&&(i=Rt(S.defaultStorage.get(e))),i}remove(e){return this.removeTempVariable(e),S.removeVariable(st,e)}setTempVariable(e,i){if(i==null){this.removeTempVariable(e);return}else S.setVariable(ht,e,i),this.tempStorageDeadlines.has(e)||this.tempStorageDeadlines.set(e,core.GameUnifier.openedLabels);}removeTempVariable(e){S.removeVariable(ht,e),this.tempStorageDeadlines.has(e)&&this.tempStorageDeadlines.delete(e);}setFlag(e,i){return S.setFlag(e,i)}getFlag(e){return S.getFlag(e)}setStorageHandler(e){S.setExternalStoreHandler(e);}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let e=[];[...this.base.keys()].forEach(s=>{e.push({key:s,value:this.base.get(s)});});let i=[];return [...S.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:this.tempStorageDeadlines.get(s)});}),Rt({main:e,tempDeadlines:i})}restore(e){this.clear();try{e?(e.base?.forEach(i=>{switch(i.key){case "___current_dialogue_memory___":S.setVariable(H,j.CURRENT_DIALOGUE_MEMORY_KEY,i.value);break;case "___last_dialogue_added_in_step_memory___":S.setVariable(H,j.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_menu_options_memory___":S.setVariable(H,j.CURRENT_MENU_OPTIONS_MEMORY_KEY,i.value);break;case "___last_menu_options_added_in_step_memory___":S.setVariable(H,j.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "_input_value_":S.setVariable(H,j.CURRENT_INPUT_VALUE_MEMORY_KEY,i.value);break;case "___last_input_added_in_step_memory___":S.setVariable(H,j.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_input_info_memory___":S.setVariable(H,j.CURRENT_INPUT_INFO_MEMORY_KEY,i.value);break;case "___opened_labels_counter___":S.setVariable(H,j.OPENED_LABELS_COUNTER_KEY,i.value);break;case "___all_choices_made___":S.setVariable(H,j.ALL_CHOICES_MADE_KEY,i.value);break;case "___current_step_times_counter___":S.setVariable(H,j.CURRENT_STEP_TIMES_COUNTER_KEY,i.value);break;case "___last_step_glued___":S.setVariable(H,j.LAST_STEP_GLUED,i.value);break;default:S.setVariable(st,i.key,i.value);}}),e.temp?.forEach(i=>{S.setVariable(ht,i.key,i.value);}),e.flags?.forEach(i=>{S.setFlag(i,!0);}),e.main?.forEach(i=>{this.base.set(i.key,i.value);}),e.tempDeadlines?.forEach(i=>{this.tempStorageDeadlines.set(i.key,i.value);})):yt.warn("No storage data found");}catch(i){yt.error("Error importing data",i);}}};var Vt=class{constructor(e,i){E(this,"id");E(this,"categoryId");this.categoryId=e,this.id=i,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let i=S.getVariable(st,e);i&&(Object.entries(i).forEach(([s,r])=>{typeof r=="object"&&r!==null&&Object.entries(r).forEach(([o,a])=>{S.setVariable(this.categoryId,`${s}:${o}`,a);});}),S.removeVariable(st,e));}setStorageProperty(e,i){S.setVariable(this.categoryId,`${this.id}:${e}`,i);}getStorageProperty(e,i=this.id){return S.getVariable(this.categoryId,`${i}:${e}`)}};var Ve=new Dt;exports.StorageRegistry=S;exports.StoredClassModel=Vt;exports.storage=Ve;
|
package/dist/storage.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
2
|
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
3
3
|
export { a as StorageObjectType } from './StorageElementType-C7ETezlL.cjs';
|
|
4
|
-
|
|
4
|
+
import { S as StorageGameState } from './StorageGameState-CtjNJpvE.cjs';
|
|
5
|
+
export { S as StoredClassModel } from './StoredClassModel-Bykjdn8S.cjs';
|
|
5
6
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.cjs';
|
|
6
7
|
|
|
7
8
|
interface StorageExternalStoreHandler {
|
|
@@ -22,30 +23,6 @@ interface StorageExternalStoreHandler {
|
|
|
22
23
|
onRemoveVariable?: (key: string) => void;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
interface StorageGameStateItem<T = StorageElementType> {
|
|
26
|
-
key: string;
|
|
27
|
-
value: T;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Interface exported storage data
|
|
31
|
-
*/
|
|
32
|
-
type StorageGameState = {
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
base?: StorageGameStateItem[];
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated
|
|
39
|
-
*/
|
|
40
|
-
temp?: StorageGameStateItem[];
|
|
41
|
-
tempDeadlines: StorageGameStateItem<number>[];
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
flags?: string[];
|
|
46
|
-
main: StorageGameStateItem[];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
26
|
interface StorageManagerInterface {
|
|
50
27
|
/**
|
|
51
28
|
* The internal storage. **Do not modify this directly.**
|
|
@@ -126,7 +103,7 @@ interface StorageManagerInterface {
|
|
|
126
103
|
* Call this at any time to start/stop mirroring.
|
|
127
104
|
* @param value The handler to set. If undefined, the handler will be removed.
|
|
128
105
|
* @example
|
|
129
|
-
* ```
|
|
106
|
+
* ```ts
|
|
130
107
|
* import { Store } from '@tanstack/store'
|
|
131
108
|
*
|
|
132
109
|
* // Create a TanStack store that mirrors the game storage variables
|
|
@@ -190,4 +167,4 @@ declare namespace StorageRegistry {
|
|
|
190
167
|
|
|
191
168
|
declare const storage: StorageManagerInterface;
|
|
192
169
|
|
|
193
|
-
export { StorageElementType, type StorageExternalStoreHandler,
|
|
170
|
+
export { StorageElementType, type StorageExternalStoreHandler, StorageGameState, type StorageManagerInterface, StorageRegistry, storage };
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
2
|
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
3
3
|
export { a as StorageObjectType } from './StorageElementType-C7ETezlL.js';
|
|
4
|
-
|
|
4
|
+
import { S as StorageGameState } from './StorageGameState-BJy57o6K.js';
|
|
5
|
+
export { S as StoredClassModel } from './StoredClassModel-uMifeNzV.js';
|
|
5
6
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.js';
|
|
6
7
|
|
|
7
8
|
interface StorageExternalStoreHandler {
|
|
@@ -22,30 +23,6 @@ interface StorageExternalStoreHandler {
|
|
|
22
23
|
onRemoveVariable?: (key: string) => void;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
interface StorageGameStateItem<T = StorageElementType> {
|
|
26
|
-
key: string;
|
|
27
|
-
value: T;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Interface exported storage data
|
|
31
|
-
*/
|
|
32
|
-
type StorageGameState = {
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
base?: StorageGameStateItem[];
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated
|
|
39
|
-
*/
|
|
40
|
-
temp?: StorageGameStateItem[];
|
|
41
|
-
tempDeadlines: StorageGameStateItem<number>[];
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
flags?: string[];
|
|
46
|
-
main: StorageGameStateItem[];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
26
|
interface StorageManagerInterface {
|
|
50
27
|
/**
|
|
51
28
|
* The internal storage. **Do not modify this directly.**
|
|
@@ -126,7 +103,7 @@ interface StorageManagerInterface {
|
|
|
126
103
|
* Call this at any time to start/stop mirroring.
|
|
127
104
|
* @param value The handler to set. If undefined, the handler will be removed.
|
|
128
105
|
* @example
|
|
129
|
-
* ```
|
|
106
|
+
* ```ts
|
|
130
107
|
* import { Store } from '@tanstack/store'
|
|
131
108
|
*
|
|
132
109
|
* // Create a TanStack store that mirrors the game storage variables
|
|
@@ -190,4 +167,4 @@ declare namespace StorageRegistry {
|
|
|
190
167
|
|
|
191
168
|
declare const storage: StorageManagerInterface;
|
|
192
169
|
|
|
193
|
-
export { StorageElementType, type StorageExternalStoreHandler,
|
|
170
|
+
export { StorageElementType, type StorageExternalStoreHandler, StorageGameState, type StorageManagerInterface, StorageRegistry, storage };
|
package/dist/storage.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as StorageRegistry,b as StoredClassModel,c as storage}from'./chunk-
|
|
1
|
+
export{a as StorageRegistry,b as StoredClassModel,c as storage}from'./chunk-BQRPDCUT.mjs';import'./chunk-IWAXXFXE.mjs';import'./chunk-3M6A7TU2.mjs';
|
package/dist/vite-listener.d.cts
CHANGED
|
@@ -17,7 +17,7 @@ declare function isViteDevelopmentMode(): boolean;
|
|
|
17
17
|
* typically in your client-side initialization code.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
|
-
* ```
|
|
20
|
+
* ```ts
|
|
21
21
|
* // In your main game initialization file
|
|
22
22
|
* import { setupPixivnViteData } from '@drincs/pixi-vn/vite-listener';
|
|
23
23
|
*
|
package/dist/vite-listener.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare function isViteDevelopmentMode(): boolean;
|
|
|
17
17
|
* typically in your client-side initialization code.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
|
-
* ```
|
|
20
|
+
* ```ts
|
|
21
21
|
* // In your main game initialization file
|
|
22
22
|
* import { setupPixivnViteData } from '@drincs/pixi-vn/vite-listener';
|
|
23
23
|
*
|
package/dist/vite.d.cts
CHANGED
|
@@ -73,7 +73,7 @@ interface VitePluginPixivnOptions {
|
|
|
73
73
|
* loading. Await this before generating JSON files.
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
|
-
* ```
|
|
76
|
+
* ```ts
|
|
77
77
|
* // vite.config.ts
|
|
78
78
|
* import { defineConfig } from "vite";
|
|
79
79
|
* import { vitePluginPixivn } from "@drincs/pixi-vn/vite";
|
package/dist/vite.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface VitePluginPixivnOptions {
|
|
|
73
73
|
* loading. Await this before generating JSON files.
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
|
-
* ```
|
|
76
|
+
* ```ts
|
|
77
77
|
* // vite.config.ts
|
|
78
78
|
* import { defineConfig } from "vite";
|
|
79
79
|
* import { vitePluginPixivn } from "@drincs/pixi-vn/vite";
|
package/package.json
CHANGED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
-
import { Difference } from 'microdiff';
|
|
3
|
-
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
4
|
-
|
|
5
|
-
type CloseType = "close";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* is a string containing the name of the label.
|
|
9
|
-
* It is used to {@link narration.registeredLabels} to get the label class.
|
|
10
|
-
*/
|
|
11
|
-
type LabelIdType = string;
|
|
12
|
-
|
|
13
|
-
type LabelRunModeType = "call" | "jump";
|
|
14
|
-
|
|
15
|
-
interface ChoiceOptionInterface extends Omit<ChoiceInterface, "label" | "type" | "closeCurrentLabel"> {
|
|
16
|
-
/**
|
|
17
|
-
* Label Id to be opened when the option is selected
|
|
18
|
-
*/
|
|
19
|
-
label: LabelIdType;
|
|
20
|
-
/**
|
|
21
|
-
* Type of the label to be opened
|
|
22
|
-
*/
|
|
23
|
-
type: LabelRunModeType;
|
|
24
|
-
}
|
|
25
|
-
interface CloseChoiceOptionInterface extends Omit<ChoiceInterface, "label" | "type" | "closeCurrentLabel"> {
|
|
26
|
-
/**
|
|
27
|
-
* Type of the label to be opened
|
|
28
|
-
*/
|
|
29
|
-
type: CloseType;
|
|
30
|
-
/**
|
|
31
|
-
* If true, the current label will be closed
|
|
32
|
-
*/
|
|
33
|
-
closeCurrentLabel?: boolean;
|
|
34
|
-
}
|
|
35
|
-
type StoredChoiceInterface = ChoiceOptionInterface | CloseChoiceOptionInterface;
|
|
36
|
-
type StoredIndexedChoiceInterface = StoredChoiceInterface & {
|
|
37
|
-
/**
|
|
38
|
-
* Is the index of the choice in the menu. It is used to identify the choice when it is selected.
|
|
39
|
-
*/
|
|
40
|
-
choiceIndex: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Result of a {@link StepLabelType} execution.
|
|
45
|
-
*
|
|
46
|
-
* - `StepLabelResult`: a structured result consumed by the narration engine.
|
|
47
|
-
* - `void`: the step completed without returning an explicit result.
|
|
48
|
-
* - `string`: a simple token or message interpreted by higher-level logic.
|
|
49
|
-
*
|
|
50
|
-
* Prefer returning a well-typed {@link StepLabelResult} for anything that
|
|
51
|
-
* needs to be consumed programmatically. Use plain strings only where a
|
|
52
|
-
* lightweight, convention-based signal is sufficient and clearly documented
|
|
53
|
-
* by the surrounding game logic.
|
|
54
|
-
*/
|
|
55
|
-
type StepLabelResultType = StepLabelResult | void | string;
|
|
56
|
-
type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
|
|
57
|
-
/**
|
|
58
|
-
* StepLabel is a function that will be executed as the game continues.
|
|
59
|
-
*/
|
|
60
|
-
type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
61
|
-
/**
|
|
62
|
-
* The id of the label.
|
|
63
|
-
*/
|
|
64
|
-
labelId: string;
|
|
65
|
-
}) => StepLabelResultType | Promise<StepLabelResultType>;
|
|
66
|
-
|
|
67
|
-
interface DialogueInterface {
|
|
68
|
-
/**
|
|
69
|
-
* The text of the dialogue.
|
|
70
|
-
*/
|
|
71
|
-
text: string | string[];
|
|
72
|
-
/**
|
|
73
|
-
* The id of the character that is speaking.
|
|
74
|
-
*/
|
|
75
|
-
character?: CharacterInterface | string;
|
|
76
|
-
}
|
|
77
|
-
type StoredDialogue = Omit<DialogueInterface, "character"> & {
|
|
78
|
-
character: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
interface HistoryStep {
|
|
82
|
-
/**
|
|
83
|
-
* The difference between the previous step and the current step.
|
|
84
|
-
*/
|
|
85
|
-
diff?: Difference[];
|
|
86
|
-
/**
|
|
87
|
-
* The label id of the current step.
|
|
88
|
-
*/
|
|
89
|
-
currentLabel?: LabelIdType;
|
|
90
|
-
/**
|
|
91
|
-
* The sha1 of the step function.
|
|
92
|
-
*/
|
|
93
|
-
stepSha1: string;
|
|
94
|
-
/**
|
|
95
|
-
* Equivalent to the narration.stepCounter
|
|
96
|
-
*/
|
|
97
|
-
index: number;
|
|
98
|
-
/**
|
|
99
|
-
* The data of the step of the label.
|
|
100
|
-
*/
|
|
101
|
-
labelStepIndex: number | null;
|
|
102
|
-
/**
|
|
103
|
-
* Dialogue to be shown in the game
|
|
104
|
-
*/
|
|
105
|
-
dialogue?: StoredDialogue;
|
|
106
|
-
/**
|
|
107
|
-
* List of choices asked of the player
|
|
108
|
-
*/
|
|
109
|
-
choices?: StoredChoiceInterface[];
|
|
110
|
-
/**
|
|
111
|
-
* List of choices already made by the player
|
|
112
|
-
*/
|
|
113
|
-
alreadyMadeChoices?: number[];
|
|
114
|
-
/**
|
|
115
|
-
* The input value of the player
|
|
116
|
-
*/
|
|
117
|
-
inputValue?: StorageElementType;
|
|
118
|
-
/**
|
|
119
|
-
* The choice made by the player
|
|
120
|
-
*/
|
|
121
|
-
choiceIndexMade?: number;
|
|
122
|
-
/**
|
|
123
|
-
* If true, the current dialogue will be glued to the previous one.
|
|
124
|
-
*/
|
|
125
|
-
isGlued?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Opened Labels in the current step.
|
|
128
|
-
*/
|
|
129
|
-
openedLabels?: OpenedLabel[];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
interface OpenedLabel {
|
|
133
|
-
label: LabelIdType;
|
|
134
|
-
currentStepIndex: number;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface NarrationHistory {
|
|
138
|
-
/**
|
|
139
|
-
* Dialogue to be shown in the game
|
|
140
|
-
*/
|
|
141
|
-
dialogue?: DialogueInterface;
|
|
142
|
-
/**
|
|
143
|
-
* List of choices asked of the player
|
|
144
|
-
*/
|
|
145
|
-
choices?: HistoryChoiceMenuOption[];
|
|
146
|
-
/**
|
|
147
|
-
* The player made a choice
|
|
148
|
-
*/
|
|
149
|
-
playerMadeChoice?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* The index of the step in the history.
|
|
152
|
-
*/
|
|
153
|
-
stepIndex: number;
|
|
154
|
-
/**
|
|
155
|
-
* The input value of the player
|
|
156
|
-
*/
|
|
157
|
-
inputValue?: StorageElementType;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
|
|
162
|
-
*/
|
|
163
|
-
type HistoryChoiceMenuOption = {
|
|
164
|
-
/**
|
|
165
|
-
* Text to be displayed in the menu
|
|
166
|
-
*/
|
|
167
|
-
text: string | string[];
|
|
168
|
-
/**
|
|
169
|
-
* Method used to open the label, or close the menu.
|
|
170
|
-
*/
|
|
171
|
-
type: CloseType | LabelRunModeType;
|
|
172
|
-
/**
|
|
173
|
-
* This choice is a response
|
|
174
|
-
*/
|
|
175
|
-
isResponse: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* The choice is hidden
|
|
178
|
-
*/
|
|
179
|
-
hidden: boolean;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryChoiceMenuOption as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelPropsType as S, CloseChoiceOptionInterface as a, CloseType as b, HistoryStep as c, LabelRunModeType as d, StepLabelResultType as e, StepLabelType as f, StoredChoiceInterface as g, StoredIndexedChoiceInterface as h };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
-
import { Difference } from 'microdiff';
|
|
3
|
-
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
4
|
-
|
|
5
|
-
type CloseType = "close";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* is a string containing the name of the label.
|
|
9
|
-
* It is used to {@link narration.registeredLabels} to get the label class.
|
|
10
|
-
*/
|
|
11
|
-
type LabelIdType = string;
|
|
12
|
-
|
|
13
|
-
type LabelRunModeType = "call" | "jump";
|
|
14
|
-
|
|
15
|
-
interface ChoiceOptionInterface extends Omit<ChoiceInterface, "label" | "type" | "closeCurrentLabel"> {
|
|
16
|
-
/**
|
|
17
|
-
* Label Id to be opened when the option is selected
|
|
18
|
-
*/
|
|
19
|
-
label: LabelIdType;
|
|
20
|
-
/**
|
|
21
|
-
* Type of the label to be opened
|
|
22
|
-
*/
|
|
23
|
-
type: LabelRunModeType;
|
|
24
|
-
}
|
|
25
|
-
interface CloseChoiceOptionInterface extends Omit<ChoiceInterface, "label" | "type" | "closeCurrentLabel"> {
|
|
26
|
-
/**
|
|
27
|
-
* Type of the label to be opened
|
|
28
|
-
*/
|
|
29
|
-
type: CloseType;
|
|
30
|
-
/**
|
|
31
|
-
* If true, the current label will be closed
|
|
32
|
-
*/
|
|
33
|
-
closeCurrentLabel?: boolean;
|
|
34
|
-
}
|
|
35
|
-
type StoredChoiceInterface = ChoiceOptionInterface | CloseChoiceOptionInterface;
|
|
36
|
-
type StoredIndexedChoiceInterface = StoredChoiceInterface & {
|
|
37
|
-
/**
|
|
38
|
-
* Is the index of the choice in the menu. It is used to identify the choice when it is selected.
|
|
39
|
-
*/
|
|
40
|
-
choiceIndex: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Result of a {@link StepLabelType} execution.
|
|
45
|
-
*
|
|
46
|
-
* - `StepLabelResult`: a structured result consumed by the narration engine.
|
|
47
|
-
* - `void`: the step completed without returning an explicit result.
|
|
48
|
-
* - `string`: a simple token or message interpreted by higher-level logic.
|
|
49
|
-
*
|
|
50
|
-
* Prefer returning a well-typed {@link StepLabelResult} for anything that
|
|
51
|
-
* needs to be consumed programmatically. Use plain strings only where a
|
|
52
|
-
* lightweight, convention-based signal is sufficient and clearly documented
|
|
53
|
-
* by the surrounding game logic.
|
|
54
|
-
*/
|
|
55
|
-
type StepLabelResultType = StepLabelResult | void | string;
|
|
56
|
-
type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
|
|
57
|
-
/**
|
|
58
|
-
* StepLabel is a function that will be executed as the game continues.
|
|
59
|
-
*/
|
|
60
|
-
type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
61
|
-
/**
|
|
62
|
-
* The id of the label.
|
|
63
|
-
*/
|
|
64
|
-
labelId: string;
|
|
65
|
-
}) => StepLabelResultType | Promise<StepLabelResultType>;
|
|
66
|
-
|
|
67
|
-
interface DialogueInterface {
|
|
68
|
-
/**
|
|
69
|
-
* The text of the dialogue.
|
|
70
|
-
*/
|
|
71
|
-
text: string | string[];
|
|
72
|
-
/**
|
|
73
|
-
* The id of the character that is speaking.
|
|
74
|
-
*/
|
|
75
|
-
character?: CharacterInterface | string;
|
|
76
|
-
}
|
|
77
|
-
type StoredDialogue = Omit<DialogueInterface, "character"> & {
|
|
78
|
-
character: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
interface HistoryStep {
|
|
82
|
-
/**
|
|
83
|
-
* The difference between the previous step and the current step.
|
|
84
|
-
*/
|
|
85
|
-
diff?: Difference[];
|
|
86
|
-
/**
|
|
87
|
-
* The label id of the current step.
|
|
88
|
-
*/
|
|
89
|
-
currentLabel?: LabelIdType;
|
|
90
|
-
/**
|
|
91
|
-
* The sha1 of the step function.
|
|
92
|
-
*/
|
|
93
|
-
stepSha1: string;
|
|
94
|
-
/**
|
|
95
|
-
* Equivalent to the narration.stepCounter
|
|
96
|
-
*/
|
|
97
|
-
index: number;
|
|
98
|
-
/**
|
|
99
|
-
* The data of the step of the label.
|
|
100
|
-
*/
|
|
101
|
-
labelStepIndex: number | null;
|
|
102
|
-
/**
|
|
103
|
-
* Dialogue to be shown in the game
|
|
104
|
-
*/
|
|
105
|
-
dialogue?: StoredDialogue;
|
|
106
|
-
/**
|
|
107
|
-
* List of choices asked of the player
|
|
108
|
-
*/
|
|
109
|
-
choices?: StoredChoiceInterface[];
|
|
110
|
-
/**
|
|
111
|
-
* List of choices already made by the player
|
|
112
|
-
*/
|
|
113
|
-
alreadyMadeChoices?: number[];
|
|
114
|
-
/**
|
|
115
|
-
* The input value of the player
|
|
116
|
-
*/
|
|
117
|
-
inputValue?: StorageElementType;
|
|
118
|
-
/**
|
|
119
|
-
* The choice made by the player
|
|
120
|
-
*/
|
|
121
|
-
choiceIndexMade?: number;
|
|
122
|
-
/**
|
|
123
|
-
* If true, the current dialogue will be glued to the previous one.
|
|
124
|
-
*/
|
|
125
|
-
isGlued?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Opened Labels in the current step.
|
|
128
|
-
*/
|
|
129
|
-
openedLabels?: OpenedLabel[];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
interface OpenedLabel {
|
|
133
|
-
label: LabelIdType;
|
|
134
|
-
currentStepIndex: number;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface NarrationHistory {
|
|
138
|
-
/**
|
|
139
|
-
* Dialogue to be shown in the game
|
|
140
|
-
*/
|
|
141
|
-
dialogue?: DialogueInterface;
|
|
142
|
-
/**
|
|
143
|
-
* List of choices asked of the player
|
|
144
|
-
*/
|
|
145
|
-
choices?: HistoryChoiceMenuOption[];
|
|
146
|
-
/**
|
|
147
|
-
* The player made a choice
|
|
148
|
-
*/
|
|
149
|
-
playerMadeChoice?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* The index of the step in the history.
|
|
152
|
-
*/
|
|
153
|
-
stepIndex: number;
|
|
154
|
-
/**
|
|
155
|
-
* The input value of the player
|
|
156
|
-
*/
|
|
157
|
-
inputValue?: StorageElementType;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
|
|
162
|
-
*/
|
|
163
|
-
type HistoryChoiceMenuOption = {
|
|
164
|
-
/**
|
|
165
|
-
* Text to be displayed in the menu
|
|
166
|
-
*/
|
|
167
|
-
text: string | string[];
|
|
168
|
-
/**
|
|
169
|
-
* Method used to open the label, or close the menu.
|
|
170
|
-
*/
|
|
171
|
-
type: CloseType | LabelRunModeType;
|
|
172
|
-
/**
|
|
173
|
-
* This choice is a response
|
|
174
|
-
*/
|
|
175
|
-
isResponse: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* The choice is hidden
|
|
178
|
-
*/
|
|
179
|
-
hidden: boolean;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryChoiceMenuOption as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelPropsType as S, CloseChoiceOptionInterface as a, CloseType as b, HistoryStep as c, LabelRunModeType as d, StepLabelResultType as e, StepLabelType as f, StoredChoiceInterface as g, StoredIndexedChoiceInterface as h };
|