@drincs/pixi-vn 1.6.3 → 1.6.4
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/{HistoryChoiceMenuOption-BQc_jAe-.d.ts → HistoryChoiceMenuOption-DM4wqiGt.d.ts} +1 -1
- package/dist/{HistoryChoiceMenuOption-ok3Zd5pB.d.cts → HistoryChoiceMenuOption-iazqoVVm.d.cts} +1 -1
- package/dist/{StorageElementType-dAIVJeiw.d.cts → StorageElementType-DkJ394kq.d.cts} +6 -1
- package/dist/{StorageElementType-dAIVJeiw.d.ts → StorageElementType-DkJ394kq.d.ts} +6 -1
- package/dist/{StoredClassModel-D-s0mEVj.d.ts → StoredClassModel-LtyakzOw.d.cts} +4 -6
- package/dist/{StoredClassModel-CUrGRJi0.d.cts → StoredClassModel-a4pvgJXD.d.ts} +4 -6
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +3 -3
- package/dist/characters.d.ts +3 -3
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-HACUDOYJ.mjs → chunk-EWW7VYPM.mjs} +1 -1
- package/dist/core.d.cts +8 -3
- package/dist/core.d.ts +8 -3
- package/dist/history.d.cts +2 -2
- package/dist/history.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +1 -1
- package/dist/narration.d.cts +3 -3
- package/dist/narration.d.ts +3 -3
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +5 -5
- package/dist/storage.d.ts +5 -5
- package/dist/storage.mjs +1 -1
- package/package.json +1 -1
package/dist/{HistoryChoiceMenuOption-BQc_jAe-.d.ts → HistoryChoiceMenuOption-DM4wqiGt.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
3
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
6
|
declare const Close: CloseType;
|
package/dist/{HistoryChoiceMenuOption-ok3Zd5pB.d.cts → HistoryChoiceMenuOption-iazqoVVm.d.cts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
3
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
6
|
declare const Close: CloseType;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
2
2
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
3
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
4
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* StorageElementType are all the types that can be stored in the storage
|
|
5
8
|
*/
|
|
6
9
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
7
10
|
[key: string | number | symbol]: StorageElementType;
|
|
8
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
11
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
12
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
13
|
+
};
|
|
9
14
|
/**
|
|
10
15
|
* StorageObjectType are all the types that can be stored in the storage
|
|
11
16
|
*/
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
2
2
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
3
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
4
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* StorageElementType are all the types that can be stored in the storage
|
|
5
8
|
*/
|
|
6
9
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
7
10
|
[key: string | number | symbol]: StorageElementType;
|
|
8
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
11
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
12
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
13
|
+
};
|
|
9
14
|
/**
|
|
10
15
|
* StorageObjectType are all the types that can be stored in the storage
|
|
11
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
1
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* StoredClassModel is a abstract class that contains the methods to store a class in the game.
|
|
@@ -41,18 +41,16 @@ declare class StoredClassModel {
|
|
|
41
41
|
readonly id: string;
|
|
42
42
|
private categoryId;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param propertyName The name of the property to set.
|
|
46
|
-
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
44
|
+
* @deprecated Remove the type parameter, it is not needed and it is not used in the implementation.
|
|
47
45
|
*/
|
|
48
|
-
protected setStorageProperty<T
|
|
46
|
+
protected setStorageProperty<T>(propertyName: string, value: StorageElementType): void;
|
|
49
47
|
/**
|
|
50
48
|
* Get a property from the storage.
|
|
51
49
|
* @param propertyName The name of the property to get.
|
|
52
50
|
* @param idToUse The id of the instance to get the property. @default this.id
|
|
53
51
|
* @returns The value of the property. If the property is not found, returns undefined.
|
|
54
52
|
*/
|
|
55
|
-
protected getStorageProperty<T
|
|
53
|
+
protected getStorageProperty<T = StorageElementType>(propertyName: string, idToUse?: string): T | undefined;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
export { StoredClassModel as S };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
1
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* StoredClassModel is a abstract class that contains the methods to store a class in the game.
|
|
@@ -41,18 +41,16 @@ declare class StoredClassModel {
|
|
|
41
41
|
readonly id: string;
|
|
42
42
|
private categoryId;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param propertyName The name of the property to set.
|
|
46
|
-
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
44
|
+
* @deprecated Remove the type parameter, it is not needed and it is not used in the implementation.
|
|
47
45
|
*/
|
|
48
|
-
protected setStorageProperty<T
|
|
46
|
+
protected setStorageProperty<T>(propertyName: string, value: StorageElementType): void;
|
|
49
47
|
/**
|
|
50
48
|
* Get a property from the storage.
|
|
51
49
|
* @param propertyName The name of the property to get.
|
|
52
50
|
* @param idToUse The id of the instance to get the property. @default this.id
|
|
53
51
|
* @returns The value of the property. If the property is not found, returns undefined.
|
|
54
52
|
*/
|
|
55
|
-
protected getStorageProperty<T
|
|
53
|
+
protected getStorageProperty<T = StorageElementType>(propertyName: string, idToUse?: string): T | undefined;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
export { StoredClassModel as S };
|
package/dist/characters.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var re=Object.defineProperty;var Xt=u=>{throw TypeError(u)};var ae=(u,e,t)=>e in u?re(u,e,{enumerable:true,configurable:true,writable:true,value:t}):u[e]=t;var g=(u,e,t)=>ae(u,typeof e!="symbol"?e+"":e,t),Kt=(u,e,t)=>e.has(u)||Xt("Cannot "+t);var i=(u,e,t)=>(Kt(u,e,"read from private field"),t?t.call(u):e.get(u)),m=(u,e,t)=>e.has(u)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),f=(u,e,t,s)=>(Kt(u,e,"write to private field"),e.set(u,t),t),l=(u,e,t)=>(Kt(u,e,"access private method"),t);var Ft=(u,e,t,s)=>({set _(a){f(u,e,a);},get _(){return i(u,e,s)}});var ot="storage",ft="temp",Gt="flags",V={CHARACTER_CATEGORY_KEY:"character"};var k;(a=>(a.log=(o,...r)=>console.log(`[Pixi\u2019VN] ${o}`,...r),a.warn=(o,...r)=>console.warn(`[Pixi\u2019VN] ${o}`,...r),a.error=(o,...r)=>console.error(`[Pixi\u2019VN] ${o}`,...r),a.info=(o,...r)=>console.info(`[Pixi\u2019VN] ${o}`,...r)))(k||(k={}));function Ct(u){try{if(typeof u>"u")return u;let e=JSON.stringify(u);return JSON.parse(e)}catch(e){throw k.error("Error creating exportable element",u,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zt=new Set,Wt=typeof process=="object"&&process?process:{},te=(u,e,t,s)=>{typeof Wt.emitWarning=="function"?Wt.emitWarning(u,e,t,s):console.error(`[${t}] ${e}: ${u}`);},zt=globalThis.AbortController,Jt=globalThis.AbortSignal;if(typeof zt>"u"){Jt=class{constructor(){g(this,"onabort");g(this,"_onabort",[]);g(this,"reason");g(this,"aborted",false);}addEventListener(t,s){this._onabort.push(s);}},zt=class{constructor(){g(this,"signal",new Jt);e();}abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=true;for(let s of this.signal._onabort)s(t);this.signal.onabort?.(t);}}};let u=Wt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{u&&(u=false,te("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var he=u=>!Zt.has(u);var nt=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u),ee=u=>nt(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?Lt:null:null,Lt=class extends Array{constructor(u){super(u),this.fill(0);}},it,Et,le=(it=class{constructor(e,t){g(this,"heap");g(this,"length");if(!i(it,Et))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=ee(e);if(!t)return [];f(it,Et,true);let s=new it(e,t);return f(it,Et,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Et=new WeakMap,m(it,Et,false),it),qt,Qt,$,U,H,dt,B,Tt,bt,X,O,J,w,A,d,M,z,I,R,q,x,Q,Z,P,Y,tt,ct,F,At,n,jt,gt,st,Dt,K,se,pt,yt,Nt,ht,lt,$t,Vt,Ut,b,kt,It,ut,Ht,vt,ie=(vt=class{constructor(e){m(this,n);m(this,$);m(this,U);m(this,H);m(this,dt);m(this,B);m(this,Tt);m(this,bt);m(this,X);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,O);m(this,J);m(this,w);m(this,A);m(this,d);m(this,M);m(this,z);m(this,I);m(this,R);m(this,q);m(this,x);m(this,Q);m(this,Z);m(this,P);m(this,Y);m(this,tt);m(this,ct);m(this,F);m(this,At);m(this,gt,()=>{});m(this,st,()=>{});m(this,Dt,()=>{});m(this,K,()=>false);m(this,pt,e=>{});m(this,yt,(e,t,s)=>{});m(this,Nt,(e,t,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});g(this,qt,"LRUCache");let{max:t=0,ttl:s,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:c,dispose:S,onInsert:C,disposeAfter:E,noDisposeOnSet:at,noUpdateTTL:W,maxSize:et=0,maxEntrySize:y=0,sizeCalculation:T,fetchMethod:p,memoMethod:D,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:N,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:xt,ignoreFetchAbort:_t,perf:mt}=e;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,mt??ne),t!==0&&!nt(t))throw new TypeError("max option must be a nonnegative integer");let St=t?ee(t):Array;if(!St)throw new Error("invalid max value: "+t);if(f(this,$,t),f(this,U,et),this.maxEntrySize=y||i(this,U),this.sizeCalculation=T,this.sizeCalculation){if(!i(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(D!==void 0&&typeof D!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,bt,D),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,Tt,p),f(this,ct,!!p),f(this,w,new Map),f(this,A,new Array(t).fill(void 0)),f(this,d,new Array(t).fill(void 0)),f(this,M,new St(t)),f(this,z,new St(t)),f(this,I,0),f(this,R,0),f(this,q,le.create(t)),f(this,O,0),f(this,J,0),typeof S=="function"&&f(this,H,S),typeof C=="function"&&f(this,dt,C),typeof E=="function"?(f(this,B,E),f(this,x,[])):(f(this,B,void 0),f(this,x,void 0)),f(this,tt,!!i(this,H)),f(this,At,!!i(this,dt)),f(this,F,!!i(this,B)),this.noDisposeOnSet=!!at,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!_t,this.maxEntrySize!==0){if(i(this,U)!==0&&!nt(i(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!nt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,n,se).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!N,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=nt(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!nt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,n,jt).call(this);}if(i(this,$)===0&&this.ttl===0&&i(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!i(this,$)&&!i(this,U)){let Yt="LRU_CACHE_UNBOUNDED";he(Yt)&&(Zt.add(Yt),te("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Yt,vt));}}get perf(){return i(this,X)}static unsafeExposeInternals(e){return {starts:i(e,Z),ttls:i(e,P),autopurgeTimers:i(e,Y),sizes:i(e,Q),keyMap:i(e,w),keyList:i(e,A),valList:i(e,d),next:i(e,M),prev:i(e,z),get head(){return i(e,I)},get tail(){return i(e,R)},free:i(e,q),isBackgroundFetch:t=>{var s;return l(s=e,n,b).call(s,t)},backgroundFetch:(t,s,a,o)=>{var r;return l(r=e,n,Ut).call(r,t,s,a,o)},moveToTail:t=>{var s;return l(s=e,n,It).call(s,t)},indexes:t=>{var s;return l(s=e,n,ht).call(s,t)},rindexes:t=>{var s;return l(s=e,n,lt).call(s,t)},isStale:t=>{var s;return i(s=e,K).call(s,t)}}}get max(){return i(this,$)}get maxSize(){return i(this,U)}get calculatedSize(){return i(this,J)}get size(){return i(this,O)}get fetchMethod(){return i(this,Tt)}get memoMethod(){return i(this,bt)}get dispose(){return i(this,H)}get onInsert(){return i(this,dt)}get disposeAfter(){return i(this,B)}getRemainingTTL(e){return i(this,w).has(e)?1/0:0}*entries(){for(let e of l(this,n,ht).call(this))i(this,d)[e]!==void 0&&i(this,A)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield [i(this,A)[e],i(this,d)[e]]);}*rentries(){for(let e of l(this,n,lt).call(this))i(this,d)[e]!==void 0&&i(this,A)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield [i(this,A)[e],i(this,d)[e]]);}*keys(){for(let e of l(this,n,ht).call(this)){let t=i(this,A)[e];t!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield t);}}*rkeys(){for(let e of l(this,n,lt).call(this)){let t=i(this,A)[e];t!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield t);}}*values(){for(let e of l(this,n,ht).call(this))i(this,d)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield i(this,d)[e]);}*rvalues(){for(let e of l(this,n,lt).call(this))i(this,d)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield i(this,d)[e]);}[(Qt=Symbol.iterator,qt=Symbol.toStringTag,Qt)](){return this.entries()}find(e,t={}){for(let s of l(this,n,ht).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;if(o!==void 0&&e(o,i(this,A)[s],this))return this.get(i(this,A)[s],t)}}forEach(e,t=this){for(let s of l(this,n,ht).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&e.call(t,o,i(this,A)[s],this);}}rforEach(e,t=this){for(let s of l(this,n,lt).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&e.call(t,o,i(this,A)[s],this);}}purgeStale(){let e=false;for(let t of l(this,n,lt).call(this,{allowStale:true}))i(this,K).call(this,t)&&(l(this,n,ut).call(this,i(this,A)[t],"expire"),e=true);return e}info(e){let t=i(this,w).get(e);if(t===void 0)return;let s=i(this,d)[t],a=l(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(a===void 0)return;let o={value:a};if(i(this,P)&&i(this,Z)){let r=i(this,P)[t],h=i(this,Z)[t];if(r&&h){let c=r-(i(this,X).now()-h);o.ttl=c,o.start=Date.now();}}return i(this,Q)&&(o.size=i(this,Q)[t]),o}dump(){let e=[];for(let t of l(this,n,ht).call(this,{allowStale:true})){let s=i(this,A)[t],a=i(this,d)[t],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;if(o===void 0||s===void 0)continue;let r={value:o};if(i(this,P)&&i(this,Z)){r.ttl=i(this,P)[t];let h=i(this,X).now()-i(this,Z)[t];r.start=Math.floor(Date.now()-h);}i(this,Q)&&(r.size=i(this,Q)[t]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[t,s]of e){if(s.start){let a=Date.now()-s.start;s.start=i(this,X).now()-a;}this.set(t,s.value,s);}}set(e,t,s={}){var at,W,et,y;if(t===void 0)return this.delete(e),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s,{noUpdateTTL:S=this.noUpdateTTL}=s,C=i(this,Nt).call(this,e,t,s.size||0,h);if(this.maxEntrySize&&C>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),l(this,n,ut).call(this,e,"set"),this;let E=i(this,O)===0?void 0:i(this,w).get(e);if(E===void 0)E=i(this,O)===0?i(this,R):i(this,q).length!==0?i(this,q).pop():i(this,O)===i(this,$)?l(this,n,Vt).call(this,false):i(this,O),i(this,A)[E]=e,i(this,d)[E]=t,i(this,w).set(e,E),i(this,M)[i(this,R)]=E,i(this,z)[E]=i(this,R),f(this,R,E),Ft(this,O)._++,i(this,yt).call(this,E,C,c),c&&(c.set="add"),S=false,i(this,At)&&((at=i(this,dt))==null||at.call(this,t,e,"add"));else {l(this,n,It).call(this,E);let T=i(this,d)[E];if(t!==T){if(i(this,ct)&&l(this,n,b).call(this,T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=T;p!==void 0&&!r&&(i(this,tt)&&((W=i(this,H))==null||W.call(this,p,e,"set")),i(this,F)&&i(this,x)?.push([p,e,"set"]));}else r||(i(this,tt)&&((et=i(this,H))==null||et.call(this,T,e,"set")),i(this,F)&&i(this,x)?.push([T,e,"set"]));if(i(this,pt).call(this,E),i(this,yt).call(this,E,C,c),i(this,d)[E]=t,c){c.set="replace";let p=T&&l(this,n,b).call(this,T)?T.__staleWhileFetching:T;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");i(this,At)&&this.onInsert?.(t,e,t===T?"update":"replace");}if(a!==0&&!i(this,P)&&l(this,n,jt).call(this),i(this,P)&&(S||i(this,Dt).call(this,E,a,o),c&&i(this,st).call(this,c,E)),!r&&i(this,F)&&i(this,x)){let T=i(this,x),p;for(;p=T?.shift();)(y=i(this,B))==null||y.call(this,...p);}return this}pop(){var e;try{for(;i(this,O);){let t=i(this,d)[i(this,I)];if(l(this,n,Vt).call(this,!0),l(this,n,b).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(i(this,F)&&i(this,x)){let t=i(this,x),s;for(;s=t?.shift();)(e=i(this,B))==null||e.call(this,...s);}}}has(e,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=t,o=i(this,w).get(e);if(o!==void 0){let r=i(this,d)[o];if(l(this,n,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(i(this,K).call(this,o))a&&(a.has="stale",i(this,st).call(this,a,o));else return s&&i(this,gt).call(this,o),a&&(a.has="hit",i(this,st).call(this,a,o)),true}else a&&(a.has="miss");return false}peek(e,t={}){let{allowStale:s=this.allowStale}=t,a=i(this,w).get(e);if(a===void 0||!s&&i(this,K).call(this,a))return;let o=i(this,d)[a];return l(this,n,b).call(this,o)?o.__staleWhileFetching:o}async fetch(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:E=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:at=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:et=this.allowStaleOnFetchAbort,context:y,forceRefresh:T=false,status:p,signal:D}=t;if(!i(this,ct))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:p});let L={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:r,noDisposeOnSet:h,size:c,sizeCalculation:S,noUpdateTTL:C,noDeleteOnFetchRejection:E,allowStaleOnFetchRejection:at,allowStaleOnFetchAbort:et,ignoreFetchAbort:W,status:p,signal:D},N=i(this,w).get(e);if(N===void 0){p&&(p.fetch="miss");let v=l(this,n,Ut).call(this,e,N,L,y);return v.__returned=v}else {let v=i(this,d)[N];if(l(this,n,b).call(this,v)){let St=s&&v.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",St&&(p.returnedStale=true)),St?v.__staleWhileFetching:v.__returned=v}let xt=i(this,K).call(this,N);if(!T&&!xt)return p&&(p.fetch="hit"),l(this,n,It).call(this,N),a&&i(this,gt).call(this,N),p&&i(this,st).call(this,p,N),v;let _t=l(this,n,Ut).call(this,e,N,L,y),mt=_t.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=xt?"stale":"refresh",mt&&xt&&(p.returnedStale=true)),mt?_t.__staleWhileFetching:_t.__returned=_t}}async forceFetch(e,t={}){let s=await this.fetch(e,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,t={}){let s=i(this,bt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...r}=t,h=this.get(e,r);if(!o&&h!==void 0)return h;let c=s(e,h,{options:r,context:a});return this.set(e,c,r),c}get(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:r}=t,h=i(this,w).get(e);if(h!==void 0){let c=i(this,d)[h],S=l(this,n,b).call(this,c);return r&&i(this,st).call(this,r,h),i(this,K).call(this,h)?(r&&(r.get="stale"),S?(r&&s&&c.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?c.__staleWhileFetching:void 0):(o||l(this,n,ut).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?c:void 0)):(r&&(r.get="hit"),S?c.__staleWhileFetching:(l(this,n,It).call(this,h),a&&i(this,gt).call(this,h),c))}else r&&(r.get="miss");}delete(e){return l(this,n,ut).call(this,e,"delete")}clear(){return l(this,n,Ht).call(this,"delete")}},$=new WeakMap,U=new WeakMap,H=new WeakMap,dt=new WeakMap,B=new WeakMap,Tt=new WeakMap,bt=new WeakMap,X=new WeakMap,O=new WeakMap,J=new WeakMap,w=new WeakMap,A=new WeakMap,d=new WeakMap,M=new WeakMap,z=new WeakMap,I=new WeakMap,R=new WeakMap,q=new WeakMap,x=new WeakMap,Q=new WeakMap,Z=new WeakMap,P=new WeakMap,Y=new WeakMap,tt=new WeakMap,ct=new WeakMap,F=new WeakMap,At=new WeakMap,n=new WeakSet,jt=function(){let e=new Lt(i(this,$)),t=new Lt(i(this,$));f(this,P,e),f(this,Z,t);let s=this.ttlAutopurge?new Array(i(this,$)):void 0;f(this,Y,s),f(this,Dt,(h,c,S=i(this,X).now())=>{t[h]=c!==0?S:0,e[h]=c,a(h,c);}),f(this,gt,h=>{t[h]=e[h]!==0?i(this,X).now():0,a(h,e[h]);});let a=this.ttlAutopurge?(h,c)=>{if(s?.[h]&&(clearTimeout(s[h]),s[h]=void 0),c&&c!==0&&s){let S=setTimeout(()=>{i(this,K).call(this,h)&&l(this,n,ut).call(this,i(this,A)[h],"expire");},c+1);S.unref&&S.unref(),s[h]=S;}}:()=>{};f(this,st,(h,c)=>{if(e[c]){let S=e[c],C=t[c];if(!S||!C)return;h.ttl=S,h.start=C,h.now=o||r();let E=h.now-C;h.remainingTTL=S-E;}});let o=0,r=()=>{let h=i(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=i(this,w).get(h);if(c===void 0)return 0;let S=e[c],C=t[c];if(!S||!C)return 1/0;let E=(o||r())-C;return S-E},f(this,K,h=>{let c=t[h],S=e[h];return !!S&&!!c&&(o||r())-c>S});},gt=new WeakMap,st=new WeakMap,Dt=new WeakMap,K=new WeakMap,se=function(){let e=new Lt(i(this,$));f(this,J,0),f(this,Q,e),f(this,pt,t=>{f(this,J,i(this,J)-e[t]),e[t]=0;}),f(this,Nt,(t,s,a,o)=>{if(l(this,n,b).call(this,s))return 0;if(!nt(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(s,t),!nt(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,yt,(t,s,a)=>{if(e[t]=s,i(this,U)){let o=i(this,U)-e[t];for(;i(this,J)>o;)l(this,n,Vt).call(this,true);}f(this,J,i(this,J)+e[t]),a&&(a.entrySize=s,a.totalCalculatedSize=i(this,J));});},pt=new WeakMap,yt=new WeakMap,Nt=new WeakMap,ht=function*({allowStale:e=this.allowStale}={}){if(i(this,O))for(let t=i(this,R);!(!l(this,n,$t).call(this,t)||((e||!i(this,K).call(this,t))&&(yield t),t===i(this,I)));)t=i(this,z)[t];},lt=function*({allowStale:e=this.allowStale}={}){if(i(this,O))for(let t=i(this,I);!(!l(this,n,$t).call(this,t)||((e||!i(this,K).call(this,t))&&(yield t),t===i(this,R)));)t=i(this,M)[t];},$t=function(e){return e!==void 0&&i(this,w).get(i(this,A)[e])===e},Vt=function(e){var o;let t=i(this,I),s=i(this,A)[t],a=i(this,d)[t];return i(this,ct)&&l(this,n,b).call(this,a)?a.__abortController.abort(new Error("evicted")):(i(this,tt)||i(this,F))&&(i(this,tt)&&((o=i(this,H))==null||o.call(this,a,s,"evict")),i(this,F)&&i(this,x)?.push([a,s,"evict"])),i(this,pt).call(this,t),i(this,Y)?.[t]&&(clearTimeout(i(this,Y)[t]),i(this,Y)[t]=void 0),e&&(i(this,A)[t]=void 0,i(this,d)[t]=void 0,i(this,q).push(t)),i(this,O)===1?(f(this,I,f(this,R,0)),i(this,q).length=0):f(this,I,i(this,M)[t]),i(this,w).delete(s),Ft(this,O)._--,t},Ut=function(e,t,s,a){let o=t===void 0?void 0:i(this,d)[t];if(l(this,n,b).call(this,o))return o;let r=new zt,{signal:h}=s;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let c={signal:r.signal,options:s,context:a},S=(y,T=false)=>{let{aborted:p}=r.signal,D=s.ignoreFetchAbort&&y!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(p&&!T?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,D&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!D&&!T)return E(r.signal.reason,L);let N=W,v=i(this,d)[t];return (v===W||D&&T&&v===void 0)&&(y===void 0?N.__staleWhileFetching!==void 0?i(this,d)[t]=N.__staleWhileFetching:l(this,n,ut).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,c.options))),y},C=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),E(y,false)),E=(y,T)=>{let{aborted:p}=r.signal,D=p&&s.allowStaleOnFetchAbort,L=D||s.allowStaleOnFetchRejection,N=L||s.noDeleteOnFetchRejection,v=W;if(i(this,d)[t]===W&&(!N||!T&&v.__staleWhileFetching===void 0?l(this,n,ut).call(this,e,"fetch"):D||(i(this,d)[t]=v.__staleWhileFetching)),L)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw y},at=(y,T)=>{var D;let p=(D=i(this,Tt))==null?void 0:D.call(this,e,o,c);p&&p instanceof Promise&&p.then(L=>y(L===void 0?void 0:L),T),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=L=>S(L,true)));});};s.status&&(s.status.fetchDispatched=true);let W=new Promise(at).then(S,C),et=Object.assign(W,{__abortController:r,__staleWhileFetching:o,__returned:void 0});return t===void 0?(this.set(e,et,{...c.options,status:void 0}),t=i(this,w).get(e)):i(this,d)[t]=et,et},b=function(e){if(!i(this,ct))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof zt},kt=function(e,t){i(this,z)[t]=e,i(this,M)[e]=t;},It=function(e){e!==i(this,R)&&(e===i(this,I)?f(this,I,i(this,M)[e]):l(this,n,kt).call(this,i(this,z)[e],i(this,M)[e]),l(this,n,kt).call(this,i(this,R),e),f(this,R,e));},ut=function(e,t){var a,o;let s=false;if(i(this,O)!==0){let r=i(this,w).get(e);if(r!==void 0)if(i(this,Y)?.[r]&&(clearTimeout(i(this,Y)?.[r]),i(this,Y)[r]=void 0),s=true,i(this,O)===1)l(this,n,Ht).call(this,t);else {i(this,pt).call(this,r);let h=i(this,d)[r];if(l(this,n,b).call(this,h)?h.__abortController.abort(new Error("deleted")):(i(this,tt)||i(this,F))&&(i(this,tt)&&((a=i(this,H))==null||a.call(this,h,e,t)),i(this,F)&&i(this,x)?.push([h,e,t])),i(this,w).delete(e),i(this,A)[r]=void 0,i(this,d)[r]=void 0,r===i(this,R))f(this,R,i(this,z)[r]);else if(r===i(this,I))f(this,I,i(this,M)[r]);else {let c=i(this,z)[r];i(this,M)[c]=i(this,M)[r];let S=i(this,M)[r];i(this,z)[S]=i(this,z)[r];}Ft(this,O)._--,i(this,q).push(r);}}if(i(this,F)&&i(this,x)?.length){let r=i(this,x),h;for(;h=r?.shift();)(o=i(this,B))==null||o.call(this,...h);}return s},Ht=function(e){var t,s;for(let a of l(this,n,lt).call(this,{allowStale:true})){let o=i(this,d)[a];if(l(this,n,b).call(this,o))o.__abortController.abort(new Error("deleted"));else {let r=i(this,A)[a];i(this,tt)&&((t=i(this,H))==null||t.call(this,o,r,e)),i(this,F)&&i(this,x)?.push([o,r,e]);}}if(i(this,w).clear(),i(this,d).fill(void 0),i(this,A).fill(void 0),i(this,P)&&i(this,Z)){i(this,P).fill(0),i(this,Z).fill(0);for(let a of i(this,Y)??[])a!==void 0&&clearTimeout(a);i(this,Y)?.fill(void 0);}if(i(this,Q)&&i(this,Q).fill(0),f(this,I,0),f(this,R,0),i(this,q).length=0,f(this,J,0),f(this,O,0),i(this,F)&&i(this,x)){let a=i(this,x),o;for(;o=a?.shift();)(s=i(this,B))==null||s.call(this,...o);}},vt);var rt=class{constructor(e){g(this,"cache");g(this,"map",new Map);this.cache=new ie({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 t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var G=class G{constructor(){}static clearOldTempVariables(e){G.tempStorageDeadlines.forEach((t,s)=>{t>e&&(G.removeVariable(ft,s),G.tempStorageDeadlines.delete(s));});}static setVariable(e,t,s){s==null?G.storage.delete(`${e}:${t}`):G.storage.set(`${e}:${t}`,s);}static getVariable(e,t){let s=G.storage.get(`${e}:${t}`);return Ct(s)}static removeVariable(e,t){G.storage.delete(`${e}:${t}`);}static setFlag(e,t){let s=G.storage.get(Gt)||[];if(t)s.includes(e)||s.push(e);else {let a=s.indexOf(e);a>-1&&s.splice(a,1);}G.storage.set(Gt,s);}static getFlag(e){return (G.storage.get(Gt)||[]).includes(e)}};g(G,"storage",new rt({cacheSize:50})),g(G,"default",new rt({cacheSize:10})),g(G,"tempStorageDeadlines",new Map);var _=G;var wt=class{constructor(e,t){g(this,"id");g(this,"categoryId");this.categoryId=e,this.id=t,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let t=_.getVariable(ot,e);t&&(Object.entries(t).forEach(([s,a])=>{typeof a=="object"&&a!==null&&Object.entries(a).forEach(([o,r])=>{_.setVariable(this.categoryId,`${s}:${o}`,r);});}),_.removeVariable(ot,e));}setStorageProperty(e,t){_.setVariable(this.categoryId,`${this.id}:${e}`,t);}getStorageProperty(e,t=this.id){return _.getVariable(this.categoryId,`${t}:${e}`)}};var ce="@",Ot=class extends wt{constructor(t,s=""){super(V.CHARACTER_CATEGORY_KEY,t+(s?ce+s:""));g(this,"sourceId");this.sourceId=t,this.migrateOldStorage("___character___");}getStorageProperty(t){let s=super.getStorageProperty(t);return s===void 0&&(s=super.getStorageProperty(t,this.sourceId)),s}};var Pt=class extends Ot{constructor(t,s){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.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(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Rt=new rt({cacheSize:10}),Bt;(o=>{function u(r){try{let h=Rt.get(r);if(!h){k.warn(`Character "${r}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return h}catch(h){k.error(`Error while getting Character "${r}"`,h);return}}o.get=u;function e(r){if(Array.isArray(r)){r.forEach(h=>e(h));return}Rt.get(r.id)&&k.info(`Character id "${r.id}" already exists, it will be overwritten`),Rt.set(r.id,r);}o.add=e;function t(){return Array.from(Rt.values())}o.values=t;function s(r){return Rt.has(r)}o.has=s;function a(){return Array.from(Rt.keys())}o.keys=a;})(Bt||(Bt={}));var fe=Bt;exports.CharacterBaseModel=Pt;exports.CharacterStoredClass=Ot;exports.RegisteredCharacters=fe;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');var re=Object.defineProperty;var Xt=c=>{throw TypeError(c)};var ae=(c,e,t)=>e in c?re(c,e,{enumerable:true,configurable:true,writable:true,value:t}):c[e]=t;var g=(c,e,t)=>ae(c,typeof e!="symbol"?e+"":e,t),Kt=(c,e,t)=>e.has(c)||Xt("Cannot "+t);var i=(c,e,t)=>(Kt(c,e,"read from private field"),t?t.call(c):e.get(c)),m=(c,e,t)=>e.has(c)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(c):e.set(c,t),f=(c,e,t,s)=>(Kt(c,e,"write to private field"),e.set(c,t),t),l=(c,e,t)=>(Kt(c,e,"access private method"),t);var Ft=(c,e,t,s)=>({set _(a){f(c,e,a);},get _(){return i(c,e,s)}});var ot="storage",ft="temp",Gt="flags",V={CHARACTER_CATEGORY_KEY:"character"};var k;(a=>(a.log=(o,...r)=>console.log(`[Pixi\u2019VN] ${o}`,...r),a.warn=(o,...r)=>console.warn(`[Pixi\u2019VN] ${o}`,...r),a.error=(o,...r)=>console.error(`[Pixi\u2019VN] ${o}`,...r),a.info=(o,...r)=>console.info(`[Pixi\u2019VN] ${o}`,...r)))(k||(k={}));function Ct(c){try{if(typeof c>"u")return c;let e=JSON.stringify(c);return JSON.parse(e)}catch(e){throw k.error("Error creating exportable element",c,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zt=new Set,Wt=typeof process=="object"&&process?process:{},te=(c,e,t,s)=>{typeof Wt.emitWarning=="function"?Wt.emitWarning(c,e,t,s):console.error(`[${t}] ${e}: ${c}`);},zt=globalThis.AbortController,Jt=globalThis.AbortSignal;if(typeof zt>"u"){Jt=class{constructor(){g(this,"onabort");g(this,"_onabort",[]);g(this,"reason");g(this,"aborted",false);}addEventListener(t,s){this._onabort.push(s);}},zt=class{constructor(){g(this,"signal",new Jt);e();}abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=true;for(let s of this.signal._onabort)s(t);this.signal.onabort?.(t);}}};let c=Wt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{c&&(c=false,te("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var he=c=>!Zt.has(c);var nt=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),ee=c=>nt(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?Lt:null:null,Lt=class extends Array{constructor(c){super(c),this.fill(0);}},it,Et,le=(it=class{constructor(e,t){g(this,"heap");g(this,"length");if(!i(it,Et))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=ee(e);if(!t)return [];f(it,Et,true);let s=new it(e,t);return f(it,Et,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Et=new WeakMap,m(it,Et,false),it),qt,Qt,$,U,H,dt,B,Tt,bt,X,O,J,w,A,d,M,z,I,R,q,x,Q,Z,P,Y,tt,ut,F,At,n,jt,gt,st,Dt,K,se,pt,yt,Nt,ht,lt,$t,Vt,Ut,b,kt,It,ct,Ht,vt,ie=(vt=class{constructor(e){m(this,n);m(this,$);m(this,U);m(this,H);m(this,dt);m(this,B);m(this,Tt);m(this,bt);m(this,X);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,O);m(this,J);m(this,w);m(this,A);m(this,d);m(this,M);m(this,z);m(this,I);m(this,R);m(this,q);m(this,x);m(this,Q);m(this,Z);m(this,P);m(this,Y);m(this,tt);m(this,ut);m(this,F);m(this,At);m(this,gt,()=>{});m(this,st,()=>{});m(this,Dt,()=>{});m(this,K,()=>false);m(this,pt,e=>{});m(this,yt,(e,t,s)=>{});m(this,Nt,(e,t,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});g(this,qt,"LRUCache");let{max:t=0,ttl:s,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:u,dispose:S,onInsert:C,disposeAfter:E,noDisposeOnSet:at,noUpdateTTL:W,maxSize:et=0,maxEntrySize:y=0,sizeCalculation:T,fetchMethod:p,memoMethod:D,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:N,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:xt,ignoreFetchAbort:_t,perf:mt}=e;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,X,mt??ne),t!==0&&!nt(t))throw new TypeError("max option must be a nonnegative integer");let St=t?ee(t):Array;if(!St)throw new Error("invalid max value: "+t);if(f(this,$,t),f(this,U,et),this.maxEntrySize=y||i(this,U),this.sizeCalculation=T,this.sizeCalculation){if(!i(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(D!==void 0&&typeof D!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,bt,D),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,Tt,p),f(this,ut,!!p),f(this,w,new Map),f(this,A,new Array(t).fill(void 0)),f(this,d,new Array(t).fill(void 0)),f(this,M,new St(t)),f(this,z,new St(t)),f(this,I,0),f(this,R,0),f(this,q,le.create(t)),f(this,O,0),f(this,J,0),typeof S=="function"&&f(this,H,S),typeof C=="function"&&f(this,dt,C),typeof E=="function"?(f(this,B,E),f(this,x,[])):(f(this,B,void 0),f(this,x,void 0)),f(this,tt,!!i(this,H)),f(this,At,!!i(this,dt)),f(this,F,!!i(this,B)),this.noDisposeOnSet=!!at,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!_t,this.maxEntrySize!==0){if(i(this,U)!==0&&!nt(i(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!nt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,n,se).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!N,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=nt(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!nt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,n,jt).call(this);}if(i(this,$)===0&&this.ttl===0&&i(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!i(this,$)&&!i(this,U)){let Yt="LRU_CACHE_UNBOUNDED";he(Yt)&&(Zt.add(Yt),te("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Yt,vt));}}get perf(){return i(this,X)}static unsafeExposeInternals(e){return {starts:i(e,Z),ttls:i(e,P),autopurgeTimers:i(e,Y),sizes:i(e,Q),keyMap:i(e,w),keyList:i(e,A),valList:i(e,d),next:i(e,M),prev:i(e,z),get head(){return i(e,I)},get tail(){return i(e,R)},free:i(e,q),isBackgroundFetch:t=>{var s;return l(s=e,n,b).call(s,t)},backgroundFetch:(t,s,a,o)=>{var r;return l(r=e,n,Ut).call(r,t,s,a,o)},moveToTail:t=>{var s;return l(s=e,n,It).call(s,t)},indexes:t=>{var s;return l(s=e,n,ht).call(s,t)},rindexes:t=>{var s;return l(s=e,n,lt).call(s,t)},isStale:t=>{var s;return i(s=e,K).call(s,t)}}}get max(){return i(this,$)}get maxSize(){return i(this,U)}get calculatedSize(){return i(this,J)}get size(){return i(this,O)}get fetchMethod(){return i(this,Tt)}get memoMethod(){return i(this,bt)}get dispose(){return i(this,H)}get onInsert(){return i(this,dt)}get disposeAfter(){return i(this,B)}getRemainingTTL(e){return i(this,w).has(e)?1/0:0}*entries(){for(let e of l(this,n,ht).call(this))i(this,d)[e]!==void 0&&i(this,A)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield [i(this,A)[e],i(this,d)[e]]);}*rentries(){for(let e of l(this,n,lt).call(this))i(this,d)[e]!==void 0&&i(this,A)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield [i(this,A)[e],i(this,d)[e]]);}*keys(){for(let e of l(this,n,ht).call(this)){let t=i(this,A)[e];t!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield t);}}*rkeys(){for(let e of l(this,n,lt).call(this)){let t=i(this,A)[e];t!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield t);}}*values(){for(let e of l(this,n,ht).call(this))i(this,d)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield i(this,d)[e]);}*rvalues(){for(let e of l(this,n,lt).call(this))i(this,d)[e]!==void 0&&!l(this,n,b).call(this,i(this,d)[e])&&(yield i(this,d)[e]);}[(Qt=Symbol.iterator,qt=Symbol.toStringTag,Qt)](){return this.entries()}find(e,t={}){for(let s of l(this,n,ht).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;if(o!==void 0&&e(o,i(this,A)[s],this))return this.get(i(this,A)[s],t)}}forEach(e,t=this){for(let s of l(this,n,ht).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&e.call(t,o,i(this,A)[s],this);}}rforEach(e,t=this){for(let s of l(this,n,lt).call(this)){let a=i(this,d)[s],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;o!==void 0&&e.call(t,o,i(this,A)[s],this);}}purgeStale(){let e=false;for(let t of l(this,n,lt).call(this,{allowStale:true}))i(this,K).call(this,t)&&(l(this,n,ct).call(this,i(this,A)[t],"expire"),e=true);return e}info(e){let t=i(this,w).get(e);if(t===void 0)return;let s=i(this,d)[t],a=l(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(a===void 0)return;let o={value:a};if(i(this,P)&&i(this,Z)){let r=i(this,P)[t],h=i(this,Z)[t];if(r&&h){let u=r-(i(this,X).now()-h);o.ttl=u,o.start=Date.now();}}return i(this,Q)&&(o.size=i(this,Q)[t]),o}dump(){let e=[];for(let t of l(this,n,ht).call(this,{allowStale:true})){let s=i(this,A)[t],a=i(this,d)[t],o=l(this,n,b).call(this,a)?a.__staleWhileFetching:a;if(o===void 0||s===void 0)continue;let r={value:o};if(i(this,P)&&i(this,Z)){r.ttl=i(this,P)[t];let h=i(this,X).now()-i(this,Z)[t];r.start=Math.floor(Date.now()-h);}i(this,Q)&&(r.size=i(this,Q)[t]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[t,s]of e){if(s.start){let a=Date.now()-s.start;s.start=i(this,X).now()-a;}this.set(t,s.value,s);}}set(e,t,s={}){var at,W,et,y;if(t===void 0)return this.delete(e),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:u}=s,{noUpdateTTL:S=this.noUpdateTTL}=s,C=i(this,Nt).call(this,e,t,s.size||0,h);if(this.maxEntrySize&&C>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),l(this,n,ct).call(this,e,"set"),this;let E=i(this,O)===0?void 0:i(this,w).get(e);if(E===void 0)E=i(this,O)===0?i(this,R):i(this,q).length!==0?i(this,q).pop():i(this,O)===i(this,$)?l(this,n,Vt).call(this,false):i(this,O),i(this,A)[E]=e,i(this,d)[E]=t,i(this,w).set(e,E),i(this,M)[i(this,R)]=E,i(this,z)[E]=i(this,R),f(this,R,E),Ft(this,O)._++,i(this,yt).call(this,E,C,u),u&&(u.set="add"),S=false,i(this,At)&&((at=i(this,dt))==null||at.call(this,t,e,"add"));else {l(this,n,It).call(this,E);let T=i(this,d)[E];if(t!==T){if(i(this,ut)&&l(this,n,b).call(this,T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=T;p!==void 0&&!r&&(i(this,tt)&&((W=i(this,H))==null||W.call(this,p,e,"set")),i(this,F)&&i(this,x)?.push([p,e,"set"]));}else r||(i(this,tt)&&((et=i(this,H))==null||et.call(this,T,e,"set")),i(this,F)&&i(this,x)?.push([T,e,"set"]));if(i(this,pt).call(this,E),i(this,yt).call(this,E,C,u),i(this,d)[E]=t,u){u.set="replace";let p=T&&l(this,n,b).call(this,T)?T.__staleWhileFetching:T;p!==void 0&&(u.oldValue=p);}}else u&&(u.set="update");i(this,At)&&this.onInsert?.(t,e,t===T?"update":"replace");}if(a!==0&&!i(this,P)&&l(this,n,jt).call(this),i(this,P)&&(S||i(this,Dt).call(this,E,a,o),u&&i(this,st).call(this,u,E)),!r&&i(this,F)&&i(this,x)){let T=i(this,x),p;for(;p=T?.shift();)(y=i(this,B))==null||y.call(this,...p);}return this}pop(){var e;try{for(;i(this,O);){let t=i(this,d)[i(this,I)];if(l(this,n,Vt).call(this,!0),l(this,n,b).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(i(this,F)&&i(this,x)){let t=i(this,x),s;for(;s=t?.shift();)(e=i(this,B))==null||e.call(this,...s);}}}has(e,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=t,o=i(this,w).get(e);if(o!==void 0){let r=i(this,d)[o];if(l(this,n,b).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(i(this,K).call(this,o))a&&(a.has="stale",i(this,st).call(this,a,o));else return s&&i(this,gt).call(this,o),a&&(a.has="hit",i(this,st).call(this,a,o)),true}else a&&(a.has="miss");return false}peek(e,t={}){let{allowStale:s=this.allowStale}=t,a=i(this,w).get(e);if(a===void 0||!s&&i(this,K).call(this,a))return;let o=i(this,d)[a];return l(this,n,b).call(this,o)?o.__staleWhileFetching:o}async fetch(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:u=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:E=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:at=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:et=this.allowStaleOnFetchAbort,context:y,forceRefresh:T=false,status:p,signal:D}=t;if(!i(this,ut))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:p});let L={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:r,noDisposeOnSet:h,size:u,sizeCalculation:S,noUpdateTTL:C,noDeleteOnFetchRejection:E,allowStaleOnFetchRejection:at,allowStaleOnFetchAbort:et,ignoreFetchAbort:W,status:p,signal:D},N=i(this,w).get(e);if(N===void 0){p&&(p.fetch="miss");let v=l(this,n,Ut).call(this,e,N,L,y);return v.__returned=v}else {let v=i(this,d)[N];if(l(this,n,b).call(this,v)){let St=s&&v.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",St&&(p.returnedStale=true)),St?v.__staleWhileFetching:v.__returned=v}let xt=i(this,K).call(this,N);if(!T&&!xt)return p&&(p.fetch="hit"),l(this,n,It).call(this,N),a&&i(this,gt).call(this,N),p&&i(this,st).call(this,p,N),v;let _t=l(this,n,Ut).call(this,e,N,L,y),mt=_t.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=xt?"stale":"refresh",mt&&xt&&(p.returnedStale=true)),mt?_t.__staleWhileFetching:_t.__returned=_t}}async forceFetch(e,t={}){let s=await this.fetch(e,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,t={}){let s=i(this,bt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...r}=t,h=this.get(e,r);if(!o&&h!==void 0)return h;let u=s(e,h,{options:r,context:a});return this.set(e,u,r),u}get(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:r}=t,h=i(this,w).get(e);if(h!==void 0){let u=i(this,d)[h],S=l(this,n,b).call(this,u);return r&&i(this,st).call(this,r,h),i(this,K).call(this,h)?(r&&(r.get="stale"),S?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(o||l(this,n,ct).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),S?u.__staleWhileFetching:(l(this,n,It).call(this,h),a&&i(this,gt).call(this,h),u))}else r&&(r.get="miss");}delete(e){return l(this,n,ct).call(this,e,"delete")}clear(){return l(this,n,Ht).call(this,"delete")}},$=new WeakMap,U=new WeakMap,H=new WeakMap,dt=new WeakMap,B=new WeakMap,Tt=new WeakMap,bt=new WeakMap,X=new WeakMap,O=new WeakMap,J=new WeakMap,w=new WeakMap,A=new WeakMap,d=new WeakMap,M=new WeakMap,z=new WeakMap,I=new WeakMap,R=new WeakMap,q=new WeakMap,x=new WeakMap,Q=new WeakMap,Z=new WeakMap,P=new WeakMap,Y=new WeakMap,tt=new WeakMap,ut=new WeakMap,F=new WeakMap,At=new WeakMap,n=new WeakSet,jt=function(){let e=new Lt(i(this,$)),t=new Lt(i(this,$));f(this,P,e),f(this,Z,t);let s=this.ttlAutopurge?new Array(i(this,$)):void 0;f(this,Y,s),f(this,Dt,(h,u,S=i(this,X).now())=>{t[h]=u!==0?S:0,e[h]=u,a(h,u);}),f(this,gt,h=>{t[h]=e[h]!==0?i(this,X).now():0,a(h,e[h]);});let a=this.ttlAutopurge?(h,u)=>{if(s?.[h]&&(clearTimeout(s[h]),s[h]=void 0),u&&u!==0&&s){let S=setTimeout(()=>{i(this,K).call(this,h)&&l(this,n,ct).call(this,i(this,A)[h],"expire");},u+1);S.unref&&S.unref(),s[h]=S;}}:()=>{};f(this,st,(h,u)=>{if(e[u]){let S=e[u],C=t[u];if(!S||!C)return;h.ttl=S,h.start=C,h.now=o||r();let E=h.now-C;h.remainingTTL=S-E;}});let o=0,r=()=>{let h=i(this,X).now();if(this.ttlResolution>0){o=h;let u=setTimeout(()=>o=0,this.ttlResolution);u.unref&&u.unref();}return h};this.getRemainingTTL=h=>{let u=i(this,w).get(h);if(u===void 0)return 0;let S=e[u],C=t[u];if(!S||!C)return 1/0;let E=(o||r())-C;return S-E},f(this,K,h=>{let u=t[h],S=e[h];return !!S&&!!u&&(o||r())-u>S});},gt=new WeakMap,st=new WeakMap,Dt=new WeakMap,K=new WeakMap,se=function(){let e=new Lt(i(this,$));f(this,J,0),f(this,Q,e),f(this,pt,t=>{f(this,J,i(this,J)-e[t]),e[t]=0;}),f(this,Nt,(t,s,a,o)=>{if(l(this,n,b).call(this,s))return 0;if(!nt(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(s,t),!nt(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,yt,(t,s,a)=>{if(e[t]=s,i(this,U)){let o=i(this,U)-e[t];for(;i(this,J)>o;)l(this,n,Vt).call(this,true);}f(this,J,i(this,J)+e[t]),a&&(a.entrySize=s,a.totalCalculatedSize=i(this,J));});},pt=new WeakMap,yt=new WeakMap,Nt=new WeakMap,ht=function*({allowStale:e=this.allowStale}={}){if(i(this,O))for(let t=i(this,R);!(!l(this,n,$t).call(this,t)||((e||!i(this,K).call(this,t))&&(yield t),t===i(this,I)));)t=i(this,z)[t];},lt=function*({allowStale:e=this.allowStale}={}){if(i(this,O))for(let t=i(this,I);!(!l(this,n,$t).call(this,t)||((e||!i(this,K).call(this,t))&&(yield t),t===i(this,R)));)t=i(this,M)[t];},$t=function(e){return e!==void 0&&i(this,w).get(i(this,A)[e])===e},Vt=function(e){var o;let t=i(this,I),s=i(this,A)[t],a=i(this,d)[t];return i(this,ut)&&l(this,n,b).call(this,a)?a.__abortController.abort(new Error("evicted")):(i(this,tt)||i(this,F))&&(i(this,tt)&&((o=i(this,H))==null||o.call(this,a,s,"evict")),i(this,F)&&i(this,x)?.push([a,s,"evict"])),i(this,pt).call(this,t),i(this,Y)?.[t]&&(clearTimeout(i(this,Y)[t]),i(this,Y)[t]=void 0),e&&(i(this,A)[t]=void 0,i(this,d)[t]=void 0,i(this,q).push(t)),i(this,O)===1?(f(this,I,f(this,R,0)),i(this,q).length=0):f(this,I,i(this,M)[t]),i(this,w).delete(s),Ft(this,O)._--,t},Ut=function(e,t,s,a){let o=t===void 0?void 0:i(this,d)[t];if(l(this,n,b).call(this,o))return o;let r=new zt,{signal:h}=s;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:a},S=(y,T=false)=>{let{aborted:p}=r.signal,D=s.ignoreFetchAbort&&y!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(p&&!T?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,D&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!D&&!T)return E(r.signal.reason,L);let N=W,v=i(this,d)[t];return (v===W||D&&T&&v===void 0)&&(y===void 0?N.__staleWhileFetching!==void 0?i(this,d)[t]=N.__staleWhileFetching:l(this,n,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,u.options))),y},C=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),E(y,false)),E=(y,T)=>{let{aborted:p}=r.signal,D=p&&s.allowStaleOnFetchAbort,L=D||s.allowStaleOnFetchRejection,N=L||s.noDeleteOnFetchRejection,v=W;if(i(this,d)[t]===W&&(!N||!T&&v.__staleWhileFetching===void 0?l(this,n,ct).call(this,e,"fetch"):D||(i(this,d)[t]=v.__staleWhileFetching)),L)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw y},at=(y,T)=>{var D;let p=(D=i(this,Tt))==null?void 0:D.call(this,e,o,u);p&&p instanceof Promise&&p.then(L=>y(L===void 0?void 0:L),T),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=L=>S(L,true)));});};s.status&&(s.status.fetchDispatched=true);let W=new Promise(at).then(S,C),et=Object.assign(W,{__abortController:r,__staleWhileFetching:o,__returned:void 0});return t===void 0?(this.set(e,et,{...u.options,status:void 0}),t=i(this,w).get(e)):i(this,d)[t]=et,et},b=function(e){if(!i(this,ut))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof zt},kt=function(e,t){i(this,z)[t]=e,i(this,M)[e]=t;},It=function(e){e!==i(this,R)&&(e===i(this,I)?f(this,I,i(this,M)[e]):l(this,n,kt).call(this,i(this,z)[e],i(this,M)[e]),l(this,n,kt).call(this,i(this,R),e),f(this,R,e));},ct=function(e,t){var a,o;let s=false;if(i(this,O)!==0){let r=i(this,w).get(e);if(r!==void 0)if(i(this,Y)?.[r]&&(clearTimeout(i(this,Y)?.[r]),i(this,Y)[r]=void 0),s=true,i(this,O)===1)l(this,n,Ht).call(this,t);else {i(this,pt).call(this,r);let h=i(this,d)[r];if(l(this,n,b).call(this,h)?h.__abortController.abort(new Error("deleted")):(i(this,tt)||i(this,F))&&(i(this,tt)&&((a=i(this,H))==null||a.call(this,h,e,t)),i(this,F)&&i(this,x)?.push([h,e,t])),i(this,w).delete(e),i(this,A)[r]=void 0,i(this,d)[r]=void 0,r===i(this,R))f(this,R,i(this,z)[r]);else if(r===i(this,I))f(this,I,i(this,M)[r]);else {let u=i(this,z)[r];i(this,M)[u]=i(this,M)[r];let S=i(this,M)[r];i(this,z)[S]=i(this,z)[r];}Ft(this,O)._--,i(this,q).push(r);}}if(i(this,F)&&i(this,x)?.length){let r=i(this,x),h;for(;h=r?.shift();)(o=i(this,B))==null||o.call(this,...h);}return s},Ht=function(e){var t,s;for(let a of l(this,n,lt).call(this,{allowStale:true})){let o=i(this,d)[a];if(l(this,n,b).call(this,o))o.__abortController.abort(new Error("deleted"));else {let r=i(this,A)[a];i(this,tt)&&((t=i(this,H))==null||t.call(this,o,r,e)),i(this,F)&&i(this,x)?.push([o,r,e]);}}if(i(this,w).clear(),i(this,d).fill(void 0),i(this,A).fill(void 0),i(this,P)&&i(this,Z)){i(this,P).fill(0),i(this,Z).fill(0);for(let a of i(this,Y)??[])a!==void 0&&clearTimeout(a);i(this,Y)?.fill(void 0);}if(i(this,Q)&&i(this,Q).fill(0),f(this,I,0),f(this,R,0),i(this,q).length=0,f(this,J,0),f(this,O,0),i(this,F)&&i(this,x)){let a=i(this,x),o;for(;o=a?.shift();)(s=i(this,B))==null||s.call(this,...o);}},vt);var rt=class{constructor(e){g(this,"cache");g(this,"map",new Map);this.cache=new ie({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 t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var G=class G{constructor(){}static clearOldTempVariables(e){G.tempStorageDeadlines.forEach((t,s)=>{t>e&&(G.removeVariable(ft,s),G.tempStorageDeadlines.delete(s));});}static setVariable(e,t,s){s==null?G.storage.delete(`${e}:${t}`):G.storage.set(`${e}:${t}`,s);}static getVariable(e,t){let s=G.storage.get(`${e}:${t}`);return Ct(s)}static removeVariable(e,t){G.storage.delete(`${e}:${t}`);}static setFlag(e,t){let s=G.storage.get(Gt)||[];if(t)s.includes(e)||s.push(e);else {let a=s.indexOf(e);a>-1&&s.splice(a,1);}G.storage.set(Gt,s);}static getFlag(e){return (G.storage.get(Gt)||[]).includes(e)}};g(G,"storage",new rt({cacheSize:50})),g(G,"default",new rt({cacheSize:10})),g(G,"tempStorageDeadlines",new Map);var _=G;var wt=class{constructor(e,t){g(this,"id");g(this,"categoryId");this.categoryId=e,this.id=t,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let t=_.getVariable(ot,e);t&&(Object.entries(t).forEach(([s,a])=>{typeof a=="object"&&a!==null&&Object.entries(a).forEach(([o,r])=>{_.setVariable(this.categoryId,`${s}:${o}`,r);});}),_.removeVariable(ot,e));}setStorageProperty(e,t){_.setVariable(this.categoryId,`${this.id}:${e}`,t);}getStorageProperty(e,t=this.id){return _.getVariable(this.categoryId,`${t}:${e}`)}};var ue="@",Ot=class extends wt{constructor(t,s=""){super(V.CHARACTER_CATEGORY_KEY,t+(s?ue+s:""));g(this,"sourceId");this.sourceId=t,this.migrateOldStorage("___character___");}getStorageProperty(t){let s=super.getStorageProperty(t);return s===void 0&&(s=super.getStorageProperty(t,this.sourceId)),s}};var Pt=class extends Ot{constructor(t,s){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.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(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Rt=new rt({cacheSize:10}),Bt;(o=>{function c(r){try{let h=Rt.get(r);if(!h){k.warn(`Character "${r}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return h}catch(h){k.error(`Error while getting Character "${r}"`,h);return}}o.get=c;function e(r){if(Array.isArray(r)){r.forEach(h=>e(h));return}Rt.get(r.id)&&k.info(`Character id "${r.id}" already exists, it will be overwritten`),Rt.set(r.id,r);}o.add=e;function t(){return Array.from(Rt.values())}o.values=t;function s(r){return Rt.has(r)}o.has=s;function a(){return Array.from(Rt.keys())}o.keys=a;})(Bt||(Bt={}));var fe=Bt;exports.CharacterBaseModel=Pt;exports.CharacterStoredClass=Ot;exports.RegisteredCharacters=fe;
|
package/dist/characters.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as StoredClassModel } from './StoredClassModel-CUrGRJi0.cjs';
|
|
1
|
+
import { S as StoredClassModel } from './StoredClassModel-LtyakzOw.cjs';
|
|
3
2
|
import { CharacterInterface as CharacterInterface$1 } from '@drincs/pixi-vn';
|
|
3
|
+
import './StorageElementType-DkJ394kq.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* CharacterBaseModelProps is an interface that is used to create a character model.
|
|
@@ -31,7 +31,7 @@ interface CharacterBaseModelProps {
|
|
|
31
31
|
declare class CharacterStoredClass extends StoredClassModel {
|
|
32
32
|
private sourceId;
|
|
33
33
|
constructor(id: string, emotion?: string);
|
|
34
|
-
getStorageProperty<T
|
|
34
|
+
getStorageProperty<T>(propertyName: string): T | undefined;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
package/dist/characters.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as StoredClassModel } from './StoredClassModel-D-s0mEVj.js';
|
|
1
|
+
import { S as StoredClassModel } from './StoredClassModel-a4pvgJXD.js';
|
|
3
2
|
import { CharacterInterface as CharacterInterface$1 } from '@drincs/pixi-vn';
|
|
3
|
+
import './StorageElementType-DkJ394kq.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* CharacterBaseModelProps is an interface that is used to create a character model.
|
|
@@ -31,7 +31,7 @@ interface CharacterBaseModelProps {
|
|
|
31
31
|
declare class CharacterStoredClass extends StoredClassModel {
|
|
32
32
|
private sourceId;
|
|
33
33
|
constructor(id: string, emotion?: string);
|
|
34
|
-
getStorageProperty<T
|
|
34
|
+
getStorageProperty<T>(propertyName: string): T | undefined;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
package/dist/characters.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-EWW7VYPM.mjs';import {a}from'./chunk-ZW3MIPMS.mjs';import {n}from'./chunk-IWAXXFXE.mjs';import {j,d}from'./chunk-D45QSSXG.mjs';var l="@",i=class extends b{constructor(e,r=""){super(n.CHARACTER_CATEGORY_KEY,e+(r?l+r:""));d(this,"sourceId");this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var u=class extends i{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion);d(this,"defaultName");d(this,"defaultSurname");d(this,"defaultAge");d(this,"_icon");d(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}),f;(S=>{function d(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}}S.get=d;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);}S.add=g;function e(){return Array.from(s.values())}S.values=e;function r(t){return s.has(t)}S.has=r;function C(){return Array.from(s.keys())}S.keys=C;})(f||(f={}));var p=f;export{u as CharacterBaseModel,i as CharacterStoredClass,p as RegisteredCharacters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-ZW3MIPMS.mjs';import {k,m,j,l,n}from'./chunk-IWAXXFXE.mjs';import {d,k as k$1,j as j$1}from'./chunk-D45QSSXG.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var s=class s{constructor(){}static clearOldTempVariables(t){s.tempStorageDeadlines.forEach((e,r)=>{e>t&&(s.removeVariable(k,r),s.tempStorageDeadlines.delete(r));});}static setVariable(t,e,r){r==null?s.storage.delete(`${t}:${e}`):s.storage.set(`${t}:${e}`,r);}static getVariable(t,e){let r=s.storage.get(`${t}:${e}`);return k$1(r)}static removeVariable(t,e){s.storage.delete(`${t}:${e}`);}static setFlag(t,e){let r=s.storage.get(m)||[];if(e)r.includes(t)||r.push(t);else {let g=r.indexOf(t);g>-1&&r.splice(g,1);}s.storage.set(m,r);}static getFlag(t){return (s.storage.get(m)||[]).includes(t)}};d(s,"storage",new a$1({cacheSize:50})),d(s,"default",new a$1({cacheSize:10})),d(s,"tempStorageDeadlines",new Map);var a=s;var p=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,r])=>{a.default.map.set(e,r);});}set(t,e){return a.setVariable(j,t,e)}get(t){let e=a.getVariable(k,t);return e===void 0&&(e=a.getVariable(j,t)),e===void 0&&(e=k$1(a.default.get(t))),e}remove(t){return this.removeTempVariable(t),a.removeVariable(j,t)}setTempVariable(t,e){if(e==null){this.removeTempVariable(t);return}else a.setVariable(k,t,e),this.tempStorageDeadlines.has(t)||this.tempStorageDeadlines.set(t,GameUnifier.openedLabels);}removeTempVariable(t){a.removeVariable(k,t),this.tempStorageDeadlines.has(t)&&this.tempStorageDeadlines.delete(t);}setFlag(t,e){return a.setFlag(t,e)}getFlag(t){return a.getFlag(t)}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let t=[];[...this.base.keys()].forEach(r=>{t.push({key:r,value:this.base.get(r)});});let e=[];return [...a.tempStorageDeadlines.keys()].forEach(r=>{e.push({key:r,value:this.tempStorageDeadlines.get(r)});}),k$1({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(l,n.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(l,n.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(l,n.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(l,n.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(l,n.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(l,n.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(l,n.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(l,n.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(l,n.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(l,n.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(l,n.LAST_STEP_GLUED,e.value);break;default:a.setVariable(j,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(k,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.tempStorageDeadlines.set(e.key,e.value);})):j$1.warn("No storage data found");}catch(e){j$1.error("Error importing data",e);}}};var E=class{constructor(t,e){d(this,"id");d(this,"categoryId");this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(j,t);e&&(Object.entries(e).forEach(([r,g])=>{typeof g=="object"&&g!==null&&Object.entries(g).forEach(([f,b])=>{a.setVariable(this.categoryId,`${r}:${f}`,b);});}),a.removeVariable(j,t));}setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var
|
|
1
|
+
import {a as a$1}from'./chunk-ZW3MIPMS.mjs';import {k,m,j,l,n}from'./chunk-IWAXXFXE.mjs';import {d,k as k$1,j as j$1}from'./chunk-D45QSSXG.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var s=class s{constructor(){}static clearOldTempVariables(t){s.tempStorageDeadlines.forEach((e,r)=>{e>t&&(s.removeVariable(k,r),s.tempStorageDeadlines.delete(r));});}static setVariable(t,e,r){r==null?s.storage.delete(`${t}:${e}`):s.storage.set(`${t}:${e}`,r);}static getVariable(t,e){let r=s.storage.get(`${t}:${e}`);return k$1(r)}static removeVariable(t,e){s.storage.delete(`${t}:${e}`);}static setFlag(t,e){let r=s.storage.get(m)||[];if(e)r.includes(t)||r.push(t);else {let g=r.indexOf(t);g>-1&&r.splice(g,1);}s.storage.set(m,r);}static getFlag(t){return (s.storage.get(m)||[]).includes(t)}};d(s,"storage",new a$1({cacheSize:50})),d(s,"default",new a$1({cacheSize:10})),d(s,"tempStorageDeadlines",new Map);var a=s;var p=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,r])=>{a.default.map.set(e,r);});}set(t,e){return a.setVariable(j,t,e)}get(t){let e=a.getVariable(k,t);return e===void 0&&(e=a.getVariable(j,t)),e===void 0&&(e=k$1(a.default.get(t))),e}remove(t){return this.removeTempVariable(t),a.removeVariable(j,t)}setTempVariable(t,e){if(e==null){this.removeTempVariable(t);return}else a.setVariable(k,t,e),this.tempStorageDeadlines.has(t)||this.tempStorageDeadlines.set(t,GameUnifier.openedLabels);}removeTempVariable(t){a.removeVariable(k,t),this.tempStorageDeadlines.has(t)&&this.tempStorageDeadlines.delete(t);}setFlag(t,e){return a.setFlag(t,e)}getFlag(t){return a.getFlag(t)}clear(){this.base.clear(),this.cache.clear(),this.tempStorageDeadlines.clear();}export(){let t=[];[...this.base.keys()].forEach(r=>{t.push({key:r,value:this.base.get(r)});});let e=[];return [...a.tempStorageDeadlines.keys()].forEach(r=>{e.push({key:r,value:this.tempStorageDeadlines.get(r)});}),k$1({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(l,n.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(l,n.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(l,n.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(l,n.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(l,n.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(l,n.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(l,n.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(l,n.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(l,n.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(l,n.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(l,n.LAST_STEP_GLUED,e.value);break;default:a.setVariable(j,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(k,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.tempStorageDeadlines.set(e.key,e.value);})):j$1.warn("No storage data found");}catch(e){j$1.error("Error importing data",e);}}};var E=class{constructor(t,e){d(this,"id");d(this,"categoryId");this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(j,t);e&&(Object.entries(e).forEach(([r,g])=>{typeof g=="object"&&g!==null&&Object.entries(g).forEach(([f,b])=>{a.setVariable(this.categoryId,`${r}:${f}`,b);});}),a.removeVariable(j,t));}setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var L=new p;export{a,E as b,L as c};
|
package/dist/core.d.cts
CHANGED
|
@@ -99,12 +99,17 @@ type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
|
99
99
|
|
|
100
100
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
101
101
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
102
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
103
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
104
|
+
};
|
|
102
105
|
/**
|
|
103
106
|
* StorageElementType are all the types that can be stored in the storage
|
|
104
107
|
*/
|
|
105
108
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
106
109
|
[key: string | number | symbol]: StorageElementType;
|
|
107
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
110
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
111
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
112
|
+
};
|
|
108
113
|
/**
|
|
109
114
|
* StorageObjectType are all the types that can be stored in the storage
|
|
110
115
|
*/
|
|
@@ -169,7 +174,7 @@ declare class GameUnifier {
|
|
|
169
174
|
* @param key The key of the variable.
|
|
170
175
|
* @returns The value of the variable.
|
|
171
176
|
*/
|
|
172
|
-
getVariable: <T
|
|
177
|
+
getVariable: <T = StorageElementType>(prefix: string, key: string) => T | undefined;
|
|
173
178
|
/**
|
|
174
179
|
* This function sets the value of a variable.
|
|
175
180
|
* @param key The key of the variable.
|
|
@@ -338,7 +343,7 @@ declare class GameUnifier {
|
|
|
338
343
|
* @param key The key of the variable.
|
|
339
344
|
* @returns The value of the variable.
|
|
340
345
|
*/
|
|
341
|
-
static get getVariable(): <T
|
|
346
|
+
static get getVariable(): <T = StorageElementType>(prefix: string, key: string) => T | undefined;
|
|
342
347
|
private static _setVariable;
|
|
343
348
|
/**
|
|
344
349
|
* This function sets the value of a variable.
|
package/dist/core.d.ts
CHANGED
|
@@ -99,12 +99,17 @@ type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
|
99
99
|
|
|
100
100
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
101
101
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
102
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
103
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
104
|
+
};
|
|
102
105
|
/**
|
|
103
106
|
* StorageElementType are all the types that can be stored in the storage
|
|
104
107
|
*/
|
|
105
108
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
106
109
|
[key: string | number | symbol]: StorageElementType;
|
|
107
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
110
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
111
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
112
|
+
};
|
|
108
113
|
/**
|
|
109
114
|
* StorageObjectType are all the types that can be stored in the storage
|
|
110
115
|
*/
|
|
@@ -169,7 +174,7 @@ declare class GameUnifier {
|
|
|
169
174
|
* @param key The key of the variable.
|
|
170
175
|
* @returns The value of the variable.
|
|
171
176
|
*/
|
|
172
|
-
getVariable: <T
|
|
177
|
+
getVariable: <T = StorageElementType>(prefix: string, key: string) => T | undefined;
|
|
173
178
|
/**
|
|
174
179
|
* This function sets the value of a variable.
|
|
175
180
|
* @param key The key of the variable.
|
|
@@ -338,7 +343,7 @@ declare class GameUnifier {
|
|
|
338
343
|
* @param key The key of the variable.
|
|
339
344
|
* @returns The value of the variable.
|
|
340
345
|
*/
|
|
341
|
-
static get getVariable(): <T
|
|
346
|
+
static get getVariable(): <T = StorageElementType>(prefix: string, key: string) => T | undefined;
|
|
342
347
|
private static _setVariable;
|
|
343
348
|
/**
|
|
344
349
|
* This function sets the value of a variable.
|
package/dist/history.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GameStepState, HistoryInfo } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.cjs';
|
|
4
|
-
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-
|
|
4
|
+
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-iazqoVVm.cjs';
|
|
5
5
|
import 'lru-cache';
|
|
6
|
-
import './StorageElementType-
|
|
6
|
+
import './StorageElementType-DkJ394kq.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Interface exported step data
|
package/dist/history.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GameStepState, HistoryInfo } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.js';
|
|
4
|
-
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-
|
|
4
|
+
import { H as HistoryStep, N as NarrationHistory, d as StepLabelPropsType, e as StepLabelResultType } from './HistoryChoiceMenuOption-DM4wqiGt.js';
|
|
5
5
|
import 'lru-cache';
|
|
6
|
-
import './StorageElementType-
|
|
6
|
+
import './StorageElementType-DkJ394kq.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Interface exported step data
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Xt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),C=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),I=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');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 nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Xt__namespace=/*#__PURE__*/_interopNamespace(Xt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var C__namespace=/*#__PURE__*/_interopNamespace(C);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var I__namespace=/*#__PURE__*/_interopNamespace(I);var $t=Object.defineProperty;var Bt=h=>{throw TypeError(h)};var le=(h,e,i)=>e in h?$t(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var he=(h,e)=>{for(var i in e)$t(h,i,{get:e[i],enumerable:true});};var E=(h,e,i)=>le(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Bt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),g=(h,e,i)=>e.has(h)?Bt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var de=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,te=new Set,It=typeof process=="object"&&process?process:{},ee=(h,e,i,s)=>{typeof It.emitWarning=="function"?It.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Jt=globalThis.AbortSignal;if(typeof Nt>"u"){Jt=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=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 h=It.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ee("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=h=>!te.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),ie=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,pe=(it=class{constructor(e,i){E(this,"heap");E(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=ie(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,g(it,St,false),it),Qt,Zt,K,G,q,ut,X,yt,Et,$,U,B,T,b,m,F,z,N,D,J,L,Q,Z,V,W,tt,ct,P,xt,l,Mt,ft,rt,Ot,Y,re,mt,At,Tt,lt,ht,Gt,Lt,Ct,A,zt,wt,dt,Vt,bt,se=(bt=class{constructor(e){g(this,l);g(this,K);g(this,G);g(this,q);g(this,ut);g(this,X);g(this,yt);g(this,Et);g(this,$);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");g(this,U);g(this,B);g(this,T);g(this,b);g(this,m);g(this,F);g(this,z);g(this,N);g(this,D);g(this,J);g(this,L);g(this,Q);g(this,Z);g(this,V);g(this,W);g(this,tt);g(this,ct);g(this,P);g(this,xt);g(this,ft,()=>{});g(this,rt,()=>{});g(this,Ot,()=>{});g(this,Y,()=>false);g(this,mt,e=>{});g(this,At,(e,i,s)=>{});g(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});E(this,Qt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:M,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:H,perf:gt}=e;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,$,gt??de),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?ie(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,G,k),this.maxEntrySize=w||t(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!t(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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Et,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,ct,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,F,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,D,0),u(this,J,pe.create(i)),u(this,U,0),u(this,B,0),typeof v=="function"&&u(this,q,v),typeof R=="function"&&u(this,ut,R),typeof S=="function"?(u(this,X,S),u(this,L,[])):(u(this,X,void 0),u(this,L,void 0)),u(this,tt,!!t(this,q)),u(this,xt,!!t(this,ut)),u(this,P,!!t(this,X)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!M,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,G)!==0&&!at(t(this,G)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,re).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,Mt).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,G)){let Pt="LRU_CACHE_UNBOUNDED";ce(Pt)&&(te.add(Pt),ee("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,bt));}}get perf(){return t(this,$)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,F),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,D)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,A).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,wt).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,G)}get calculatedSize(){return t(this,B)}get size(){return t(this,U)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,Et)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,X)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(Zt=Symbol.iterator,Qt=Symbol.toStringTag,Zt)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,dt).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,A).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,$).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,$).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}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,$).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var st,M,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=t(this,Tt).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&R>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,dt).call(this,e,"set"),this;let S=t(this,U)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,U)===0?t(this,D):t(this,J).length!==0?t(this,J).pop():t(this,U)===t(this,K)?d(this,l,Lt).call(this,false):t(this,U),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,F)[t(this,D)]=S,t(this,z)[S]=t(this,D),u(this,D,S),Rt(this,U)._++,t(this,At).call(this,S,R,p),p&&(p.set="add"),v=false,t(this,xt)&&((st=t(this,ut))==null||st.call(this,i,e,"add"));else {d(this,l,wt).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,ct)&&d(this,l,A).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((M=t(this,q))==null||M.call(this,a,e,"set")),t(this,P)&&t(this,L)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,P)&&t(this,L)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,At).call(this,S,R,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,A).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,xt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,Mt).call(this),t(this,V)&&(v||t(this,Ot).call(this,S,r,n),p&&t(this,rt).call(this,p,S)),!o&&t(this,P)&&t(this,L)){let y=t(this,L),a;for(;a=y?.shift();)(w=t(this,X))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,U);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,P)&&t(this,L)){let i=t(this,L),s;for(;s=i?.shift();)(e=t(this,X))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,A).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,rt).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,rt).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,A).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:M=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,ct))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:k,ignoreFetchAbort:M,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let _=d(this,l,Ct).call(this,e,f,O,w);return _.__returned=_}else {let _=t(this,m)[f];if(d(this,l,A).call(this,_)){let vt=s&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?_.__staleWhileFetching:_.__returned=_}let j=t(this,Y).call(this,f);if(!y&&!j)return a&&(a.fetch="hit"),d(this,l,wt).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,rt).call(this,a,f),_;let H=d(this,l,Ct).call(this,e,f,O,w),gt=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=j?"stale":"refresh",gt&&j&&(a.returnedStale=true)),gt?H.__staleWhileFetching:H.__returned=H}}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:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,A).call(this,p);return o&&t(this,rt).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,dt).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,wt).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,dt).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,G=new WeakMap,q=new WeakMap,ut=new WeakMap,X=new WeakMap,yt=new WeakMap,Et=new WeakMap,$=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,F=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,ct=new WeakMap,P=new WeakMap,xt=new WeakMap,l=new WeakSet,Mt=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Ot,(c,p,v=t(this,$).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,$).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,dt).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,rt,(c,p)=>{if(e[p]){let v=e[p],R=i[p];if(!v||!R)return;c.ttl=v,c.start=R,c.now=n||o();let S=c.now-R;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,$).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],R=i[p];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,rt=new WeakMap,Ot=new WeakMap,Y=new WeakMap,re=function(){let e=new Dt(t(this,K));u(this,B,0),u(this,Q,e),u(this,mt,i=>{u(this,B,t(this,B)-e[i]),e[i]=0;}),u(this,Tt,(i,s,r,n)=>{if(d(this,l,A).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(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}),u(this,At,(i,s,r)=>{if(e[i]=s,t(this,G)){let n=t(this,G)-e[i];for(;t(this,B)>n;)d(this,l,Lt).call(this,true);}u(this,B,t(this,B)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,B));});},mt=new WeakMap,At=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,D);!(!d(this,l,Gt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,N);!(!d(this,l,Gt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,D)));)i=t(this,F)[i];},Gt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,ct)&&d(this,l,A).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,P))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,P)&&t(this,L)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,U)===1?(u(this,N,u(this,D,0)),t(this,J).length=0):u(this,N,t(this,F)[i]),t(this,T).delete(s),Rt(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,A).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,O);let f=M,_=t(this,m)[i];return (_===M||x&&y&&_===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,dt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},R=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,O=x||s.allowStaleOnFetchRejection,f=O||s.noDeleteOnFetchRejection,_=M;if(t(this,m)[i]===M&&(!f||!y&&_.__staleWhileFetching===void 0?d(this,l,dt).call(this,e,"fetch"):x||(t(this,m)[i]=_.__staleWhileFetching)),O)return s.status&&_.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),_.__staleWhileFetching;if(_.__returned===_)throw w},st=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(O=>w(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let M=new Promise(st).then(v,R),k=Object.assign(M,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},A=function(e){if(!t(this,ct))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,F)[e]=i;},wt=function(e){e!==t(this,D)&&(e===t(this,N)?u(this,N,t(this,F)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,F)[e]),d(this,l,zt).call(this,t(this,D),e),u(this,D,e));},dt=function(e,i){var r,n;let s=false;if(t(this,U)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,U)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,A).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,P))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,P)&&t(this,L)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,D))u(this,D,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,F)[o]);else {let p=t(this,z)[o];t(this,F)[p]=t(this,F)[o];let v=t(this,F)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,U)._--,t(this,J).push(o);}}if(t(this,P)&&t(this,L)?.length){let o=t(this,L),c;for(;c=o?.shift();)(n=t(this,X))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,A).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,P)&&t(this,L)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,D,0),t(this,J).length=0,u(this,B,0),u(this,U,0),t(this,P)&&t(this,L)){let r=t(this,L),n;for(;n=r?.shift();)(s=t(this,X))==null||s.call(this,...n);}},bt);var Ft=class{constructor(e){E(this,"cache");E(this,"map",new Map);this.cache=new se({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 Ut="1.6.3";var Wt="repeat";function Yt(h){return {type:"pause",duration:h}}var Ht="__game_layer__";var fe="general";var me={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 oe={};var Kt={};he(Kt,{createExportableElement:()=>ne});var _t;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(_t||(_t={}));function ne(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw _t.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}function ae(){console.info(`
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Xt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),C=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),I=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');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 nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Xt__namespace=/*#__PURE__*/_interopNamespace(Xt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var C__namespace=/*#__PURE__*/_interopNamespace(C);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var I__namespace=/*#__PURE__*/_interopNamespace(I);var $t=Object.defineProperty;var Bt=h=>{throw TypeError(h)};var le=(h,e,i)=>e in h?$t(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var he=(h,e)=>{for(var i in e)$t(h,i,{get:e[i],enumerable:true});};var E=(h,e,i)=>le(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Bt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),g=(h,e,i)=>e.has(h)?Bt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var de=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,te=new Set,It=typeof process=="object"&&process?process:{},ee=(h,e,i,s)=>{typeof It.emitWarning=="function"?It.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Jt=globalThis.AbortSignal;if(typeof Nt>"u"){Jt=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=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 h=It.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ee("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=h=>!te.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),ie=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,pe=(it=class{constructor(e,i){E(this,"heap");E(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=ie(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,g(it,St,false),it),Qt,Zt,K,G,q,ut,X,yt,Et,$,U,B,T,b,m,F,z,N,D,J,L,Q,Z,V,W,tt,ct,P,xt,l,Mt,ft,rt,Ot,Y,re,mt,At,Tt,lt,ht,Gt,Lt,Ct,A,zt,wt,dt,Vt,bt,se=(bt=class{constructor(e){g(this,l);g(this,K);g(this,G);g(this,q);g(this,ut);g(this,X);g(this,yt);g(this,Et);g(this,$);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");g(this,U);g(this,B);g(this,T);g(this,b);g(this,m);g(this,F);g(this,z);g(this,N);g(this,D);g(this,J);g(this,L);g(this,Q);g(this,Z);g(this,V);g(this,W);g(this,tt);g(this,ct);g(this,P);g(this,xt);g(this,ft,()=>{});g(this,rt,()=>{});g(this,Ot,()=>{});g(this,Y,()=>false);g(this,mt,e=>{});g(this,At,(e,i,s)=>{});g(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});E(this,Qt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:M,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:H,perf:gt}=e;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,$,gt??de),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?ie(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,G,k),this.maxEntrySize=w||t(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!t(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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Et,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,ct,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,F,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,D,0),u(this,J,pe.create(i)),u(this,U,0),u(this,B,0),typeof v=="function"&&u(this,q,v),typeof R=="function"&&u(this,ut,R),typeof S=="function"?(u(this,X,S),u(this,L,[])):(u(this,X,void 0),u(this,L,void 0)),u(this,tt,!!t(this,q)),u(this,xt,!!t(this,ut)),u(this,P,!!t(this,X)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!M,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,G)!==0&&!at(t(this,G)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,re).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,Mt).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,G)){let Pt="LRU_CACHE_UNBOUNDED";ce(Pt)&&(te.add(Pt),ee("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,bt));}}get perf(){return t(this,$)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,F),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,D)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,A).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,wt).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,G)}get calculatedSize(){return t(this,B)}get size(){return t(this,U)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,Et)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,X)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,A).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(Zt=Symbol.iterator,Qt=Symbol.toStringTag,Zt)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,dt).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,A).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,$).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,$).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}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,$).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var st,M,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=t(this,Tt).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&R>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,dt).call(this,e,"set"),this;let S=t(this,U)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,U)===0?t(this,D):t(this,J).length!==0?t(this,J).pop():t(this,U)===t(this,K)?d(this,l,Lt).call(this,false):t(this,U),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,F)[t(this,D)]=S,t(this,z)[S]=t(this,D),u(this,D,S),Rt(this,U)._++,t(this,At).call(this,S,R,p),p&&(p.set="add"),v=false,t(this,xt)&&((st=t(this,ut))==null||st.call(this,i,e,"add"));else {d(this,l,wt).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,ct)&&d(this,l,A).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((M=t(this,q))==null||M.call(this,a,e,"set")),t(this,P)&&t(this,L)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,P)&&t(this,L)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,At).call(this,S,R,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,A).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,xt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,Mt).call(this),t(this,V)&&(v||t(this,Ot).call(this,S,r,n),p&&t(this,rt).call(this,p,S)),!o&&t(this,P)&&t(this,L)){let y=t(this,L),a;for(;a=y?.shift();)(w=t(this,X))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,U);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,P)&&t(this,L)){let i=t(this,L),s;for(;s=i?.shift();)(e=t(this,X))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,A).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,rt).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,rt).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,A).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:M=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,ct))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:k,ignoreFetchAbort:M,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let _=d(this,l,Ct).call(this,e,f,O,w);return _.__returned=_}else {let _=t(this,m)[f];if(d(this,l,A).call(this,_)){let vt=s&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?_.__staleWhileFetching:_.__returned=_}let j=t(this,Y).call(this,f);if(!y&&!j)return a&&(a.fetch="hit"),d(this,l,wt).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,rt).call(this,a,f),_;let H=d(this,l,Ct).call(this,e,f,O,w),gt=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=j?"stale":"refresh",gt&&j&&(a.returnedStale=true)),gt?H.__staleWhileFetching:H.__returned=H}}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:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,A).call(this,p);return o&&t(this,rt).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,dt).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,wt).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,dt).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,G=new WeakMap,q=new WeakMap,ut=new WeakMap,X=new WeakMap,yt=new WeakMap,Et=new WeakMap,$=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,F=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,ct=new WeakMap,P=new WeakMap,xt=new WeakMap,l=new WeakSet,Mt=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Ot,(c,p,v=t(this,$).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,$).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,dt).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,rt,(c,p)=>{if(e[p]){let v=e[p],R=i[p];if(!v||!R)return;c.ttl=v,c.start=R,c.now=n||o();let S=c.now-R;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,$).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],R=i[p];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,rt=new WeakMap,Ot=new WeakMap,Y=new WeakMap,re=function(){let e=new Dt(t(this,K));u(this,B,0),u(this,Q,e),u(this,mt,i=>{u(this,B,t(this,B)-e[i]),e[i]=0;}),u(this,Tt,(i,s,r,n)=>{if(d(this,l,A).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(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}),u(this,At,(i,s,r)=>{if(e[i]=s,t(this,G)){let n=t(this,G)-e[i];for(;t(this,B)>n;)d(this,l,Lt).call(this,true);}u(this,B,t(this,B)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,B));});},mt=new WeakMap,At=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,D);!(!d(this,l,Gt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,N);!(!d(this,l,Gt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,D)));)i=t(this,F)[i];},Gt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,ct)&&d(this,l,A).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,P))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,P)&&t(this,L)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,U)===1?(u(this,N,u(this,D,0)),t(this,J).length=0):u(this,N,t(this,F)[i]),t(this,T).delete(s),Rt(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,A).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,O);let f=M,_=t(this,m)[i];return (_===M||x&&y&&_===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,dt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},R=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,O=x||s.allowStaleOnFetchRejection,f=O||s.noDeleteOnFetchRejection,_=M;if(t(this,m)[i]===M&&(!f||!y&&_.__staleWhileFetching===void 0?d(this,l,dt).call(this,e,"fetch"):x||(t(this,m)[i]=_.__staleWhileFetching)),O)return s.status&&_.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),_.__staleWhileFetching;if(_.__returned===_)throw w},st=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(O=>w(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let M=new Promise(st).then(v,R),k=Object.assign(M,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},A=function(e){if(!t(this,ct))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,F)[e]=i;},wt=function(e){e!==t(this,D)&&(e===t(this,N)?u(this,N,t(this,F)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,F)[e]),d(this,l,zt).call(this,t(this,D),e),u(this,D,e));},dt=function(e,i){var r,n;let s=false;if(t(this,U)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,U)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,A).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,P))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,P)&&t(this,L)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,D))u(this,D,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,F)[o]);else {let p=t(this,z)[o];t(this,F)[p]=t(this,F)[o];let v=t(this,F)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,U)._--,t(this,J).push(o);}}if(t(this,P)&&t(this,L)?.length){let o=t(this,L),c;for(;c=o?.shift();)(n=t(this,X))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,A).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,P)&&t(this,L)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,D,0),t(this,J).length=0,u(this,B,0),u(this,U,0),t(this,P)&&t(this,L)){let r=t(this,L),n;for(;n=r?.shift();)(s=t(this,X))==null||s.call(this,...n);}},bt);var Ft=class{constructor(e){E(this,"cache");E(this,"map",new Map);this.cache=new se({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 Ut="1.6.4";var Wt="repeat";function Yt(h){return {type:"pause",duration:h}}var Ht="__game_layer__";var fe="general";var me={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 oe={};var Kt={};he(Kt,{createExportableElement:()=>ne});var _t;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(_t||(_t={}));function ne(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw _t.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}function ae(){console.info(`
|
|
2
2
|
_______ _ _ _ ____ ____ ____ _____
|
|
3
3
|
|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
|
|
4
4
|
| |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
|
package/dist/index.d.cts
CHANGED
|
@@ -535,7 +535,7 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
535
535
|
elements: CanvasBaseItemMemory[];
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
var version = "1.6.
|
|
538
|
+
var version = "1.6.4";
|
|
539
539
|
|
|
540
540
|
/**
|
|
541
541
|
* @deprecated
|
|
@@ -615,12 +615,17 @@ declare const SYSTEM_RESERVED_STORAGE_KEYS: {
|
|
|
615
615
|
|
|
616
616
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
617
617
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
618
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
619
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
620
|
+
};
|
|
618
621
|
/**
|
|
619
622
|
* StorageElementType are all the types that can be stored in the storage
|
|
620
623
|
*/
|
|
621
624
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
622
625
|
[key: string | number | symbol]: StorageElementType;
|
|
623
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
626
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
627
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
628
|
+
};
|
|
624
629
|
/**
|
|
625
630
|
* StorageObjectType are all the types that can be stored in the storage
|
|
626
631
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -535,7 +535,7 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
535
535
|
elements: CanvasBaseItemMemory[];
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
var version = "1.6.
|
|
538
|
+
var version = "1.6.4";
|
|
539
539
|
|
|
540
540
|
/**
|
|
541
541
|
* @deprecated
|
|
@@ -615,12 +615,17 @@ declare const SYSTEM_RESERVED_STORAGE_KEYS: {
|
|
|
615
615
|
|
|
616
616
|
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
617
617
|
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
618
|
+
type NonFunctionStorage = string | number | boolean | undefined | null | NonFunctionStorage[] | {
|
|
619
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
620
|
+
};
|
|
618
621
|
/**
|
|
619
622
|
* StorageElementType are all the types that can be stored in the storage
|
|
620
623
|
*/
|
|
621
624
|
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
622
625
|
[key: string | number | symbol]: StorageElementType;
|
|
623
|
-
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[]
|
|
626
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[] | {
|
|
627
|
+
[key: string | number | symbol]: NonFunctionStorage;
|
|
628
|
+
};
|
|
624
629
|
/**
|
|
625
630
|
* StorageObjectType are all the types that can be stored in the storage
|
|
626
631
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$1,d,a,c,e,f as f$1,g}from'./chunk-TTRUPDAB.mjs';import*as nt from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as qt from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import {PixiError,GameUnifier}from'@drincs/pixi-vn/core';export*from'@drincs/pixi-vn/core';import*as et from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as C from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as pt from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as I from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {motion}from'@drincs/pixi-vn/motion';var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,jt=typeof process=="object"&&process?process:{},Qt=(g,e,i,s)=>{typeof jt.emitWarning=="function"?jt.emitWarning(g,e,i,s):console.error(`[${i}] ${e}: ${g}`);},Nt=globalThis.AbortController,Xt=globalThis.AbortSignal;if(typeof Nt>"u"){Xt=class{constructor(){b$1(this,"onabort");b$1(this,"_onabort",[]);b$1(this,"reason");b$1(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){b$1(this,"signal",new Xt);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 g=jt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{g&&(g=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",e));};}var ae=g=>!Jt.has(g);var at=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),Zt=g=>at(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(g){super(g),this.fill(0);}},it,St,le=(it=class{constructor(e,i){b$1(this,"heap");b$1(this,"length");if(!c(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e$1){let i=Zt(e$1);if(!i)return [];e(it,St,true);let s=new it(e$1,i);return e(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,d(it,St,false),it),$t,Bt,K,G,q,ut,X,yt,Et,$,U,B,T,b,f,F,z,N,D,J,L,Q,Z,V,W,tt,ct,P,xt,l,It,ft,rt,Ot,Y,ee,mt,At,Tt,lt,ht,Mt,Lt,Ct,A,Gt,wt,dt,zt,bt,te=(bt=class{constructor(e$1){d(this,l);d(this,K);d(this,G);d(this,q);d(this,ut);d(this,X);d(this,yt);d(this,Et);d(this,$);b$1(this,"ttl");b$1(this,"ttlResolution");b$1(this,"ttlAutopurge");b$1(this,"updateAgeOnGet");b$1(this,"updateAgeOnHas");b$1(this,"allowStale");b$1(this,"noDisposeOnSet");b$1(this,"noUpdateTTL");b$1(this,"maxEntrySize");b$1(this,"sizeCalculation");b$1(this,"noDeleteOnFetchRejection");b$1(this,"noDeleteOnStaleGet");b$1(this,"allowStaleOnFetchAbort");b$1(this,"allowStaleOnFetchRejection");b$1(this,"ignoreFetchAbort");d(this,U);d(this,B);d(this,T);d(this,b);d(this,f);d(this,F);d(this,z);d(this,N);d(this,D);d(this,J);d(this,L);d(this,Q);d(this,Z);d(this,V);d(this,W);d(this,tt);d(this,ct);d(this,P);d(this,xt);d(this,ft,()=>{});d(this,rt,()=>{});d(this,Ot,()=>{});d(this,Y,()=>false);d(this,mt,e=>{});d(this,At,(e,i,s)=>{});d(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});b$1(this,$t,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:d$1,allowStale:c$1,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:M,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:u,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:j,ignoreFetchAbort:H,perf:gt}=e$1;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(e(this,$,gt??ne),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?Zt(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(e(this,K,i),e(this,G,k),this.maxEntrySize=w||c(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!c(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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(e(this,Et,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(e(this,yt,a),e(this,ct,!!a),e(this,T,new Map),e(this,b,new Array(i).fill(void 0)),e(this,f,new Array(i).fill(void 0)),e(this,F,new vt(i)),e(this,z,new vt(i)),e(this,N,0),e(this,D,0),e(this,J,le.create(i)),e(this,U,0),e(this,B,0),typeof v=="function"&&e(this,q,v),typeof R=="function"&&e(this,ut,R),typeof S=="function"?(e(this,X,S),e(this,L,[])):(e(this,X,void 0),e(this,L,void 0)),e(this,tt,!!c(this,q)),e(this,xt,!!c(this,ut)),e(this,P,!!c(this,X)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!M,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(c(this,G)!==0&&!at(c(this,G)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");f$1(this,l,ee).call(this);}if(this.allowStale=!!c$1,this.noDeleteOnStaleGet=!!u,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!d$1,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");f$1(this,l,It).call(this);}if(c(this,K)===0&&this.ttl===0&&c(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!c(this,K)&&!c(this,G)){let Pt="LRU_CACHE_UNBOUNDED";ae(Pt)&&(Jt.add(Pt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,bt));}}get perf(){return c(this,$)}static unsafeExposeInternals(e){return {starts:c(e,Z),ttls:c(e,V),autopurgeTimers:c(e,W),sizes:c(e,Q),keyMap:c(e,T),keyList:c(e,b),valList:c(e,f),next:c(e,F),prev:c(e,z),get head(){return c(e,N)},get tail(){return c(e,D)},free:c(e,J),isBackgroundFetch:i=>{var s;return f$1(s=e,l,A).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return f$1(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return f$1(s=e,l,wt).call(s,i)},indexes:i=>{var s;return f$1(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return f$1(s=e,l,ht).call(s,i)},isStale:i=>{var s;return c(s=e,Y).call(s,i)}}}get max(){return c(this,K)}get maxSize(){return c(this,G)}get calculatedSize(){return c(this,B)}get size(){return c(this,U)}get fetchMethod(){return c(this,yt)}get memoMethod(){return c(this,Et)}get dispose(){return c(this,q)}get onInsert(){return c(this,ut)}get disposeAfter(){return c(this,X)}getRemainingTTL(e){return c(this,T).has(e)?1/0:0}*entries(){for(let e of f$1(this,l,lt).call(this))c(this,f)[e]!==void 0&&c(this,b)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,b)[e],c(this,f)[e]]);}*rentries(){for(let e of f$1(this,l,ht).call(this))c(this,f)[e]!==void 0&&c(this,b)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,b)[e],c(this,f)[e]]);}*keys(){for(let e of f$1(this,l,lt).call(this)){let i=c(this,b)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*rkeys(){for(let e of f$1(this,l,ht).call(this)){let i=c(this,b)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*values(){for(let e of f$1(this,l,lt).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}*rvalues(){for(let e of f$1(this,l,ht).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}[(Bt=Symbol.iterator,$t=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(let s of f$1(this,l,lt).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,c(this,b)[s],this))return this.get(c(this,b)[s],i)}}forEach(e,i=this){for(let s of f$1(this,l,lt).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,c(this,b)[s],this);}}rforEach(e,i=this){for(let s of f$1(this,l,ht).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,c(this,b)[s],this);}}purgeStale(){let e=false;for(let i of f$1(this,l,ht).call(this,{allowStale:true}))c(this,Y).call(this,i)&&(f$1(this,l,dt).call(this,c(this,b)[i],"expire"),e=true);return e}info(e){let i=c(this,T).get(e);if(i===void 0)return;let s=c(this,f)[i],r=f$1(this,l,A).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(c(this,V)&&c(this,Z)){let o=c(this,V)[i],d=c(this,Z)[i];if(o&&d){let c$1=o-(c(this,$).now()-d);n.ttl=c$1,n.start=Date.now();}}return c(this,Q)&&(n.size=c(this,Q)[i]),n}dump(){let e=[];for(let i of f$1(this,l,lt).call(this,{allowStale:true})){let s=c(this,b)[i],r=c(this,f)[i],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(c(this,V)&&c(this,Z)){o.ttl=c(this,V)[i];let d=c(this,$).now()-c(this,Z)[i];o.start=Math.floor(Date.now()-d);}c(this,Q)&&(o.size=c(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=c(this,$).now()-r;}this.set(i,s.value,s);}}set(e$1,i,s={}){var st,M,k,w;if(i===void 0)return this.delete(e$1),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c$1}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=c(this,Tt).call(this,e$1,i,s.size||0,d);if(this.maxEntrySize&&R>this.maxEntrySize)return c$1&&(c$1.set="miss",c$1.maxEntrySizeExceeded=true),f$1(this,l,dt).call(this,e$1,"set"),this;let S=c(this,U)===0?void 0:c(this,T).get(e$1);if(S===void 0)S=c(this,U)===0?c(this,D):c(this,J).length!==0?c(this,J).pop():c(this,U)===c(this,K)?f$1(this,l,Lt).call(this,false):c(this,U),c(this,b)[S]=e$1,c(this,f)[S]=i,c(this,T).set(e$1,S),c(this,F)[c(this,D)]=S,c(this,z)[S]=c(this,D),e(this,D,S),g(this,U)._++,c(this,At).call(this,S,R,c$1),c$1&&(c$1.set="add"),v=false,c(this,xt)&&((st=c(this,ut))==null||st.call(this,i,e$1,"add"));else {f$1(this,l,wt).call(this,S);let y=c(this,f)[S];if(i!==y){if(c(this,ct)&&f$1(this,l,A).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(c(this,tt)&&((M=c(this,q))==null||M.call(this,a,e$1,"set")),c(this,P)&&c(this,L)?.push([a,e$1,"set"]));}else o||(c(this,tt)&&((k=c(this,q))==null||k.call(this,y,e$1,"set")),c(this,P)&&c(this,L)?.push([y,e$1,"set"]));if(c(this,mt).call(this,S),c(this,At).call(this,S,R,c$1),c(this,f)[S]=i,c$1){c$1.set="replace";let a=y&&f$1(this,l,A).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(c$1.oldValue=a);}}else c$1&&(c$1.set="update");c(this,xt)&&this.onInsert?.(i,e$1,i===y?"update":"replace");}if(r!==0&&!c(this,V)&&f$1(this,l,It).call(this),c(this,V)&&(v||c(this,Ot).call(this,S,r,n),c$1&&c(this,rt).call(this,c$1,S)),!o&&c(this,P)&&c(this,L)){let y=c(this,L),a;for(;a=y?.shift();)(w=c(this,X))==null||w.call(this,...a);}return this}pop(){var e;try{for(;c(this,U);){let i=c(this,f)[c(this,N)];if(f$1(this,l,Lt).call(this,!0),f$1(this,l,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(c(this,P)&&c(this,L)){let i=c(this,L),s;for(;s=i?.shift();)(e=c(this,X))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=c(this,T).get(e);if(n!==void 0){let o=c(this,f)[n];if(f$1(this,l,A).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(c(this,Y).call(this,n))r&&(r.has="stale",c(this,rt).call(this,r,n));else return s&&c(this,ft).call(this,n),r&&(r.has="hit",c(this,rt).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=c(this,T).get(e);if(r===void 0||!s&&c(this,Y).call(this,r))return;let n=c(this,f)[r];return f$1(this,l,A).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c$1=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:M=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!c(this,ct))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:d,size:c$1,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:k,ignoreFetchAbort:M,status:a,signal:x},u=c(this,T).get(e);if(u===void 0){a&&(a.fetch="miss");let m=f$1(this,l,Ct).call(this,e,u,O,w);return m.__returned=m}else {let m=c(this,f)[u];if(f$1(this,l,A).call(this,m)){let vt=s&&m.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?m.__staleWhileFetching:m.__returned=m}let j=c(this,Y).call(this,u);if(!y&&!j)return a&&(a.fetch="hit"),f$1(this,l,wt).call(this,u),r&&c(this,ft).call(this,u),a&&c(this,rt).call(this,a,u),m;let H=f$1(this,l,Ct).call(this,e,u,O,w),gt=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=j?"stale":"refresh",gt&&j&&(a.returnedStale=true)),gt?H.__staleWhileFetching:H.__returned=H}}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=c(this,Et);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,d=this.get(e,o);if(!n&&d!==void 0)return d;let c$1=s(e,d,{options:o,context:r});return this.set(e,c$1,o),c$1}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,d=c(this,T).get(e);if(d!==void 0){let c$1=c(this,f)[d],v=f$1(this,l,A).call(this,c$1);return o&&c(this,rt).call(this,o,d),c(this,Y).call(this,d)?(o&&(o.get="stale"),v?(o&&s&&c$1.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c$1.__staleWhileFetching:void 0):(n||f$1(this,l,dt).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c$1:void 0)):(o&&(o.get="hit"),v?c$1.__staleWhileFetching:(f$1(this,l,wt).call(this,d),r&&c(this,ft).call(this,d),c$1))}else o&&(o.get="miss");}delete(e){return f$1(this,l,dt).call(this,e,"delete")}clear(){return f$1(this,l,zt).call(this,"delete")}},K=new WeakMap,G=new WeakMap,q=new WeakMap,ut=new WeakMap,X=new WeakMap,yt=new WeakMap,Et=new WeakMap,$=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,b=new WeakMap,f=new WeakMap,F=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,ct=new WeakMap,P=new WeakMap,xt=new WeakMap,l=new WeakSet,It=function(){let e$1=new Dt(c(this,K)),i=new Dt(c(this,K));e(this,V,e$1),e(this,Z,i);let s=this.ttlAutopurge?new Array(c(this,K)):void 0;e(this,W,s),e(this,Ot,(d,c$1,v=c(this,$).now())=>{i[d]=c$1!==0?v:0,e$1[d]=c$1,r(d,c$1);}),e(this,ft,d=>{i[d]=e$1[d]!==0?c(this,$).now():0,r(d,e$1[d]);});let r=this.ttlAutopurge?(d,c$1)=>{if(s?.[d]&&(clearTimeout(s[d]),s[d]=void 0),c$1&&c$1!==0&&s){let v=setTimeout(()=>{c(this,Y).call(this,d)&&f$1(this,l,dt).call(this,c(this,b)[d],"expire");},c$1+1);v.unref&&v.unref(),s[d]=v;}}:()=>{};e(this,rt,(d,c)=>{if(e$1[c]){let v=e$1[c],R=i[c];if(!v||!R)return;d.ttl=v,d.start=R,d.now=n||o();let S=d.now-R;d.remainingTTL=v-S;}});let n=0,o=()=>{let d=c(this,$).now();if(this.ttlResolution>0){n=d;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref();}return d};this.getRemainingTTL=d=>{let c$1=c(this,T).get(d);if(c$1===void 0)return 0;let v=e$1[c$1],R=i[c$1];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},e(this,Y,d=>{let c=i[d],v=e$1[d];return !!v&&!!c&&(n||o())-c>v});},ft=new WeakMap,rt=new WeakMap,Ot=new WeakMap,Y=new WeakMap,ee=function(){let e$1=new Dt(c(this,K));e(this,B,0),e(this,Q,e$1),e(this,mt,i=>{e(this,B,c(this,B)-e$1[i]),e$1[i]=0;}),e(this,Tt,(i,s,r,n)=>{if(f$1(this,l,A).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(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}),e(this,At,(i,s,r)=>{if(e$1[i]=s,c(this,G)){let n=c(this,G)-e$1[i];for(;c(this,B)>n;)f$1(this,l,Lt).call(this,true);}e(this,B,c(this,B)+e$1[i]),r&&(r.entrySize=s,r.totalCalculatedSize=c(this,B));});},mt=new WeakMap,At=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(c(this,U))for(let i=c(this,D);!(!f$1(this,l,Mt).call(this,i)||((e||!c(this,Y).call(this,i))&&(yield i),i===c(this,N)));)i=c(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(c(this,U))for(let i=c(this,N);!(!f$1(this,l,Mt).call(this,i)||((e||!c(this,Y).call(this,i))&&(yield i),i===c(this,D)));)i=c(this,F)[i];},Mt=function(e){return e!==void 0&&c(this,T).get(c(this,b)[e])===e},Lt=function(e$1){var n;let i=c(this,N),s=c(this,b)[i],r=c(this,f)[i];return c(this,ct)&&f$1(this,l,A).call(this,r)?r.__abortController.abort(new Error("evicted")):(c(this,tt)||c(this,P))&&(c(this,tt)&&((n=c(this,q))==null||n.call(this,r,s,"evict")),c(this,P)&&c(this,L)?.push([r,s,"evict"])),c(this,mt).call(this,i),c(this,W)?.[i]&&(clearTimeout(c(this,W)[i]),c(this,W)[i]=void 0),e$1&&(c(this,b)[i]=void 0,c(this,f)[i]=void 0,c(this,J).push(i)),c(this,U)===1?(e(this,N,e(this,D,0)),c(this,J).length=0):e(this,N,c(this,F)[i]),c(this,T).delete(s),g(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:c(this,f)[i];if(f$1(this,l,A).call(this,n))return n;let o=new Nt,{signal:d}=s;d?.addEventListener("abort",()=>o.abort(d.reason),{signal:o.signal});let c$1={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,O);let u=M,m=c(this,f)[i];return (m===M||x&&y&&m===void 0)&&(w===void 0?u.__staleWhileFetching!==void 0?c(this,f)[i]=u.__staleWhileFetching:f$1(this,l,dt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,c$1.options))),w},R=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,O=x||s.allowStaleOnFetchRejection,u=O||s.noDeleteOnFetchRejection,m=M;if(c(this,f)[i]===M&&(!u||!y&&m.__staleWhileFetching===void 0?f$1(this,l,dt).call(this,e,"fetch"):x||(c(this,f)[i]=m.__staleWhileFetching)),O)return s.status&&m.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),m.__staleWhileFetching;if(m.__returned===m)throw w},st=(w,y)=>{var x;let a=(x=c(this,yt))==null?void 0:x.call(this,e,n,c$1);a&&a instanceof Promise&&a.then(O=>w(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let M=new Promise(st).then(v,R),k=Object.assign(M,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...c$1.options,status:void 0}),i=c(this,T).get(e)):c(this,f)[i]=k,k},A=function(e){if(!c(this,ct))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},Gt=function(e,i){c(this,z)[i]=e,c(this,F)[e]=i;},wt=function(e$1){e$1!==c(this,D)&&(e$1===c(this,N)?e(this,N,c(this,F)[e$1]):f$1(this,l,Gt).call(this,c(this,z)[e$1],c(this,F)[e$1]),f$1(this,l,Gt).call(this,c(this,D),e$1),e(this,D,e$1));},dt=function(e$1,i){var r,n;let s=false;if(c(this,U)!==0){let o=c(this,T).get(e$1);if(o!==void 0)if(c(this,W)?.[o]&&(clearTimeout(c(this,W)?.[o]),c(this,W)[o]=void 0),s=true,c(this,U)===1)f$1(this,l,zt).call(this,i);else {c(this,mt).call(this,o);let d=c(this,f)[o];if(f$1(this,l,A).call(this,d)?d.__abortController.abort(new Error("deleted")):(c(this,tt)||c(this,P))&&(c(this,tt)&&((r=c(this,q))==null||r.call(this,d,e$1,i)),c(this,P)&&c(this,L)?.push([d,e$1,i])),c(this,T).delete(e$1),c(this,b)[o]=void 0,c(this,f)[o]=void 0,o===c(this,D))e(this,D,c(this,z)[o]);else if(o===c(this,N))e(this,N,c(this,F)[o]);else {let c$1=c(this,z)[o];c(this,F)[c$1]=c(this,F)[o];let v=c(this,F)[o];c(this,z)[v]=c(this,z)[o];}g(this,U)._--,c(this,J).push(o);}}if(c(this,P)&&c(this,L)?.length){let o=c(this,L),d;for(;d=o?.shift();)(n=c(this,X))==null||n.call(this,...d);}return s},zt=function(e$1){var i,s;for(let r of f$1(this,l,ht).call(this,{allowStale:true})){let n=c(this,f)[r];if(f$1(this,l,A).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=c(this,b)[r];c(this,tt)&&((i=c(this,q))==null||i.call(this,n,o,e$1)),c(this,P)&&c(this,L)?.push([n,o,e$1]);}}if(c(this,T).clear(),c(this,f).fill(void 0),c(this,b).fill(void 0),c(this,V)&&c(this,Z)){c(this,V).fill(0),c(this,Z).fill(0);for(let r of c(this,W)??[])r!==void 0&&clearTimeout(r);c(this,W)?.fill(void 0);}if(c(this,Q)&&c(this,Q).fill(0),e(this,N,0),e(this,D,0),c(this,J).length=0,e(this,B,0),e(this,U,0),c(this,P)&&c(this,L)){let r=c(this,L),n;for(;n=r?.shift();)(s=c(this,X))==null||s.call(this,...n);}},bt);var Ft=class{constructor(e){b$1(this,"cache");b$1(this,"map",new Map);this.cache=new te({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 Ut="1.6.3";var Vt="repeat";function Wt(g){return {type:"pause",duration:g}}var Yt="__game_layer__";var de="general";var ce={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={};var Ht={};a(Ht,{createExportableElement:()=>se});var _t;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(_t||(_t={}));function se(g){try{if(typeof g>"u")return g;let e=JSON.stringify(g);return JSON.parse(e)}catch(e){throw _t.error("Error creating exportable element",g,e),new PixiError("not_json_serializable","Error creating exportable element")}}function re(){console.info(`
|
|
1
|
+
import {b as b$1,d,a,c,e,f as f$1,g}from'./chunk-TTRUPDAB.mjs';import*as nt from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as qt from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import {PixiError,GameUnifier}from'@drincs/pixi-vn/core';export*from'@drincs/pixi-vn/core';import*as et from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as C from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as pt from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as I from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {motion}from'@drincs/pixi-vn/motion';var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,jt=typeof process=="object"&&process?process:{},Qt=(g,e,i,s)=>{typeof jt.emitWarning=="function"?jt.emitWarning(g,e,i,s):console.error(`[${i}] ${e}: ${g}`);},Nt=globalThis.AbortController,Xt=globalThis.AbortSignal;if(typeof Nt>"u"){Xt=class{constructor(){b$1(this,"onabort");b$1(this,"_onabort",[]);b$1(this,"reason");b$1(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){b$1(this,"signal",new Xt);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 g=jt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{g&&(g=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",e));};}var ae=g=>!Jt.has(g);var at=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),Zt=g=>at(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(g){super(g),this.fill(0);}},it,St,le=(it=class{constructor(e,i){b$1(this,"heap");b$1(this,"length");if(!c(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e$1){let i=Zt(e$1);if(!i)return [];e(it,St,true);let s=new it(e$1,i);return e(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,d(it,St,false),it),$t,Bt,K,G,q,ut,X,yt,Et,$,U,B,T,b,f,F,z,N,D,J,L,Q,Z,V,W,tt,ct,P,xt,l,It,ft,rt,Ot,Y,ee,mt,At,Tt,lt,ht,Mt,Lt,Ct,A,Gt,wt,dt,zt,bt,te=(bt=class{constructor(e$1){d(this,l);d(this,K);d(this,G);d(this,q);d(this,ut);d(this,X);d(this,yt);d(this,Et);d(this,$);b$1(this,"ttl");b$1(this,"ttlResolution");b$1(this,"ttlAutopurge");b$1(this,"updateAgeOnGet");b$1(this,"updateAgeOnHas");b$1(this,"allowStale");b$1(this,"noDisposeOnSet");b$1(this,"noUpdateTTL");b$1(this,"maxEntrySize");b$1(this,"sizeCalculation");b$1(this,"noDeleteOnFetchRejection");b$1(this,"noDeleteOnStaleGet");b$1(this,"allowStaleOnFetchAbort");b$1(this,"allowStaleOnFetchRejection");b$1(this,"ignoreFetchAbort");d(this,U);d(this,B);d(this,T);d(this,b);d(this,f);d(this,F);d(this,z);d(this,N);d(this,D);d(this,J);d(this,L);d(this,Q);d(this,Z);d(this,V);d(this,W);d(this,tt);d(this,ct);d(this,P);d(this,xt);d(this,ft,()=>{});d(this,rt,()=>{});d(this,Ot,()=>{});d(this,Y,()=>false);d(this,mt,e=>{});d(this,At,(e,i,s)=>{});d(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});b$1(this,$t,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:d$1,allowStale:c$1,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:M,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:u,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:j,ignoreFetchAbort:H,perf:gt}=e$1;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(e(this,$,gt??ne),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?Zt(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(e(this,K,i),e(this,G,k),this.maxEntrySize=w||c(this,G),this.sizeCalculation=y,this.sizeCalculation){if(!c(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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(e(this,Et,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(e(this,yt,a),e(this,ct,!!a),e(this,T,new Map),e(this,b,new Array(i).fill(void 0)),e(this,f,new Array(i).fill(void 0)),e(this,F,new vt(i)),e(this,z,new vt(i)),e(this,N,0),e(this,D,0),e(this,J,le.create(i)),e(this,U,0),e(this,B,0),typeof v=="function"&&e(this,q,v),typeof R=="function"&&e(this,ut,R),typeof S=="function"?(e(this,X,S),e(this,L,[])):(e(this,X,void 0),e(this,L,void 0)),e(this,tt,!!c(this,q)),e(this,xt,!!c(this,ut)),e(this,P,!!c(this,X)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!M,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(c(this,G)!==0&&!at(c(this,G)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");f$1(this,l,ee).call(this);}if(this.allowStale=!!c$1,this.noDeleteOnStaleGet=!!u,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!d$1,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");f$1(this,l,It).call(this);}if(c(this,K)===0&&this.ttl===0&&c(this,G)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!c(this,K)&&!c(this,G)){let Pt="LRU_CACHE_UNBOUNDED";ae(Pt)&&(Jt.add(Pt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,bt));}}get perf(){return c(this,$)}static unsafeExposeInternals(e){return {starts:c(e,Z),ttls:c(e,V),autopurgeTimers:c(e,W),sizes:c(e,Q),keyMap:c(e,T),keyList:c(e,b),valList:c(e,f),next:c(e,F),prev:c(e,z),get head(){return c(e,N)},get tail(){return c(e,D)},free:c(e,J),isBackgroundFetch:i=>{var s;return f$1(s=e,l,A).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return f$1(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return f$1(s=e,l,wt).call(s,i)},indexes:i=>{var s;return f$1(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return f$1(s=e,l,ht).call(s,i)},isStale:i=>{var s;return c(s=e,Y).call(s,i)}}}get max(){return c(this,K)}get maxSize(){return c(this,G)}get calculatedSize(){return c(this,B)}get size(){return c(this,U)}get fetchMethod(){return c(this,yt)}get memoMethod(){return c(this,Et)}get dispose(){return c(this,q)}get onInsert(){return c(this,ut)}get disposeAfter(){return c(this,X)}getRemainingTTL(e){return c(this,T).has(e)?1/0:0}*entries(){for(let e of f$1(this,l,lt).call(this))c(this,f)[e]!==void 0&&c(this,b)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,b)[e],c(this,f)[e]]);}*rentries(){for(let e of f$1(this,l,ht).call(this))c(this,f)[e]!==void 0&&c(this,b)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,b)[e],c(this,f)[e]]);}*keys(){for(let e of f$1(this,l,lt).call(this)){let i=c(this,b)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*rkeys(){for(let e of f$1(this,l,ht).call(this)){let i=c(this,b)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*values(){for(let e of f$1(this,l,lt).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}*rvalues(){for(let e of f$1(this,l,ht).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}[(Bt=Symbol.iterator,$t=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(let s of f$1(this,l,lt).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,c(this,b)[s],this))return this.get(c(this,b)[s],i)}}forEach(e,i=this){for(let s of f$1(this,l,lt).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,c(this,b)[s],this);}}rforEach(e,i=this){for(let s of f$1(this,l,ht).call(this)){let r=c(this,f)[s],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,c(this,b)[s],this);}}purgeStale(){let e=false;for(let i of f$1(this,l,ht).call(this,{allowStale:true}))c(this,Y).call(this,i)&&(f$1(this,l,dt).call(this,c(this,b)[i],"expire"),e=true);return e}info(e){let i=c(this,T).get(e);if(i===void 0)return;let s=c(this,f)[i],r=f$1(this,l,A).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(c(this,V)&&c(this,Z)){let o=c(this,V)[i],d=c(this,Z)[i];if(o&&d){let c$1=o-(c(this,$).now()-d);n.ttl=c$1,n.start=Date.now();}}return c(this,Q)&&(n.size=c(this,Q)[i]),n}dump(){let e=[];for(let i of f$1(this,l,lt).call(this,{allowStale:true})){let s=c(this,b)[i],r=c(this,f)[i],n=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(c(this,V)&&c(this,Z)){o.ttl=c(this,V)[i];let d=c(this,$).now()-c(this,Z)[i];o.start=Math.floor(Date.now()-d);}c(this,Q)&&(o.size=c(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=c(this,$).now()-r;}this.set(i,s.value,s);}}set(e$1,i,s={}){var st,M,k,w;if(i===void 0)return this.delete(e$1),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:c$1}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=c(this,Tt).call(this,e$1,i,s.size||0,d);if(this.maxEntrySize&&R>this.maxEntrySize)return c$1&&(c$1.set="miss",c$1.maxEntrySizeExceeded=true),f$1(this,l,dt).call(this,e$1,"set"),this;let S=c(this,U)===0?void 0:c(this,T).get(e$1);if(S===void 0)S=c(this,U)===0?c(this,D):c(this,J).length!==0?c(this,J).pop():c(this,U)===c(this,K)?f$1(this,l,Lt).call(this,false):c(this,U),c(this,b)[S]=e$1,c(this,f)[S]=i,c(this,T).set(e$1,S),c(this,F)[c(this,D)]=S,c(this,z)[S]=c(this,D),e(this,D,S),g(this,U)._++,c(this,At).call(this,S,R,c$1),c$1&&(c$1.set="add"),v=false,c(this,xt)&&((st=c(this,ut))==null||st.call(this,i,e$1,"add"));else {f$1(this,l,wt).call(this,S);let y=c(this,f)[S];if(i!==y){if(c(this,ct)&&f$1(this,l,A).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(c(this,tt)&&((M=c(this,q))==null||M.call(this,a,e$1,"set")),c(this,P)&&c(this,L)?.push([a,e$1,"set"]));}else o||(c(this,tt)&&((k=c(this,q))==null||k.call(this,y,e$1,"set")),c(this,P)&&c(this,L)?.push([y,e$1,"set"]));if(c(this,mt).call(this,S),c(this,At).call(this,S,R,c$1),c(this,f)[S]=i,c$1){c$1.set="replace";let a=y&&f$1(this,l,A).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(c$1.oldValue=a);}}else c$1&&(c$1.set="update");c(this,xt)&&this.onInsert?.(i,e$1,i===y?"update":"replace");}if(r!==0&&!c(this,V)&&f$1(this,l,It).call(this),c(this,V)&&(v||c(this,Ot).call(this,S,r,n),c$1&&c(this,rt).call(this,c$1,S)),!o&&c(this,P)&&c(this,L)){let y=c(this,L),a;for(;a=y?.shift();)(w=c(this,X))==null||w.call(this,...a);}return this}pop(){var e;try{for(;c(this,U);){let i=c(this,f)[c(this,N)];if(f$1(this,l,Lt).call(this,!0),f$1(this,l,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(c(this,P)&&c(this,L)){let i=c(this,L),s;for(;s=i?.shift();)(e=c(this,X))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=c(this,T).get(e);if(n!==void 0){let o=c(this,f)[n];if(f$1(this,l,A).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(c(this,Y).call(this,n))r&&(r.has="stale",c(this,rt).call(this,r,n));else return s&&c(this,ft).call(this,n),r&&(r.has="hit",c(this,rt).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=c(this,T).get(e);if(r===void 0||!s&&c(this,Y).call(this,r))return;let n=c(this,f)[r];return f$1(this,l,A).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:c$1=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:M=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!c(this,ct))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:d,size:c$1,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:k,ignoreFetchAbort:M,status:a,signal:x},u=c(this,T).get(e);if(u===void 0){a&&(a.fetch="miss");let m=f$1(this,l,Ct).call(this,e,u,O,w);return m.__returned=m}else {let m=c(this,f)[u];if(f$1(this,l,A).call(this,m)){let vt=s&&m.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?m.__staleWhileFetching:m.__returned=m}let j=c(this,Y).call(this,u);if(!y&&!j)return a&&(a.fetch="hit"),f$1(this,l,wt).call(this,u),r&&c(this,ft).call(this,u),a&&c(this,rt).call(this,a,u),m;let H=f$1(this,l,Ct).call(this,e,u,O,w),gt=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=j?"stale":"refresh",gt&&j&&(a.returnedStale=true)),gt?H.__staleWhileFetching:H.__returned=H}}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=c(this,Et);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,d=this.get(e,o);if(!n&&d!==void 0)return d;let c$1=s(e,d,{options:o,context:r});return this.set(e,c$1,o),c$1}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,d=c(this,T).get(e);if(d!==void 0){let c$1=c(this,f)[d],v=f$1(this,l,A).call(this,c$1);return o&&c(this,rt).call(this,o,d),c(this,Y).call(this,d)?(o&&(o.get="stale"),v?(o&&s&&c$1.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c$1.__staleWhileFetching:void 0):(n||f$1(this,l,dt).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c$1:void 0)):(o&&(o.get="hit"),v?c$1.__staleWhileFetching:(f$1(this,l,wt).call(this,d),r&&c(this,ft).call(this,d),c$1))}else o&&(o.get="miss");}delete(e){return f$1(this,l,dt).call(this,e,"delete")}clear(){return f$1(this,l,zt).call(this,"delete")}},K=new WeakMap,G=new WeakMap,q=new WeakMap,ut=new WeakMap,X=new WeakMap,yt=new WeakMap,Et=new WeakMap,$=new WeakMap,U=new WeakMap,B=new WeakMap,T=new WeakMap,b=new WeakMap,f=new WeakMap,F=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,ct=new WeakMap,P=new WeakMap,xt=new WeakMap,l=new WeakSet,It=function(){let e$1=new Dt(c(this,K)),i=new Dt(c(this,K));e(this,V,e$1),e(this,Z,i);let s=this.ttlAutopurge?new Array(c(this,K)):void 0;e(this,W,s),e(this,Ot,(d,c$1,v=c(this,$).now())=>{i[d]=c$1!==0?v:0,e$1[d]=c$1,r(d,c$1);}),e(this,ft,d=>{i[d]=e$1[d]!==0?c(this,$).now():0,r(d,e$1[d]);});let r=this.ttlAutopurge?(d,c$1)=>{if(s?.[d]&&(clearTimeout(s[d]),s[d]=void 0),c$1&&c$1!==0&&s){let v=setTimeout(()=>{c(this,Y).call(this,d)&&f$1(this,l,dt).call(this,c(this,b)[d],"expire");},c$1+1);v.unref&&v.unref(),s[d]=v;}}:()=>{};e(this,rt,(d,c)=>{if(e$1[c]){let v=e$1[c],R=i[c];if(!v||!R)return;d.ttl=v,d.start=R,d.now=n||o();let S=d.now-R;d.remainingTTL=v-S;}});let n=0,o=()=>{let d=c(this,$).now();if(this.ttlResolution>0){n=d;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref();}return d};this.getRemainingTTL=d=>{let c$1=c(this,T).get(d);if(c$1===void 0)return 0;let v=e$1[c$1],R=i[c$1];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},e(this,Y,d=>{let c=i[d],v=e$1[d];return !!v&&!!c&&(n||o())-c>v});},ft=new WeakMap,rt=new WeakMap,Ot=new WeakMap,Y=new WeakMap,ee=function(){let e$1=new Dt(c(this,K));e(this,B,0),e(this,Q,e$1),e(this,mt,i=>{e(this,B,c(this,B)-e$1[i]),e$1[i]=0;}),e(this,Tt,(i,s,r,n)=>{if(f$1(this,l,A).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(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}),e(this,At,(i,s,r)=>{if(e$1[i]=s,c(this,G)){let n=c(this,G)-e$1[i];for(;c(this,B)>n;)f$1(this,l,Lt).call(this,true);}e(this,B,c(this,B)+e$1[i]),r&&(r.entrySize=s,r.totalCalculatedSize=c(this,B));});},mt=new WeakMap,At=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(c(this,U))for(let i=c(this,D);!(!f$1(this,l,Mt).call(this,i)||((e||!c(this,Y).call(this,i))&&(yield i),i===c(this,N)));)i=c(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(c(this,U))for(let i=c(this,N);!(!f$1(this,l,Mt).call(this,i)||((e||!c(this,Y).call(this,i))&&(yield i),i===c(this,D)));)i=c(this,F)[i];},Mt=function(e){return e!==void 0&&c(this,T).get(c(this,b)[e])===e},Lt=function(e$1){var n;let i=c(this,N),s=c(this,b)[i],r=c(this,f)[i];return c(this,ct)&&f$1(this,l,A).call(this,r)?r.__abortController.abort(new Error("evicted")):(c(this,tt)||c(this,P))&&(c(this,tt)&&((n=c(this,q))==null||n.call(this,r,s,"evict")),c(this,P)&&c(this,L)?.push([r,s,"evict"])),c(this,mt).call(this,i),c(this,W)?.[i]&&(clearTimeout(c(this,W)[i]),c(this,W)[i]=void 0),e$1&&(c(this,b)[i]=void 0,c(this,f)[i]=void 0,c(this,J).push(i)),c(this,U)===1?(e(this,N,e(this,D,0)),c(this,J).length=0):e(this,N,c(this,F)[i]),c(this,T).delete(s),g(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:c(this,f)[i];if(f$1(this,l,A).call(this,n))return n;let o=new Nt,{signal:d}=s;d?.addEventListener("abort",()=>o.abort(d.reason),{signal:o.signal});let c$1={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,O);let u=M,m=c(this,f)[i];return (m===M||x&&y&&m===void 0)&&(w===void 0?u.__staleWhileFetching!==void 0?c(this,f)[i]=u.__staleWhileFetching:f$1(this,l,dt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,c$1.options))),w},R=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,O=x||s.allowStaleOnFetchRejection,u=O||s.noDeleteOnFetchRejection,m=M;if(c(this,f)[i]===M&&(!u||!y&&m.__staleWhileFetching===void 0?f$1(this,l,dt).call(this,e,"fetch"):x||(c(this,f)[i]=m.__staleWhileFetching)),O)return s.status&&m.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),m.__staleWhileFetching;if(m.__returned===m)throw w},st=(w,y)=>{var x;let a=(x=c(this,yt))==null?void 0:x.call(this,e,n,c$1);a&&a instanceof Promise&&a.then(O=>w(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let M=new Promise(st).then(v,R),k=Object.assign(M,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...c$1.options,status:void 0}),i=c(this,T).get(e)):c(this,f)[i]=k,k},A=function(e){if(!c(this,ct))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},Gt=function(e,i){c(this,z)[i]=e,c(this,F)[e]=i;},wt=function(e$1){e$1!==c(this,D)&&(e$1===c(this,N)?e(this,N,c(this,F)[e$1]):f$1(this,l,Gt).call(this,c(this,z)[e$1],c(this,F)[e$1]),f$1(this,l,Gt).call(this,c(this,D),e$1),e(this,D,e$1));},dt=function(e$1,i){var r,n;let s=false;if(c(this,U)!==0){let o=c(this,T).get(e$1);if(o!==void 0)if(c(this,W)?.[o]&&(clearTimeout(c(this,W)?.[o]),c(this,W)[o]=void 0),s=true,c(this,U)===1)f$1(this,l,zt).call(this,i);else {c(this,mt).call(this,o);let d=c(this,f)[o];if(f$1(this,l,A).call(this,d)?d.__abortController.abort(new Error("deleted")):(c(this,tt)||c(this,P))&&(c(this,tt)&&((r=c(this,q))==null||r.call(this,d,e$1,i)),c(this,P)&&c(this,L)?.push([d,e$1,i])),c(this,T).delete(e$1),c(this,b)[o]=void 0,c(this,f)[o]=void 0,o===c(this,D))e(this,D,c(this,z)[o]);else if(o===c(this,N))e(this,N,c(this,F)[o]);else {let c$1=c(this,z)[o];c(this,F)[c$1]=c(this,F)[o];let v=c(this,F)[o];c(this,z)[v]=c(this,z)[o];}g(this,U)._--,c(this,J).push(o);}}if(c(this,P)&&c(this,L)?.length){let o=c(this,L),d;for(;d=o?.shift();)(n=c(this,X))==null||n.call(this,...d);}return s},zt=function(e$1){var i,s;for(let r of f$1(this,l,ht).call(this,{allowStale:true})){let n=c(this,f)[r];if(f$1(this,l,A).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=c(this,b)[r];c(this,tt)&&((i=c(this,q))==null||i.call(this,n,o,e$1)),c(this,P)&&c(this,L)?.push([n,o,e$1]);}}if(c(this,T).clear(),c(this,f).fill(void 0),c(this,b).fill(void 0),c(this,V)&&c(this,Z)){c(this,V).fill(0),c(this,Z).fill(0);for(let r of c(this,W)??[])r!==void 0&&clearTimeout(r);c(this,W)?.fill(void 0);}if(c(this,Q)&&c(this,Q).fill(0),e(this,N,0),e(this,D,0),c(this,J).length=0,e(this,B,0),e(this,U,0),c(this,P)&&c(this,L)){let r=c(this,L),n;for(;n=r?.shift();)(s=c(this,X))==null||s.call(this,...n);}},bt);var Ft=class{constructor(e){b$1(this,"cache");b$1(this,"map",new Map);this.cache=new te({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 Ut="1.6.4";var Vt="repeat";function Wt(g){return {type:"pause",duration:g}}var Yt="__game_layer__";var de="general";var ce={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={};var Ht={};a(Ht,{createExportableElement:()=>se});var _t;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(_t||(_t={}));function se(g){try{if(typeof g>"u")return g;let e=JSON.stringify(g);return JSON.parse(e)}catch(e){throw _t.error("Error creating exportable element",g,e),new PixiError("not_json_serializable","Error creating exportable element")}}function re(){console.info(`
|
|
2
2
|
_______ _ _ _ ____ ____ ____ _____
|
|
3
3
|
|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
|
|
4
4
|
| |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
|
package/dist/narration.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChoiceInterface as ChoiceInterface$1 } from '@drincs/pixi-vn';
|
|
2
|
-
import { S as StorageObjectType, a as StorageElementType } from './StorageElementType-
|
|
3
|
-
import { L as LabelIdType, S as StepLabelType, a as LabelRunModeType, C as ChoiceOptionInterface, b as CloseChoiceOptionInterface, c as CloseType, O as OpenedLabel, d as StepLabelPropsType, e as StepLabelResultType, f as StoredIndexedChoiceInterface, D as DialogueInterface, g as StoredChoiceInterface, H as HistoryStep } from './HistoryChoiceMenuOption-
|
|
4
|
-
export { h as Close, i as HistoryChoiceMenuOption, N as NarrationHistory } from './HistoryChoiceMenuOption-
|
|
2
|
+
import { S as StorageObjectType, a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
3
|
+
import { L as LabelIdType, S as StepLabelType, a as LabelRunModeType, C as ChoiceOptionInterface, b as CloseChoiceOptionInterface, c as CloseType, O as OpenedLabel, d as StepLabelPropsType, e as StepLabelResultType, f as StoredIndexedChoiceInterface, D as DialogueInterface, g as StoredChoiceInterface, H as HistoryStep } from './HistoryChoiceMenuOption-iazqoVVm.cjs';
|
|
4
|
+
export { h as Close, i as HistoryChoiceMenuOption, N as NarrationHistory } from './HistoryChoiceMenuOption-iazqoVVm.cjs';
|
|
5
5
|
import 'microdiff';
|
|
6
6
|
|
|
7
7
|
interface LabelProps<T, StepIdType = number> {
|
package/dist/narration.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChoiceInterface as ChoiceInterface$1 } from '@drincs/pixi-vn';
|
|
2
|
-
import { S as StorageObjectType, a as StorageElementType } from './StorageElementType-
|
|
3
|
-
import { L as LabelIdType, S as StepLabelType, a as LabelRunModeType, C as ChoiceOptionInterface, b as CloseChoiceOptionInterface, c as CloseType, O as OpenedLabel, d as StepLabelPropsType, e as StepLabelResultType, f as StoredIndexedChoiceInterface, D as DialogueInterface, g as StoredChoiceInterface, H as HistoryStep } from './HistoryChoiceMenuOption-
|
|
4
|
-
export { h as Close, i as HistoryChoiceMenuOption, N as NarrationHistory } from './HistoryChoiceMenuOption-
|
|
2
|
+
import { S as StorageObjectType, a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
3
|
+
import { L as LabelIdType, S as StepLabelType, a as LabelRunModeType, C as ChoiceOptionInterface, b as CloseChoiceOptionInterface, c as CloseType, O as OpenedLabel, d as StepLabelPropsType, e as StepLabelResultType, f as StoredIndexedChoiceInterface, D as DialogueInterface, g as StoredChoiceInterface, H as HistoryStep } from './HistoryChoiceMenuOption-DM4wqiGt.js';
|
|
4
|
+
export { h as Close, i as HistoryChoiceMenuOption, N as NarrationHistory } from './HistoryChoiceMenuOption-DM4wqiGt.js';
|
|
5
5
|
import 'microdiff';
|
|
6
6
|
|
|
7
7
|
interface LabelProps<T, StepIdType = number> {
|
package/dist/storage.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var te=Object.defineProperty;var $t=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 m=(u,e,i)=>ee(u,typeof e!="symbol"?e+"":e,i),zt=(u,e,i)=>e.has(u)||$t("Cannot "+i);var t=(u,e,i)=>(zt(u,e,"read from private field"),i?i.call(u):e.get(u)),g=(u,e,i)=>e.has(u)?$t("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,i),f=(u,e,i,s)=>(zt(u,e,"write to private field"),e.set(u,i),i),h=(u,e,i)=>(zt(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 rt="storage",ct="temp",W="narration",Ft="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 ut;(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)))(ut||(ut={}));function Ot(u){try{if(typeof u>"u")return u;let e=JSON.stringify(u);return JSON.parse(e)}catch(e){throw ut.error("Error creating exportable element",u,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var se=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Xt=new Set,Yt=typeof process=="object"&&process?process:{},Jt=(u,e,i,s)=>{typeof Yt.emitWarning=="function"?Yt.emitWarning(u,e,i,s):console.error(`[${i}] ${e}: ${u}`);},Lt=globalThis.AbortController,kt=globalThis.AbortSignal;if(typeof Lt>"u"){kt=class{constructor(){m(this,"onabort");m(this,"_onabort",[]);m(this,"reason");m(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Lt=class{constructor(){m(this,"signal",new kt);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=Yt.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 re=u=>!Xt.has(u);var at=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u),qt=u=>at(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?Ct:null:null,Ct=class extends Array{constructor(u){super(u),this.fill(0);}},et,St,ae=(et=class{constructor(e,i){m(this,"heap");m(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,g(et,St,false),et),Ht,Bt,$,V,k,ft,H,Tt,bt,B,O,X,w,A,_,C,U,N,R,J,x,q,Q,z,Y,Z,lt,M,At,n,Pt,_t,it,xt,P,Zt,pt,yt,Dt,ot,nt,Kt,Mt,Gt,b,Wt,Rt,ht,jt,vt,Qt=(vt=class{constructor(e){g(this,n);g(this,$);g(this,V);g(this,k);g(this,ft);g(this,H);g(this,Tt);g(this,bt);g(this,B);m(this,"ttl");m(this,"ttlResolution");m(this,"ttlAutopurge");m(this,"updateAgeOnGet");m(this,"updateAgeOnHas");m(this,"allowStale");m(this,"noDisposeOnSet");m(this,"noUpdateTTL");m(this,"maxEntrySize");m(this,"sizeCalculation");m(this,"noDeleteOnFetchRejection");m(this,"noDeleteOnStaleGet");m(this,"allowStaleOnFetchAbort");m(this,"allowStaleOnFetchRejection");m(this,"ignoreFetchAbort");g(this,O);g(this,X);g(this,w);g(this,A);g(this,_);g(this,C);g(this,U);g(this,N);g(this,R);g(this,J);g(this,x);g(this,q);g(this,Q);g(this,z);g(this,Y);g(this,Z);g(this,lt);g(this,M);g(this,At);g(this,_t,()=>{});g(this,it,()=>{});g(this,xt,()=>{});g(this,P,()=>false);g(this,pt,e=>{});g(this,yt,(e,i,s)=>{});g(this,Dt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});m(this,Ht,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:c,dispose:E,onInsert:D,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:K,maxSize:tt=0,maxEntrySize:y=0,sizeCalculation:T,fetchMethod:p,memoMethod:I,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:wt,ignoreFetchAbort:gt,perf:mt}=e;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,B,mt??se),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?qt(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,$,i),f(this,V,tt),this.maxEntrySize=y||t(this,V),this.sizeCalculation=T,this.sizeCalculation){if(!t(this,V)&&!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(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,bt,I),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,Tt,p),f(this,lt,!!p),f(this,w,new Map),f(this,A,new Array(i).fill(void 0)),f(this,_,new Array(i).fill(void 0)),f(this,C,new Et(i)),f(this,U,new Et(i)),f(this,N,0),f(this,R,0),f(this,J,ae.create(i)),f(this,O,0),f(this,X,0),typeof E=="function"&&f(this,k,E),typeof D=="function"&&f(this,ft,D),typeof S=="function"?(f(this,H,S),f(this,x,[])):(f(this,H,void 0),f(this,x,void 0)),f(this,Z,!!t(this,k)),f(this,At,!!t(this,ft)),f(this,M,!!t(this,H)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!wt,this.ignoreFetchAbort=!!gt,this.maxEntrySize!==0){if(t(this,V)!==0&&!at(t(this,V)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,n,Zt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,n,Pt).call(this);}if(t(this,$)===0&&this.ttl===0&&t(this,V)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,$)&&!t(this,V)){let Ut="LRU_CACHE_UNBOUNDED";re(Ut)&&(Xt.add(Ut),Jt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ut,vt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Q),ttls:t(e,z),autopurgeTimers:t(e,Y),sizes:t(e,q),keyMap:t(e,w),keyList:t(e,A),valList:t(e,_),next:t(e,C),prev:t(e,U),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return h(s=e,n,b).call(s,i)},backgroundFetch:(i,s,r,o)=>{var a;return h(a=e,n,Gt).call(a,i,s,r,o)},moveToTail:i=>{var s;return h(s=e,n,Rt).call(s,i)},indexes:i=>{var s;return h(s=e,n,ot).call(s,i)},rindexes:i=>{var s;return h(s=e,n,nt).call(s,i)},isStale:i=>{var s;return t(s=e,P).call(s,i)}}}get max(){return t(this,$)}get maxSize(){return t(this,V)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,Tt)}get memoMethod(){return t(this,bt)}get dispose(){return t(this,k)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,H)}getRemainingTTL(e){return t(this,w).has(e)?1/0:0}*entries(){for(let e of h(this,n,ot).call(this))t(this,_)[e]!==void 0&&t(this,A)[e]!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield [t(this,A)[e],t(this,_)[e]]);}*rentries(){for(let e of h(this,n,nt).call(this))t(this,_)[e]!==void 0&&t(this,A)[e]!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield [t(this,A)[e],t(this,_)[e]]);}*keys(){for(let e of h(this,n,ot).call(this)){let i=t(this,A)[e];i!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield i);}}*rkeys(){for(let e of h(this,n,nt).call(this)){let i=t(this,A)[e];i!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield i);}}*values(){for(let e of h(this,n,ot).call(this))t(this,_)[e]!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield t(this,_)[e]);}*rvalues(){for(let e of h(this,n,nt).call(this))t(this,_)[e]!==void 0&&!h(this,n,b).call(this,t(this,_)[e])&&(yield t(this,_)[e]);}[(Bt=Symbol.iterator,Ht=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(let s of h(this,n,ot).call(this)){let r=t(this,_)[s],o=h(this,n,b).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&e(o,t(this,A)[s],this))return this.get(t(this,A)[s],i)}}forEach(e,i=this){for(let s of h(this,n,ot).call(this)){let r=t(this,_)[s],o=h(this,n,b).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,A)[s],this);}}rforEach(e,i=this){for(let s of h(this,n,nt).call(this)){let r=t(this,_)[s],o=h(this,n,b).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,A)[s],this);}}purgeStale(){let e=false;for(let i of h(this,n,nt).call(this,{allowStale:true}))t(this,P).call(this,i)&&(h(this,n,ht).call(this,t(this,A)[i],"expire"),e=true);return e}info(e){let i=t(this,w).get(e);if(i===void 0)return;let s=t(this,_)[i],r=h(this,n,b).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let o={value:r};if(t(this,z)&&t(this,Q)){let a=t(this,z)[i],l=t(this,Q)[i];if(a&&l){let c=a-(t(this,B).now()-l);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 h(this,n,ot).call(this,{allowStale:true})){let s=t(this,A)[i],r=t(this,_)[i],o=h(this,n,b).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||s===void 0)continue;let a={value:o};if(t(this,z)&&t(this,Q)){a.ttl=t(this,z)[i];let l=t(this,B).now()-t(this,Q)[i];a.start=Math.floor(Date.now()-l);}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,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var st,K,tt,y;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=s,{noUpdateTTL:E=this.noUpdateTTL}=s,D=t(this,Dt).call(this,e,i,s.size||0,l);if(this.maxEntrySize&&D>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,n,ht).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,w).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,$)?h(this,n,Mt).call(this,false):t(this,O),t(this,A)[S]=e,t(this,_)[S]=i,t(this,w).set(e,S),t(this,C)[t(this,R)]=S,t(this,U)[S]=t(this,R),f(this,R,S),It(this,O)._++,t(this,yt).call(this,S,D,c),c&&(c.set="add"),E=false,t(this,At)&&((st=t(this,ft))==null||st.call(this,i,e,"add"));else {h(this,n,Rt).call(this,S);let T=t(this,_)[S];if(i!==T){if(t(this,lt)&&h(this,n,b).call(this,T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=T;p!==void 0&&!a&&(t(this,Z)&&((K=t(this,k))==null||K.call(this,p,e,"set")),t(this,M)&&t(this,x)?.push([p,e,"set"]));}else a||(t(this,Z)&&((tt=t(this,k))==null||tt.call(this,T,e,"set")),t(this,M)&&t(this,x)?.push([T,e,"set"]));if(t(this,pt).call(this,S),t(this,yt).call(this,S,D,c),t(this,_)[S]=i,c){c.set="replace";let p=T&&h(this,n,b).call(this,T)?T.__staleWhileFetching:T;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,At)&&this.onInsert?.(i,e,i===T?"update":"replace");}if(r!==0&&!t(this,z)&&h(this,n,Pt).call(this),t(this,z)&&(E||t(this,xt).call(this,S,r,o),c&&t(this,it).call(this,c,S)),!a&&t(this,M)&&t(this,x)){let T=t(this,x),p;for(;p=T?.shift();)(y=t(this,H))==null||y.call(this,...p);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,_)[t(this,N)];if(h(this,n,Mt).call(this,!0),h(this,n,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,M)&&t(this,x)){let i=t(this,x),s;for(;s=i?.shift();)(e=t(this,H))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,o=t(this,w).get(e);if(o!==void 0){let a=t(this,_)[o];if(h(this,n,b).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(t(this,P).call(this,o))r&&(r.has="stale",t(this,it).call(this,r,o));else return s&&t(this,_t).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,w).get(e);if(r===void 0||!s&&t(this,P).call(this,r))return;let o=t(this,_)[r];return h(this,n,b).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:l=this.noDisposeOnSet,size:c=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:D=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:K=this.ignoreFetchAbort,allowStaleOnFetchAbort:tt=this.allowStaleOnFetchAbort,context:y,forceRefresh:T=false,status:p,signal:I}=i;if(!t(this,lt))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:p});let L={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:l,size:c,sizeCalculation:E,noUpdateTTL:D,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:tt,ignoreFetchAbort:K,status:p,signal:I},F=t(this,w).get(e);if(F===void 0){p&&(p.fetch="miss");let v=h(this,n,Gt).call(this,e,F,L,y);return v.__returned=v}else {let v=t(this,_)[F];if(h(this,n,b).call(this,v)){let Et=s&&v.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",Et&&(p.returnedStale=true)),Et?v.__staleWhileFetching:v.__returned=v}let wt=t(this,P).call(this,F);if(!T&&!wt)return p&&(p.fetch="hit"),h(this,n,Rt).call(this,F),r&&t(this,_t).call(this,F),p&&t(this,it).call(this,p,F),v;let gt=h(this,n,Gt).call(this,e,F,L,y),mt=gt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=wt?"stale":"refresh",mt&&wt&&(p.returnedStale=true)),mt?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,bt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...a}=i,l=this.get(e,a);if(!o&&l!==void 0)return l;let c=s(e,l,{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,l=t(this,w).get(e);if(l!==void 0){let c=t(this,_)[l],E=h(this,n,b).call(this,c);return a&&t(this,it).call(this,a,l),t(this,P).call(this,l)?(a&&(a.get="stale"),E?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(o||h(this,n,ht).call(this,e,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),E?c.__staleWhileFetching:(h(this,n,Rt).call(this,l),r&&t(this,_t).call(this,l),c))}else a&&(a.get="miss");}delete(e){return h(this,n,ht).call(this,e,"delete")}clear(){return h(this,n,jt).call(this,"delete")}},$=new WeakMap,V=new WeakMap,k=new WeakMap,ft=new WeakMap,H=new WeakMap,Tt=new WeakMap,bt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,w=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakMap,U=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,x=new WeakMap,q=new WeakMap,Q=new WeakMap,z=new WeakMap,Y=new WeakMap,Z=new WeakMap,lt=new WeakMap,M=new WeakMap,At=new WeakMap,n=new WeakSet,Pt=function(){let e=new Ct(t(this,$)),i=new Ct(t(this,$));f(this,z,e),f(this,Q,i);let s=this.ttlAutopurge?new Array(t(this,$)):void 0;f(this,Y,s),f(this,xt,(l,c,E=t(this,B).now())=>{i[l]=c!==0?E:0,e[l]=c,r(l,c);}),f(this,_t,l=>{i[l]=e[l]!==0?t(this,B).now():0,r(l,e[l]);});let r=this.ttlAutopurge?(l,c)=>{if(s?.[l]&&(clearTimeout(s[l]),s[l]=void 0),c&&c!==0&&s){let E=setTimeout(()=>{t(this,P).call(this,l)&&h(this,n,ht).call(this,t(this,A)[l],"expire");},c+1);E.unref&&E.unref(),s[l]=E;}}:()=>{};f(this,it,(l,c)=>{if(e[c]){let E=e[c],D=i[c];if(!E||!D)return;l.ttl=E,l.start=D,l.now=o||a();let S=l.now-D;l.remainingTTL=E-S;}});let o=0,a=()=>{let l=t(this,B).now();if(this.ttlResolution>0){o=l;let c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref();}return l};this.getRemainingTTL=l=>{let c=t(this,w).get(l);if(c===void 0)return 0;let E=e[c],D=i[c];if(!E||!D)return 1/0;let S=(o||a())-D;return E-S},f(this,P,l=>{let c=i[l],E=e[l];return !!E&&!!c&&(o||a())-c>E});},_t=new WeakMap,it=new WeakMap,xt=new WeakMap,P=new WeakMap,Zt=function(){let e=new Ct(t(this,$));f(this,X,0),f(this,q,e),f(this,pt,i=>{f(this,X,t(this,X)-e[i]),e[i]=0;}),f(this,Dt,(i,s,r,o)=>{if(h(this,n,b).call(this,s))return 0;if(!at(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(s,i),!at(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,yt,(i,s,r)=>{if(e[i]=s,t(this,V)){let o=t(this,V)-e[i];for(;t(this,X)>o;)h(this,n,Mt).call(this,true);}f(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},pt=new WeakMap,yt=new WeakMap,Dt=new WeakMap,ot=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!h(this,n,Kt).call(this,i)||((e||!t(this,P).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,U)[i];},nt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!h(this,n,Kt).call(this,i)||((e||!t(this,P).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,C)[i];},Kt=function(e){return e!==void 0&&t(this,w).get(t(this,A)[e])===e},Mt=function(e){var o;let i=t(this,N),s=t(this,A)[i],r=t(this,_)[i];return t(this,lt)&&h(this,n,b).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,Z)||t(this,M))&&(t(this,Z)&&((o=t(this,k))==null||o.call(this,r,s,"evict")),t(this,M)&&t(this,x)?.push([r,s,"evict"])),t(this,pt).call(this,i),t(this,Y)?.[i]&&(clearTimeout(t(this,Y)[i]),t(this,Y)[i]=void 0),e&&(t(this,A)[i]=void 0,t(this,_)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(f(this,N,f(this,R,0)),t(this,J).length=0):f(this,N,t(this,C)[i]),t(this,w).delete(s),It(this,O)._--,i},Gt=function(e,i,s,r){let o=i===void 0?void 0:t(this,_)[i];if(h(this,n,b).call(this,o))return o;let a=new Lt,{signal:l}=s;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:r},E=(y,T=false)=>{let{aborted:p}=a.signal,I=s.ignoreFetchAbort&&y!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(p&&!T?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,I&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!I&&!T)return S(a.signal.reason,L);let F=K,v=t(this,_)[i];return (v===K||I&&T&&v===void 0)&&(y===void 0?F.__staleWhileFetching!==void 0?t(this,_)[i]=F.__staleWhileFetching:h(this,n,ht).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,c.options))),y},D=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),S(y,false)),S=(y,T)=>{let{aborted:p}=a.signal,I=p&&s.allowStaleOnFetchAbort,L=I||s.allowStaleOnFetchRejection,F=L||s.noDeleteOnFetchRejection,v=K;if(t(this,_)[i]===K&&(!F||!T&&v.__staleWhileFetching===void 0?h(this,n,ht).call(this,e,"fetch"):I||(t(this,_)[i]=v.__staleWhileFetching)),L)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw y},st=(y,T)=>{var I;let p=(I=t(this,Tt))==null?void 0:I.call(this,e,o,c);p&&p instanceof Promise&&p.then(L=>y(L===void 0?void 0:L),T),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=L=>E(L,true)));});};s.status&&(s.status.fetchDispatched=true);let K=new Promise(st).then(E,D),tt=Object.assign(K,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(e,tt,{...c.options,status:void 0}),i=t(this,w).get(e)):t(this,_)[i]=tt,tt},b=function(e){if(!t(this,lt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Lt},Wt=function(e,i){t(this,U)[i]=e,t(this,C)[e]=i;},Rt=function(e){e!==t(this,R)&&(e===t(this,N)?f(this,N,t(this,C)[e]):h(this,n,Wt).call(this,t(this,U)[e],t(this,C)[e]),h(this,n,Wt).call(this,t(this,R),e),f(this,R,e));},ht=function(e,i){var r,o;let s=false;if(t(this,O)!==0){let a=t(this,w).get(e);if(a!==void 0)if(t(this,Y)?.[a]&&(clearTimeout(t(this,Y)?.[a]),t(this,Y)[a]=void 0),s=true,t(this,O)===1)h(this,n,jt).call(this,i);else {t(this,pt).call(this,a);let l=t(this,_)[a];if(h(this,n,b).call(this,l)?l.__abortController.abort(new Error("deleted")):(t(this,Z)||t(this,M))&&(t(this,Z)&&((r=t(this,k))==null||r.call(this,l,e,i)),t(this,M)&&t(this,x)?.push([l,e,i])),t(this,w).delete(e),t(this,A)[a]=void 0,t(this,_)[a]=void 0,a===t(this,R))f(this,R,t(this,U)[a]);else if(a===t(this,N))f(this,N,t(this,C)[a]);else {let c=t(this,U)[a];t(this,C)[c]=t(this,C)[a];let E=t(this,C)[a];t(this,U)[E]=t(this,U)[a];}It(this,O)._--,t(this,J).push(a);}}if(t(this,M)&&t(this,x)?.length){let a=t(this,x),l;for(;l=a?.shift();)(o=t(this,H))==null||o.call(this,...l);}return s},jt=function(e){var i,s;for(let r of h(this,n,nt).call(this,{allowStale:true})){let o=t(this,_)[r];if(h(this,n,b).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=t(this,A)[r];t(this,Z)&&((i=t(this,k))==null||i.call(this,o,a,e)),t(this,M)&&t(this,x)?.push([o,a,e]);}}if(t(this,w).clear(),t(this,_).fill(void 0),t(this,A).fill(void 0),t(this,z)&&t(this,Q)){t(this,z).fill(0),t(this,Q).fill(0);for(let r of t(this,Y)??[])r!==void 0&&clearTimeout(r);t(this,Y)?.fill(void 0);}if(t(this,q)&&t(this,q).fill(0),f(this,N,0),f(this,R,0),t(this,J).length=0,f(this,X,0),f(this,O,0),t(this,M)&&t(this,x)){let r=t(this,x),o;for(;o=r?.shift();)(s=t(this,H))==null||s.call(this,...o);}},vt);var dt=class{constructor(e){m(this,"cache");m(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(){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 G=class G{constructor(){}static clearOldTempVariables(e){G.tempStorageDeadlines.forEach((i,s)=>{i>e&&(G.removeVariable(ct,s),G.tempStorageDeadlines.delete(s));});}static setVariable(e,i,s){s==null?G.storage.delete(`${e}:${i}`):G.storage.set(`${e}:${i}`,s);}static getVariable(e,i){let s=G.storage.get(`${e}:${i}`);return Ot(s)}static removeVariable(e,i){G.storage.delete(`${e}:${i}`);}static setFlag(e,i){let s=G.storage.get(Ft)||[];if(i)s.includes(e)||s.push(e);else {let r=s.indexOf(e);r>-1&&s.splice(r,1);}G.storage.set(Ft,s);}static getFlag(e){return (G.storage.get(Ft)||[]).includes(e)}};m(G,"storage",new dt({cacheSize:50})),m(G,"default",new dt({cacheSize:10})),m(G,"tempStorageDeadlines",new Map);var d=G;var Nt=class{get base(){return d.storage.map}get cache(){return d.storage.cache}get tempStorageDeadlines(){return d.tempStorageDeadlines}set default(e){Object.entries(e).forEach(([i,s])=>{d.default.map.set(i,s);});}set(e,i){return d.setVariable(rt,e,i)}get(e){let i=d.getVariable(ct,e);return i===void 0&&(i=d.getVariable(rt,e)),i===void 0&&(i=Ot(d.default.get(e))),i}remove(e){return this.removeTempVariable(e),d.removeVariable(rt,e)}setTempVariable(e,i){if(i==null){this.removeTempVariable(e);return}else d.setVariable(ct,e,i),this.tempStorageDeadlines.has(e)||this.tempStorageDeadlines.set(e,core.GameUnifier.openedLabels);}removeTempVariable(e){d.removeVariable(ct,e),this.tempStorageDeadlines.has(e)&&this.tempStorageDeadlines.delete(e);}setFlag(e,i){return d.setFlag(e,i)}getFlag(e){return d.getFlag(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 [...d.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:this.tempStorageDeadlines.get(s)});}),Ot({main:e,tempDeadlines:i})}restore(e){this.clear();try{e?(e.base?.forEach(i=>{switch(i.key){case "___current_dialogue_memory___":d.setVariable(W,j.CURRENT_DIALOGUE_MEMORY_KEY,i.value);break;case "___last_dialogue_added_in_step_memory___":d.setVariable(W,j.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_menu_options_memory___":d.setVariable(W,j.CURRENT_MENU_OPTIONS_MEMORY_KEY,i.value);break;case "___last_menu_options_added_in_step_memory___":d.setVariable(W,j.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "_input_value_":d.setVariable(W,j.CURRENT_INPUT_VALUE_MEMORY_KEY,i.value);break;case "___last_input_added_in_step_memory___":d.setVariable(W,j.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_input_info_memory___":d.setVariable(W,j.CURRENT_INPUT_INFO_MEMORY_KEY,i.value);break;case "___opened_labels_counter___":d.setVariable(W,j.OPENED_LABELS_COUNTER_KEY,i.value);break;case "___all_choices_made___":d.setVariable(W,j.ALL_CHOICES_MADE_KEY,i.value);break;case "___current_step_times_counter___":d.setVariable(W,j.CURRENT_STEP_TIMES_COUNTER_KEY,i.value);break;case "___last_step_glued___":d.setVariable(W,j.LAST_STEP_GLUED,i.value);break;default:d.setVariable(rt,i.key,i.value);}}),e.temp?.forEach(i=>{d.setVariable(ct,i.key,i.value);}),e.flags?.forEach(i=>{d.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);})):ut.warn("No storage data found");}catch(i){ut.error("Error importing data",i);}}};var Vt=class{constructor(e,i){m(this,"id");m(this,"categoryId");this.categoryId=e,this.id=i,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let i=d.getVariable(rt,e);i&&(Object.entries(i).forEach(([s,r])=>{typeof r=="object"&&r!==null&&Object.entries(r).forEach(([o,a])=>{d.setVariable(this.categoryId,`${s}:${o}`,a);});}),d.removeVariable(rt,e));}setStorageProperty(e,i){d.setVariable(this.categoryId,`${this.id}:${e}`,i);}getStorageProperty(e,i=this.id){return d.getVariable(this.categoryId,`${i}:${e}`)}};var ze=new Nt;exports.StorageManagerStatic=d;exports.StoredClassModel=Vt;exports.storage=ze;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');var te=Object.defineProperty;var $t=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 m=(u,e,i)=>ee(u,typeof e!="symbol"?e+"":e,i),zt=(u,e,i)=>e.has(u)||$t("Cannot "+i);var t=(u,e,i)=>(zt(u,e,"read from private field"),i?i.call(u):e.get(u)),g=(u,e,i)=>e.has(u)?$t("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,i),f=(u,e,i,s)=>(zt(u,e,"write to private field"),e.set(u,i),i),h=(u,e,i)=>(zt(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 rt="storage",ct="temp",W="narration",Ft="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 ut;(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)))(ut||(ut={}));function Ot(u){try{if(typeof u>"u")return u;let e=JSON.stringify(u);return JSON.parse(e)}catch(e){throw ut.error("Error creating exportable element",u,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var se=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Xt=new Set,Yt=typeof process=="object"&&process?process:{},Jt=(u,e,i,s)=>{typeof Yt.emitWarning=="function"?Yt.emitWarning(u,e,i,s):console.error(`[${i}] ${e}: ${u}`);},Lt=globalThis.AbortController,kt=globalThis.AbortSignal;if(typeof Lt>"u"){kt=class{constructor(){m(this,"onabort");m(this,"_onabort",[]);m(this,"reason");m(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Lt=class{constructor(){m(this,"signal",new kt);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=Yt.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 re=u=>!Xt.has(u);var at=u=>u&&u===Math.floor(u)&&u>0&&isFinite(u),qt=u=>at(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?Ct:null:null,Ct=class extends Array{constructor(u){super(u),this.fill(0);}},et,St,ae=(et=class{constructor(e,i){m(this,"heap");m(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,g(et,St,false),et),Ht,Bt,$,V,k,ft,H,bt,Tt,B,O,X,w,A,_,C,U,N,R,J,x,q,Q,z,Y,Z,lt,M,At,n,Pt,_t,it,xt,P,Zt,pt,yt,Dt,ot,nt,Kt,Mt,Gt,T,Wt,Rt,ht,jt,vt,Qt=(vt=class{constructor(e){g(this,n);g(this,$);g(this,V);g(this,k);g(this,ft);g(this,H);g(this,bt);g(this,Tt);g(this,B);m(this,"ttl");m(this,"ttlResolution");m(this,"ttlAutopurge");m(this,"updateAgeOnGet");m(this,"updateAgeOnHas");m(this,"allowStale");m(this,"noDisposeOnSet");m(this,"noUpdateTTL");m(this,"maxEntrySize");m(this,"sizeCalculation");m(this,"noDeleteOnFetchRejection");m(this,"noDeleteOnStaleGet");m(this,"allowStaleOnFetchAbort");m(this,"allowStaleOnFetchRejection");m(this,"ignoreFetchAbort");g(this,O);g(this,X);g(this,w);g(this,A);g(this,_);g(this,C);g(this,U);g(this,N);g(this,R);g(this,J);g(this,x);g(this,q);g(this,Q);g(this,z);g(this,Y);g(this,Z);g(this,lt);g(this,M);g(this,At);g(this,_t,()=>{});g(this,it,()=>{});g(this,xt,()=>{});g(this,P,()=>false);g(this,pt,e=>{});g(this,yt,(e,i,s)=>{});g(this,Dt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});m(this,Ht,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:c,dispose:E,onInsert:D,disposeAfter:S,noDisposeOnSet:st,noUpdateTTL:K,maxSize:tt=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:p,memoMethod:I,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:wt,ignoreFetchAbort:gt,perf:mt}=e;if(mt!==void 0&&typeof mt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,B,mt??se),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let Et=i?qt(i):Array;if(!Et)throw new Error("invalid max value: "+i);if(f(this,$,i),f(this,V,tt),this.maxEntrySize=y||t(this,V),this.sizeCalculation=b,this.sizeCalculation){if(!t(this,V)&&!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(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,Tt,I),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,bt,p),f(this,lt,!!p),f(this,w,new Map),f(this,A,new Array(i).fill(void 0)),f(this,_,new Array(i).fill(void 0)),f(this,C,new Et(i)),f(this,U,new Et(i)),f(this,N,0),f(this,R,0),f(this,J,ae.create(i)),f(this,O,0),f(this,X,0),typeof E=="function"&&f(this,k,E),typeof D=="function"&&f(this,ft,D),typeof S=="function"?(f(this,H,S),f(this,x,[])):(f(this,H,void 0),f(this,x,void 0)),f(this,Z,!!t(this,k)),f(this,At,!!t(this,ft)),f(this,M,!!t(this,H)),this.noDisposeOnSet=!!st,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!wt,this.ignoreFetchAbort=!!gt,this.maxEntrySize!==0){if(t(this,V)!==0&&!at(t(this,V)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,n,Zt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,n,Pt).call(this);}if(t(this,$)===0&&this.ttl===0&&t(this,V)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,$)&&!t(this,V)){let Ut="LRU_CACHE_UNBOUNDED";re(Ut)&&(Xt.add(Ut),Jt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ut,vt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Q),ttls:t(e,z),autopurgeTimers:t(e,Y),sizes:t(e,q),keyMap:t(e,w),keyList:t(e,A),valList:t(e,_),next:t(e,C),prev:t(e,U),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return h(s=e,n,T).call(s,i)},backgroundFetch:(i,s,r,o)=>{var a;return h(a=e,n,Gt).call(a,i,s,r,o)},moveToTail:i=>{var s;return h(s=e,n,Rt).call(s,i)},indexes:i=>{var s;return h(s=e,n,ot).call(s,i)},rindexes:i=>{var s;return h(s=e,n,nt).call(s,i)},isStale:i=>{var s;return t(s=e,P).call(s,i)}}}get max(){return t(this,$)}get maxSize(){return t(this,V)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,bt)}get memoMethod(){return t(this,Tt)}get dispose(){return t(this,k)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,H)}getRemainingTTL(e){return t(this,w).has(e)?1/0:0}*entries(){for(let e of h(this,n,ot).call(this))t(this,_)[e]!==void 0&&t(this,A)[e]!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield [t(this,A)[e],t(this,_)[e]]);}*rentries(){for(let e of h(this,n,nt).call(this))t(this,_)[e]!==void 0&&t(this,A)[e]!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield [t(this,A)[e],t(this,_)[e]]);}*keys(){for(let e of h(this,n,ot).call(this)){let i=t(this,A)[e];i!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield i);}}*rkeys(){for(let e of h(this,n,nt).call(this)){let i=t(this,A)[e];i!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield i);}}*values(){for(let e of h(this,n,ot).call(this))t(this,_)[e]!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield t(this,_)[e]);}*rvalues(){for(let e of h(this,n,nt).call(this))t(this,_)[e]!==void 0&&!h(this,n,T).call(this,t(this,_)[e])&&(yield t(this,_)[e]);}[(Bt=Symbol.iterator,Ht=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(let s of h(this,n,ot).call(this)){let r=t(this,_)[s],o=h(this,n,T).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&e(o,t(this,A)[s],this))return this.get(t(this,A)[s],i)}}forEach(e,i=this){for(let s of h(this,n,ot).call(this)){let r=t(this,_)[s],o=h(this,n,T).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,A)[s],this);}}rforEach(e,i=this){for(let s of h(this,n,nt).call(this)){let r=t(this,_)[s],o=h(this,n,T).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&e.call(i,o,t(this,A)[s],this);}}purgeStale(){let e=false;for(let i of h(this,n,nt).call(this,{allowStale:true}))t(this,P).call(this,i)&&(h(this,n,ht).call(this,t(this,A)[i],"expire"),e=true);return e}info(e){let i=t(this,w).get(e);if(i===void 0)return;let s=t(this,_)[i],r=h(this,n,T).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let o={value:r};if(t(this,z)&&t(this,Q)){let a=t(this,z)[i],l=t(this,Q)[i];if(a&&l){let c=a-(t(this,B).now()-l);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 h(this,n,ot).call(this,{allowStale:true})){let s=t(this,A)[i],r=t(this,_)[i],o=h(this,n,T).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||s===void 0)continue;let a={value:o};if(t(this,z)&&t(this,Q)){a.ttl=t(this,z)[i];let l=t(this,B).now()-t(this,Q)[i];a.start=Math.floor(Date.now()-l);}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,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var st,K,tt,y;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=s,{noUpdateTTL:E=this.noUpdateTTL}=s,D=t(this,Dt).call(this,e,i,s.size||0,l);if(this.maxEntrySize&&D>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,n,ht).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,w).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,$)?h(this,n,Mt).call(this,false):t(this,O),t(this,A)[S]=e,t(this,_)[S]=i,t(this,w).set(e,S),t(this,C)[t(this,R)]=S,t(this,U)[S]=t(this,R),f(this,R,S),It(this,O)._++,t(this,yt).call(this,S,D,c),c&&(c.set="add"),E=false,t(this,At)&&((st=t(this,ft))==null||st.call(this,i,e,"add"));else {h(this,n,Rt).call(this,S);let b=t(this,_)[S];if(i!==b){if(t(this,lt)&&h(this,n,T).call(this,b)){b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=b;p!==void 0&&!a&&(t(this,Z)&&((K=t(this,k))==null||K.call(this,p,e,"set")),t(this,M)&&t(this,x)?.push([p,e,"set"]));}else a||(t(this,Z)&&((tt=t(this,k))==null||tt.call(this,b,e,"set")),t(this,M)&&t(this,x)?.push([b,e,"set"]));if(t(this,pt).call(this,S),t(this,yt).call(this,S,D,c),t(this,_)[S]=i,c){c.set="replace";let p=b&&h(this,n,T).call(this,b)?b.__staleWhileFetching:b;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,At)&&this.onInsert?.(i,e,i===b?"update":"replace");}if(r!==0&&!t(this,z)&&h(this,n,Pt).call(this),t(this,z)&&(E||t(this,xt).call(this,S,r,o),c&&t(this,it).call(this,c,S)),!a&&t(this,M)&&t(this,x)){let b=t(this,x),p;for(;p=b?.shift();)(y=t(this,H))==null||y.call(this,...p);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,_)[t(this,N)];if(h(this,n,Mt).call(this,!0),h(this,n,T).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,M)&&t(this,x)){let i=t(this,x),s;for(;s=i?.shift();)(e=t(this,H))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,o=t(this,w).get(e);if(o!==void 0){let a=t(this,_)[o];if(h(this,n,T).call(this,a)&&a.__staleWhileFetching===void 0)return false;if(t(this,P).call(this,o))r&&(r.has="stale",t(this,it).call(this,r,o));else return s&&t(this,_t).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,w).get(e);if(r===void 0||!s&&t(this,P).call(this,r))return;let o=t(this,_)[r];return h(this,n,T).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:l=this.noDisposeOnSet,size:c=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:D=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:st=this.allowStaleOnFetchRejection,ignoreFetchAbort:K=this.ignoreFetchAbort,allowStaleOnFetchAbort:tt=this.allowStaleOnFetchAbort,context:y,forceRefresh:b=false,status:p,signal:I}=i;if(!t(this,lt))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:p});let L={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:l,size:c,sizeCalculation:E,noUpdateTTL:D,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:st,allowStaleOnFetchAbort:tt,ignoreFetchAbort:K,status:p,signal:I},F=t(this,w).get(e);if(F===void 0){p&&(p.fetch="miss");let v=h(this,n,Gt).call(this,e,F,L,y);return v.__returned=v}else {let v=t(this,_)[F];if(h(this,n,T).call(this,v)){let Et=s&&v.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",Et&&(p.returnedStale=true)),Et?v.__staleWhileFetching:v.__returned=v}let wt=t(this,P).call(this,F);if(!b&&!wt)return p&&(p.fetch="hit"),h(this,n,Rt).call(this,F),r&&t(this,_t).call(this,F),p&&t(this,it).call(this,p,F),v;let gt=h(this,n,Gt).call(this,e,F,L,y),mt=gt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=wt?"stale":"refresh",mt&&wt&&(p.returnedStale=true)),mt?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,Tt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...a}=i,l=this.get(e,a);if(!o&&l!==void 0)return l;let c=s(e,l,{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,l=t(this,w).get(e);if(l!==void 0){let c=t(this,_)[l],E=h(this,n,T).call(this,c);return a&&t(this,it).call(this,a,l),t(this,P).call(this,l)?(a&&(a.get="stale"),E?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=true),s?c.__staleWhileFetching:void 0):(o||h(this,n,ht).call(this,e,"expire"),a&&s&&(a.returnedStale=true),s?c:void 0)):(a&&(a.get="hit"),E?c.__staleWhileFetching:(h(this,n,Rt).call(this,l),r&&t(this,_t).call(this,l),c))}else a&&(a.get="miss");}delete(e){return h(this,n,ht).call(this,e,"delete")}clear(){return h(this,n,jt).call(this,"delete")}},$=new WeakMap,V=new WeakMap,k=new WeakMap,ft=new WeakMap,H=new WeakMap,bt=new WeakMap,Tt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,w=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakMap,U=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,x=new WeakMap,q=new WeakMap,Q=new WeakMap,z=new WeakMap,Y=new WeakMap,Z=new WeakMap,lt=new WeakMap,M=new WeakMap,At=new WeakMap,n=new WeakSet,Pt=function(){let e=new Ct(t(this,$)),i=new Ct(t(this,$));f(this,z,e),f(this,Q,i);let s=this.ttlAutopurge?new Array(t(this,$)):void 0;f(this,Y,s),f(this,xt,(l,c,E=t(this,B).now())=>{i[l]=c!==0?E:0,e[l]=c,r(l,c);}),f(this,_t,l=>{i[l]=e[l]!==0?t(this,B).now():0,r(l,e[l]);});let r=this.ttlAutopurge?(l,c)=>{if(s?.[l]&&(clearTimeout(s[l]),s[l]=void 0),c&&c!==0&&s){let E=setTimeout(()=>{t(this,P).call(this,l)&&h(this,n,ht).call(this,t(this,A)[l],"expire");},c+1);E.unref&&E.unref(),s[l]=E;}}:()=>{};f(this,it,(l,c)=>{if(e[c]){let E=e[c],D=i[c];if(!E||!D)return;l.ttl=E,l.start=D,l.now=o||a();let S=l.now-D;l.remainingTTL=E-S;}});let o=0,a=()=>{let l=t(this,B).now();if(this.ttlResolution>0){o=l;let c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref();}return l};this.getRemainingTTL=l=>{let c=t(this,w).get(l);if(c===void 0)return 0;let E=e[c],D=i[c];if(!E||!D)return 1/0;let S=(o||a())-D;return E-S},f(this,P,l=>{let c=i[l],E=e[l];return !!E&&!!c&&(o||a())-c>E});},_t=new WeakMap,it=new WeakMap,xt=new WeakMap,P=new WeakMap,Zt=function(){let e=new Ct(t(this,$));f(this,X,0),f(this,q,e),f(this,pt,i=>{f(this,X,t(this,X)-e[i]),e[i]=0;}),f(this,Dt,(i,s,r,o)=>{if(h(this,n,T).call(this,s))return 0;if(!at(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(s,i),!at(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,yt,(i,s,r)=>{if(e[i]=s,t(this,V)){let o=t(this,V)-e[i];for(;t(this,X)>o;)h(this,n,Mt).call(this,true);}f(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},pt=new WeakMap,yt=new WeakMap,Dt=new WeakMap,ot=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!h(this,n,Kt).call(this,i)||((e||!t(this,P).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,U)[i];},nt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!h(this,n,Kt).call(this,i)||((e||!t(this,P).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,C)[i];},Kt=function(e){return e!==void 0&&t(this,w).get(t(this,A)[e])===e},Mt=function(e){var o;let i=t(this,N),s=t(this,A)[i],r=t(this,_)[i];return t(this,lt)&&h(this,n,T).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,Z)||t(this,M))&&(t(this,Z)&&((o=t(this,k))==null||o.call(this,r,s,"evict")),t(this,M)&&t(this,x)?.push([r,s,"evict"])),t(this,pt).call(this,i),t(this,Y)?.[i]&&(clearTimeout(t(this,Y)[i]),t(this,Y)[i]=void 0),e&&(t(this,A)[i]=void 0,t(this,_)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(f(this,N,f(this,R,0)),t(this,J).length=0):f(this,N,t(this,C)[i]),t(this,w).delete(s),It(this,O)._--,i},Gt=function(e,i,s,r){let o=i===void 0?void 0:t(this,_)[i];if(h(this,n,T).call(this,o))return o;let a=new Lt,{signal:l}=s;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:r},E=(y,b=false)=>{let{aborted:p}=a.signal,I=s.ignoreFetchAbort&&y!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(p&&!b?(s.status.fetchAborted=true,s.status.fetchError=a.signal.reason,I&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!I&&!b)return S(a.signal.reason,L);let F=K,v=t(this,_)[i];return (v===K||I&&b&&v===void 0)&&(y===void 0?F.__staleWhileFetching!==void 0?t(this,_)[i]=F.__staleWhileFetching:h(this,n,ht).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,y,c.options))),y},D=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),S(y,false)),S=(y,b)=>{let{aborted:p}=a.signal,I=p&&s.allowStaleOnFetchAbort,L=I||s.allowStaleOnFetchRejection,F=L||s.noDeleteOnFetchRejection,v=K;if(t(this,_)[i]===K&&(!F||!b&&v.__staleWhileFetching===void 0?h(this,n,ht).call(this,e,"fetch"):I||(t(this,_)[i]=v.__staleWhileFetching)),L)return s.status&&v.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),v.__staleWhileFetching;if(v.__returned===v)throw y},st=(y,b)=>{var I;let p=(I=t(this,bt))==null?void 0:I.call(this,e,o,c);p&&p instanceof Promise&&p.then(L=>y(L===void 0?void 0:L),b),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=L=>E(L,true)));});};s.status&&(s.status.fetchDispatched=true);let K=new Promise(st).then(E,D),tt=Object.assign(K,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(e,tt,{...c.options,status:void 0}),i=t(this,w).get(e)):t(this,_)[i]=tt,tt},T=function(e){if(!t(this,lt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Lt},Wt=function(e,i){t(this,U)[i]=e,t(this,C)[e]=i;},Rt=function(e){e!==t(this,R)&&(e===t(this,N)?f(this,N,t(this,C)[e]):h(this,n,Wt).call(this,t(this,U)[e],t(this,C)[e]),h(this,n,Wt).call(this,t(this,R),e),f(this,R,e));},ht=function(e,i){var r,o;let s=false;if(t(this,O)!==0){let a=t(this,w).get(e);if(a!==void 0)if(t(this,Y)?.[a]&&(clearTimeout(t(this,Y)?.[a]),t(this,Y)[a]=void 0),s=true,t(this,O)===1)h(this,n,jt).call(this,i);else {t(this,pt).call(this,a);let l=t(this,_)[a];if(h(this,n,T).call(this,l)?l.__abortController.abort(new Error("deleted")):(t(this,Z)||t(this,M))&&(t(this,Z)&&((r=t(this,k))==null||r.call(this,l,e,i)),t(this,M)&&t(this,x)?.push([l,e,i])),t(this,w).delete(e),t(this,A)[a]=void 0,t(this,_)[a]=void 0,a===t(this,R))f(this,R,t(this,U)[a]);else if(a===t(this,N))f(this,N,t(this,C)[a]);else {let c=t(this,U)[a];t(this,C)[c]=t(this,C)[a];let E=t(this,C)[a];t(this,U)[E]=t(this,U)[a];}It(this,O)._--,t(this,J).push(a);}}if(t(this,M)&&t(this,x)?.length){let a=t(this,x),l;for(;l=a?.shift();)(o=t(this,H))==null||o.call(this,...l);}return s},jt=function(e){var i,s;for(let r of h(this,n,nt).call(this,{allowStale:true})){let o=t(this,_)[r];if(h(this,n,T).call(this,o))o.__abortController.abort(new Error("deleted"));else {let a=t(this,A)[r];t(this,Z)&&((i=t(this,k))==null||i.call(this,o,a,e)),t(this,M)&&t(this,x)?.push([o,a,e]);}}if(t(this,w).clear(),t(this,_).fill(void 0),t(this,A).fill(void 0),t(this,z)&&t(this,Q)){t(this,z).fill(0),t(this,Q).fill(0);for(let r of t(this,Y)??[])r!==void 0&&clearTimeout(r);t(this,Y)?.fill(void 0);}if(t(this,q)&&t(this,q).fill(0),f(this,N,0),f(this,R,0),t(this,J).length=0,f(this,X,0),f(this,O,0),t(this,M)&&t(this,x)){let r=t(this,x),o;for(;o=r?.shift();)(s=t(this,H))==null||s.call(this,...o);}},vt);var dt=class{constructor(e){m(this,"cache");m(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(){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 G=class G{constructor(){}static clearOldTempVariables(e){G.tempStorageDeadlines.forEach((i,s)=>{i>e&&(G.removeVariable(ct,s),G.tempStorageDeadlines.delete(s));});}static setVariable(e,i,s){s==null?G.storage.delete(`${e}:${i}`):G.storage.set(`${e}:${i}`,s);}static getVariable(e,i){let s=G.storage.get(`${e}:${i}`);return Ot(s)}static removeVariable(e,i){G.storage.delete(`${e}:${i}`);}static setFlag(e,i){let s=G.storage.get(Ft)||[];if(i)s.includes(e)||s.push(e);else {let r=s.indexOf(e);r>-1&&s.splice(r,1);}G.storage.set(Ft,s);}static getFlag(e){return (G.storage.get(Ft)||[]).includes(e)}};m(G,"storage",new dt({cacheSize:50})),m(G,"default",new dt({cacheSize:10})),m(G,"tempStorageDeadlines",new Map);var d=G;var Nt=class{get base(){return d.storage.map}get cache(){return d.storage.cache}get tempStorageDeadlines(){return d.tempStorageDeadlines}set default(e){Object.entries(e).forEach(([i,s])=>{d.default.map.set(i,s);});}set(e,i){return d.setVariable(rt,e,i)}get(e){let i=d.getVariable(ct,e);return i===void 0&&(i=d.getVariable(rt,e)),i===void 0&&(i=Ot(d.default.get(e))),i}remove(e){return this.removeTempVariable(e),d.removeVariable(rt,e)}setTempVariable(e,i){if(i==null){this.removeTempVariable(e);return}else d.setVariable(ct,e,i),this.tempStorageDeadlines.has(e)||this.tempStorageDeadlines.set(e,core.GameUnifier.openedLabels);}removeTempVariable(e){d.removeVariable(ct,e),this.tempStorageDeadlines.has(e)&&this.tempStorageDeadlines.delete(e);}setFlag(e,i){return d.setFlag(e,i)}getFlag(e){return d.getFlag(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 [...d.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:this.tempStorageDeadlines.get(s)});}),Ot({main:e,tempDeadlines:i})}restore(e){this.clear();try{e?(e.base?.forEach(i=>{switch(i.key){case "___current_dialogue_memory___":d.setVariable(W,j.CURRENT_DIALOGUE_MEMORY_KEY,i.value);break;case "___last_dialogue_added_in_step_memory___":d.setVariable(W,j.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_menu_options_memory___":d.setVariable(W,j.CURRENT_MENU_OPTIONS_MEMORY_KEY,i.value);break;case "___last_menu_options_added_in_step_memory___":d.setVariable(W,j.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "_input_value_":d.setVariable(W,j.CURRENT_INPUT_VALUE_MEMORY_KEY,i.value);break;case "___last_input_added_in_step_memory___":d.setVariable(W,j.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,i.value);break;case "___current_input_info_memory___":d.setVariable(W,j.CURRENT_INPUT_INFO_MEMORY_KEY,i.value);break;case "___opened_labels_counter___":d.setVariable(W,j.OPENED_LABELS_COUNTER_KEY,i.value);break;case "___all_choices_made___":d.setVariable(W,j.ALL_CHOICES_MADE_KEY,i.value);break;case "___current_step_times_counter___":d.setVariable(W,j.CURRENT_STEP_TIMES_COUNTER_KEY,i.value);break;case "___last_step_glued___":d.setVariable(W,j.LAST_STEP_GLUED,i.value);break;default:d.setVariable(rt,i.key,i.value);}}),e.temp?.forEach(i=>{d.setVariable(ct,i.key,i.value);}),e.flags?.forEach(i=>{d.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);})):ut.warn("No storage data found");}catch(i){ut.error("Error importing data",i);}}};var Vt=class{constructor(e,i){m(this,"id");m(this,"categoryId");this.categoryId=e,this.id=i,this.migrateOldStorage();}migrateOldStorage(e=this.categoryId){let i=d.getVariable(rt,e);i&&(Object.entries(i).forEach(([s,r])=>{typeof r=="object"&&r!==null&&Object.entries(r).forEach(([o,a])=>{d.setVariable(this.categoryId,`${s}:${o}`,a);});}),d.removeVariable(rt,e));}setStorageProperty(e,i){d.setVariable(this.categoryId,`${this.id}:${e}`,i);}getStorageProperty(e,i=this.id){return d.getVariable(this.categoryId,`${i}:${e}`)}};var ze=new Nt;exports.StorageManagerStatic=d;exports.StoredClassModel=Vt;exports.storage=ze;
|
package/dist/storage.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
3
|
-
export { S as StorageObjectType } from './StorageElementType-
|
|
4
|
-
export { S as StoredClassModel } from './StoredClassModel-
|
|
2
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
3
|
+
export { S as StorageObjectType } from './StorageElementType-DkJ394kq.cjs';
|
|
4
|
+
export { S as StoredClassModel } from './StoredClassModel-LtyakzOw.cjs';
|
|
5
5
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.cjs';
|
|
6
6
|
|
|
7
7
|
interface StorageGameStateItem<T = StorageElementType> {
|
|
@@ -71,7 +71,7 @@ interface StorageManagerInterface {
|
|
|
71
71
|
* @param key The key of the variable
|
|
72
72
|
* @returns The value of the variable. If the variable does not exist, it will return undefined
|
|
73
73
|
*/
|
|
74
|
-
get<T
|
|
74
|
+
get<T = StorageElementType>(key: string): T | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* Remove a variable from the storage
|
|
77
77
|
* @param key The key of the variable
|
|
@@ -127,7 +127,7 @@ declare class StorageManagerStatic {
|
|
|
127
127
|
private constructor();
|
|
128
128
|
static clearOldTempVariables(openedLabelsNumber: number): void;
|
|
129
129
|
static setVariable(prefix: string, key: string, value: StorageElementType): void;
|
|
130
|
-
static getVariable<T
|
|
130
|
+
static getVariable<T = StorageElementType>(prefix: string, key: string): T | undefined;
|
|
131
131
|
static removeVariable(prefix: string, key: string): void;
|
|
132
132
|
static setFlag(key: string, value: boolean): void;
|
|
133
133
|
static getFlag(key: string): boolean;
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
|
-
import { a as StorageElementType } from './StorageElementType-
|
|
3
|
-
export { S as StorageObjectType } from './StorageElementType-
|
|
4
|
-
export { S as StoredClassModel } from './StoredClassModel-
|
|
2
|
+
import { a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
3
|
+
export { S as StorageObjectType } from './StorageElementType-DkJ394kq.js';
|
|
4
|
+
export { S as StoredClassModel } from './StoredClassModel-a4pvgJXD.js';
|
|
5
5
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.js';
|
|
6
6
|
|
|
7
7
|
interface StorageGameStateItem<T = StorageElementType> {
|
|
@@ -71,7 +71,7 @@ interface StorageManagerInterface {
|
|
|
71
71
|
* @param key The key of the variable
|
|
72
72
|
* @returns The value of the variable. If the variable does not exist, it will return undefined
|
|
73
73
|
*/
|
|
74
|
-
get<T
|
|
74
|
+
get<T = StorageElementType>(key: string): T | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* Remove a variable from the storage
|
|
77
77
|
* @param key The key of the variable
|
|
@@ -127,7 +127,7 @@ declare class StorageManagerStatic {
|
|
|
127
127
|
private constructor();
|
|
128
128
|
static clearOldTempVariables(openedLabelsNumber: number): void;
|
|
129
129
|
static setVariable(prefix: string, key: string, value: StorageElementType): void;
|
|
130
|
-
static getVariable<T
|
|
130
|
+
static getVariable<T = StorageElementType>(prefix: string, key: string): T | undefined;
|
|
131
131
|
static removeVariable(prefix: string, key: string): void;
|
|
132
132
|
static setFlag(key: string, value: boolean): void;
|
|
133
133
|
static getFlag(key: string): boolean;
|
package/dist/storage.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-
|
|
1
|
+
export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-EWW7VYPM.mjs';import'./chunk-ZW3MIPMS.mjs';import'./chunk-IWAXXFXE.mjs';import'./chunk-D45QSSXG.mjs';
|