@drincs/pixi-vn 1.9.2 → 1.9.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.
Files changed (59) hide show
  1. package/README.md +1 -1
  2. package/dist/{ContainerMemory-BpDgacyr.d.cts → ContainerMemory-DNqSVzLY.d.cts} +12 -116
  3. package/dist/{ContainerMemory-BpDgacyr.d.ts → ContainerMemory-DNqSVzLY.d.ts} +12 -116
  4. package/dist/canvas.cjs +2 -2
  5. package/dist/canvas.d.cts +1279 -551
  6. package/dist/canvas.d.ts +1279 -551
  7. package/dist/canvas.mjs +2 -2
  8. package/dist/characters.cjs +1 -1
  9. package/dist/characters.mjs +1 -1
  10. package/dist/{chunk-6GLWL3NH.mjs → chunk-5MVDNAT4.mjs} +1 -1
  11. package/dist/chunk-6OABTG5R.mjs +1 -0
  12. package/dist/chunk-AW5XWF24.mjs +1 -0
  13. package/dist/chunk-LXIKP2K5.mjs +1 -0
  14. package/dist/chunk-S7HZUIEI.mjs +1 -0
  15. package/dist/core.cjs +1 -1
  16. package/dist/core.d.cts +61 -5
  17. package/dist/core.d.ts +61 -5
  18. package/dist/core.mjs +1 -1
  19. package/dist/filters.cjs +1 -0
  20. package/dist/filters.d.cts +182 -0
  21. package/dist/filters.d.ts +182 -0
  22. package/dist/filters.mjs +1 -0
  23. package/dist/history.cjs +1 -1
  24. package/dist/history.d.cts +2 -2
  25. package/dist/history.d.ts +2 -2
  26. package/dist/history.mjs +1 -1
  27. package/dist/index.cjs +2 -2
  28. package/dist/index.d.cts +43 -3
  29. package/dist/index.d.ts +43 -3
  30. package/dist/index.mjs +2 -2
  31. package/dist/motion.cjs +1 -1
  32. package/dist/motion.d.cts +30 -8
  33. package/dist/motion.d.ts +30 -8
  34. package/dist/motion.mjs +1 -1
  35. package/dist/narration.cjs +1 -1
  36. package/dist/narration.d.cts +2 -1
  37. package/dist/narration.d.ts +2 -1
  38. package/dist/narration.mjs +1 -1
  39. package/dist/pixi/browser.js +170 -169
  40. package/dist/sound.mjs +1 -1
  41. package/dist/storage.cjs +1 -1
  42. package/dist/storage.d.cts +1 -1
  43. package/dist/storage.d.ts +1 -1
  44. package/dist/storage.mjs +1 -1
  45. package/dist/tickers.cjs +1 -0
  46. package/dist/tickers.d.cts +555 -0
  47. package/dist/tickers.d.ts +555 -0
  48. package/dist/tickers.mjs +1 -0
  49. package/dist/vite.cjs +6 -4
  50. package/dist/vite.d.cts +64 -0
  51. package/dist/vite.d.ts +64 -0
  52. package/dist/vite.mjs +6 -4
  53. package/dist/worker.cjs +1 -0
  54. package/dist/worker.d.cts +153 -0
  55. package/dist/worker.d.ts +153 -0
  56. package/dist/worker.mjs +1 -0
  57. package/package.json +28 -1
  58. package/dist/chunk-HQQ5WH6C.mjs +0 -1
  59. package/dist/chunk-I7DOUH5V.mjs +0 -1
@@ -0,0 +1 @@
1
+ var Ht=Object.create;var Tt=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Ut=l=>{throw TypeError(l)};var Xt=(l,e,i)=>e in l?Tt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var ee=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var ie=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var Yt=(l,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of $t(e))!qt.call(l,h)&&h!==i&&Tt(l,h,{get:()=>e[h],enumerable:!(s=Kt(e,h))||s.enumerable});return l};var se=(l,e,i)=>(i=l!=null?Ht(Bt(l)):{},Yt(e||!l||!l.__esModule?Tt(i,"default",{value:l,enumerable:true}):i,l));var x=(l,e,i)=>Xt(l,typeof e!="symbol"?e+"":e,i),xt=(l,e,i)=>e.has(l)||Ut("Cannot "+i);var t=(l,e,i)=>(xt(l,e,"read from private field"),i?i.call(l):e.get(l)),g=(l,e,i)=>e.has(l)?Ut("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,i),f=(l,e,i,s)=>(xt(l,e,"write to private field"),e.set(l,i),i),a=(l,e,i)=>(xt(l,e,"access private method"),i);var bt=(l,e,i,s)=>({set _(h){f(l,e,h);},get _(){return t(l,e,s)}});var Jt;(h=>(h.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),h.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),h.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),h.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(Jt||={});var Qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nt=new Set,zt=typeof process=="object"&&process?process:{},It=(l,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ft=globalThis.AbortController,Gt=globalThis.AbortSignal;if(typeof Ft>"u"){Gt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){e();}signal=new Gt;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let l=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,It("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Zt=l=>!Nt.has(l);var tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Vt=l=>tt(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?_t:null:null,_t=class extends Array{constructor(l){super(l),this.fill(0);}},J,ct,te=(J=class{heap;length;static create(e){let i=Vt(e);if(!i)return [];f(J,ct,true);let s=new J(e,i);return f(J,ct,false),s}constructor(e,i){if(!t(J,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,g(J,ct,false),J),Mt,jt,V,U,P,ot,k,ft,dt,H,O,K,A,y,d,W,G,z,F,$,E,B,q,M,j,X,ht,D,pt,r,Rt,nt,Q,St,N,kt,rt,gt,yt,et,it,Ct,At,Ot,S,Wt,vt,st,Dt,wt,Pt=(wt=class{constructor(e){g(this,r);g(this,V);g(this,U);g(this,P);g(this,ot);g(this,k);g(this,ft);g(this,dt);g(this,H);x(this,"ttl");x(this,"ttlResolution");x(this,"ttlAutopurge");x(this,"updateAgeOnGet");x(this,"updateAgeOnHas");x(this,"allowStale");x(this,"noDisposeOnSet");x(this,"noUpdateTTL");x(this,"maxEntrySize");x(this,"sizeCalculation");x(this,"noDeleteOnFetchRejection");x(this,"noDeleteOnStaleGet");x(this,"allowStaleOnFetchAbort");x(this,"allowStaleOnFetchRejection");x(this,"ignoreFetchAbort");g(this,O);g(this,K);g(this,A);g(this,y);g(this,d);g(this,W);g(this,G);g(this,z);g(this,F);g(this,$);g(this,E);g(this,B);g(this,q);g(this,M);g(this,j);g(this,X);g(this,ht);g(this,D);g(this,pt);g(this,nt,()=>{});g(this,Q,()=>{});g(this,St,()=>{});g(this,N,()=>false);g(this,rt,e=>{});g(this,gt,(e,i,s)=>{});g(this,yt,(e,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});x(this,Mt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:T,disposeAfter:m,noDisposeOnSet:Z,noUpdateTTL:I,maxSize:Y=0,maxEntrySize:b=0,sizeCalculation:v,fetchMethod:p,memoMethod:R,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:mt,ignoreFetchAbort:lt,perf:at}=e;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,H,at??Qt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?Vt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(f(this,V,i),f(this,U,Y),this.maxEntrySize=b||t(this,U),this.sizeCalculation=v,this.sizeCalculation){if(!t(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,dt,R),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ft,p),f(this,ht,!!p),f(this,A,new Map),f(this,y,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,W,new ut(i)),f(this,G,new ut(i)),f(this,z,0),f(this,F,0),f(this,$,te.create(i)),f(this,O,0),f(this,K,0),typeof w=="function"&&f(this,P,w),typeof T=="function"&&f(this,ot,T),typeof m=="function"?(f(this,k,m),f(this,E,[])):(f(this,k,void 0),f(this,E,void 0)),f(this,X,!!t(this,P)),f(this,pt,!!t(this,ot)),f(this,D,!!t(this,k)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(t(this,U)!==0&&!tt(t(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");a(this,r,kt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(h)||h===0?h:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");a(this,r,Rt).call(this);}if(t(this,V)===0&&this.ttl===0&&t(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,V)&&!t(this,U)){let Et="LRU_CACHE_UNBOUNDED";Zt(Et)&&(Nt.add(Et),It("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Et,wt));}}get perf(){return t(this,H)}static unsafeExposeInternals(e){return {starts:t(e,q),ttls:t(e,M),autopurgeTimers:t(e,j),sizes:t(e,B),keyMap:t(e,A),keyList:t(e,y),valList:t(e,d),next:t(e,W),prev:t(e,G),get head(){return t(e,z)},get tail(){return t(e,F)},free:t(e,$),isBackgroundFetch:i=>{var s;return a(s=e,r,S).call(s,i)},backgroundFetch:(i,s,h,n)=>{var o;return a(o=e,r,Ot).call(o,i,s,h,n)},moveToTail:i=>{var s;return a(s=e,r,vt).call(s,i)},indexes:i=>{var s;return a(s=e,r,et).call(s,i)},rindexes:i=>{var s;return a(s=e,r,it).call(s,i)},isStale:i=>{var s;return t(s=e,N).call(s,i)}}}get max(){return t(this,V)}get maxSize(){return t(this,U)}get calculatedSize(){return t(this,K)}get size(){return t(this,O)}get fetchMethod(){return t(this,ft)}get memoMethod(){return t(this,dt)}get dispose(){return t(this,P)}get onInsert(){return t(this,ot)}get disposeAfter(){return t(this,k)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of a(this,r,et).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*rentries(){for(let e of a(this,r,it).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*keys(){for(let e of a(this,r,et).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of a(this,r,it).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of a(this,r,et).call(this))t(this,d)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of a(this,r,it).call(this))t(this,d)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(jt=Symbol.iterator,Mt=Symbol.toStringTag,jt)](){return this.entries()}find(e,i={}){for(let s of a(this,r,et).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;if(n!==void 0&&e(n,t(this,y)[s],this))return this.get(t(this,y)[s],i)}}forEach(e,i=this){for(let s of a(this,r,et).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&e.call(i,n,t(this,y)[s],this);}}rforEach(e,i=this){for(let s of a(this,r,it).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&e.call(i,n,t(this,y)[s],this);}}purgeStale(){let e=false;for(let i of a(this,r,it).call(this,{allowStale:true}))t(this,N).call(this,i)&&(a(this,r,st).call(this,t(this,y)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,d)[i],h=a(this,r,S).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let n={value:h};if(t(this,M)&&t(this,q)){let o=t(this,M)[i],u=t(this,q)[i];if(o&&u){let c=o-(t(this,H).now()-u);n.ttl=c,n.start=Date.now();}}return t(this,B)&&(n.size=t(this,B)[i]),n}dump(){let e=[];for(let i of a(this,r,et).call(this,{allowStale:true})){let s=t(this,y)[i],h=t(this,d)[i],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,M)&&t(this,q)){o.ttl=t(this,M)[i];let u=t(this,H).now()-t(this,q)[i];o.start=Math.floor(Date.now()-u);}t(this,B)&&(o.size=t(this,B)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let h=Date.now()-s.start;s.start=t(this,H).now()-h;}this.set(i,s.value,s);}}set(e,i,s={}){var Z,I,Y,b;if(i===void 0)return this.delete(e),this;let{ttl:h=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,T=t(this,yt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&T>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),a(this,r,st).call(this,e,"set"),this;let m=t(this,O)===0?void 0:t(this,A).get(e);if(m===void 0)m=t(this,O)===0?t(this,F):t(this,$).length!==0?t(this,$).pop():t(this,O)===t(this,V)?a(this,r,At).call(this,false):t(this,O),t(this,y)[m]=e,t(this,d)[m]=i,t(this,A).set(e,m),t(this,W)[t(this,F)]=m,t(this,G)[m]=t(this,F),f(this,F,m),bt(this,O)._++,t(this,gt).call(this,m,T,c),c&&(c.set="add"),w=false,t(this,pt)&&((Z=t(this,ot))==null||Z.call(this,i,e,"add"));else {a(this,r,vt).call(this,m);let v=t(this,d)[m];if(i!==v){if(t(this,ht)&&a(this,r,S).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=v;p!==void 0&&!o&&(t(this,X)&&((I=t(this,P))==null||I.call(this,p,e,"set")),t(this,D)&&t(this,E)?.push([p,e,"set"]));}else o||(t(this,X)&&((Y=t(this,P))==null||Y.call(this,v,e,"set")),t(this,D)&&t(this,E)?.push([v,e,"set"]));if(t(this,rt).call(this,m),t(this,gt).call(this,m,T,c),t(this,d)[m]=i,c){c.set="replace";let p=v&&a(this,r,S).call(this,v)?v.__staleWhileFetching:v;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,pt)&&this.onInsert?.(i,e,i===v?"update":"replace");}if(h!==0&&!t(this,M)&&a(this,r,Rt).call(this),t(this,M)&&(w||t(this,St).call(this,m,h,n),c&&t(this,Q).call(this,c,m)),!o&&t(this,D)&&t(this,E)){let v=t(this,E),p;for(;p=v?.shift();)(b=t(this,k))==null||b.call(this,...p);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,d)[t(this,z)];if(a(this,r,At).call(this,!0),a(this,r,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,D)&&t(this,E)){let i=t(this,E),s;for(;s=i?.shift();)(e=t(this,k))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,n=t(this,A).get(e);if(n!==void 0){let o=t(this,d)[n];if(a(this,r,S).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,N).call(this,n))h&&(h.has="stale",t(this,Q).call(this,h,n));else return s&&t(this,nt).call(this,n),h&&(h.has="hit",t(this,Q).call(this,h,n)),true}else h&&(h.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,h=t(this,A).get(e);if(h===void 0||!s&&t(this,N).call(this,h))return;let n=t(this,d)[h];return a(this,r,S).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:T=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:b,forceRefresh:v=false,status:p,signal:R}=i;if(!t(this,ht))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,status:p});let L={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:T,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:Y,ignoreFetchAbort:I,status:p,signal:R},C=t(this,A).get(e);if(C===void 0){p&&(p.fetch="miss");let _=a(this,r,Ot).call(this,e,C,L,b);return _.__returned=_}else {let _=t(this,d)[C];if(a(this,r,S).call(this,_)){let ut=s&&_.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",ut&&(p.returnedStale=true)),ut?_.__staleWhileFetching:_.__returned=_}let mt=t(this,N).call(this,C);if(!v&&!mt)return p&&(p.fetch="hit"),a(this,r,vt).call(this,C),h&&t(this,nt).call(this,C),p&&t(this,Q).call(this,p,C),_;let lt=a(this,r,Ot).call(this,e,C,L,b),at=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=mt?"stale":"refresh",at&&mt&&(p.returnedStale=true)),at?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:n,...o}=i,u=this.get(e,o);if(!n&&u!==void 0)return u;let c=s(e,u,{options:o,context:h});return this.set(e,c,o),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,u=t(this,A).get(e);if(u!==void 0){let c=t(this,d)[u],w=a(this,r,S).call(this,c);return o&&t(this,Q).call(this,o,u),t(this,N).call(this,u)?(o&&(o.get="stale"),w?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c.__staleWhileFetching:void 0):(n||a(this,r,st).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c:void 0)):(o&&(o.get="hit"),w?c.__staleWhileFetching:(a(this,r,vt).call(this,u),h&&t(this,nt).call(this,u),c))}else o&&(o.get="miss");}delete(e){return a(this,r,st).call(this,e,"delete")}clear(){return a(this,r,Dt).call(this,"delete")}},V=new WeakMap,U=new WeakMap,P=new WeakMap,ot=new WeakMap,k=new WeakMap,ft=new WeakMap,dt=new WeakMap,H=new WeakMap,O=new WeakMap,K=new WeakMap,A=new WeakMap,y=new WeakMap,d=new WeakMap,W=new WeakMap,G=new WeakMap,z=new WeakMap,F=new WeakMap,$=new WeakMap,E=new WeakMap,B=new WeakMap,q=new WeakMap,M=new WeakMap,j=new WeakMap,X=new WeakMap,ht=new WeakMap,D=new WeakMap,pt=new WeakMap,r=new WeakSet,Rt=function(){let e=new _t(t(this,V)),i=new _t(t(this,V));f(this,M,e),f(this,q,i);let s=this.ttlAutopurge?new Array(t(this,V)):void 0;f(this,j,s),f(this,St,(u,c,w=t(this,H).now())=>{i[u]=c!==0?w:0,e[u]=c,h(u,c);}),f(this,nt,u=>{i[u]=e[u]!==0?t(this,H).now():0,h(u,e[u]);});let h=this.ttlAutopurge?(u,c)=>{if(s?.[u]&&(clearTimeout(s[u]),s[u]=void 0),c&&c!==0&&s){let w=setTimeout(()=>{t(this,N).call(this,u)&&a(this,r,st).call(this,t(this,y)[u],"expire");},c+1);w.unref&&w.unref(),s[u]=w;}}:()=>{};f(this,Q,(u,c)=>{if(e[c]){let w=e[c],T=i[c];if(!w||!T)return;u.ttl=w,u.start=T,u.now=n||o();let m=u.now-T;u.remainingTTL=w-m;}});let n=0,o=()=>{let u=t(this,H).now();if(this.ttlResolution>0){n=u;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref();}return u};this.getRemainingTTL=u=>{let c=t(this,A).get(u);if(c===void 0)return 0;let w=e[c],T=i[c];if(!w||!T)return 1/0;let m=(n||o())-T;return w-m},f(this,N,u=>{let c=i[u],w=e[u];return !!w&&!!c&&(n||o())-c>w});},nt=new WeakMap,Q=new WeakMap,St=new WeakMap,N=new WeakMap,kt=function(){let e=new _t(t(this,V));f(this,K,0),f(this,B,e),f(this,rt,i=>{f(this,K,t(this,K)-e[i]),e[i]=0;}),f(this,yt,(i,s,h,n)=>{if(a(this,r,S).call(this,s))return 0;if(!tt(h))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(h=n(s,i),!tt(h))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h}),f(this,gt,(i,s,h)=>{if(e[i]=s,t(this,U)){let n=t(this,U)-e[i];for(;t(this,K)>n;)a(this,r,At).call(this,true);}f(this,K,t(this,K)+e[i]),h&&(h.entrySize=s,h.totalCalculatedSize=t(this,K));});},rt=new WeakMap,gt=new WeakMap,yt=new WeakMap,et=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,F);!(!a(this,r,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,z)));)i=t(this,G)[i];},it=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,z);!(!a(this,r,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,W)[i];},Ct=function(e){return e!==void 0&&t(this,A).get(t(this,y)[e])===e},At=function(e){var n;let i=t(this,z),s=t(this,y)[i],h=t(this,d)[i];return t(this,ht)&&a(this,r,S).call(this,h)?h.__abortController.abort(new Error("evicted")):(t(this,X)||t(this,D))&&(t(this,X)&&((n=t(this,P))==null||n.call(this,h,s,"evict")),t(this,D)&&t(this,E)?.push([h,s,"evict"])),t(this,rt).call(this,i),t(this,j)?.[i]&&(clearTimeout(t(this,j)[i]),t(this,j)[i]=void 0),e&&(t(this,y)[i]=void 0,t(this,d)[i]=void 0,t(this,$).push(i)),t(this,O)===1?(f(this,z,f(this,F,0)),t(this,$).length=0):f(this,z,t(this,W)[i]),t(this,A).delete(s),bt(this,O)._--,i},Ot=function(e,i,s,h){let n=i===void 0?void 0:t(this,d)[i];if(a(this,r,S).call(this,n))return n;let o=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:h},w=(b,v=false)=>{let{aborted:p}=o.signal,R=s.ignoreFetchAbort&&b!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&b!==void 0);if(s.status&&(p&&!v?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!R&&!v)return m(o.signal.reason,L);let C=I,_=t(this,d)[i];return (_===I||R&&v&&_===void 0)&&(b===void 0?C.__staleWhileFetching!==void 0?t(this,d)[i]=C.__staleWhileFetching:a(this,r,st).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,b,c.options))),b},T=b=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=b),m(b,false)),m=(b,v)=>{let{aborted:p}=o.signal,R=p&&s.allowStaleOnFetchAbort,L=R||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,_=I;if(t(this,d)[i]===I&&(!C||!v&&_.__staleWhileFetching===void 0?a(this,r,st).call(this,e,"fetch"):R||(t(this,d)[i]=_.__staleWhileFetching)),L)return s.status&&_.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),_.__staleWhileFetching;if(_.__returned===_)throw b},Z=(b,v)=>{var R;let p=(R=t(this,ft))==null?void 0:R.call(this,e,n,c);p&&p instanceof Promise&&p.then(L=>b(L===void 0?void 0:L),v),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(b(void 0),s.allowStaleOnFetchAbort&&(b=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(Z).then(w,T),Y=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,Y,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,d)[i]=Y,Y},S=function(e){if(!t(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Wt=function(e,i){t(this,G)[i]=e,t(this,W)[e]=i;},vt=function(e){e!==t(this,F)&&(e===t(this,z)?f(this,z,t(this,W)[e]):a(this,r,Wt).call(this,t(this,G)[e],t(this,W)[e]),a(this,r,Wt).call(this,t(this,F),e),f(this,F,e));},st=function(e,i){var h,n;let s=false;if(t(this,O)!==0){let o=t(this,A).get(e);if(o!==void 0)if(t(this,j)?.[o]&&(clearTimeout(t(this,j)?.[o]),t(this,j)[o]=void 0),s=true,t(this,O)===1)a(this,r,Dt).call(this,i);else {t(this,rt).call(this,o);let u=t(this,d)[o];if(a(this,r,S).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,X)||t(this,D))&&(t(this,X)&&((h=t(this,P))==null||h.call(this,u,e,i)),t(this,D)&&t(this,E)?.push([u,e,i])),t(this,A).delete(e),t(this,y)[o]=void 0,t(this,d)[o]=void 0,o===t(this,F))f(this,F,t(this,G)[o]);else if(o===t(this,z))f(this,z,t(this,W)[o]);else {let c=t(this,G)[o];t(this,W)[c]=t(this,W)[o];let w=t(this,W)[o];t(this,G)[w]=t(this,G)[o];}bt(this,O)._--,t(this,$).push(o);}}if(t(this,D)&&t(this,E)?.length){let o=t(this,E),u;for(;u=o?.shift();)(n=t(this,k))==null||n.call(this,...u);}return s},Dt=function(e){var i,s;for(let h of a(this,r,it).call(this,{allowStale:true})){let n=t(this,d)[h];if(a(this,r,S).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,y)[h];t(this,X)&&((i=t(this,P))==null||i.call(this,n,o,e)),t(this,D)&&t(this,E)?.push([n,o,e]);}}if(t(this,A).clear(),t(this,d).fill(void 0),t(this,y).fill(void 0),t(this,M)&&t(this,q)){t(this,M).fill(0),t(this,q).fill(0);for(let h of t(this,j)??[])h!==void 0&&clearTimeout(h);t(this,j)?.fill(void 0);}if(t(this,B)&&t(this,B).fill(0),f(this,z,0),f(this,F,0),t(this,$).length=0,f(this,K,0),f(this,O,0),t(this,D)&&t(this,E)){let h=t(this,E),n;for(;n=h?.shift();)(s=t(this,k))==null||s.call(this,...n);}},wt);var Lt=class{cache;map=new Map;constructor(e){this.cache=new Pt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};export{ee as a,ie as b,se as c,Lt as d,Jt as e};
@@ -0,0 +1 @@
1
+ var n=class extends Error{code;constructor(t,a,m,o,r){super(`[Pixi\u2019VN] ${a}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var i;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(i||={});var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate,e._animateFilter=t.animateFilter,e._removeCanvasComponent=t.removeCanvasComponent,e._canvasComponentExists=t.canvasComponentExists;}static _navigate=()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(a=>a!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(a=>a()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let a=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=a.newValue,await a.result}static _getVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(a=>a!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,a){for(let m of e._onErrorHandlers.slice())try{await m(t,a);}catch(o){i.error("Error in onError handler",o);}}static _animate=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}static _animateFilter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animateFilter(){return e._animateFilter}static _removeCanvasComponent=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeCanvasComponent(){return e._removeCanvasComponent}static _canvasComponentExists=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get canvasComponentExists(){return e._canvasComponentExists}};export{n as a,i as b,l as c};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-AW5XWF24.mjs';import {PixiError}from'@drincs/pixi-vn/core';function a(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e$1){throw e.error("Error creating exportable element",r,e$1),new PixiError("not_json_serializable","Error creating exportable element")}}export{a};
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var a;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(a||={});var n=class extends Error{code;constructor(t,i,m,o,r){super(`[Pixi\u2019VN] ${i}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static _navigate=()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(i=>i!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(i=>i()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let i=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=i.newValue,await i.result}static _getVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(i=>i!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,i){for(let m of e._onErrorHandlers.slice())try{await m(t,i);}catch(o){a.error("Error in onError handler",o);}}static _animate=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}};exports.GameUnifier=l;exports.PixiError=n;
1
+ 'use strict';var n=class extends Error{code;constructor(t,a,m,o,r){super(`[Pixi\u2019VN] ${a}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var i;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(i||={});var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate,e._animateFilter=t.animateFilter,e._removeCanvasComponent=t.removeCanvasComponent,e._canvasComponentExists=t.canvasComponentExists;}static _navigate=()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(a=>a!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(a=>a()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let a=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=a.newValue,await a.result}static _getVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(a=>a!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,a){for(let m of e._onErrorHandlers.slice())try{await m(t,a);}catch(o){i.error("Error in onError handler",o);}}static _animate=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}static _animateFilter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animateFilter(){return e._animateFilter}static _removeCanvasComponent=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeCanvasComponent(){return e._removeCanvasComponent}static _canvasComponentExists=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get canvasComponentExists(){return e._canvasComponentExists}};exports.GameUnifier=l;exports.PixiError=n;
package/dist/core.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { StepLabelProps, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
2
2
  import { CanvasBaseInterface, CanvasBaseItemMemory, CanvasBaseItem } from '@drincs/pixi-vn/canvas';
3
- import { UPDATE_PRIORITY, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
3
+ import { UPDATE_PRIORITY, Filter, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
4
4
  import { S as StepLabelPropsType, a as StepLabelResultType, b as StepLabelType } from './StepLabelType-CN97wZzm.cjs';
5
5
  import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
6
6
 
@@ -37,7 +37,7 @@ declare class GameUnifier {
37
37
  *
38
38
  * If your game engine does not have a history of steps, you can return an empty object.
39
39
  */
40
- getCurrentGameStepState: () => GameStepState;
40
+ getCurrentGameStepState: () => GameStepState | Promise<GameStepState>;
41
41
  /**
42
42
  * This function restores the game step state.
43
43
  *
@@ -109,7 +109,7 @@ declare class GameUnifier {
109
109
  * If true, the step will not be added to the history if the current step is the same as the last step.
110
110
  */
111
111
  ignoreSameStep?: boolean;
112
- }): void;
112
+ }): void | Promise<void>;
113
113
  /**
114
114
  * This function returns the character by its id.
115
115
  * @param id The id of the character.
@@ -126,6 +126,42 @@ declare class GameUnifier {
126
126
  * @template T - The type of Pixi’VN component(s) being animated.
127
127
  */
128
128
  animate: <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
129
+ /**
130
+ * This function is called to animate either a `Filter`'s own properties, or a plain numeric
131
+ * "progress" value with no live target (as opposed to {@link animate}, which animates a canvas
132
+ * element's properties). The latter is the generic mechanism behind the mask-based transitions
133
+ * (wipe/iris/split): they have no canvas element or Filter property to write directly, just a
134
+ * number and a side effect.
135
+ * @param components - The canvas element alias(es) the filter is attached to, or otherwise
136
+ * associated with this animation (kept alive/cleaned up alongside them), not the animation
137
+ * target itself.
138
+ * @param filter - The `Filter` instance to animate, or `undefined` to animate a plain value
139
+ * instead (in which case `keyframes` describes that value, e.g. `{ value: [0, 1] }`, and `apply`
140
+ * is required).
141
+ * @param keyframes - The keyframes to animate the filter's properties (or the plain value) with.
142
+ * @param options - Additional options for the animation, including duration, easing, and ticker.
143
+ * @param priority - The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
144
+ * @param apply - Called on every frame with the current interpolated value - required when
145
+ * `filter` is `undefined`, ignored otherwise.
146
+ * @param cleanup - Called once, right before completion handling, to detach/destroy the filter or
147
+ * tear down whatever `apply` was driving.
148
+ * @returns The id of the ticker.
149
+ */
150
+ animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void) => string | undefined;
151
+ /**
152
+ * This function removes one or more canvas components by alias. Used by the `tickers` module's
153
+ * `onComplete` to honor `aliasToRemoveAfter` without importing `@drincs/pixi-vn/canvas` directly
154
+ * (which would close an import cycle, since `canvas` depends on `tickers`).
155
+ * @param alias - The alias(es) of the canvas component(s) to remove.
156
+ */
157
+ removeCanvasComponent: (alias: string | string[]) => void;
158
+ /**
159
+ * This function checks whether a canvas component with the given alias currently exists. Used by
160
+ * the `tickers` module to prune ticker/alias associations for components no longer on the canvas,
161
+ * without importing `@drincs/pixi-vn/canvas` directly (see {@link removeCanvasComponent}).
162
+ * @param alias - The alias of the canvas component to check.
163
+ */
164
+ canvasComponentExists: (alias: string) => boolean;
129
165
  }): void;
130
166
  private static _navigate;
131
167
  /**
@@ -152,7 +188,7 @@ declare class GameUnifier {
152
188
  * Returns the current state of the game step.
153
189
  * @throws {PixiError} when `Game.init()` has not been called yet.
154
190
  */
155
- static get currentGameStepState(): GameStepState;
191
+ static get currentGameStepState(): GameStepState | Promise<GameStepState>;
156
192
  private static _restoreGameStepState;
157
193
  /**
158
194
  * Restores the game step state.
@@ -279,7 +315,7 @@ declare class GameUnifier {
279
315
  * If true, the step will not be added to the history if the current step is the same as the last step.
280
316
  */
281
317
  ignoreSameStep?: boolean;
282
- }) => void;
318
+ }) => void | Promise<void>;
283
319
  /**
284
320
  * Count of currently executing steps.
285
321
  * If a step triggers a narration.continue(), this number is greater than 1.
@@ -309,6 +345,26 @@ declare class GameUnifier {
309
345
  * @template T - The type of Pixi’VN component(s) being animated.
310
346
  */
311
347
  static get animate(): <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
348
+ private static _animateFilter;
349
+ /**
350
+ * This function is called to animate a `Filter`'s own properties, or a plain numeric "progress"
351
+ * value when no `filter` is given. See {@link animate} for animating a canvas element's properties
352
+ * instead.
353
+ * @returns The id of the ticker.
354
+ */
355
+ static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void) => string | undefined;
356
+ private static _removeCanvasComponent;
357
+ /**
358
+ * Removes one or more canvas components by alias. See the `removeCanvasComponent` option of
359
+ * {@link init} for why this exists.
360
+ */
361
+ static get removeCanvasComponent(): (alias: string | string[]) => void;
362
+ private static _canvasComponentExists;
363
+ /**
364
+ * Checks whether a canvas component with the given alias currently exists. See the
365
+ * `canvasComponentExists` option of {@link init} for why this exists.
366
+ */
367
+ static get canvasComponentExists(): (alias: string) => boolean;
312
368
  }
313
369
 
314
370
  declare class PixiError extends Error {
package/dist/core.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { StepLabelProps, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
2
2
  import { CanvasBaseInterface, CanvasBaseItemMemory, CanvasBaseItem } from '@drincs/pixi-vn/canvas';
3
- import { UPDATE_PRIORITY, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
3
+ import { UPDATE_PRIORITY, Filter, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
4
4
  import { S as StepLabelPropsType, a as StepLabelResultType, b as StepLabelType } from './StepLabelType-CN97wZzm.js';
5
5
  import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
6
6
 
@@ -37,7 +37,7 @@ declare class GameUnifier {
37
37
  *
38
38
  * If your game engine does not have a history of steps, you can return an empty object.
39
39
  */
40
- getCurrentGameStepState: () => GameStepState;
40
+ getCurrentGameStepState: () => GameStepState | Promise<GameStepState>;
41
41
  /**
42
42
  * This function restores the game step state.
43
43
  *
@@ -109,7 +109,7 @@ declare class GameUnifier {
109
109
  * If true, the step will not be added to the history if the current step is the same as the last step.
110
110
  */
111
111
  ignoreSameStep?: boolean;
112
- }): void;
112
+ }): void | Promise<void>;
113
113
  /**
114
114
  * This function returns the character by its id.
115
115
  * @param id The id of the character.
@@ -126,6 +126,42 @@ declare class GameUnifier {
126
126
  * @template T - The type of Pixi’VN component(s) being animated.
127
127
  */
128
128
  animate: <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
129
+ /**
130
+ * This function is called to animate either a `Filter`'s own properties, or a plain numeric
131
+ * "progress" value with no live target (as opposed to {@link animate}, which animates a canvas
132
+ * element's properties). The latter is the generic mechanism behind the mask-based transitions
133
+ * (wipe/iris/split): they have no canvas element or Filter property to write directly, just a
134
+ * number and a side effect.
135
+ * @param components - The canvas element alias(es) the filter is attached to, or otherwise
136
+ * associated with this animation (kept alive/cleaned up alongside them), not the animation
137
+ * target itself.
138
+ * @param filter - The `Filter` instance to animate, or `undefined` to animate a plain value
139
+ * instead (in which case `keyframes` describes that value, e.g. `{ value: [0, 1] }`, and `apply`
140
+ * is required).
141
+ * @param keyframes - The keyframes to animate the filter's properties (or the plain value) with.
142
+ * @param options - Additional options for the animation, including duration, easing, and ticker.
143
+ * @param priority - The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
144
+ * @param apply - Called on every frame with the current interpolated value - required when
145
+ * `filter` is `undefined`, ignored otherwise.
146
+ * @param cleanup - Called once, right before completion handling, to detach/destroy the filter or
147
+ * tear down whatever `apply` was driving.
148
+ * @returns The id of the ticker.
149
+ */
150
+ animateFilter: (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void) => string | undefined;
151
+ /**
152
+ * This function removes one or more canvas components by alias. Used by the `tickers` module's
153
+ * `onComplete` to honor `aliasToRemoveAfter` without importing `@drincs/pixi-vn/canvas` directly
154
+ * (which would close an import cycle, since `canvas` depends on `tickers`).
155
+ * @param alias - The alias(es) of the canvas component(s) to remove.
156
+ */
157
+ removeCanvasComponent: (alias: string | string[]) => void;
158
+ /**
159
+ * This function checks whether a canvas component with the given alias currently exists. Used by
160
+ * the `tickers` module to prune ticker/alias associations for components no longer on the canvas,
161
+ * without importing `@drincs/pixi-vn/canvas` directly (see {@link removeCanvasComponent}).
162
+ * @param alias - The alias of the canvas component to check.
163
+ */
164
+ canvasComponentExists: (alias: string) => boolean;
129
165
  }): void;
130
166
  private static _navigate;
131
167
  /**
@@ -152,7 +188,7 @@ declare class GameUnifier {
152
188
  * Returns the current state of the game step.
153
189
  * @throws {PixiError} when `Game.init()` has not been called yet.
154
190
  */
155
- static get currentGameStepState(): GameStepState;
191
+ static get currentGameStepState(): GameStepState | Promise<GameStepState>;
156
192
  private static _restoreGameStepState;
157
193
  /**
158
194
  * Restores the game step state.
@@ -279,7 +315,7 @@ declare class GameUnifier {
279
315
  * If true, the step will not be added to the history if the current step is the same as the last step.
280
316
  */
281
317
  ignoreSameStep?: boolean;
282
- }) => void;
318
+ }) => void | Promise<void>;
283
319
  /**
284
320
  * Count of currently executing steps.
285
321
  * If a step triggers a narration.continue(), this number is greater than 1.
@@ -309,6 +345,26 @@ declare class GameUnifier {
309
345
  * @template T - The type of Pixi’VN component(s) being animated.
310
346
  */
311
347
  static get animate(): <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
348
+ private static _animateFilter;
349
+ /**
350
+ * This function is called to animate a `Filter`'s own properties, or a plain numeric "progress"
351
+ * value when no `filter` is given. See {@link animate} for animating a canvas element's properties
352
+ * instead.
353
+ * @returns The id of the ticker.
354
+ */
355
+ static get animateFilter(): (components: string | string[], filter: Filter | undefined, keyframes: any, options?: any, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void) => string | undefined;
356
+ private static _removeCanvasComponent;
357
+ /**
358
+ * Removes one or more canvas components by alias. See the `removeCanvasComponent` option of
359
+ * {@link init} for why this exists.
360
+ */
361
+ static get removeCanvasComponent(): (alias: string | string[]) => void;
362
+ private static _canvasComponentExists;
363
+ /**
364
+ * Checks whether a canvas component with the given alias currently exists. See the
365
+ * `canvasComponentExists` option of {@link init} for why this exists.
366
+ */
367
+ static get canvasComponentExists(): (alias: string) => boolean;
312
368
  }
313
369
 
314
370
  declare class PixiError extends Error {
package/dist/core.mjs CHANGED
@@ -1 +1 @@
1
- var a;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(a||={});var n=class extends Error{code;constructor(t,i,m,o,r){super(`[Pixi\u2019VN] ${i}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static _navigate=()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(i=>i!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(i=>i()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let i=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=i.newValue,await i.result}static _getVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(i=>i!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,i){for(let m of e._onErrorHandlers.slice())try{await m(t,i);}catch(o){a.error("Error in onError handler",o);}}static _animate=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}};export{l as GameUnifier,n as PixiError};
1
+ export{c as GameUnifier,a as PixiError}from'./chunk-LXIKP2K5.mjs';
@@ -0,0 +1 @@
1
+ 'use strict';var core=require('@drincs/pixi-vn/core'),pixi_js=require('@drincs/pixi-vn/pixi.js'),pixiFilters=require('pixi-filters');var Kt=Object.defineProperty;var Ut=t=>{throw TypeError(t)};var $t=(t,i,s)=>i in t?Kt(t,i,{enumerable:true,configurable:true,writable:true,value:s}):t[i]=s;var C=(t,i,s)=>$t(t,typeof i!="symbol"?i+"":i,s),Et=(t,i,s)=>i.has(t)||Ut("Cannot "+s);var e=(t,i,s)=>(Et(t,i,"read from private field"),s?s.call(t):i.get(t)),f=(t,i,s)=>i.has(t)?Ut("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),u=(t,i,s,o)=>(Et(t,i,"write to private field"),i.set(t,s),s),d=(t,i,s)=>(Et(t,i,"access private method"),s);var Tt=(t,i,s,o)=>({set _(r){u(t,i,r);},get _(){return e(t,i,o)}});var Zt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Pt=new Set,Dt=typeof process=="object"&&process?process:{},Xt=(t,i,s,o)=>{typeof Dt.emitWarning=="function"?Dt.emitWarning(t,i,s,o):console.error(`[${s}] ${i}: ${t}`);},Mt=globalThis.AbortController,jt=globalThis.AbortSignal;if(typeof Mt>"u"){jt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(s,o){this._onabort.push(o);}},Mt=class{constructor(){i();}signal=new jt;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=true;for(let o of this.signal._onabort)o(s);this.signal.onabort?.(s);}}};let t=Dt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",i=()=>{t&&(t=false,Xt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",i));};}var Jt=t=>!Pt.has(t);var it=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),It=t=>it(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?zt:null:null,zt=class extends Array{constructor(t){super(t),this.fill(0);}},Q,pt,Qt=(Q=class{heap;length;static create(i){let s=It(i);if(!s)return [];u(Q,pt,true);let o=new Q(i,s);return u(Q,pt,false),o}constructor(i,s){if(!e(Q,pt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(i),this.length=0;}push(i){this.heap[this.length++]=i;}pop(){return this.heap[--this.length]}},pt=new WeakMap,f(Q,pt,false),Q),Yt,Nt,P,W,X,at,I,mt,Ft,H,T,q,_,b,g,B,L,R,z,V,O,K,$,U,j,Z,nt,G,yt,l,Bt,lt,tt,xt,Y,qt,ht,ft,_t,st,ot,Gt,Ot,Ct,S,kt,At,rt,Wt,wt,Ht=(wt=class{constructor(i){f(this,l);f(this,P);f(this,W);f(this,X);f(this,at);f(this,I);f(this,mt);f(this,Ft);f(this,H);C(this,"ttl");C(this,"ttlResolution");C(this,"ttlAutopurge");C(this,"updateAgeOnGet");C(this,"updateAgeOnHas");C(this,"allowStale");C(this,"noDisposeOnSet");C(this,"noUpdateTTL");C(this,"maxEntrySize");C(this,"sizeCalculation");C(this,"noDeleteOnFetchRejection");C(this,"noDeleteOnStaleGet");C(this,"allowStaleOnFetchAbort");C(this,"allowStaleOnFetchRejection");C(this,"ignoreFetchAbort");f(this,T);f(this,q);f(this,_);f(this,b);f(this,g);f(this,B);f(this,L);f(this,R);f(this,z);f(this,V);f(this,O);f(this,K);f(this,$);f(this,U);f(this,j);f(this,Z);f(this,nt);f(this,G);f(this,yt);f(this,lt,()=>{});f(this,tt,()=>{});f(this,xt,()=>{});f(this,Y,()=>false);f(this,ht,i=>{});f(this,ft,(i,s,o)=>{});f(this,_t,(i,s,o,r)=>{if(o||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Yt,"LRUCache");let{max:s=0,ttl:o,ttlResolution:r=1,ttlAutopurge:a,updateAgeOnGet:n,updateAgeOnHas:c,allowStale:h,dispose:p,onInsert:w,disposeAfter:y,noDisposeOnSet:et,noUpdateTTL:N,maxSize:J=0,maxEntrySize:A=0,sizeCalculation:v,fetchMethod:m,memoMethod:E,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:bt,ignoreFetchAbort:ct,perf:ut}=i;if(ut!==void 0&&typeof ut?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,H,ut??Zt),s!==0&&!it(s))throw new TypeError("max option must be a nonnegative integer");let gt=s?It(s):Array;if(!gt)throw new Error("invalid max value: "+s);if(u(this,P,s),u(this,W,J),this.maxEntrySize=A||e(this,W),this.sizeCalculation=v,this.sizeCalculation){if(!e(this,W)&&!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(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Ft,E),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,mt,m),u(this,nt,!!m),u(this,_,new Map),u(this,b,new Array(s).fill(void 0)),u(this,g,new Array(s).fill(void 0)),u(this,B,new gt(s)),u(this,L,new gt(s)),u(this,R,0),u(this,z,0),u(this,V,Qt.create(s)),u(this,T,0),u(this,q,0),typeof p=="function"&&u(this,X,p),typeof w=="function"&&u(this,at,w),typeof y=="function"?(u(this,I,y),u(this,O,[])):(u(this,I,void 0),u(this,O,void 0)),u(this,Z,!!e(this,X)),u(this,yt,!!e(this,at)),u(this,G,!!e(this,I)),this.noDisposeOnSet=!!et,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!bt,this.ignoreFetchAbort=!!ct,this.maxEntrySize!==0){if(e(this,W)!==0&&!it(e(this,W)))throw new TypeError("maxSize must be a positive integer if specified");if(!it(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,qt).call(this);}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!c,this.ttlResolution=it(r)||r===0?r:1,this.ttlAutopurge=!!a,this.ttl=o||0,this.ttl){if(!it(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,Bt).call(this);}if(e(this,P)===0&&this.ttl===0&&e(this,W)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,P)&&!e(this,W)){let Rt="LRU_CACHE_UNBOUNDED";Jt(Rt)&&(Pt.add(Rt),Xt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Rt,wt));}}get perf(){return e(this,H)}static unsafeExposeInternals(i){return {starts:e(i,$),ttls:e(i,U),autopurgeTimers:e(i,j),sizes:e(i,K),keyMap:e(i,_),keyList:e(i,b),valList:e(i,g),next:e(i,B),prev:e(i,L),get head(){return e(i,R)},get tail(){return e(i,z)},free:e(i,V),isBackgroundFetch:s=>{var o;return d(o=i,l,S).call(o,s)},backgroundFetch:(s,o,r,a)=>{var n;return d(n=i,l,Ct).call(n,s,o,r,a)},moveToTail:s=>{var o;return d(o=i,l,At).call(o,s)},indexes:s=>{var o;return d(o=i,l,st).call(o,s)},rindexes:s=>{var o;return d(o=i,l,ot).call(o,s)},isStale:s=>{var o;return e(o=i,Y).call(o,s)}}}get max(){return e(this,P)}get maxSize(){return e(this,W)}get calculatedSize(){return e(this,q)}get size(){return e(this,T)}get fetchMethod(){return e(this,mt)}get memoMethod(){return e(this,Ft)}get dispose(){return e(this,X)}get onInsert(){return e(this,at)}get disposeAfter(){return e(this,I)}getRemainingTTL(i){return e(this,_).has(i)?1/0:0}*entries(){for(let i of d(this,l,st).call(this))e(this,g)[i]!==void 0&&e(this,b)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield [e(this,b)[i],e(this,g)[i]]);}*rentries(){for(let i of d(this,l,ot).call(this))e(this,g)[i]!==void 0&&e(this,b)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield [e(this,b)[i],e(this,g)[i]]);}*keys(){for(let i of d(this,l,st).call(this)){let s=e(this,b)[i];s!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield s);}}*rkeys(){for(let i of d(this,l,ot).call(this)){let s=e(this,b)[i];s!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield s);}}*values(){for(let i of d(this,l,st).call(this))e(this,g)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield e(this,g)[i]);}*rvalues(){for(let i of d(this,l,ot).call(this))e(this,g)[i]!==void 0&&!d(this,l,S).call(this,e(this,g)[i])&&(yield e(this,g)[i]);}[(Nt=Symbol.iterator,Yt=Symbol.toStringTag,Nt)](){return this.entries()}find(i,s={}){for(let o of d(this,l,st).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;if(a!==void 0&&i(a,e(this,b)[o],this))return this.get(e(this,b)[o],s)}}forEach(i,s=this){for(let o of d(this,l,st).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&i.call(s,a,e(this,b)[o],this);}}rforEach(i,s=this){for(let o of d(this,l,ot).call(this)){let r=e(this,g)[o],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&i.call(s,a,e(this,b)[o],this);}}purgeStale(){let i=false;for(let s of d(this,l,ot).call(this,{allowStale:true}))e(this,Y).call(this,s)&&(d(this,l,rt).call(this,e(this,b)[s],"expire"),i=true);return i}info(i){let s=e(this,_).get(i);if(s===void 0)return;let o=e(this,g)[s],r=d(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0)return;let a={value:r};if(e(this,U)&&e(this,$)){let n=e(this,U)[s],c=e(this,$)[s];if(n&&c){let h=n-(e(this,H).now()-c);a.ttl=h,a.start=Date.now();}}return e(this,K)&&(a.size=e(this,K)[s]),a}dump(){let i=[];for(let s of d(this,l,st).call(this,{allowStale:true})){let o=e(this,b)[s],r=e(this,g)[s],a=d(this,l,S).call(this,r)?r.__staleWhileFetching:r;if(a===void 0||o===void 0)continue;let n={value:a};if(e(this,U)&&e(this,$)){n.ttl=e(this,U)[s];let c=e(this,H).now()-e(this,$)[s];n.start=Math.floor(Date.now()-c);}e(this,K)&&(n.size=e(this,K)[s]),i.unshift([o,n]);}return i}load(i){this.clear();for(let[s,o]of i){if(o.start){let r=Date.now()-o.start;o.start=e(this,H).now()-r;}this.set(s,o.value,o);}}set(i,s,o={}){var et,N,J,A;if(s===void 0)return this.delete(i),this;let{ttl:r=this.ttl,start:a,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=o,{noUpdateTTL:p=this.noUpdateTTL}=o,w=e(this,_t).call(this,i,s,o.size||0,c);if(this.maxEntrySize&&w>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=true),d(this,l,rt).call(this,i,"set"),this;let y=e(this,T)===0?void 0:e(this,_).get(i);if(y===void 0)y=e(this,T)===0?e(this,z):e(this,V).length!==0?e(this,V).pop():e(this,T)===e(this,P)?d(this,l,Ot).call(this,false):e(this,T),e(this,b)[y]=i,e(this,g)[y]=s,e(this,_).set(i,y),e(this,B)[e(this,z)]=y,e(this,L)[y]=e(this,z),u(this,z,y),Tt(this,T)._++,e(this,ft).call(this,y,w,h),h&&(h.set="add"),p=false,e(this,yt)&&((et=e(this,at))==null||et.call(this,s,i,"add"));else {d(this,l,At).call(this,y);let v=e(this,g)[y];if(s!==v){if(e(this,nt)&&d(this,l,S).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=v;m!==void 0&&!n&&(e(this,Z)&&((N=e(this,X))==null||N.call(this,m,i,"set")),e(this,G)&&e(this,O)?.push([m,i,"set"]));}else n||(e(this,Z)&&((J=e(this,X))==null||J.call(this,v,i,"set")),e(this,G)&&e(this,O)?.push([v,i,"set"]));if(e(this,ht).call(this,y),e(this,ft).call(this,y,w,h),e(this,g)[y]=s,h){h.set="replace";let m=v&&d(this,l,S).call(this,v)?v.__staleWhileFetching:v;m!==void 0&&(h.oldValue=m);}}else h&&(h.set="update");e(this,yt)&&this.onInsert?.(s,i,s===v?"update":"replace");}if(r!==0&&!e(this,U)&&d(this,l,Bt).call(this),e(this,U)&&(p||e(this,xt).call(this,y,r,a),h&&e(this,tt).call(this,h,y)),!n&&e(this,G)&&e(this,O)){let v=e(this,O),m;for(;m=v?.shift();)(A=e(this,I))==null||A.call(this,...m);}return this}pop(){var i;try{for(;e(this,T);){let s=e(this,g)[e(this,R)];if(d(this,l,Ot).call(this,!0),d(this,l,S).call(this,s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(e(this,G)&&e(this,O)){let s=e(this,O),o;for(;o=s?.shift();)(i=e(this,I))==null||i.call(this,...o);}}}has(i,s={}){let{updateAgeOnHas:o=this.updateAgeOnHas,status:r}=s,a=e(this,_).get(i);if(a!==void 0){let n=e(this,g)[a];if(d(this,l,S).call(this,n)&&n.__staleWhileFetching===void 0)return false;if(e(this,Y).call(this,a))r&&(r.has="stale",e(this,tt).call(this,r,a));else return o&&e(this,lt).call(this,a),r&&(r.has="hit",e(this,tt).call(this,r,a)),true}else r&&(r.has="miss");return false}peek(i,s={}){let{allowStale:o=this.allowStale}=s,r=e(this,_).get(i);if(r===void 0||!o&&e(this,Y).call(this,r))return;let a=e(this,g)[r];return d(this,l,S).call(this,a)?a.__staleWhileFetching:a}async fetch(i,s={}){let{allowStale:o=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:et=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:A,forceRefresh:v=false,status:m,signal:E}=s;if(!e(this,nt))return m&&(m.fetch="get"),this.get(i,{allowStale:o,updateAgeOnGet:r,noDeleteOnStaleGet:a,status:m});let k={allowStale:o,updateAgeOnGet:r,noDeleteOnStaleGet:a,ttl:n,noDisposeOnSet:c,size:h,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:et,allowStaleOnFetchAbort:J,ignoreFetchAbort:N,status:m,signal:E},D=e(this,_).get(i);if(D===void 0){m&&(m.fetch="miss");let x=d(this,l,Ct).call(this,i,D,k,A);return x.__returned=x}else {let x=e(this,g)[D];if(d(this,l,S).call(this,x)){let gt=o&&x.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",gt&&(m.returnedStale=true)),gt?x.__staleWhileFetching:x.__returned=x}let bt=e(this,Y).call(this,D);if(!v&&!bt)return m&&(m.fetch="hit"),d(this,l,At).call(this,D),r&&e(this,lt).call(this,D),m&&e(this,tt).call(this,m,D),x;let ct=d(this,l,Ct).call(this,i,D,k,A),ut=ct.__staleWhileFetching!==void 0&&o;return m&&(m.fetch=bt?"stale":"refresh",ut&&bt&&(m.returnedStale=true)),ut?ct.__staleWhileFetching:ct.__returned=ct}}async forceFetch(i,s={}){let o=await this.fetch(i,s);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(i,s={}){let o=e(this,Ft);if(!o)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:a,...n}=s,c=this.get(i,n);if(!a&&c!==void 0)return c;let h=o(i,c,{options:n,context:r});return this.set(i,h,n),h}get(i,s={}){let{allowStale:o=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:n}=s,c=e(this,_).get(i);if(c!==void 0){let h=e(this,g)[c],p=d(this,l,S).call(this,h);return n&&e(this,tt).call(this,n,c),e(this,Y).call(this,c)?(n&&(n.get="stale"),p?(n&&o&&h.__staleWhileFetching!==void 0&&(n.returnedStale=true),o?h.__staleWhileFetching:void 0):(a||d(this,l,rt).call(this,i,"expire"),n&&o&&(n.returnedStale=true),o?h:void 0)):(n&&(n.get="hit"),p?h.__staleWhileFetching:(d(this,l,At).call(this,c),r&&e(this,lt).call(this,c),h))}else n&&(n.get="miss");}delete(i){return d(this,l,rt).call(this,i,"delete")}clear(){return d(this,l,Wt).call(this,"delete")}},P=new WeakMap,W=new WeakMap,X=new WeakMap,at=new WeakMap,I=new WeakMap,mt=new WeakMap,Ft=new WeakMap,H=new WeakMap,T=new WeakMap,q=new WeakMap,_=new WeakMap,b=new WeakMap,g=new WeakMap,B=new WeakMap,L=new WeakMap,R=new WeakMap,z=new WeakMap,V=new WeakMap,O=new WeakMap,K=new WeakMap,$=new WeakMap,U=new WeakMap,j=new WeakMap,Z=new WeakMap,nt=new WeakMap,G=new WeakMap,yt=new WeakMap,l=new WeakSet,Bt=function(){let i=new zt(e(this,P)),s=new zt(e(this,P));u(this,U,i),u(this,$,s);let o=this.ttlAutopurge?new Array(e(this,P)):void 0;u(this,j,o),u(this,xt,(c,h,p=e(this,H).now())=>{s[c]=h!==0?p:0,i[c]=h,r(c,h);}),u(this,lt,c=>{s[c]=i[c]!==0?e(this,H).now():0,r(c,i[c]);});let r=this.ttlAutopurge?(c,h)=>{if(o?.[c]&&(clearTimeout(o[c]),o[c]=void 0),h&&h!==0&&o){let p=setTimeout(()=>{e(this,Y).call(this,c)&&d(this,l,rt).call(this,e(this,b)[c],"expire");},h+1);p.unref&&p.unref(),o[c]=p;}}:()=>{};u(this,tt,(c,h)=>{if(i[h]){let p=i[h],w=s[h];if(!p||!w)return;c.ttl=p,c.start=w,c.now=a||n();let y=c.now-w;c.remainingTTL=p-y;}});let a=0,n=()=>{let c=e(this,H).now();if(this.ttlResolution>0){a=c;let h=setTimeout(()=>a=0,this.ttlResolution);h.unref&&h.unref();}return c};this.getRemainingTTL=c=>{let h=e(this,_).get(c);if(h===void 0)return 0;let p=i[h],w=s[h];if(!p||!w)return 1/0;let y=(a||n())-w;return p-y},u(this,Y,c=>{let h=s[c],p=i[c];return !!p&&!!h&&(a||n())-h>p});},lt=new WeakMap,tt=new WeakMap,xt=new WeakMap,Y=new WeakMap,qt=function(){let i=new zt(e(this,P));u(this,q,0),u(this,K,i),u(this,ht,s=>{u(this,q,e(this,q)-i[s]),i[s]=0;}),u(this,_t,(s,o,r,a)=>{if(d(this,l,S).call(this,o))return 0;if(!it(r))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(r=a(o,s),!it(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,ft,(s,o,r)=>{if(i[s]=o,e(this,W)){let a=e(this,W)-i[s];for(;e(this,q)>a;)d(this,l,Ot).call(this,true);}u(this,q,e(this,q)+i[s]),r&&(r.entrySize=o,r.totalCalculatedSize=e(this,q));});},ht=new WeakMap,ft=new WeakMap,_t=new WeakMap,st=function*({allowStale:i=this.allowStale}={}){if(e(this,T))for(let s=e(this,z);!(!d(this,l,Gt).call(this,s)||((i||!e(this,Y).call(this,s))&&(yield s),s===e(this,R)));)s=e(this,L)[s];},ot=function*({allowStale:i=this.allowStale}={}){if(e(this,T))for(let s=e(this,R);!(!d(this,l,Gt).call(this,s)||((i||!e(this,Y).call(this,s))&&(yield s),s===e(this,z)));)s=e(this,B)[s];},Gt=function(i){return i!==void 0&&e(this,_).get(e(this,b)[i])===i},Ot=function(i){var a;let s=e(this,R),o=e(this,b)[s],r=e(this,g)[s];return e(this,nt)&&d(this,l,S).call(this,r)?r.__abortController.abort(new Error("evicted")):(e(this,Z)||e(this,G))&&(e(this,Z)&&((a=e(this,X))==null||a.call(this,r,o,"evict")),e(this,G)&&e(this,O)?.push([r,o,"evict"])),e(this,ht).call(this,s),e(this,j)?.[s]&&(clearTimeout(e(this,j)[s]),e(this,j)[s]=void 0),i&&(e(this,b)[s]=void 0,e(this,g)[s]=void 0,e(this,V).push(s)),e(this,T)===1?(u(this,R,u(this,z,0)),e(this,V).length=0):u(this,R,e(this,B)[s]),e(this,_).delete(o),Tt(this,T)._--,s},Ct=function(i,s,o,r){let a=s===void 0?void 0:e(this,g)[s];if(d(this,l,S).call(this,a))return a;let n=new Mt,{signal:c}=o;c?.addEventListener("abort",()=>n.abort(c.reason),{signal:n.signal});let h={signal:n.signal,options:o,context:r},p=(A,v=false)=>{let{aborted:m}=n.signal,E=o.ignoreFetchAbort&&A!==void 0,k=o.ignoreFetchAbort||!!(o.allowStaleOnFetchAbort&&A!==void 0);if(o.status&&(m&&!v?(o.status.fetchAborted=true,o.status.fetchError=n.signal.reason,E&&(o.status.fetchAbortIgnored=true)):o.status.fetchResolved=true),m&&!E&&!v)return y(n.signal.reason,k);let D=N,x=e(this,g)[s];return (x===N||E&&v&&x===void 0)&&(A===void 0?D.__staleWhileFetching!==void 0?e(this,g)[s]=D.__staleWhileFetching:d(this,l,rt).call(this,i,"fetch"):(o.status&&(o.status.fetchUpdated=true),this.set(i,A,h.options))),A},w=A=>(o.status&&(o.status.fetchRejected=true,o.status.fetchError=A),y(A,false)),y=(A,v)=>{let{aborted:m}=n.signal,E=m&&o.allowStaleOnFetchAbort,k=E||o.allowStaleOnFetchRejection,D=k||o.noDeleteOnFetchRejection,x=N;if(e(this,g)[s]===N&&(!D||!v&&x.__staleWhileFetching===void 0?d(this,l,rt).call(this,i,"fetch"):E||(e(this,g)[s]=x.__staleWhileFetching)),k)return o.status&&x.__staleWhileFetching!==void 0&&(o.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw A},et=(A,v)=>{var E;let m=(E=e(this,mt))==null?void 0:E.call(this,i,a,h);m&&m instanceof Promise&&m.then(k=>A(k===void 0?void 0:k),v),n.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(A(void 0),o.allowStaleOnFetchAbort&&(A=k=>p(k,true)));});};o.status&&(o.status.fetchDispatched=true);let N=new Promise(et).then(p,w),J=Object.assign(N,{__abortController:n,__staleWhileFetching:a,__returned:void 0});return s===void 0?(this.set(i,J,{...h.options,status:void 0}),s=e(this,_).get(i)):e(this,g)[s]=J,J},S=function(i){if(!e(this,nt))return false;let s=i;return !!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof Mt},kt=function(i,s){e(this,L)[s]=i,e(this,B)[i]=s;},At=function(i){i!==e(this,z)&&(i===e(this,R)?u(this,R,e(this,B)[i]):d(this,l,kt).call(this,e(this,L)[i],e(this,B)[i]),d(this,l,kt).call(this,e(this,z),i),u(this,z,i));},rt=function(i,s){var r,a;let o=false;if(e(this,T)!==0){let n=e(this,_).get(i);if(n!==void 0)if(e(this,j)?.[n]&&(clearTimeout(e(this,j)?.[n]),e(this,j)[n]=void 0),o=true,e(this,T)===1)d(this,l,Wt).call(this,s);else {e(this,ht).call(this,n);let c=e(this,g)[n];if(d(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(e(this,Z)||e(this,G))&&(e(this,Z)&&((r=e(this,X))==null||r.call(this,c,i,s)),e(this,G)&&e(this,O)?.push([c,i,s])),e(this,_).delete(i),e(this,b)[n]=void 0,e(this,g)[n]=void 0,n===e(this,z))u(this,z,e(this,L)[n]);else if(n===e(this,R))u(this,R,e(this,B)[n]);else {let h=e(this,L)[n];e(this,B)[h]=e(this,B)[n];let p=e(this,B)[n];e(this,L)[p]=e(this,L)[n];}Tt(this,T)._--,e(this,V).push(n);}}if(e(this,G)&&e(this,O)?.length){let n=e(this,O),c;for(;c=n?.shift();)(a=e(this,I))==null||a.call(this,...c);}return o},Wt=function(i){var s,o;for(let r of d(this,l,ot).call(this,{allowStale:true})){let a=e(this,g)[r];if(d(this,l,S).call(this,a))a.__abortController.abort(new Error("deleted"));else {let n=e(this,b)[r];e(this,Z)&&((s=e(this,X))==null||s.call(this,a,n,i)),e(this,G)&&e(this,O)?.push([a,n,i]);}}if(e(this,_).clear(),e(this,g).fill(void 0),e(this,b).fill(void 0),e(this,U)&&e(this,$)){e(this,U).fill(0),e(this,$).fill(0);for(let r of e(this,j)??[])r!==void 0&&clearTimeout(r);e(this,j)?.fill(void 0);}if(e(this,K)&&e(this,K).fill(0),u(this,R,0),u(this,z,0),e(this,V).length=0,u(this,q,0),u(this,T,0),e(this,G)&&e(this,O)){let r=e(this,O),a;for(;a=r?.shift();)(o=e(this,I))==null||o.call(this,...a);}},wt);var vt=class{cache;map=new Map;constructor(i){this.cache=new Ht({max:i.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(i){let s=this.map.delete(i);return s&&this.cache.delete(i),s}get forEach(){return this.map.forEach}get(i){let s=this.cache.get(i);return s||this.map.get(i)}has(i){return this.map.has(i)}set(i,s){return this.map.set(i,s),this.cache.set(i,s),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var dt;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN] ${a}`,...n)))(dt||={});var St=new vt({cacheSize:5}),Vt=new vt({cacheSize:5});function te(t){return i=>{Lt.add(i,t);}}var Lt;(c=>{function t(h,p){let{toMemory:w}=p,y=p.name??h.name;St.get(y)&&dt.info(`Filter "${y}" already exists, it will be overwritten`),h.prototype.pixivnFilterId=y,St.set(y,h),Vt.set(y,w);}c.add=t;function i(h){let p=St.get(h);if(!p){dt.error(`Filter "${h}" not found, did you forget to register it with the filterDecorator?`);return}return p}c.get=i;function s(h,p){let w=i(h);if(w)try{return new w(p)}catch(y){dt.error(`Error while getting Filter instance "${h}"`,y);return}}c.getInstance=s;function o(h,p){let w=Vt.get(h);if(!w){dt.error(`Filter "${h}" not found, did you forget to register it with the filterDecorator?`);return}try{return {filterId:h,args:w(p)}}catch(y){dt.error(`Error while converting Filter "${h}" to memory`,y);return}}c.toMemory=o;function r(){return Array.from(St.values())}c.values=r;function a(h){return St.has(h)}c.has=a;function n(){return Array.from(St.keys())}c.keys=n;})(Lt||={});var F=Lt;function M(t,i){return {x:t,y:i}}F.add(pixi_js.BlurFilter,{name:"BlurFilter",toMemory:t=>({strengthX:t.strengthX,strengthY:t.strengthY,quality:t.quality,repeatEdgePixels:t.repeatEdgePixels})});F.add(pixi_js.AlphaFilter,{name:"AlphaFilter",toMemory:t=>({alpha:t.alpha})});F.add(pixi_js.NoiseFilter,{name:"NoiseFilter",toMemory:t=>({noise:t.noise,seed:t.seed})});F.add(pixiFilters.PixelateFilter,{name:"PixelateFilter",toMemory:t=>[t.sizeX,t.sizeY]});F.add(pixiFilters.AdjustmentFilter,{name:"AdjustmentFilter",toMemory:t=>({gamma:t.gamma,contrast:t.contrast,saturation:t.saturation,brightness:t.brightness,red:t.red,green:t.green,blue:t.blue,alpha:t.alpha})});F.add(pixiFilters.AdvancedBloomFilter,{name:"AdvancedBloomFilter",toMemory:t=>({threshold:t.threshold,bloomScale:t.bloomScale,brightness:t.brightness,blur:t.blur,kernels:t.kernels,quality:t.quality,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.AsciiFilter,{name:"AsciiFilter",toMemory:t=>({size:t.size,color:t.color,replaceColor:t.replaceColor})});F.add(pixiFilters.BackdropBlurFilter,{name:"BackdropBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality})});F.add(pixiFilters.BevelFilter,{name:"BevelFilter",toMemory:t=>({rotation:t.rotation,thickness:t.thickness,lightColor:t.lightColor,lightAlpha:t.lightAlpha,shadowColor:t.shadowColor,shadowAlpha:t.shadowAlpha})});F.add(pixiFilters.BloomFilter,{name:"BloomFilter",toMemory:t=>({strength:M(t.strengthX,t.strengthY)})});F.add(pixiFilters.BulgePinchFilter,{name:"BulgePinchFilter",toMemory:t=>({center:M(t.centerX,t.centerY),radius:t.radius,strength:t.strength})});F.add(pixiFilters.ColorGradientFilter,{name:"ColorGradientFilter",toMemory:t=>({type:t.type,stops:t.stops,angle:t.angle,alpha:t.alpha,maxColors:t.maxColors,replace:t.replace})});F.add(pixiFilters.ColorOverlayFilter,{name:"ColorOverlayFilter",toMemory:t=>({color:t.color,alpha:t.alpha})});F.add(pixiFilters.ColorReplaceFilter,{name:"ColorReplaceFilter",toMemory:t=>({originalColor:t.originalColor,targetColor:t.targetColor,tolerance:t.tolerance})});F.add(pixiFilters.ConvolutionFilter,{name:"ConvolutionFilter",toMemory:t=>({matrix:t.matrix,width:t.width,height:t.height})});F.add(pixiFilters.CrossHatchFilter,{name:"CrossHatchFilter",toMemory:()=>({})});F.add(pixiFilters.CRTFilter,{name:"CRTFilter",toMemory:t=>({curvature:t.curvature,lineWidth:t.lineWidth,lineContrast:t.lineContrast,verticalLine:t.verticalLine,noise:t.noise,noiseSize:t.noiseSize,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed,time:t.time})});F.add(pixiFilters.DotFilter,{name:"DotFilter",toMemory:t=>({scale:t.scale,angle:t.angle,grayscale:t.grayscale})});F.add(pixiFilters.DropShadowFilter,{name:"DropShadowFilter",toMemory:t=>({offset:M(t.offsetX,t.offsetY),color:t.color,alpha:t.alpha,shadowOnly:t.shadowOnly,blur:t.blur,quality:t.quality,kernels:t.kernels,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.EmbossFilter,{name:"EmbossFilter",toMemory:t=>t.strength});F.add(pixiFilters.GlitchFilter,{name:"GlitchFilter",toMemory:t=>({slices:t.slices,offset:t.offset,direction:t.direction,fillMode:t.fillMode,seed:t.seed,average:t.average,minSize:t.minSize,sampleSize:t.sampleSize,red:t.red,green:t.green,blue:t.blue})});F.add(pixiFilters.GlowFilter,{name:"GlowFilter",toMemory:t=>({distance:t.distance,outerStrength:t.outerStrength,innerStrength:t.innerStrength,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});F.add(pixiFilters.GodrayFilter,{name:"GodrayFilter",toMemory:t=>({angle:t.angle,parallel:t.parallel,center:M(t.centerX,t.centerY),gain:t.gain,lacunarity:t.lacunarity,time:t.time,alpha:t.alpha})});F.add(pixiFilters.GrayscaleFilter,{name:"GrayscaleFilter",toMemory:()=>({})});F.add(pixiFilters.HslAdjustmentFilter,{name:"HslAdjustmentFilter",toMemory:t=>({hue:t.hue,saturation:t.saturation,lightness:t.lightness,colorize:t.colorize,alpha:t.alpha})});F.add(pixiFilters.KawaseBlurFilter,{name:"KawaseBlurFilter",toMemory:t=>({strength:t.strength,quality:t.quality,pixelSize:M(t.pixelSizeX,t.pixelSizeY)})});F.add(pixiFilters.MotionBlurFilter,{name:"MotionBlurFilter",toMemory:t=>({velocity:M(t.velocityX,t.velocityY),kernelSize:t.kernelSize,offset:t.offset})});F.add(pixiFilters.MultiColorReplaceFilter,{name:"MultiColorReplaceFilter",toMemory:t=>({replacements:t.replacements,tolerance:t.tolerance})});F.add(pixiFilters.OldFilmFilter,{name:"OldFilmFilter",toMemory:t=>({sepia:t.sepia,noise:t.noise,noiseSize:t.noiseSize,scratch:t.scratch,scratchDensity:t.scratchDensity,scratchWidth:t.scratchWidth,vignetting:t.vignetting,vignettingAlpha:t.vignettingAlpha,vignettingBlur:t.vignettingBlur,seed:t.seed})});F.add(pixiFilters.OutlineFilter,{name:"OutlineFilter",toMemory:t=>({thickness:t.thickness,color:t.color,alpha:t.alpha,quality:t.quality,knockout:t.knockout})});F.add(pixiFilters.RadialBlurFilter,{name:"RadialBlurFilter",toMemory:t=>({angle:t.angle,center:M(t.centerX,t.centerY),kernelSize:t.kernelSize,radius:t.radius})});F.add(pixiFilters.ReflectionFilter,{name:"ReflectionFilter",toMemory:t=>({mirror:t.mirror,boundary:t.boundary,amplitude:t.amplitude,waveLength:t.waveLength,alpha:t.alpha,time:t.time})});F.add(pixiFilters.RGBSplitFilter,{name:"RGBSplitFilter",toMemory:t=>({red:M(t.redX,t.redY),green:M(t.greenX,t.greenY),blue:M(t.blueX,t.blueY)})});F.add(pixiFilters.ShockwaveFilter,{name:"ShockwaveFilter",toMemory:t=>({center:M(t.centerX,t.centerY),speed:t.speed,amplitude:t.amplitude,wavelength:t.wavelength,brightness:t.brightness,radius:t.radius,time:t.time})});F.add(pixiFilters.SimplexNoiseFilter,{name:"SimplexNoiseFilter",toMemory:t=>({strength:t.strength,noiseScale:t.noiseScale,offsetX:t.offsetX,offsetY:t.offsetY,offsetZ:t.offsetZ,step:t.step})});F.add(pixiFilters.TiltShiftFilter,{name:"TiltShiftFilter",toMemory:t=>({blur:t.blur,gradientBlur:t.gradientBlur,start:M(t.startX,t.startY),end:M(t.endX,t.endY)})});F.add(pixiFilters.TwistFilter,{name:"TwistFilter",toMemory:t=>({radius:t.radius,angle:t.angle,offset:M(t.offsetX,t.offsetY)})});F.add(pixiFilters.ZoomBlurFilter,{name:"ZoomBlurFilter",toMemory:t=>({strength:t.strength,center:M(t.centerX,t.centerY),innerRadius:t.innerRadius,radius:t.radius})});function xi(t,i,s,o,r,a,n){return core.GameUnifier.animateFilter(t,i,s,o,r,a,n)}var Xi={AlphaFilter:pixi_js.AlphaFilter,BlurFilter:pixi_js.BlurFilter,NoiseFilter:pixi_js.NoiseFilter,AdjustmentFilter:pixiFilters.AdjustmentFilter,AdvancedBloomFilter:pixiFilters.AdvancedBloomFilter,AsciiFilter:pixiFilters.AsciiFilter,BackdropBlurFilter:pixiFilters.BackdropBlurFilter,BevelFilter:pixiFilters.BevelFilter,BloomFilter:pixiFilters.BloomFilter,BulgePinchFilter:pixiFilters.BulgePinchFilter,ColorGradientFilter:pixiFilters.ColorGradientFilter,ColorOverlayFilter:pixiFilters.ColorOverlayFilter,ColorReplaceFilter:pixiFilters.ColorReplaceFilter,ConvolutionFilter:pixiFilters.ConvolutionFilter,CRTFilter:pixiFilters.CRTFilter,CrossHatchFilter:pixiFilters.CrossHatchFilter,DotFilter:pixiFilters.DotFilter,DropShadowFilter:pixiFilters.DropShadowFilter,EmbossFilter:pixiFilters.EmbossFilter,GlitchFilter:pixiFilters.GlitchFilter,GlowFilter:pixiFilters.GlowFilter,GodrayFilter:pixiFilters.GodrayFilter,GrayscaleFilter:pixiFilters.GrayscaleFilter,HslAdjustmentFilter:pixiFilters.HslAdjustmentFilter,KawaseBlurFilter:pixiFilters.KawaseBlurFilter,MotionBlurFilter:pixiFilters.MotionBlurFilter,MultiColorReplaceFilter:pixiFilters.MultiColorReplaceFilter,OldFilmFilter:pixiFilters.OldFilmFilter,OutlineFilter:pixiFilters.OutlineFilter,PixelateFilter:pixiFilters.PixelateFilter,RadialBlurFilter:pixiFilters.RadialBlurFilter,ReflectionFilter:pixiFilters.ReflectionFilter,RGBSplitFilter:pixiFilters.RGBSplitFilter,ShockwaveFilter:pixiFilters.ShockwaveFilter,SimplexNoiseFilter:pixiFilters.SimplexNoiseFilter,TiltShiftFilter:pixiFilters.TiltShiftFilter,TwistFilter:pixiFilters.TwistFilter,ZoomBlurFilter:pixiFilters.ZoomBlurFilter,animate:xi};exports.RegisteredFilters=F;exports.filterDecorator=te;exports.filters=Xi;
@@ -0,0 +1,182 @@
1
+ import { AnimationOptions } from '@drincs/pixi-vn/motion';
2
+ import { Filter, AlphaFilter, BlurFilter, NoiseFilter, UPDATE_PRIORITY } from '@drincs/pixi-vn/pixi.js';
3
+ import { AdjustmentFilter, AdvancedBloomFilter, AsciiFilter, BackdropBlurFilter, BevelFilter, BloomFilter, BulgePinchFilter, ColorGradientFilter, ColorOverlayFilter, ColorReplaceFilter, ConvolutionFilter, CRTFilter, CrossHatchFilter, DotFilter, DropShadowFilter, EmbossFilter, GlitchFilter, GlowFilter, GodrayFilter, GrayscaleFilter, HslAdjustmentFilter, KawaseBlurFilter, MotionBlurFilter, MultiColorReplaceFilter, OldFilmFilter, OutlineFilter, PixelateFilter, RadialBlurFilter, ReflectionFilter, RGBSplitFilter, ShockwaveFilter, SimplexNoiseFilter, TiltShiftFilter, TwistFilter, ZoomBlurFilter } from 'pixi-filters';
4
+
5
+ /**
6
+ * Is a decorator that registers a `Filter` class so it can be saved and restored as part of a canvas
7
+ * element's `.filters`. Required for any custom filter you want to survive a save/restore round-trip -
8
+ * built-in ones like `PixelateFilter` (and `BlurFilter`) are already registered by Pixi'VN.
9
+ * @param options.name The id used to identify this filter class in saves (must be unique). Defaults to the class name.
10
+ * @param options.toMemory Reads a live instance's current parameters into a plain, serializable object. It is passed to the class's constructor (as its single argument) to reconstruct the filter on restore.
11
+ * @example
12
+ * ```ts
13
+ * @filterDecorator({ toMemory: (filter: MyFilter) => ({ amount: filter.amount }) })
14
+ * class MyFilter extends Filter {
15
+ * constructor(args: { amount?: number } = {}) {
16
+ * super({ ... });
17
+ * this.amount = args.amount ?? 0;
18
+ * }
19
+ * // ...
20
+ * }
21
+ * ```
22
+ */
23
+ declare function filterDecorator<T extends {
24
+ new (args: any): Filter;
25
+ }>(options: {
26
+ name?: string;
27
+ toMemory: (filter: InstanceType<T>) => any;
28
+ }): (target: T) => void;
29
+ declare namespace RegisteredFilters {
30
+ /**
31
+ * Register a filter class in the game.
32
+ * @param target The class of the filter. Must be constructible from a single, serializable `args` object.
33
+ * @param options.name Name of the filter, by default it will use the class name. If the name is already registered, it will show a warning
34
+ * @param options.toMemory Reads a live instance's current parameters into a plain, serializable object.
35
+ */
36
+ function add<T extends {
37
+ new (args: any): Filter;
38
+ }>(target: T, options: {
39
+ name?: string;
40
+ toMemory: (filter: InstanceType<T>) => any;
41
+ }): void;
42
+ /**
43
+ * Get a filter class by the id.
44
+ * @param filterId The id of the filter.
45
+ * @returns The filter class.
46
+ */
47
+ function get<T = {
48
+ new (args: any): Filter;
49
+ }>(filterId: string): T | undefined;
50
+ /**
51
+ * Get a filter instance by the id, reconstructed from previously saved `args`.
52
+ * @param filterId The id of the filter.
53
+ * @param args The arguments to pass to the filter's constructor, as produced by a previous `toMemory` call.
54
+ * @returns The filter instance, or `undefined` if the filter isn't registered or construction failed.
55
+ */
56
+ function getInstance(filterId: string, args: any): Filter | undefined;
57
+ /**
58
+ * Reads a live filter instance's current parameters into a serializable {@link FilterMemory}, using
59
+ * the `toMemory` function it was registered with.
60
+ * @param filterId The id the filter was registered under (readable on any instance as `filter.pixivnFilterId`).
61
+ * @param filter The live filter instance.
62
+ * @returns The memory object, or `undefined` if the filter isn't registered or conversion failed.
63
+ */
64
+ function toMemory(filterId: string, filter: Filter): {
65
+ filterId: string;
66
+ args: any;
67
+ } | undefined;
68
+ /**
69
+ * Get a list of all filter classes registered.
70
+ * @returns An array of filter classes.
71
+ */
72
+ function values(): {
73
+ new (args: any): Filter;
74
+ }[];
75
+ /**
76
+ * Check if a filter is registered.
77
+ * @param id The id of the filter.
78
+ * @returns True if the filter is registered, false otherwise.
79
+ */
80
+ function has(id: string): boolean;
81
+ /**
82
+ * Get a list of all filter ids registered.
83
+ * @returns An array of filter ids.
84
+ */
85
+ function keys(): string[];
86
+ }
87
+
88
+ /**
89
+ * Serializable representation of a single `Filter` attached to a canvas element's `.filters` array.
90
+ *
91
+ * A live `Filter` instance (PixiJS's own, like `BlurFilter`, or a custom one) generally can't be
92
+ * serialized directly - it doesn't expose its constructor options after creation, and its state lives in
93
+ * GPU-facing resources/uniform groups. `filterId` identifies which registration (see
94
+ * {@link filterDecorator}/{@link RegisteredFilters}) knows how to convert it to and from `args`.
95
+ */
96
+ interface FilterMemory {
97
+ /**
98
+ * The id the filter's class was registered under. Used on restore to look up the class and
99
+ * reconstruct an instance from `args`.
100
+ */
101
+ filterId: string;
102
+ /**
103
+ * The serializable arguments needed to reconstruct the filter, as produced by its registration's
104
+ * `toMemory` function.
105
+ */
106
+ args: any;
107
+ }
108
+
109
+ /**
110
+ * Animate either a `Filter`'s own properties, or a plain numeric "progress" value with no live target
111
+ * (used by the mask-based transitions - wipe/iris/split - which have no filter property to write
112
+ * directly, just a number and a side effect). See `GameUnifier.animateFilter`'s own doc comment for the
113
+ * full parameter reference; this just forwards to it (through the same DI indirection `canvas`'s own
114
+ * animate methods use - `filters` can't import `motion` directly, since `canvas` already depends on
115
+ * `filters` and `motion` depends on `canvas`, so `filters -> motion` would close a cycle).
116
+ * @param components The canvas element alias(es) the filter is attached to, or otherwise associated
117
+ * with this animation.
118
+ * @param filter The `Filter` instance to animate, or `undefined` to animate a plain value instead.
119
+ * @param keyframes The keyframes to animate the filter's properties (or the plain value) with.
120
+ * @param options The animation options.
121
+ * @param priority The update priority of the ticker.
122
+ * @param apply Called on every frame with the current interpolated value - required when `filter` is
123
+ * `undefined`, ignored otherwise.
124
+ * @param cleanup Called once, right before completion handling, to detach/destroy the filter or tear
125
+ * down whatever `apply` was driving.
126
+ * @returns The id of the ticker, or `undefined` if the ticker was not added.
127
+ */
128
+ declare function animate(components: string | string[], filter: Filter | undefined, keyframes: Record<string, any>, options?: AnimationOptions, priority?: UPDATE_PRIORITY, apply?: (value: number) => void, cleanup?: () => void): string | undefined;
129
+ /**
130
+ * Every filter class Pixi'VN registers for save/restore out of the box (see
131
+ * `register-builtin-filters.ts`), grouped in one place so a project can use them without importing
132
+ * from `pixi.js`/`pixi-filters` directly - e.g. `new filters.BloomFilter({...})` - plus
133
+ * {@link animate}. Not every filter `pixi.js`/`pixi-filters` ships is here: a few (`ColorMapFilter`,
134
+ * `SimpleLightmapFilter`, `TiltShiftAxisFilter`, `ColorMatrixFilter`, `DisplacementFilter`, and
135
+ * pixi.js's internal `MaskFilter`/`BlendModeFilter`/`PassthroughFilter`) are deliberately not
136
+ * registered - see that file's doc comment for why. Those are still directly importable from
137
+ * `pixi.js`/`pixi-filters` as usual; they just won't survive a save/restore round-trip unless a project
138
+ * registers its own `toMemory` for them.
139
+ */
140
+ declare const filters: {
141
+ readonly AlphaFilter: typeof AlphaFilter;
142
+ readonly BlurFilter: typeof BlurFilter;
143
+ readonly NoiseFilter: typeof NoiseFilter;
144
+ readonly AdjustmentFilter: typeof AdjustmentFilter;
145
+ readonly AdvancedBloomFilter: typeof AdvancedBloomFilter;
146
+ readonly AsciiFilter: typeof AsciiFilter;
147
+ readonly BackdropBlurFilter: typeof BackdropBlurFilter;
148
+ readonly BevelFilter: typeof BevelFilter;
149
+ readonly BloomFilter: typeof BloomFilter;
150
+ readonly BulgePinchFilter: typeof BulgePinchFilter;
151
+ readonly ColorGradientFilter: typeof ColorGradientFilter;
152
+ readonly ColorOverlayFilter: typeof ColorOverlayFilter;
153
+ readonly ColorReplaceFilter: typeof ColorReplaceFilter;
154
+ readonly ConvolutionFilter: typeof ConvolutionFilter;
155
+ readonly CRTFilter: typeof CRTFilter;
156
+ readonly CrossHatchFilter: typeof CrossHatchFilter;
157
+ readonly DotFilter: typeof DotFilter;
158
+ readonly DropShadowFilter: typeof DropShadowFilter;
159
+ readonly EmbossFilter: typeof EmbossFilter;
160
+ readonly GlitchFilter: typeof GlitchFilter;
161
+ readonly GlowFilter: typeof GlowFilter;
162
+ readonly GodrayFilter: typeof GodrayFilter;
163
+ readonly GrayscaleFilter: typeof GrayscaleFilter;
164
+ readonly HslAdjustmentFilter: typeof HslAdjustmentFilter;
165
+ readonly KawaseBlurFilter: typeof KawaseBlurFilter;
166
+ readonly MotionBlurFilter: typeof MotionBlurFilter;
167
+ readonly MultiColorReplaceFilter: typeof MultiColorReplaceFilter;
168
+ readonly OldFilmFilter: typeof OldFilmFilter;
169
+ readonly OutlineFilter: typeof OutlineFilter;
170
+ readonly PixelateFilter: typeof PixelateFilter;
171
+ readonly RadialBlurFilter: typeof RadialBlurFilter;
172
+ readonly ReflectionFilter: typeof ReflectionFilter;
173
+ readonly RGBSplitFilter: typeof RGBSplitFilter;
174
+ readonly ShockwaveFilter: typeof ShockwaveFilter;
175
+ readonly SimplexNoiseFilter: typeof SimplexNoiseFilter;
176
+ readonly TiltShiftFilter: typeof TiltShiftFilter;
177
+ readonly TwistFilter: typeof TwistFilter;
178
+ readonly ZoomBlurFilter: typeof ZoomBlurFilter;
179
+ readonly animate: typeof animate;
180
+ };
181
+
182
+ export { type FilterMemory, RegisteredFilters, filterDecorator, filters };