@drincs/pixi-vn 1.8.18 → 1.8.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas.d.cts +75 -1
- package/dist/canvas.d.ts +75 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/narration.d.cts +1 -1
- package/dist/narration.d.ts +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.d.cts +89 -2
- package/dist/vite.d.ts +89 -2
- package/dist/vite.mjs +2 -2
- package/package.json +1 -1
package/dist/canvas.d.cts
CHANGED
|
@@ -1721,6 +1721,80 @@ interface ShakeEffectProps extends BaseTransitionProps, AnimationOptions {
|
|
|
1721
1721
|
maxShockSize?: number;
|
|
1722
1722
|
}
|
|
1723
1723
|
|
|
1724
|
+
/**
|
|
1725
|
+
* An empty interface that can be augmented via `declare module '@drincs/pixi-vn/canvas'`
|
|
1726
|
+
* to constrain the set of valid asset aliases to a known union of string literals.
|
|
1727
|
+
*
|
|
1728
|
+
* When this interface has no keys (the default), {@link AssetAliasIdType} resolves to `string`,
|
|
1729
|
+
* preserving full backwards compatibility. Once you augment it, {@link AssetAliasIdType} becomes
|
|
1730
|
+
* the union of the declared keys and the compiler will reject any unknown asset alias.
|
|
1731
|
+
*
|
|
1732
|
+
* The augmentation is typically written into an auto-generated declaration file by the
|
|
1733
|
+
* Vite plugin (see the `assetsManifest` option of `vitePluginPixivn`), but it can
|
|
1734
|
+
* also be written by hand.
|
|
1735
|
+
*
|
|
1736
|
+
* @example
|
|
1737
|
+
* ```ts
|
|
1738
|
+
* // pixi-vn.gen.d.ts (auto-generated — do not edit manually)
|
|
1739
|
+
* declare module "@drincs/pixi-vn/canvas" {
|
|
1740
|
+
* interface PixivnAssetAliasIds {
|
|
1741
|
+
* logo: never;
|
|
1742
|
+
* hero: never;
|
|
1743
|
+
* }
|
|
1744
|
+
* }
|
|
1745
|
+
* export {};
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
interface PixivnAssetAliasIds {
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* The type used wherever an asset alias is expected (e.g. `Assets.load`, `getTexture`).
|
|
1752
|
+
*
|
|
1753
|
+
* - **Default** — resolves to `string` so that existing code that passes arbitrary strings
|
|
1754
|
+
* continues to compile without any changes.
|
|
1755
|
+
* - **Augmented** — when {@link PixivnAssetAliasIds} has been extended via
|
|
1756
|
+
* `declare module "@drincs/pixi-vn/canvas"`, this type resolves to the union of the
|
|
1757
|
+
* declared keys, giving you compile-time safety against typos and unknown asset aliases.
|
|
1758
|
+
*/
|
|
1759
|
+
type AssetAliasIdType = [keyof PixivnAssetAliasIds] extends [never] ? string : keyof PixivnAssetAliasIds;
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* An empty interface that can be augmented via `declare module '@drincs/pixi-vn/canvas'`
|
|
1763
|
+
* to constrain the set of valid asset bundle names to a known union of string literals.
|
|
1764
|
+
*
|
|
1765
|
+
* When this interface has no keys (the default), {@link BundleIdType} resolves to `string`,
|
|
1766
|
+
* preserving full backwards compatibility. Once you augment it, {@link BundleIdType} becomes
|
|
1767
|
+
* the union of the declared keys and the compiler will reject any unknown bundle name.
|
|
1768
|
+
*
|
|
1769
|
+
* The augmentation is typically written into an auto-generated declaration file by the
|
|
1770
|
+
* Vite plugin (see the `assetsManifest` option of `vitePluginPixivn`), but it can
|
|
1771
|
+
* also be written by hand.
|
|
1772
|
+
*
|
|
1773
|
+
* @example
|
|
1774
|
+
* ```ts
|
|
1775
|
+
* // pixi-vn.gen.d.ts (auto-generated — do not edit manually)
|
|
1776
|
+
* declare module "@drincs/pixi-vn/canvas" {
|
|
1777
|
+
* interface PixivnBundleIds {
|
|
1778
|
+
* main: never;
|
|
1779
|
+
* ui: never;
|
|
1780
|
+
* }
|
|
1781
|
+
* }
|
|
1782
|
+
* export {};
|
|
1783
|
+
* ```
|
|
1784
|
+
*/
|
|
1785
|
+
interface PixivnBundleIds {
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* The type used wherever an asset bundle name is expected (e.g. `Assets.loadBundle`).
|
|
1789
|
+
*
|
|
1790
|
+
* - **Default** — resolves to `string` so that existing code that passes arbitrary strings
|
|
1791
|
+
* continues to compile without any changes.
|
|
1792
|
+
* - **Augmented** — when {@link PixivnBundleIds} has been extended via
|
|
1793
|
+
* `declare module "@drincs/pixi-vn/canvas"`, this type resolves to the union of the
|
|
1794
|
+
* declared keys, giving you compile-time safety against typos and unknown bundle names.
|
|
1795
|
+
*/
|
|
1796
|
+
type BundleIdType = [keyof PixivnBundleIds] extends [never] ? string : keyof PixivnBundleIds;
|
|
1797
|
+
|
|
1724
1798
|
declare const Assets: _drincs_pixi_vn_pixi_js.AssetsClass;
|
|
1725
1799
|
declare const Color: typeof _drincs_pixi_vn_pixi_js.Color;
|
|
1726
1800
|
declare const Rectangle: typeof _drincs_pixi_vn_pixi_js.Rectangle;
|
|
@@ -1730,4 +1804,4 @@ declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
|
|
|
1730
1804
|
|
|
1731
1805
|
declare const canvas: CanvasManagerInterface;
|
|
1732
1806
|
|
|
1733
|
-
export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetMemory, Assets, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, ListenerExtension, ListenerExtensionMemory, type MoveInOutProps, OnEventsHandlers, PauseType, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, Ticker$1 as Ticker, TickerArgs, TickerBase, TickerHistory, TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, drawCanvasErrorHandler, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|
|
1807
|
+
export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetAliasIdType, type AssetMemory, Assets, type BundleIdType, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, ListenerExtension, ListenerExtensionMemory, type MoveInOutProps, OnEventsHandlers, PauseType, type PixivnAssetAliasIds, type PixivnBundleIds, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, Ticker$1 as Ticker, TickerArgs, TickerBase, TickerHistory, TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, drawCanvasErrorHandler, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|
package/dist/canvas.d.ts
CHANGED
|
@@ -1721,6 +1721,80 @@ interface ShakeEffectProps extends BaseTransitionProps, AnimationOptions {
|
|
|
1721
1721
|
maxShockSize?: number;
|
|
1722
1722
|
}
|
|
1723
1723
|
|
|
1724
|
+
/**
|
|
1725
|
+
* An empty interface that can be augmented via `declare module '@drincs/pixi-vn/canvas'`
|
|
1726
|
+
* to constrain the set of valid asset aliases to a known union of string literals.
|
|
1727
|
+
*
|
|
1728
|
+
* When this interface has no keys (the default), {@link AssetAliasIdType} resolves to `string`,
|
|
1729
|
+
* preserving full backwards compatibility. Once you augment it, {@link AssetAliasIdType} becomes
|
|
1730
|
+
* the union of the declared keys and the compiler will reject any unknown asset alias.
|
|
1731
|
+
*
|
|
1732
|
+
* The augmentation is typically written into an auto-generated declaration file by the
|
|
1733
|
+
* Vite plugin (see the `assetsManifest` option of `vitePluginPixivn`), but it can
|
|
1734
|
+
* also be written by hand.
|
|
1735
|
+
*
|
|
1736
|
+
* @example
|
|
1737
|
+
* ```ts
|
|
1738
|
+
* // pixi-vn.gen.d.ts (auto-generated — do not edit manually)
|
|
1739
|
+
* declare module "@drincs/pixi-vn/canvas" {
|
|
1740
|
+
* interface PixivnAssetAliasIds {
|
|
1741
|
+
* logo: never;
|
|
1742
|
+
* hero: never;
|
|
1743
|
+
* }
|
|
1744
|
+
* }
|
|
1745
|
+
* export {};
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
interface PixivnAssetAliasIds {
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* The type used wherever an asset alias is expected (e.g. `Assets.load`, `getTexture`).
|
|
1752
|
+
*
|
|
1753
|
+
* - **Default** — resolves to `string` so that existing code that passes arbitrary strings
|
|
1754
|
+
* continues to compile without any changes.
|
|
1755
|
+
* - **Augmented** — when {@link PixivnAssetAliasIds} has been extended via
|
|
1756
|
+
* `declare module "@drincs/pixi-vn/canvas"`, this type resolves to the union of the
|
|
1757
|
+
* declared keys, giving you compile-time safety against typos and unknown asset aliases.
|
|
1758
|
+
*/
|
|
1759
|
+
type AssetAliasIdType = [keyof PixivnAssetAliasIds] extends [never] ? string : keyof PixivnAssetAliasIds;
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* An empty interface that can be augmented via `declare module '@drincs/pixi-vn/canvas'`
|
|
1763
|
+
* to constrain the set of valid asset bundle names to a known union of string literals.
|
|
1764
|
+
*
|
|
1765
|
+
* When this interface has no keys (the default), {@link BundleIdType} resolves to `string`,
|
|
1766
|
+
* preserving full backwards compatibility. Once you augment it, {@link BundleIdType} becomes
|
|
1767
|
+
* the union of the declared keys and the compiler will reject any unknown bundle name.
|
|
1768
|
+
*
|
|
1769
|
+
* The augmentation is typically written into an auto-generated declaration file by the
|
|
1770
|
+
* Vite plugin (see the `assetsManifest` option of `vitePluginPixivn`), but it can
|
|
1771
|
+
* also be written by hand.
|
|
1772
|
+
*
|
|
1773
|
+
* @example
|
|
1774
|
+
* ```ts
|
|
1775
|
+
* // pixi-vn.gen.d.ts (auto-generated — do not edit manually)
|
|
1776
|
+
* declare module "@drincs/pixi-vn/canvas" {
|
|
1777
|
+
* interface PixivnBundleIds {
|
|
1778
|
+
* main: never;
|
|
1779
|
+
* ui: never;
|
|
1780
|
+
* }
|
|
1781
|
+
* }
|
|
1782
|
+
* export {};
|
|
1783
|
+
* ```
|
|
1784
|
+
*/
|
|
1785
|
+
interface PixivnBundleIds {
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* The type used wherever an asset bundle name is expected (e.g. `Assets.loadBundle`).
|
|
1789
|
+
*
|
|
1790
|
+
* - **Default** — resolves to `string` so that existing code that passes arbitrary strings
|
|
1791
|
+
* continues to compile without any changes.
|
|
1792
|
+
* - **Augmented** — when {@link PixivnBundleIds} has been extended via
|
|
1793
|
+
* `declare module "@drincs/pixi-vn/canvas"`, this type resolves to the union of the
|
|
1794
|
+
* declared keys, giving you compile-time safety against typos and unknown bundle names.
|
|
1795
|
+
*/
|
|
1796
|
+
type BundleIdType = [keyof PixivnBundleIds] extends [never] ? string : keyof PixivnBundleIds;
|
|
1797
|
+
|
|
1724
1798
|
declare const Assets: _drincs_pixi_vn_pixi_js.AssetsClass;
|
|
1725
1799
|
declare const Color: typeof _drincs_pixi_vn_pixi_js.Color;
|
|
1726
1800
|
declare const Rectangle: typeof _drincs_pixi_vn_pixi_js.Rectangle;
|
|
@@ -1730,4 +1804,4 @@ declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
|
|
|
1730
1804
|
|
|
1731
1805
|
declare const canvas: CanvasManagerInterface;
|
|
1732
1806
|
|
|
1733
|
-
export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetMemory, Assets, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, ListenerExtension, ListenerExtensionMemory, type MoveInOutProps, OnEventsHandlers, PauseType, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, Ticker$1 as Ticker, TickerArgs, TickerBase, TickerHistory, TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, drawCanvasErrorHandler, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|
|
1807
|
+
export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetAliasIdType, type AssetMemory, Assets, type BundleIdType, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, ListenerExtension, ListenerExtensionMemory, type MoveInOutProps, OnEventsHandlers, PauseType, type PixivnAssetAliasIds, type PixivnBundleIds, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, Ticker$1 as Ticker, TickerArgs, TickerBase, TickerHistory, TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, drawCanvasErrorHandler, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),L=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var L__namespace=/*#__PURE__*/_interopNamespace(L);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Xt=Object.defineProperty;var Jt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Xt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Xt(h,i,{get:e[i],enumerable:true});};var C=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Jt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Gt=typeof process=="object"&&process?process:{},ie=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Nt>"u"){Qt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Qt;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ie("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ee.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),se=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{heap;length;static create(e){let i=se(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}constructor(e,i){if(!t(it,St))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]}},St=new WeakMap,_(it,St,false),it),Zt,te,K,M,q,ut,$,yt,xt,B,O,X,T,b,m,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,It,ft,ot,Tt,Y,oe,mt,bt,Ot,lt,ht,Mt,Lt,Ct,E,zt,At,ct,Vt,wt,re=(wt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ut);_(this,$);_(this,yt);_(this,xt);_(this,B);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");_(this,O);_(this,X);_(this,T);_(this,b);_(this,m);_(this,P);_(this,z);_(this,N);_(this,R);_(this,J);_(this,D);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,Et);_(this,ft,()=>{});_(this,ot,()=>{});_(this,Tt,()=>{});_(this,Y,()=>false);_(this,mt,e=>{});_(this,bt,(e,i,s)=>{});_(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?se(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=w||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,R,0),u(this,J,_e.create(i)),u(this,O,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof U=="function"&&u(this,ut,U),typeof S=="function"?(u(this,$,S),u(this,D,[])):(u(this,$,void 0),u(this,D,void 0)),u(this,tt,!!t(this,q)),u(this,Et,!!t(this,ut)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,oe).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ee.add(Pt),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,xt)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=t(this,Ot).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&U>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,K)?d(this,l,Lt).call(this,false):t(this,O),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,R)]=S,t(this,z)[S]=t(this,R),u(this,R,S),Rt(this,O)._++,t(this,bt).call(this,S,U,p),p&&(p.set="add"),v=false,t(this,Et)&&((rt=t(this,ut))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,D)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,D)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,bt).call(this,S,U,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,Et)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Tt).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,D)){let y=t(this,D),a;for(;a=y?.shift();)(w=t(this,$))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,D)){let i=t(this,D),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,A,w);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,E).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Tt,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],U=i[p];if(!v||!U)return;c.ttl=v,c.start=U,c.now=n||o();let S=c.now-U;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],U=i[p];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,oe=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,mt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Ot,(i,s,r,n)=>{if(d(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,D)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(u(this,N,u(this,R,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,O)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,E).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let f=I,g=t(this,m)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,f=A||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):x||(t(this,m)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},E=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,R)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,R),e),u(this,R,e));},ct=function(e,i){var r,n;let s=false;if(t(this,O)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,O)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,E).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,D)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,R))u(this,R,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,O)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,D)?.length){let o=t(this,D),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,D)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,R,0),t(this,J).length=0,u(this,X,0),u(this,O,0),t(this,j)&&t(this,D)){let r=t(this,D),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new re({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.18";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ae={};var kt={};fe(kt,{createExportableElement:()=>le});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function le(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",he=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],ce=31,xe="background:#2f90da;color:#fff;font-weight:bold;",Ee="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function de(){if(!ye)return;let h=[],e=[];for(let i=0;i<he.length;i++){let s=he[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,ce),c=n.slice(ce),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(xe,o,Ee,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Bt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),L=require('@drincs/pixi-vn/narration'),pt=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Bt__namespace=/*#__PURE__*/_interopNamespace(Bt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var L__namespace=/*#__PURE__*/_interopNamespace(L);var pt__namespace=/*#__PURE__*/_interopNamespace(pt);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Xt=Object.defineProperty;var Jt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Xt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Xt(h,i,{get:e[i],enumerable:true});};var C=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Jt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ee=new Set,Gt=typeof process=="object"&&process?process:{},ie=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Qt=globalThis.AbortSignal;if(typeof Nt>"u"){Qt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Qt;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,ie("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var ge=h=>!ee.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),se=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{heap;length;static create(e){let i=se(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}constructor(e,i){if(!t(it,St))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]}},St=new WeakMap,_(it,St,false),it),Zt,te,K,M,q,ut,$,yt,xt,B,O,X,T,b,m,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,It,ft,ot,Tt,Y,oe,mt,bt,Ot,lt,ht,Mt,Lt,Ct,E,zt,At,ct,Vt,wt,re=(wt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ut);_(this,$);_(this,yt);_(this,xt);_(this,B);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");_(this,O);_(this,X);_(this,T);_(this,b);_(this,m);_(this,P);_(this,z);_(this,N);_(this,R);_(this,J);_(this,D);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,Et);_(this,ft,()=>{});_(this,ot,()=>{});_(this,Tt,()=>{});_(this,Y,()=>false);_(this,mt,e=>{});_(this,bt,(e,i,s)=>{});_(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});C(this,Zt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?se(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=w||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,b,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,R,0),u(this,J,_e.create(i)),u(this,O,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof U=="function"&&u(this,ut,U),typeof S=="function"?(u(this,$,S),u(this,D,[])):(u(this,$,void 0),u(this,D,void 0)),u(this,tt,!!t(this,q)),u(this,Et,!!t(this,ut)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,oe).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ee.add(Pt),ie("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,b),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,R)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,O)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,xt)}get dispose(){return t(this,q)}get onInsert(){return t(this,ut)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,b)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield [t(this,b)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,b)[e];i!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,E).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(te=Symbol.iterator,Zt=Symbol.toStringTag,te)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,b)[s],this))return this.get(t(this,b)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,b)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,b)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,b)[i],r=t(this,m)[i],n=d(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,w;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=t(this,Ot).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&U>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,O)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,O)===0?t(this,R):t(this,J).length!==0?t(this,J).pop():t(this,O)===t(this,K)?d(this,l,Lt).call(this,false):t(this,O),t(this,b)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,R)]=S,t(this,z)[S]=t(this,R),u(this,R,S),Rt(this,O)._++,t(this,bt).call(this,S,U,p),p&&(p.set="add"),v=false,t(this,Et)&&((rt=t(this,ut))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,D)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,D)?.push([y,e,"set"]));if(t(this,mt).call(this,S),t(this,bt).call(this,S,U,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,Et)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Tt).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,D)){let y=t(this,D),a;for(;a=y?.shift();)(w=t(this,$))==null||w.call(this,...a);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,D)){let i=t(this,D),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,ft).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,A,w);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,ft).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,E).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,ft).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Tt,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,ft,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,b)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],U=i[p];if(!v||!U)return;c.ttl=v,c.start=U,c.now=n||o();let S=c.now-U;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],U=i[p];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,oe=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,mt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Ot,(i,s,r,n)=>{if(d(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,R);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,R)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,b)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,b)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,D)?.push([r,s,"evict"])),t(this,mt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,b)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,O)===1?(u(this,N,u(this,R,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,O)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,E).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let f=I,g=t(this,m)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,w,p.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,f=A||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):x||(t(this,m)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=t(this,yt))==null?void 0:x.call(this,e,n,p);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},E=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,R)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,R),e),u(this,R,e));},ct=function(e,i){var r,n;let s=false;if(t(this,O)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,O)===1)d(this,l,Vt).call(this,i);else {t(this,mt).call(this,o);let c=t(this,m)[o];if(d(this,l,E).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,D)?.push([c,e,i])),t(this,T).delete(e),t(this,b)[o]=void 0,t(this,m)[o]=void 0,o===t(this,R))u(this,R,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,O)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,D)?.length){let o=t(this,D),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,b)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,D)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,b).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,R,0),t(this,J).length=0,u(this,X,0),u(this,O,0),t(this,j)&&t(this,D)){let r=t(this,D),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new re({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.20";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var ae={};var kt={};fe(kt,{createExportableElement:()=>le});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function le(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",he=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],ce=31,xe="background:#2f90da;color:#fff;font-weight:bold;",Ee="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function de(){if(!ye)return;let h=[],e=[];for(let i=0;i<he.length;i++){let s=he[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,ce),c=n.slice(ce),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(xe,o,Ee,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
2
2
|
`),...e);}function $t(){let h=window.location.pathname+window.location.hash;return h.includes("#")&&(h=h.split("#")[1]),h}de();exports.Game=void 0;(y=>{async function h(a,x,A){if(core.GameUnifier.init({navigate:x?.navigate,getCurrentGameStepState:()=>{let f={};try{f=nt__namespace.canvas.export();}catch{}return {path:$t(),storage:G__namespace.storage.export(),canvas:f,sound:pt__namespace.sound.export(),labelIndex:L__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:L__namespace.narration.openedLabels}},restoreGameStepState:async(f,g)=>{et__namespace.HistoryManagerStatic._originalStepData=f,L__namespace.NarrationManagerStatic.openedLabels=f.openedLabels,G__namespace.storage.restore(f.storage);try{await nt__namespace.canvas.restore(f.canvas),await pt__namespace.sound.restore(f.sound);}catch(F){gt.error("Error restoring game step state:",F);}await g(f.path);},getStepCounter:()=>L__namespace.narration.stepCounter,setStepCounter:f=>{L__namespace.NarrationManagerStatic._stepCounter=f;},getOpenedLabels:()=>L__namespace.narration.openedLabels.length,addHistoryItem:(f,g)=>et__namespace.stepHistory.add(f,g),getCharacter:f=>Bt__namespace.RegisteredCharacters.get(f),processNavigationRequests:(f,g)=>{let F=f,H=Promise.resolve();return f>0?(F--,H=L__namespace.narration.continue(g)):f<0&&(F=0,H=et__namespace.stepHistory.back(g,{steps:f*-1})),{newValue:F,result:H}},animate:(f,g,F,H)=>motion.motion.animate(f,g,F,H),getVariable:(f,g)=>G__namespace.StorageRegistry.getVariable(f,g),setVariable:(f,g,F)=>G__namespace.StorageRegistry.setVariable(f,g,F),removeVariable:(f,g)=>G__namespace.StorageRegistry.removeVariable(f,g),getFlag:f=>G__namespace.storage.getFlag(f),setFlag:(f,g)=>G__namespace.storage.setFlag(f,g),onLabelClosing:f=>G__namespace.StorageRegistry.clearOldTempVariables(f)}),!a||!x){gt.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await nt__namespace.canvas.init(a,x,A)}y.init=h;function e(){G__namespace.storage.clear();try{nt__namespace.canvas.clear();}catch{}pt__namespace.sound.clear(),L__namespace.narration.clear(),et__namespace.stepHistory.clear();}y.clear=e;function i(){let a={};try{a=nt__namespace.canvas.export();}catch{}return {pixivn_version:Ut,stepData:L__namespace.narration.export(),storageData:G__namespace.storage.export(),canvasData:a,soundData:pt__namespace.sound.export(),historyData:et__namespace.stepHistory.export(),path:$t()}}y.exportGameState=i;async function s(a,x){et__namespace.stepHistory.restore(a.historyData);let A=et__namespace.stepHistory.lastKey;if(typeof A=="number"){let f=et__namespace.stepHistory.stepsInfoMap.get(A)||null;await L__namespace.narration.restore(a.stepData,f);}G__namespace.storage.restore(a.storageData);try{await nt__namespace.canvas.restore(a.canvasData),await pt__namespace.sound.restore(a.soundData);}catch{}x?await x(a.path):await core.GameUnifier.navigate(a.path);}y.restoreGameState=s;async function r(a,x){return y.clear(),await L__namespace.narration.call(a,x)}y.start=r;function n(a){return JSON.parse(a)}y.jsonToGameState=n;function o(a){core.GameUnifier.onEnd=a;}y.onEnd=o;function c(a){return gt.warn("Game.onError is deprecated. Use Game.addOnError / Game.removeOnError to register multiple handlers."),core.GameUnifier.addOnError((x,A)=>a("step",x,A))}y.onError=c;function p(a){return core.GameUnifier.addOnError(a)}y.addOnError=p;function v(a){return core.GameUnifier.removeOnError(a)}y.removeOnError=v;function U(a){L__namespace.NarrationManagerStatic.onStepStart=a;}y.onStepStart=U;function S(a){L__namespace.NarrationManagerStatic.onLoadingLabel=a;}y.onLoadingLabel=S;function rt(a){L__namespace.NarrationManagerStatic.onStepEnd=a;}y.onStepEnd=rt;function I(a){core.GameUnifier.navigate=a;}y.onNavigate=I;function k(a){return core.GameUnifier.addOnPreContinue(a)}y.addOnPreContinue=k;function w(a){return core.GameUnifier.removeOnPreContinue(a)}y.removeOnPreContinue=w;})(exports.Game||={});var Ze={characterUtils:Bt__namespace,canvasUtils:nt__namespace,narrationUtils:L__namespace,soundUtils:pt__namespace,CANVAS_APP_GAME_LAYER_ALIAS:Kt,Pause:Ht,Repeat:Yt,PIXIVN_VERSION:Ut,...kt,...ae,canvas:nt__namespace.canvas,narration:L__namespace.narration,sound:pt__namespace.sound,storage:G__namespace.storage,history:et__namespace.stepHistory,Game:exports.Game,GameUnifier:core.GameUnifier};exports.CANVAS_APP_GAME_LAYER_ALIAS=Kt;exports.CachedMap=Ft;exports.PIXIVN_VERSION=Ut;exports.Pause=Ht;exports.Repeat=Yt;exports.SYSTEM_RESERVED_STORAGE_KEYS=ve;exports.createExportableElement=le;exports.default=Ze;Object.keys(nt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return nt[k]}})});Object.keys(Bt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return Bt[k]}})});Object.keys(core).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return core[k]}})});Object.keys(et).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return et[k]}})});Object.keys(L).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return L[k]}})});Object.keys(pt).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return pt[k]}})});Object.keys(G).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return G[k]}})});
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {f as f$1,b as b$1,g,e,d,h,i}from'./chunk-K7JIC2F2.mjs';import*as nt from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as $t from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import {PixiError,GameUnifier}from'@drincs/pixi-vn/core';export*from'@drincs/pixi-vn/core';import*as et from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as L from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as pt from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as G from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {motion}from'@drincs/pixi-vn/motion';var de=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Qt=new Set,jt=typeof process=="object"&&process?process:{},Zt=(m,e,i,s)=>{typeof jt.emitWarning=="function"?jt.emitWarning(m,e,i,s):console.error(`[${i}] ${e}: ${m}`);},Nt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Nt>"u"){Bt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Bt;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 m=jt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{m&&(m=false,Zt("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 pe=m=>!Qt.has(m);var at=m=>m&&m===Math.floor(m)&&m>0&&isFinite(m),te=m=>at(m)?m<=Math.pow(2,8)?Uint8Array:m<=Math.pow(2,16)?Uint16Array:m<=Math.pow(2,32)?Uint32Array:m<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(m){super(m),this.fill(0);}},it,St,ue=(it=class{heap;length;static create(e){let i=te(e);if(!i)return [];g(it,St,true);let s=new it(e,i);return g(it,St,false),s}constructor(e$1,i){if(!e(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e$1),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,f$1(it,St,false),it),Xt,Jt,K,M,q,ut,$,yt,xt,B,O,X,T,b,f,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,Gt,ft,ot,Tt,Y,ie,mt,bt,Ot,lt,ht,It,Lt,Ct,E,Mt,At,ct,zt,wt,ee=(wt=class{constructor(e$1){f$1(this,l);f$1(this,K);f$1(this,M);f$1(this,q);f$1(this,ut);f$1(this,$);f$1(this,yt);f$1(this,xt);f$1(this,B);d(this,"ttl");d(this,"ttlResolution");d(this,"ttlAutopurge");d(this,"updateAgeOnGet");d(this,"updateAgeOnHas");d(this,"allowStale");d(this,"noDisposeOnSet");d(this,"noUpdateTTL");d(this,"maxEntrySize");d(this,"sizeCalculation");d(this,"noDeleteOnFetchRejection");d(this,"noDeleteOnStaleGet");d(this,"allowStaleOnFetchAbort");d(this,"allowStaleOnFetchRejection");d(this,"ignoreFetchAbort");f$1(this,O);f$1(this,X);f$1(this,T);f$1(this,b);f$1(this,f);f$1(this,P);f$1(this,z);f$1(this,N);f$1(this,R);f$1(this,J);f$1(this,D);f$1(this,Q);f$1(this,Z);f$1(this,V);f$1(this,W);f$1(this,tt);f$1(this,dt);f$1(this,j);f$1(this,Et);f$1(this,ft,()=>{});f$1(this,ot,()=>{});f$1(this,Tt,()=>{});f$1(this,Y,()=>false);f$1(this,mt,e=>{});f$1(this,bt,(e,i,s)=>{});f$1(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});d(this,Xt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h$1,allowStale:d$1,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:u,allowStaleOnFetchRejection:g$1,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e$1;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(g(this,B,_t??de),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?te(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(g(this,K,i),g(this,M,k),this.maxEntrySize=w||e(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!e(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(g(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(g(this,yt,a),g(this,dt,!!a),g(this,T,new Map),g(this,b,new Array(i).fill(void 0)),g(this,f,new Array(i).fill(void 0)),g(this,P,new vt(i)),g(this,z,new vt(i)),g(this,N,0),g(this,R,0),g(this,J,ue.create(i)),g(this,O,0),g(this,X,0),typeof v=="function"&&g(this,q,v),typeof U=="function"&&g(this,ut,U),typeof S=="function"?(g(this,$,S),g(this,D,[])):(g(this,$,void 0),g(this,D,void 0)),g(this,tt,!!e(this,q)),g(this,Et,!!e(this,ut)),g(this,j,!!e(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g$1,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(e(this,M)!==0&&!at(e(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,l,ie).call(this);}if(this.allowStale=!!d$1,this.noDeleteOnStaleGet=!!u,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h$1,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,l,Gt).call(this);}if(e(this,K)===0&&this.ttl===0&&e(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,K)&&!e(this,M)){let Pt="LRU_CACHE_UNBOUNDED";pe(Pt)&&(Qt.add(Pt),Zt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return e(this,B)}static unsafeExposeInternals(e$1){return {starts:e(e$1,Z),ttls:e(e$1,V),autopurgeTimers:e(e$1,W),sizes:e(e$1,Q),keyMap:e(e$1,T),keyList:e(e$1,b),valList:e(e$1,f),next:e(e$1,P),prev:e(e$1,z),get head(){return e(e$1,N)},get tail(){return e(e$1,R)},free:e(e$1,J),isBackgroundFetch:i=>{var s;return h(s=e$1,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return h(o=e$1,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return h(s=e$1,l,At).call(s,i)},indexes:i=>{var s;return h(s=e$1,l,lt).call(s,i)},rindexes:i=>{var s;return h(s=e$1,l,ht).call(s,i)},isStale:i=>{var s;return e(s=e$1,Y).call(s,i)}}}get max(){return e(this,K)}get maxSize(){return e(this,M)}get calculatedSize(){return e(this,X)}get size(){return e(this,O)}get fetchMethod(){return e(this,yt)}get memoMethod(){return e(this,xt)}get dispose(){return e(this,q)}get onInsert(){return e(this,ut)}get disposeAfter(){return e(this,$)}getRemainingTTL(e$1){return e(this,T).has(e$1)?1/0:0}*entries(){for(let e$1 of h(this,l,lt).call(this))e(this,f)[e$1]!==void 0&&e(this,b)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield [e(this,b)[e$1],e(this,f)[e$1]]);}*rentries(){for(let e$1 of h(this,l,ht).call(this))e(this,f)[e$1]!==void 0&&e(this,b)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield [e(this,b)[e$1],e(this,f)[e$1]]);}*keys(){for(let e$1 of h(this,l,lt).call(this)){let i=e(this,b)[e$1];i!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield i);}}*rkeys(){for(let e$1 of h(this,l,ht).call(this)){let i=e(this,b)[e$1];i!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield i);}}*values(){for(let e$1 of h(this,l,lt).call(this))e(this,f)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}*rvalues(){for(let e$1 of h(this,l,ht).call(this))e(this,f)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}[(Jt=Symbol.iterator,Xt=Symbol.toStringTag,Jt)](){return this.entries()}find(e$1,i={}){for(let s of h(this,l,lt).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e$1(n,e(this,b)[s],this))return this.get(e(this,b)[s],i)}}forEach(e$1,i=this){for(let s of h(this,l,lt).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e$1.call(i,n,e(this,b)[s],this);}}rforEach(e$1,i=this){for(let s of h(this,l,ht).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e$1.call(i,n,e(this,b)[s],this);}}purgeStale(){let e$1=false;for(let i of h(this,l,ht).call(this,{allowStale:true}))e(this,Y).call(this,i)&&(h(this,l,ct).call(this,e(this,b)[i],"expire"),e$1=true);return e$1}info(e$1){let i=e(this,T).get(e$1);if(i===void 0)return;let s=e(this,f)[i],r=h(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(e(this,V)&&e(this,Z)){let o=e(this,V)[i],h=e(this,Z)[i];if(o&&h){let d=o-(e(this,B).now()-h);n.ttl=d,n.start=Date.now();}}return e(this,Q)&&(n.size=e(this,Q)[i]),n}dump(){let e$1=[];for(let i of h(this,l,lt).call(this,{allowStale:true})){let s=e(this,b)[i],r=e(this,f)[i],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(e(this,V)&&e(this,Z)){o.ttl=e(this,V)[i];let h=e(this,B).now()-e(this,Z)[i];o.start=Math.floor(Date.now()-h);}e(this,Q)&&(o.size=e(this,Q)[i]),e$1.unshift([s,o]);}return e$1}load(e$1){this.clear();for(let[i,s]of e$1){if(s.start){let r=Date.now()-s.start;s.start=e(this,B).now()-r;}this.set(i,s.value,s);}}set(e$1,i$1,s={}){var rt,I,k,w;if(i$1===void 0)return this.delete(e$1),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h$1=this.sizeCalculation,status:d}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=e(this,Ot).call(this,e$1,i$1,s.size||0,h$1);if(this.maxEntrySize&&U>this.maxEntrySize)return d&&(d.set="miss",d.maxEntrySizeExceeded=true),h(this,l,ct).call(this,e$1,"set"),this;let S=e(this,O)===0?void 0:e(this,T).get(e$1);if(S===void 0)S=e(this,O)===0?e(this,R):e(this,J).length!==0?e(this,J).pop():e(this,O)===e(this,K)?h(this,l,Lt).call(this,false):e(this,O),e(this,b)[S]=e$1,e(this,f)[S]=i$1,e(this,T).set(e$1,S),e(this,P)[e(this,R)]=S,e(this,z)[S]=e(this,R),g(this,R,S),i(this,O)._++,e(this,bt).call(this,S,U,d),d&&(d.set="add"),v=false,e(this,Et)&&((rt=e(this,ut))==null||rt.call(this,i$1,e$1,"add"));else {h(this,l,At).call(this,S);let y=e(this,f)[S];if(i$1!==y){if(e(this,dt)&&h(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(e(this,tt)&&((I=e(this,q))==null||I.call(this,a,e$1,"set")),e(this,j)&&e(this,D)?.push([a,e$1,"set"]));}else o||(e(this,tt)&&((k=e(this,q))==null||k.call(this,y,e$1,"set")),e(this,j)&&e(this,D)?.push([y,e$1,"set"]));if(e(this,mt).call(this,S),e(this,bt).call(this,S,U,d),e(this,f)[S]=i$1,d){d.set="replace";let a=y&&h(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(d.oldValue=a);}}else d&&(d.set="update");e(this,Et)&&this.onInsert?.(i$1,e$1,i$1===y?"update":"replace");}if(r!==0&&!e(this,V)&&h(this,l,Gt).call(this),e(this,V)&&(v||e(this,Tt).call(this,S,r,n),d&&e(this,ot).call(this,d,S)),!o&&e(this,j)&&e(this,D)){let y=e(this,D),a;for(;a=y?.shift();)(w=e(this,$))==null||w.call(this,...a);}return this}pop(){var e$1;try{for(;e(this,O);){let i=e(this,f)[e(this,N)];if(h(this,l,Lt).call(this,!0),h(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,j)&&e(this,D)){let i=e(this,D),s;for(;s=i?.shift();)(e$1=e(this,$))==null||e$1.call(this,...s);}}}has(e$1,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=e(this,T).get(e$1);if(n!==void 0){let o=e(this,f)[n];if(h(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(e(this,Y).call(this,n))r&&(r.has="stale",e(this,ot).call(this,r,n));else return s&&e(this,ft).call(this,n),r&&(r.has="hit",e(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e$1,i={}){let{allowStale:s=this.allowStale}=i,r=e(this,T).get(e$1);if(r===void 0||!s&&e(this,Y).call(this,r))return;let n=e(this,f)[r];return h(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h$1=this.noDisposeOnSet,size:d=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!e(this,dt))return a&&(a.fetch="get"),this.get(e$1,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h$1,size:d,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},u=e(this,T).get(e$1);if(u===void 0){a&&(a.fetch="miss");let g=h(this,l,Ct).call(this,e$1,u,A,w);return g.__returned=g}else {let g=e(this,f)[u];if(h(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=e(this,Y).call(this,u);if(!y&&!F)return a&&(a.fetch="hit"),h(this,l,At).call(this,u),r&&e(this,ft).call(this,u),a&&e(this,ot).call(this,a,u),g;let H=h(this,l,Ct).call(this,e$1,u,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e$1,i={}){let s=e(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,h=this.get(e$1,o);if(!n&&h!==void 0)return h;let d=s(e$1,h,{options:o,context:r});return this.set(e$1,d,o),d}get(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,h$1=e(this,T).get(e$1);if(h$1!==void 0){let d=e(this,f)[h$1],v=h(this,l,E).call(this,d);return o&&e(this,ot).call(this,o,h$1),e(this,Y).call(this,h$1)?(o&&(o.get="stale"),v?(o&&s&&d.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?d.__staleWhileFetching:void 0):(n||h(this,l,ct).call(this,e$1,"expire"),o&&s&&(o.returnedStale=true),s?d:void 0)):(o&&(o.get="hit"),v?d.__staleWhileFetching:(h(this,l,At).call(this,h$1),r&&e(this,ft).call(this,h$1),d))}else o&&(o.get="miss");}delete(e){return h(this,l,ct).call(this,e,"delete")}clear(){return h(this,l,zt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,f=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,Gt=function(){let e$1=new Dt(e(this,K)),i=new Dt(e(this,K));g(this,V,e$1),g(this,Z,i);let s=this.ttlAutopurge?new Array(e(this,K)):void 0;g(this,W,s),g(this,Tt,(h,d,v=e(this,B).now())=>{i[h]=d!==0?v:0,e$1[h]=d,r(h,d);}),g(this,ft,h=>{i[h]=e$1[h]!==0?e(this,B).now():0,r(h,e$1[h]);});let r=this.ttlAutopurge?(h$1,d)=>{if(s?.[h$1]&&(clearTimeout(s[h$1]),s[h$1]=void 0),d&&d!==0&&s){let v=setTimeout(()=>{e(this,Y).call(this,h$1)&&h(this,l,ct).call(this,e(this,b)[h$1],"expire");},d+1);v.unref&&v.unref(),s[h$1]=v;}}:()=>{};g(this,ot,(h,d)=>{if(e$1[d]){let v=e$1[d],U=i[d];if(!v||!U)return;h.ttl=v,h.start=U,h.now=n||o();let S=h.now-U;h.remainingTTL=v-S;}});let n=0,o=()=>{let h=e(this,B).now();if(this.ttlResolution>0){n=h;let d=setTimeout(()=>n=0,this.ttlResolution);d.unref&&d.unref();}return h};this.getRemainingTTL=h=>{let d=e(this,T).get(h);if(d===void 0)return 0;let v=e$1[d],U=i[d];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},g(this,Y,h=>{let d=i[h],v=e$1[h];return !!v&&!!d&&(n||o())-d>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,ie=function(){let e$1=new Dt(e(this,K));g(this,X,0),g(this,Q,e$1),g(this,mt,i=>{g(this,X,e(this,X)-e$1[i]),e$1[i]=0;}),g(this,Ot,(i,s,r,n)=>{if(h(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),g(this,bt,(i,s,r)=>{if(e$1[i]=s,e(this,M)){let n=e(this,M)-e$1[i];for(;e(this,X)>n;)h(this,l,Lt).call(this,true);}g(this,X,e(this,X)+e$1[i]),r&&(r.entrySize=s,r.totalCalculatedSize=e(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e$1=this.allowStale}={}){if(e(this,O))for(let i=e(this,R);!(!h(this,l,It).call(this,i)||((e$1||!e(this,Y).call(this,i))&&(yield i),i===e(this,N)));)i=e(this,z)[i];},ht=function*({allowStale:e$1=this.allowStale}={}){if(e(this,O))for(let i=e(this,N);!(!h(this,l,It).call(this,i)||((e$1||!e(this,Y).call(this,i))&&(yield i),i===e(this,R)));)i=e(this,P)[i];},It=function(e$1){return e$1!==void 0&&e(this,T).get(e(this,b)[e$1])===e$1},Lt=function(e$1){var n;let i$1=e(this,N),s=e(this,b)[i$1],r=e(this,f)[i$1];return e(this,dt)&&h(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(e(this,tt)||e(this,j))&&(e(this,tt)&&((n=e(this,q))==null||n.call(this,r,s,"evict")),e(this,j)&&e(this,D)?.push([r,s,"evict"])),e(this,mt).call(this,i$1),e(this,W)?.[i$1]&&(clearTimeout(e(this,W)[i$1]),e(this,W)[i$1]=void 0),e$1&&(e(this,b)[i$1]=void 0,e(this,f)[i$1]=void 0,e(this,J).push(i$1)),e(this,O)===1?(g(this,N,g(this,R,0)),e(this,J).length=0):g(this,N,e(this,P)[i$1]),e(this,T).delete(s),i(this,O)._--,i$1},Ct=function(e$1,i,s,r){let n=i===void 0?void 0:e(this,f)[i];if(h(this,l,E).call(this,n))return n;let o=new Nt,{signal:h$1}=s;h$1?.addEventListener("abort",()=>o.abort(h$1.reason),{signal:o.signal});let d={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let u=I,g=e(this,f)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?u.__staleWhileFetching!==void 0?e(this,f)[i]=u.__staleWhileFetching:h(this,l,ct).call(this,e$1,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e$1,w,d.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,u=A||s.noDeleteOnFetchRejection,g=I;if(e(this,f)[i]===I&&(!u||!y&&g.__staleWhileFetching===void 0?h(this,l,ct).call(this,e$1,"fetch"):x||(e(this,f)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=e(this,yt))==null?void 0:x.call(this,e$1,n,d);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e$1,k,{...d.options,status:void 0}),i=e(this,T).get(e$1)):e(this,f)[i]=k,k},E=function(e$1){if(!e(this,dt))return false;let i=e$1;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},Mt=function(e$1,i){e(this,z)[i]=e$1,e(this,P)[e$1]=i;},At=function(e$1){e$1!==e(this,R)&&(e$1===e(this,N)?g(this,N,e(this,P)[e$1]):h(this,l,Mt).call(this,e(this,z)[e$1],e(this,P)[e$1]),h(this,l,Mt).call(this,e(this,R),e$1),g(this,R,e$1));},ct=function(e$1,i$1){var r,n;let s=false;if(e(this,O)!==0){let o=e(this,T).get(e$1);if(o!==void 0)if(e(this,W)?.[o]&&(clearTimeout(e(this,W)?.[o]),e(this,W)[o]=void 0),s=true,e(this,O)===1)h(this,l,zt).call(this,i$1);else {e(this,mt).call(this,o);let h$1=e(this,f)[o];if(h(this,l,E).call(this,h$1)?h$1.__abortController.abort(new Error("deleted")):(e(this,tt)||e(this,j))&&(e(this,tt)&&((r=e(this,q))==null||r.call(this,h$1,e$1,i$1)),e(this,j)&&e(this,D)?.push([h$1,e$1,i$1])),e(this,T).delete(e$1),e(this,b)[o]=void 0,e(this,f)[o]=void 0,o===e(this,R))g(this,R,e(this,z)[o]);else if(o===e(this,N))g(this,N,e(this,P)[o]);else {let d=e(this,z)[o];e(this,P)[d]=e(this,P)[o];let v=e(this,P)[o];e(this,z)[v]=e(this,z)[o];}i(this,O)._--,e(this,J).push(o);}}if(e(this,j)&&e(this,D)?.length){let o=e(this,D),h;for(;h=o?.shift();)(n=e(this,$))==null||n.call(this,...h);}return s},zt=function(e$1){var i,s;for(let r of h(this,l,ht).call(this,{allowStale:true})){let n=e(this,f)[r];if(h(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=e(this,b)[r];e(this,tt)&&((i=e(this,q))==null||i.call(this,n,o,e$1)),e(this,j)&&e(this,D)?.push([n,o,e$1]);}}if(e(this,T).clear(),e(this,f).fill(void 0),e(this,b).fill(void 0),e(this,V)&&e(this,Z)){e(this,V).fill(0),e(this,Z).fill(0);for(let r of e(this,W)??[])r!==void 0&&clearTimeout(r);e(this,W)?.fill(void 0);}if(e(this,Q)&&e(this,Q).fill(0),g(this,N,0),g(this,R,0),e(this,J).length=0,g(this,X,0),g(this,O,0),e(this,j)&&e(this,D)){let r=e(this,D),n;for(;n=r?.shift();)(s=e(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new ee({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.18";var Vt={version:Ut};var Wt="repeat";function Yt(m){return {type:"pause",duration:m}}var Ht="__game_layer__";var fe={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var re={};var Kt={};b$1(Kt,{createExportableElement:()=>oe});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function oe(m){try{if(typeof m>"u")return m;let e=JSON.stringify(m);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",m,e),new PixiError("not_json_serializable","Error creating exportable element")}}var ge=typeof window<"u"&&typeof document<"u",ne=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Vt.version}`],ae=31,_e="background:#2f90da;color:#fff;font-weight:bold;",ve="background:#c832bb;color:#fff;font-weight:bold;",Se="background:transparent;font-weight:bold;",kt=` v${Vt.version}`;function le(){if(!ge)return;let m=[],e=[];for(let i=0;i<ne.length;i++){let s=ne[i],r=s.endsWith(kt),n=r?s.slice(0,-kt.length):s,o=n.slice(0,ae),h=n.slice(ae),d=r?"%c%s%c%s%c%s":"%c%s%c%s";m.push(d),e.push(_e,o,ve,h),r&&e.push(Se,kt);}console.info(m.join(`
|
|
1
|
+
import {f as f$1,b as b$1,g,e,d,h,i}from'./chunk-K7JIC2F2.mjs';import*as nt from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as $t from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import {PixiError,GameUnifier}from'@drincs/pixi-vn/core';export*from'@drincs/pixi-vn/core';import*as et from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as L from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as pt from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as G from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {motion}from'@drincs/pixi-vn/motion';var de=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Qt=new Set,jt=typeof process=="object"&&process?process:{},Zt=(m,e,i,s)=>{typeof jt.emitWarning=="function"?jt.emitWarning(m,e,i,s):console.error(`[${i}] ${e}: ${m}`);},Nt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Nt>"u"){Bt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){e();}signal=new Bt;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 m=jt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{m&&(m=false,Zt("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 pe=m=>!Qt.has(m);var at=m=>m&&m===Math.floor(m)&&m>0&&isFinite(m),te=m=>at(m)?m<=Math.pow(2,8)?Uint8Array:m<=Math.pow(2,16)?Uint16Array:m<=Math.pow(2,32)?Uint32Array:m<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(m){super(m),this.fill(0);}},it,St,ue=(it=class{heap;length;static create(e){let i=te(e);if(!i)return [];g(it,St,true);let s=new it(e,i);return g(it,St,false),s}constructor(e$1,i){if(!e(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e$1),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,f$1(it,St,false),it),Xt,Jt,K,M,q,ut,$,yt,xt,B,O,X,T,b,f,P,z,N,R,J,D,Q,Z,V,W,tt,dt,j,Et,l,Gt,ft,ot,Tt,Y,ie,mt,bt,Ot,lt,ht,It,Lt,Ct,E,Mt,At,ct,zt,wt,ee=(wt=class{constructor(e$1){f$1(this,l);f$1(this,K);f$1(this,M);f$1(this,q);f$1(this,ut);f$1(this,$);f$1(this,yt);f$1(this,xt);f$1(this,B);d(this,"ttl");d(this,"ttlResolution");d(this,"ttlAutopurge");d(this,"updateAgeOnGet");d(this,"updateAgeOnHas");d(this,"allowStale");d(this,"noDisposeOnSet");d(this,"noUpdateTTL");d(this,"maxEntrySize");d(this,"sizeCalculation");d(this,"noDeleteOnFetchRejection");d(this,"noDeleteOnStaleGet");d(this,"allowStaleOnFetchAbort");d(this,"allowStaleOnFetchRejection");d(this,"ignoreFetchAbort");f$1(this,O);f$1(this,X);f$1(this,T);f$1(this,b);f$1(this,f);f$1(this,P);f$1(this,z);f$1(this,N);f$1(this,R);f$1(this,J);f$1(this,D);f$1(this,Q);f$1(this,Z);f$1(this,V);f$1(this,W);f$1(this,tt);f$1(this,dt);f$1(this,j);f$1(this,Et);f$1(this,ft,()=>{});f$1(this,ot,()=>{});f$1(this,Tt,()=>{});f$1(this,Y,()=>false);f$1(this,mt,e=>{});f$1(this,bt,(e,i,s)=>{});f$1(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});d(this,Xt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h$1,allowStale:d$1,dispose:v,onInsert:U,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:a,memoMethod:x,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:u,allowStaleOnFetchRejection:g$1,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e$1;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(g(this,B,_t??de),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?te(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(g(this,K,i),g(this,M,k),this.maxEntrySize=w||e(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!e(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(g(this,xt,x),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(g(this,yt,a),g(this,dt,!!a),g(this,T,new Map),g(this,b,new Array(i).fill(void 0)),g(this,f,new Array(i).fill(void 0)),g(this,P,new vt(i)),g(this,z,new vt(i)),g(this,N,0),g(this,R,0),g(this,J,ue.create(i)),g(this,O,0),g(this,X,0),typeof v=="function"&&g(this,q,v),typeof U=="function"&&g(this,ut,U),typeof S=="function"?(g(this,$,S),g(this,D,[])):(g(this,$,void 0),g(this,D,void 0)),g(this,tt,!!e(this,q)),g(this,Et,!!e(this,ut)),g(this,j,!!e(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!g$1,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(e(this,M)!==0&&!at(e(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,l,ie).call(this);}if(this.allowStale=!!d$1,this.noDeleteOnStaleGet=!!u,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h$1,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,l,Gt).call(this);}if(e(this,K)===0&&this.ttl===0&&e(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,K)&&!e(this,M)){let Pt="LRU_CACHE_UNBOUNDED";pe(Pt)&&(Qt.add(Pt),Zt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return e(this,B)}static unsafeExposeInternals(e$1){return {starts:e(e$1,Z),ttls:e(e$1,V),autopurgeTimers:e(e$1,W),sizes:e(e$1,Q),keyMap:e(e$1,T),keyList:e(e$1,b),valList:e(e$1,f),next:e(e$1,P),prev:e(e$1,z),get head(){return e(e$1,N)},get tail(){return e(e$1,R)},free:e(e$1,J),isBackgroundFetch:i=>{var s;return h(s=e$1,l,E).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return h(o=e$1,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return h(s=e$1,l,At).call(s,i)},indexes:i=>{var s;return h(s=e$1,l,lt).call(s,i)},rindexes:i=>{var s;return h(s=e$1,l,ht).call(s,i)},isStale:i=>{var s;return e(s=e$1,Y).call(s,i)}}}get max(){return e(this,K)}get maxSize(){return e(this,M)}get calculatedSize(){return e(this,X)}get size(){return e(this,O)}get fetchMethod(){return e(this,yt)}get memoMethod(){return e(this,xt)}get dispose(){return e(this,q)}get onInsert(){return e(this,ut)}get disposeAfter(){return e(this,$)}getRemainingTTL(e$1){return e(this,T).has(e$1)?1/0:0}*entries(){for(let e$1 of h(this,l,lt).call(this))e(this,f)[e$1]!==void 0&&e(this,b)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield [e(this,b)[e$1],e(this,f)[e$1]]);}*rentries(){for(let e$1 of h(this,l,ht).call(this))e(this,f)[e$1]!==void 0&&e(this,b)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield [e(this,b)[e$1],e(this,f)[e$1]]);}*keys(){for(let e$1 of h(this,l,lt).call(this)){let i=e(this,b)[e$1];i!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield i);}}*rkeys(){for(let e$1 of h(this,l,ht).call(this)){let i=e(this,b)[e$1];i!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield i);}}*values(){for(let e$1 of h(this,l,lt).call(this))e(this,f)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}*rvalues(){for(let e$1 of h(this,l,ht).call(this))e(this,f)[e$1]!==void 0&&!h(this,l,E).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}[(Jt=Symbol.iterator,Xt=Symbol.toStringTag,Jt)](){return this.entries()}find(e$1,i={}){for(let s of h(this,l,lt).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e$1(n,e(this,b)[s],this))return this.get(e(this,b)[s],i)}}forEach(e$1,i=this){for(let s of h(this,l,lt).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e$1.call(i,n,e(this,b)[s],this);}}rforEach(e$1,i=this){for(let s of h(this,l,ht).call(this)){let r=e(this,f)[s],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e$1.call(i,n,e(this,b)[s],this);}}purgeStale(){let e$1=false;for(let i of h(this,l,ht).call(this,{allowStale:true}))e(this,Y).call(this,i)&&(h(this,l,ct).call(this,e(this,b)[i],"expire"),e$1=true);return e$1}info(e$1){let i=e(this,T).get(e$1);if(i===void 0)return;let s=e(this,f)[i],r=h(this,l,E).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(e(this,V)&&e(this,Z)){let o=e(this,V)[i],h=e(this,Z)[i];if(o&&h){let d=o-(e(this,B).now()-h);n.ttl=d,n.start=Date.now();}}return e(this,Q)&&(n.size=e(this,Q)[i]),n}dump(){let e$1=[];for(let i of h(this,l,lt).call(this,{allowStale:true})){let s=e(this,b)[i],r=e(this,f)[i],n=h(this,l,E).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(e(this,V)&&e(this,Z)){o.ttl=e(this,V)[i];let h=e(this,B).now()-e(this,Z)[i];o.start=Math.floor(Date.now()-h);}e(this,Q)&&(o.size=e(this,Q)[i]),e$1.unshift([s,o]);}return e$1}load(e$1){this.clear();for(let[i,s]of e$1){if(s.start){let r=Date.now()-s.start;s.start=e(this,B).now()-r;}this.set(i,s.value,s);}}set(e$1,i$1,s={}){var rt,I,k,w;if(i$1===void 0)return this.delete(e$1),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h$1=this.sizeCalculation,status:d}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,U=e(this,Ot).call(this,e$1,i$1,s.size||0,h$1);if(this.maxEntrySize&&U>this.maxEntrySize)return d&&(d.set="miss",d.maxEntrySizeExceeded=true),h(this,l,ct).call(this,e$1,"set"),this;let S=e(this,O)===0?void 0:e(this,T).get(e$1);if(S===void 0)S=e(this,O)===0?e(this,R):e(this,J).length!==0?e(this,J).pop():e(this,O)===e(this,K)?h(this,l,Lt).call(this,false):e(this,O),e(this,b)[S]=e$1,e(this,f)[S]=i$1,e(this,T).set(e$1,S),e(this,P)[e(this,R)]=S,e(this,z)[S]=e(this,R),g(this,R,S),i(this,O)._++,e(this,bt).call(this,S,U,d),d&&(d.set="add"),v=false,e(this,Et)&&((rt=e(this,ut))==null||rt.call(this,i$1,e$1,"add"));else {h(this,l,At).call(this,S);let y=e(this,f)[S];if(i$1!==y){if(e(this,dt)&&h(this,l,E).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(e(this,tt)&&((I=e(this,q))==null||I.call(this,a,e$1,"set")),e(this,j)&&e(this,D)?.push([a,e$1,"set"]));}else o||(e(this,tt)&&((k=e(this,q))==null||k.call(this,y,e$1,"set")),e(this,j)&&e(this,D)?.push([y,e$1,"set"]));if(e(this,mt).call(this,S),e(this,bt).call(this,S,U,d),e(this,f)[S]=i$1,d){d.set="replace";let a=y&&h(this,l,E).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(d.oldValue=a);}}else d&&(d.set="update");e(this,Et)&&this.onInsert?.(i$1,e$1,i$1===y?"update":"replace");}if(r!==0&&!e(this,V)&&h(this,l,Gt).call(this),e(this,V)&&(v||e(this,Tt).call(this,S,r,n),d&&e(this,ot).call(this,d,S)),!o&&e(this,j)&&e(this,D)){let y=e(this,D),a;for(;a=y?.shift();)(w=e(this,$))==null||w.call(this,...a);}return this}pop(){var e$1;try{for(;e(this,O);){let i=e(this,f)[e(this,N)];if(h(this,l,Lt).call(this,!0),h(this,l,E).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,j)&&e(this,D)){let i=e(this,D),s;for(;s=i?.shift();)(e$1=e(this,$))==null||e$1.call(this,...s);}}}has(e$1,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=e(this,T).get(e$1);if(n!==void 0){let o=e(this,f)[n];if(h(this,l,E).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(e(this,Y).call(this,n))r&&(r.has="stale",e(this,ot).call(this,r,n));else return s&&e(this,ft).call(this,n),r&&(r.has="hit",e(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e$1,i={}){let{allowStale:s=this.allowStale}=i,r=e(this,T).get(e$1);if(r===void 0||!s&&e(this,Y).call(this,r))return;let n=e(this,f)[r];return h(this,l,E).call(this,n)?n.__staleWhileFetching:n}async fetch(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h$1=this.noDisposeOnSet,size:d=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:w,forceRefresh:y=false,status:a,signal:x}=i;if(!e(this,dt))return a&&(a.fetch="get"),this.get(e$1,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let A={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h$1,size:d,sizeCalculation:v,noUpdateTTL:U,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:x},u=e(this,T).get(e$1);if(u===void 0){a&&(a.fetch="miss");let g=h(this,l,Ct).call(this,e$1,u,A,w);return g.__returned=g}else {let g=e(this,f)[u];if(h(this,l,E).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=e(this,Y).call(this,u);if(!y&&!F)return a&&(a.fetch="hit"),h(this,l,At).call(this,u),r&&e(this,ft).call(this,u),a&&e(this,ot).call(this,a,u),g;let H=h(this,l,Ct).call(this,e$1,u,A,w),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e$1,i={}){let s=e(this,xt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,h=this.get(e$1,o);if(!n&&h!==void 0)return h;let d=s(e$1,h,{options:o,context:r});return this.set(e$1,d,o),d}get(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,h$1=e(this,T).get(e$1);if(h$1!==void 0){let d=e(this,f)[h$1],v=h(this,l,E).call(this,d);return o&&e(this,ot).call(this,o,h$1),e(this,Y).call(this,h$1)?(o&&(o.get="stale"),v?(o&&s&&d.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?d.__staleWhileFetching:void 0):(n||h(this,l,ct).call(this,e$1,"expire"),o&&s&&(o.returnedStale=true),s?d:void 0)):(o&&(o.get="hit"),v?d.__staleWhileFetching:(h(this,l,At).call(this,h$1),r&&e(this,ft).call(this,h$1),d))}else o&&(o.get="miss");}delete(e){return h(this,l,ct).call(this,e,"delete")}clear(){return h(this,l,zt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ut=new WeakMap,$=new WeakMap,yt=new WeakMap,xt=new WeakMap,B=new WeakMap,O=new WeakMap,X=new WeakMap,T=new WeakMap,b=new WeakMap,f=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,R=new WeakMap,J=new WeakMap,D=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,Et=new WeakMap,l=new WeakSet,Gt=function(){let e$1=new Dt(e(this,K)),i=new Dt(e(this,K));g(this,V,e$1),g(this,Z,i);let s=this.ttlAutopurge?new Array(e(this,K)):void 0;g(this,W,s),g(this,Tt,(h,d,v=e(this,B).now())=>{i[h]=d!==0?v:0,e$1[h]=d,r(h,d);}),g(this,ft,h=>{i[h]=e$1[h]!==0?e(this,B).now():0,r(h,e$1[h]);});let r=this.ttlAutopurge?(h$1,d)=>{if(s?.[h$1]&&(clearTimeout(s[h$1]),s[h$1]=void 0),d&&d!==0&&s){let v=setTimeout(()=>{e(this,Y).call(this,h$1)&&h(this,l,ct).call(this,e(this,b)[h$1],"expire");},d+1);v.unref&&v.unref(),s[h$1]=v;}}:()=>{};g(this,ot,(h,d)=>{if(e$1[d]){let v=e$1[d],U=i[d];if(!v||!U)return;h.ttl=v,h.start=U,h.now=n||o();let S=h.now-U;h.remainingTTL=v-S;}});let n=0,o=()=>{let h=e(this,B).now();if(this.ttlResolution>0){n=h;let d=setTimeout(()=>n=0,this.ttlResolution);d.unref&&d.unref();}return h};this.getRemainingTTL=h=>{let d=e(this,T).get(h);if(d===void 0)return 0;let v=e$1[d],U=i[d];if(!v||!U)return 1/0;let S=(n||o())-U;return v-S},g(this,Y,h=>{let d=i[h],v=e$1[h];return !!v&&!!d&&(n||o())-d>v});},ft=new WeakMap,ot=new WeakMap,Tt=new WeakMap,Y=new WeakMap,ie=function(){let e$1=new Dt(e(this,K));g(this,X,0),g(this,Q,e$1),g(this,mt,i=>{g(this,X,e(this,X)-e$1[i]),e$1[i]=0;}),g(this,Ot,(i,s,r,n)=>{if(h(this,l,E).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),g(this,bt,(i,s,r)=>{if(e$1[i]=s,e(this,M)){let n=e(this,M)-e$1[i];for(;e(this,X)>n;)h(this,l,Lt).call(this,true);}g(this,X,e(this,X)+e$1[i]),r&&(r.entrySize=s,r.totalCalculatedSize=e(this,X));});},mt=new WeakMap,bt=new WeakMap,Ot=new WeakMap,lt=function*({allowStale:e$1=this.allowStale}={}){if(e(this,O))for(let i=e(this,R);!(!h(this,l,It).call(this,i)||((e$1||!e(this,Y).call(this,i))&&(yield i),i===e(this,N)));)i=e(this,z)[i];},ht=function*({allowStale:e$1=this.allowStale}={}){if(e(this,O))for(let i=e(this,N);!(!h(this,l,It).call(this,i)||((e$1||!e(this,Y).call(this,i))&&(yield i),i===e(this,R)));)i=e(this,P)[i];},It=function(e$1){return e$1!==void 0&&e(this,T).get(e(this,b)[e$1])===e$1},Lt=function(e$1){var n;let i$1=e(this,N),s=e(this,b)[i$1],r=e(this,f)[i$1];return e(this,dt)&&h(this,l,E).call(this,r)?r.__abortController.abort(new Error("evicted")):(e(this,tt)||e(this,j))&&(e(this,tt)&&((n=e(this,q))==null||n.call(this,r,s,"evict")),e(this,j)&&e(this,D)?.push([r,s,"evict"])),e(this,mt).call(this,i$1),e(this,W)?.[i$1]&&(clearTimeout(e(this,W)[i$1]),e(this,W)[i$1]=void 0),e$1&&(e(this,b)[i$1]=void 0,e(this,f)[i$1]=void 0,e(this,J).push(i$1)),e(this,O)===1?(g(this,N,g(this,R,0)),e(this,J).length=0):g(this,N,e(this,P)[i$1]),e(this,T).delete(s),i(this,O)._--,i$1},Ct=function(e$1,i,s,r){let n=i===void 0?void 0:e(this,f)[i];if(h(this,l,E).call(this,n))return n;let o=new Nt,{signal:h$1}=s;h$1?.addEventListener("abort",()=>o.abort(h$1.reason),{signal:o.signal});let d={signal:o.signal,options:s,context:r},v=(w,y=false)=>{let{aborted:a}=o.signal,x=s.ignoreFetchAbort&&w!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&w!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!x&&!y)return S(o.signal.reason,A);let u=I,g=e(this,f)[i];return (g===I||x&&y&&g===void 0)&&(w===void 0?u.__staleWhileFetching!==void 0?e(this,f)[i]=u.__staleWhileFetching:h(this,l,ct).call(this,e$1,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e$1,w,d.options))),w},U=w=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=w),S(w,false)),S=(w,y)=>{let{aborted:a}=o.signal,x=a&&s.allowStaleOnFetchAbort,A=x||s.allowStaleOnFetchRejection,u=A||s.noDeleteOnFetchRejection,g=I;if(e(this,f)[i]===I&&(!u||!y&&g.__staleWhileFetching===void 0?h(this,l,ct).call(this,e$1,"fetch"):x||(e(this,f)[i]=g.__staleWhileFetching)),A)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw w},rt=(w,y)=>{var x;let a=(x=e(this,yt))==null?void 0:x.call(this,e$1,n,d);a&&a instanceof Promise&&a.then(A=>w(A===void 0?void 0:A),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(w(void 0),s.allowStaleOnFetchAbort&&(w=A=>v(A,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,U),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e$1,k,{...d.options,status:void 0}),i=e(this,T).get(e$1)):e(this,f)[i]=k,k},E=function(e$1){if(!e(this,dt))return false;let i=e$1;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},Mt=function(e$1,i){e(this,z)[i]=e$1,e(this,P)[e$1]=i;},At=function(e$1){e$1!==e(this,R)&&(e$1===e(this,N)?g(this,N,e(this,P)[e$1]):h(this,l,Mt).call(this,e(this,z)[e$1],e(this,P)[e$1]),h(this,l,Mt).call(this,e(this,R),e$1),g(this,R,e$1));},ct=function(e$1,i$1){var r,n;let s=false;if(e(this,O)!==0){let o=e(this,T).get(e$1);if(o!==void 0)if(e(this,W)?.[o]&&(clearTimeout(e(this,W)?.[o]),e(this,W)[o]=void 0),s=true,e(this,O)===1)h(this,l,zt).call(this,i$1);else {e(this,mt).call(this,o);let h$1=e(this,f)[o];if(h(this,l,E).call(this,h$1)?h$1.__abortController.abort(new Error("deleted")):(e(this,tt)||e(this,j))&&(e(this,tt)&&((r=e(this,q))==null||r.call(this,h$1,e$1,i$1)),e(this,j)&&e(this,D)?.push([h$1,e$1,i$1])),e(this,T).delete(e$1),e(this,b)[o]=void 0,e(this,f)[o]=void 0,o===e(this,R))g(this,R,e(this,z)[o]);else if(o===e(this,N))g(this,N,e(this,P)[o]);else {let d=e(this,z)[o];e(this,P)[d]=e(this,P)[o];let v=e(this,P)[o];e(this,z)[v]=e(this,z)[o];}i(this,O)._--,e(this,J).push(o);}}if(e(this,j)&&e(this,D)?.length){let o=e(this,D),h;for(;h=o?.shift();)(n=e(this,$))==null||n.call(this,...h);}return s},zt=function(e$1){var i,s;for(let r of h(this,l,ht).call(this,{allowStale:true})){let n=e(this,f)[r];if(h(this,l,E).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=e(this,b)[r];e(this,tt)&&((i=e(this,q))==null||i.call(this,n,o,e$1)),e(this,j)&&e(this,D)?.push([n,o,e$1]);}}if(e(this,T).clear(),e(this,f).fill(void 0),e(this,b).fill(void 0),e(this,V)&&e(this,Z)){e(this,V).fill(0),e(this,Z).fill(0);for(let r of e(this,W)??[])r!==void 0&&clearTimeout(r);e(this,W)?.fill(void 0);}if(e(this,Q)&&e(this,Q).fill(0),g(this,N,0),g(this,R,0),e(this,J).length=0,g(this,X,0),g(this,O,0),e(this,j)&&e(this,D)){let r=e(this,D),n;for(;n=r?.shift();)(s=e(this,$))==null||s.call(this,...n);}},wt);var Ft=class{cache;map=new Map;constructor(e){this.cache=new ee({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ut="1.8.20";var Vt={version:Ut};var Wt="repeat";function Yt(m){return {type:"pause",duration:m}}var Ht="__game_layer__";var fe={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var re={};var Kt={};b$1(Kt,{createExportableElement:()=>oe});var gt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(gt||={});function oe(m){try{if(typeof m>"u")return m;let e=JSON.stringify(m);return JSON.parse(e)}catch(e){throw gt.error("Error creating exportable element",m,e),new PixiError("not_json_serializable","Error creating exportable element")}}var ge=typeof window<"u"&&typeof document<"u",ne=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Vt.version}`],ae=31,_e="background:#2f90da;color:#fff;font-weight:bold;",ve="background:#c832bb;color:#fff;font-weight:bold;",Se="background:transparent;font-weight:bold;",kt=` v${Vt.version}`;function le(){if(!ge)return;let m=[],e=[];for(let i=0;i<ne.length;i++){let s=ne[i],r=s.endsWith(kt),n=r?s.slice(0,-kt.length):s,o=n.slice(0,ae),h=n.slice(ae),d=r?"%c%s%c%s%c%s":"%c%s%c%s";m.push(d),e.push(_e,o,ve,h),r&&e.push(Se,kt);}console.info(m.join(`
|
|
2
2
|
`),...e);}function qt(){let m=window.location.pathname+window.location.hash;return m.includes("#")&&(m=m.split("#")[1]),m}le();var he;(y=>{async function m(a,x,A){if(GameUnifier.init({navigate:x?.navigate,getCurrentGameStepState:()=>{let u={};try{u=nt.canvas.export();}catch{}return {path:qt(),storage:G.storage.export(),canvas:u,sound:pt.sound.export(),labelIndex:L.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:L.narration.openedLabels}},restoreGameStepState:async(u,g)=>{et.HistoryManagerStatic._originalStepData=u,L.NarrationManagerStatic.openedLabels=u.openedLabels,G.storage.restore(u.storage);try{await nt.canvas.restore(u.canvas),await pt.sound.restore(u.sound);}catch(F){gt.error("Error restoring game step state:",F);}await g(u.path);},getStepCounter:()=>L.narration.stepCounter,setStepCounter:u=>{L.NarrationManagerStatic._stepCounter=u;},getOpenedLabels:()=>L.narration.openedLabels.length,addHistoryItem:(u,g)=>et.stepHistory.add(u,g),getCharacter:u=>$t.RegisteredCharacters.get(u),processNavigationRequests:(u,g)=>{let F=u,H=Promise.resolve();return u>0?(F--,H=L.narration.continue(g)):u<0&&(F=0,H=et.stepHistory.back(g,{steps:u*-1})),{newValue:F,result:H}},animate:(u,g,F,H)=>motion.animate(u,g,F,H),getVariable:(u,g)=>G.StorageRegistry.getVariable(u,g),setVariable:(u,g,F)=>G.StorageRegistry.setVariable(u,g,F),removeVariable:(u,g)=>G.StorageRegistry.removeVariable(u,g),getFlag:u=>G.storage.getFlag(u),setFlag:(u,g)=>G.storage.setFlag(u,g),onLabelClosing:u=>G.StorageRegistry.clearOldTempVariables(u)}),!a||!x){gt.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await nt.canvas.init(a,x,A)}y.init=m;function e(){G.storage.clear();try{nt.canvas.clear();}catch{}pt.sound.clear(),L.narration.clear(),et.stepHistory.clear();}y.clear=e;function i(){let a={};try{a=nt.canvas.export();}catch{}return {pixivn_version:Ut,stepData:L.narration.export(),storageData:G.storage.export(),canvasData:a,soundData:pt.sound.export(),historyData:et.stepHistory.export(),path:qt()}}y.exportGameState=i;async function s(a,x){et.stepHistory.restore(a.historyData);let A=et.stepHistory.lastKey;if(typeof A=="number"){let u=et.stepHistory.stepsInfoMap.get(A)||null;await L.narration.restore(a.stepData,u);}G.storage.restore(a.storageData);try{await nt.canvas.restore(a.canvasData),await pt.sound.restore(a.soundData);}catch{}x?await x(a.path):await GameUnifier.navigate(a.path);}y.restoreGameState=s;async function r(a,x){return y.clear(),await L.narration.call(a,x)}y.start=r;function n(a){return JSON.parse(a)}y.jsonToGameState=n;function o(a){GameUnifier.onEnd=a;}y.onEnd=o;function h(a){return gt.warn("Game.onError is deprecated. Use Game.addOnError / Game.removeOnError to register multiple handlers."),GameUnifier.addOnError((x,A)=>a("step",x,A))}y.onError=h;function d(a){return GameUnifier.addOnError(a)}y.addOnError=d;function v(a){return GameUnifier.removeOnError(a)}y.removeOnError=v;function U(a){L.NarrationManagerStatic.onStepStart=a;}y.onStepStart=U;function S(a){L.NarrationManagerStatic.onLoadingLabel=a;}y.onLoadingLabel=S;function rt(a){L.NarrationManagerStatic.onStepEnd=a;}y.onStepEnd=rt;function I(a){GameUnifier.navigate=a;}y.onNavigate=I;function k(a){return GameUnifier.addOnPreContinue(a)}y.addOnPreContinue=k;function w(a){return GameUnifier.removeOnPreContinue(a)}y.removeOnPreContinue=w;})(he||={});var $e={characterUtils:$t,canvasUtils:nt,narrationUtils:L,soundUtils:pt,CANVAS_APP_GAME_LAYER_ALIAS:Ht,Pause:Yt,Repeat:Wt,PIXIVN_VERSION:Ut,...Kt,...re,canvas:nt.canvas,narration:L.narration,sound:pt.sound,storage:G.storage,history:et.stepHistory,Game:he,GameUnifier:GameUnifier};export{Ht as CANVAS_APP_GAME_LAYER_ALIAS,Ft as CachedMap,he as Game,Ut as PIXIVN_VERSION,Yt as Pause,Wt as Repeat,fe as SYSTEM_RESERVED_STORAGE_KEYS,oe as createExportableElement,$e as default};
|
package/dist/narration.d.cts
CHANGED
|
@@ -513,7 +513,7 @@ declare namespace RegisteredLabels {
|
|
|
513
513
|
* Saves a label in the system
|
|
514
514
|
* @param labels The label(s) to be saved
|
|
515
515
|
*/
|
|
516
|
-
function add(...labels:
|
|
516
|
+
function add(...labels: LabelAbstract<any, any>[]): void;
|
|
517
517
|
/**
|
|
518
518
|
* Get a list of all labels registered.
|
|
519
519
|
* @returns An array of labels.
|
package/dist/narration.d.ts
CHANGED
|
@@ -513,7 +513,7 @@ declare namespace RegisteredLabels {
|
|
|
513
513
|
* Saves a label in the system
|
|
514
514
|
* @param labels The label(s) to be saved
|
|
515
515
|
*/
|
|
516
|
-
function add(...labels:
|
|
516
|
+
function add(...labels: LabelAbstract<any, any>[]): void;
|
|
517
517
|
/**
|
|
518
518
|
* Get a list of all labels registered.
|
|
519
519
|
* @returns An array of labels.
|
package/dist/vite.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var fs=require('fs'),path=require('path'),tinyglobby=require('tinyglobby');var
|
|
2
|
-
`),"utf-8");}function
|
|
1
|
+
'use strict';var fs=require('fs'),path=require('path'),tinyglobby=require('tinyglobby');var H=Object.create;var $=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var W=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Q=(n,t,l,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of z(t))!Y.call(n,a)&&a!==l&&$(n,a,{get:()=>t[a],enumerable:!(d=K(t,a))||d.enumerable});return n};var Z=(n,t,l)=>(l=n!=null?H(U(n)):{},Q($(l,"default",{value:n,enumerable:true}),n));var D=W((gt,M)=>{var I=process||{},T=I.argv||[],A=I.env||{},q=!(A.NO_COLOR||T.includes("--no-color"))&&(!!A.FORCE_COLOR||T.includes("--color")||I.platform==="win32"||(I.stdout||{}).isTTY&&A.TERM!=="dumb"||!!A.CI),tt=(n,t,l=n)=>d=>{let a=""+d,o=a.indexOf(t,n.length);return ~o?n+et(a,t,l,o)+t:n+a+t},et=(n,t,l,d)=>{let a="",o=0;do a+=n.substring(o,d)+l,o=d+t.length,d=n.indexOf(t,o);while(~d);return a+n.substring(o)},J=(n=q)=>{let t=n?tt:()=>String;return {isColorSupported:n,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};M.exports=J();M.exports.createColors=J;});var E="/__pixi-vn/characters",_="/__pixi-vn/labels",O="/__pixi-vn/assets/manifest",C="/__pixi-vn/canvas-options";var R=Z(D());var x=R.default.cyan("(pixi-vn)");function N(n){return n?Array.isArray(n)?n:[n]:[]}function ct(n){return n?n.bundles.map(t=>t.name):[]}function lt(n){if(!n)return [];let t=new Set;for(let l of n.bundles){let d=l.assets;if(Array.isArray(d))for(let a of d){let o=a.alias;if(o)for(let g of Array.isArray(o)?o:[o])t.add(g);}else if(d&&typeof d=="object")for(let a of Object.keys(d))t.add(a);}return Array.from(t)}function dt(n){let t=[],l=[];for(let d of n)try{let a=fs.readFileSync(d,"utf-8"),o=/newLabel\(\s*["']([^"']+)["']/g,g;for(;(g=o.exec(a))!==null;)l.push(g[1]);let p=/new\s+\w*[Cc]haracter\(\s*["']([^"']+)["']/g;for(;(g=p.exec(a))!==null;)t.push(g[1]);}catch{}return {charIds:t,labelIds:l}}function ft(n){let t,l,d=new Promise(e=>{l=e;}),a=[...N(n?.content),...N(n?.characters),...N(n?.labels)],o=[],g=[],p=new Set,V=[],y=typeof n?.assetsManifest=="function",h=typeof n?.assetsManifest=="function"?void 0:n?.assetsManifest;async function P(e){if(typeof n?.assetsManifest=="function")try{let r=await n.assetsManifest(e);h=r,v.manifest=r??null;}catch(r){t?.logger.error(`${x} Failed to resolve the assets manifest.`,{error:r instanceof Error?r:new Error(String(r)),timestamp:true});}}let w=new Map;function L(){if(!n?.typeFilePath||!t)return null;let e=n.typeFilePath;return path.isAbsolute(e)?e:path.resolve(t.root,e)}function X(){let e=[...g,...Array.from(w.values()).flat()];return Array.from(new Set(e))}function j(e,r,c,s,f){fs.mkdirSync(path.dirname(e),{recursive:true});let i=["/* eslint-disable */","// noinspection JSUnusedGlobalSymbols","// This file is auto-generated by @drincs/pixi-vn vite plugin. Do not edit manually."];if(r.length>0){i.push('declare module "@drincs/pixi-vn/characters" {'),i.push(" interface PixivnCharacterIds {");for(let u of r)i.push(` ${JSON.stringify(u)}: never;`);i.push(" }"),i.push("}");}if(c.length>0){i.push('declare module "@drincs/pixi-vn/narration" {'),i.push(" interface PixivnLabelIds {");for(let u of c)i.push(` ${JSON.stringify(u)}: never;`);i.push(" }"),i.push("}");}if(s.length>0||f.length>0){if(i.push('declare module "@drincs/pixi-vn/canvas" {'),s.length>0){i.push(" interface PixivnBundleIds {");for(let u of s)i.push(` ${JSON.stringify(u)}: never;`);i.push(" }");}if(f.length>0){i.push(" interface PixivnAssetAliasIds {");for(let u of f)i.push(` ${JSON.stringify(u)}: never;`);i.push(" }");}i.push("}");}i.push(`export const characterIds = ${JSON.stringify(r)} as const;`);{let u=Object.fromEntries(r.map(m=>[m,m]));i.push(`export const characterIdsEnum = ${JSON.stringify(u)} as const;`);}i.push(`export const labelIds = ${JSON.stringify(c)} as const;`);{let u=Object.fromEntries(c.map(m=>[m,m]));i.push(`export const labelIdsEnum = ${JSON.stringify(u)} as const;`);}i.push(`export const bundleIds = ${JSON.stringify(s)} as const;`);{let u=Object.fromEntries(s.map(m=>[m,m]));i.push(`export const bundleIdsEnum = ${JSON.stringify(u)} as const;`);}i.push(`export const assetAliasIds = ${JSON.stringify(f)} as const;`);{let u=Object.fromEntries(f.map(m=>[m,m]));i.push(`export const assetAliasIdsEnum = ${JSON.stringify(u)} as const;`);}i.push(""),fs.writeFileSync(e,i.join(`
|
|
2
|
+
`),"utf-8");}function b(){let e=L();if(e)try{j(e,o.map(r=>r.id),X(),ct(h),lt(h));}catch(r){t?.logger.error(`${x} Failed to write keys file "${e}".`,{error:r instanceof Error?r:new Error(String(r)),timestamp:true});}}async function B(e,r=[]){try{o=(await e("@drincs/pixi-vn/characters")).RegisteredCharacters?.values()??[];}catch{o=[];}try{g=(await e("@drincs/pixi-vn/narration")).RegisteredLabels?.keys()??[];}catch{g=[];}if(r.length>0){let{charIds:s,labelIds:f}=dt(r),i=new Set(o.map(m=>m.id)),u=new Set(g);for(let m of s)i.has(m)||o.push({id:m});for(let m of f)u.has(m)||g.push(m);}let c=o.map(s=>s.id).join(", ")||"none";t?.logger.info(`${x} ${R.default.dim(`${o.length} character(s): [${c}], ${g.length} label(s)`)}`,{timestamp:true});}async function F(e,r){try{await e("@drincs/pixi-vn/characters");}catch{}try{await e("@drincs/pixi-vn/narration");}catch{}let c=await tinyglobby.glob(a,{cwd:r,absolute:true,onlyFiles:true}),s=[];for(let f of c){p.add(f);try{await e(f);}catch{s.push(f);}}await B(e,s),await P(e),b(),l();}async function G(e){for(let s of p)for(let f of e.moduleGraph.getModulesByFile(s)??[])e.moduleGraph.invalidateModule(f);try{(await e.ssrLoadModule("@drincs/pixi-vn/characters")).RegisteredCharacters?.clear?.();}catch{}try{(await e.ssrLoadModule("@drincs/pixi-vn/narration")).RegisteredLabels?.clear?.();}catch{}let r=await tinyglobby.glob(a,{cwd:t.root,absolute:true,onlyFiles:true}),c=[];for(let s of r){p.add(s);try{await e.ssrLoadModule(s);}catch{c.push(s);}}await B(s=>e.ssrLoadModule(s),c),await P(s=>e.ssrLoadModule(s)),b();for(let s of V)s();}let v={characters:null,labels:null,manifest:h??null,canvasOptions:null};function S(e,r){return (c,s)=>{if(s.setHeader("Content-Type","application/json"),c.method==="GET"){let f=v[e];if(f===null){s.statusCode=404,s.end(JSON.stringify({error:`${r} not initialized`}));return}s.statusCode=200,s.end(JSON.stringify(f));return}if(c.method==="POST"){let f="";c.on("data",i=>{f+=i.toString();}),c.on("end",()=>{try{v[e]=JSON.parse(f),s.statusCode=201,s.end(JSON.stringify({message:`${r} updated successfully`}));}catch{s.statusCode=400,s.end(JSON.stringify({error:`Invalid JSON format for ${r}`}));}});}}}return {name:"vite-plugin-pixi-vn",enforce:"pre",api:{contentLoaded:d,get characters(){return o},onReload(e){V.push(e);},setExternalLabels(e,r){w.set(e,r),b();},clearExternalLabels(e){w.delete(e),b();},setAssetsManifest(e){h=e,v.manifest=e,b();}},config(e,r){if(r.command==="serve"&&a.length>0)return {ssr:{noExternal:["@drincs/pixi-vn"]}}},configResolved(e){t=e,a.length===0&&!y&&(b(),l());},async buildStart(){if(t?.command!=="build"||a.length===0&&!y)return;let{createServer:e}=await import('vite'),r=await e({root:t.root,configFile:false,resolve:t.resolve,server:{middlewareMode:true},appType:"custom",logLevel:"silent",optimizeDeps:{noDiscovery:true},ssr:{noExternal:["@drincs/pixi-vn"]}});try{await F(c=>r.ssrLoadModule(c),t.root);}catch{l();}finally{await r.close();}},configureServer(e){(a.length>0||y)&&F(r=>e.ssrLoadModule(r),t.root).catch(()=>{l();}),e.middlewares.use(E,S("characters","Characters")),e.middlewares.use(_,S("labels","Labels")),e.middlewares.use(O,S("manifest","Manifest")),e.middlewares.use(C,S("canvasOptions","Canvas options"));},hotUpdate({file:e,server:r}){let c=L();if(c&&e===c)return [];if(a.length>0&&p.has(e))return G(r).catch(s=>{t?.logger.error(`${x} Failed to reload content.`,{error:s instanceof Error?s:new Error(String(s)),timestamp:true});}),[];y&&P(s=>r.ssrLoadModule(s)).then(()=>b()).catch(s=>{t?.logger.error(`${x} Failed to refresh the assets manifest.`,{error:s instanceof Error?s:new Error(String(s)),timestamp:true});});}}}exports.PIXIVN_DEV_API_ASSETS_MANIFEST=O;exports.PIXIVN_DEV_API_CANVAS_OPTIONS=C;exports.PIXIVN_DEV_API_CHARACTERS=E;exports.PIXIVN_DEV_API_LABELS=_;exports.vitePluginPixivn=ft;
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetsManifest } from '@drincs/pixi-vn/pixi.js';
|
|
1
2
|
import { Plugin } from 'vite';
|
|
2
3
|
|
|
3
4
|
/** @const {string} API endpoint for characters data - GET to retrieve, POST to update */
|
|
@@ -9,6 +10,11 @@ declare const PIXIVN_DEV_API_ASSETS_MANIFEST = "/__pixi-vn/assets/manifest";
|
|
|
9
10
|
/** @const {string} API endpoint for canvas options - GET to retrieve, POST to update */
|
|
10
11
|
declare const PIXIVN_DEV_API_CANVAS_OPTIONS = "/__pixi-vn/canvas-options";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Either a plain {@link AssetsManifest}, or a function that resolves one — see
|
|
15
|
+
* {@link VitePluginPixivnOptions.assetsManifest}.
|
|
16
|
+
*/
|
|
17
|
+
type AssetsManifestOption = AssetsManifest | ((ssrLoadModule: (id: string) => Promise<unknown>) => AssetsManifest | undefined | Promise<AssetsManifest | undefined>);
|
|
12
18
|
/**
|
|
13
19
|
* Options for {@link vitePluginPixivn}.
|
|
14
20
|
*/
|
|
@@ -68,6 +74,70 @@ interface VitePluginPixivnOptions {
|
|
|
68
74
|
* @example "./src/pixi-vn.keys.gen.ts"
|
|
69
75
|
*/
|
|
70
76
|
typeFilePath?: string;
|
|
77
|
+
/**
|
|
78
|
+
* A PIXI.js {@link AssetsManifest} describing all asset bundles and their aliases — or a
|
|
79
|
+
* function that resolves one, for manifests that aren't known synchronously at
|
|
80
|
+
* plugin-creation time (e.g. one produced by an asset pipeline such as `@assetpack/core`, or
|
|
81
|
+
* merged together from several sources in an app-owned module).
|
|
82
|
+
*
|
|
83
|
+
* **Prefer the function form for anything backed by a generated file.** A *static*
|
|
84
|
+
* `import manifest from "./manifest.gen.json"` in `vite.config.ts` makes Vite treat that file
|
|
85
|
+
* as a config dependency — restarting the whole server on every change to it — which is
|
|
86
|
+
* disastrous when the very same config's own asset pipeline rewrites that file on every
|
|
87
|
+
* startup: an infinite restart loop. The function form sidesteps this entirely: nothing in
|
|
88
|
+
* `vite.config.ts` itself reads or imports the file; the plugin calls your function lazily,
|
|
89
|
+
* from inside its own plugin hooks, whenever it needs a fresh manifest.
|
|
90
|
+
*
|
|
91
|
+
* The function receives an `ssrLoadModule`-like loader (bound to whichever context is
|
|
92
|
+
* available — the running dev server, or a dedicated temporary server with this plugin's own
|
|
93
|
+
* `resolve` forwarded during `vite build`) so it can load `@/`-aliased app modules the same
|
|
94
|
+
* way `content` / `characters` / `labels` do — e.g. to import a module that merges an asset
|
|
95
|
+
* pipeline's generated manifest with hand-written bundles. Return `undefined` if there's
|
|
96
|
+
* nothing to register yet (e.g. the pipeline hasn't produced output on a fresh checkout).
|
|
97
|
+
*
|
|
98
|
+
* The plugin calls this function whenever it (re)loads content — at startup, and on every
|
|
99
|
+
* hot-reload — and, since it generally can't know which file(s) your function's own import
|
|
100
|
+
* depends on, also on every other file change (excluding its own generated
|
|
101
|
+
* {@link VitePluginPixivnOptions.typeFilePath}), so a change to a manifest generated by
|
|
102
|
+
* another plugin is picked up without any direct coupling between the two.
|
|
103
|
+
*
|
|
104
|
+
* Either way — plain value or function — once a manifest is registered, the plugin:
|
|
105
|
+
* - writes `export const bundleIds` and `export const assetAliasIds` — `as const` runtime
|
|
106
|
+
* arrays of every bundle name and every asset alias found in the manifest — to
|
|
107
|
+
* {@link VitePluginPixivnOptions.typeFilePath}, and augments `PixivnBundleIds` /
|
|
108
|
+
* `PixivnAssetAliasIds` in `@drincs/pixi-vn/canvas` (the same `declare module` pattern used
|
|
109
|
+
* for `PixivnCharacterIds` / `PixivnLabelIds`), narrowing `BundleIdType` / `AssetAliasIdType`
|
|
110
|
+
* (also exported from `@drincs/pixi-vn/canvas`) from `string` to unions of known literals.
|
|
111
|
+
* - seeds the dev-server's `GET /__pixi-vn/assets/manifest` endpoint with this manifest
|
|
112
|
+
* immediately, so it is available without the browser having to `POST` it first (see
|
|
113
|
+
* {@link PIXIVN_DEV_API_ASSETS_MANIFEST}). A later `POST` (deprecated) still overrides it.
|
|
114
|
+
*
|
|
115
|
+
* `api.setAssetsManifest(manifest)` remains available as a lower-level escape hatch for
|
|
116
|
+
* pushing an already-computed manifest from outside this plugin entirely (e.g. from a
|
|
117
|
+
* separate Vite plugin that doesn't need `ssrLoadModule` access).
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* // vite.config.ts — a manifest merged from a generated file plus hand-written bundles
|
|
122
|
+
* vitePluginPixivn({
|
|
123
|
+
* typeFilePath: "./src/pixi-vn.keys.gen.ts",
|
|
124
|
+
* assetsManifest: async (ssrLoadModule) => {
|
|
125
|
+
* const mod = await ssrLoadModule("/src/assets/index.ts");
|
|
126
|
+
* return mod.manifest;
|
|
127
|
+
* },
|
|
128
|
+
* })
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* // vite.config.ts — a genuinely static manifest, known up front
|
|
134
|
+
* vitePluginPixivn({
|
|
135
|
+
* assetsManifest: { bundles: [{ name: "ui", assets: { logo: "logo.png" } }] },
|
|
136
|
+
* typeFilePath: "./src/pixi-vn.keys.gen.ts",
|
|
137
|
+
* })
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
assetsManifest?: AssetsManifestOption;
|
|
71
141
|
}
|
|
72
142
|
/**
|
|
73
143
|
* Creates a Vite plugin for Pixi'VN integration.
|
|
@@ -98,6 +168,17 @@ interface VitePluginPixivnOptions {
|
|
|
98
168
|
* `characterIds` and `labelIds`. These arrays can be used for runtime validation
|
|
99
169
|
* (e.g. `z.enum(characterIds)`) and are regenerated on the same triggers as the type file.
|
|
100
170
|
*
|
|
171
|
+
* **Asset bundles / aliases**
|
|
172
|
+
*
|
|
173
|
+
* When a PIXI.js `AssetsManifest` is registered — via {@link VitePluginPixivnOptions.assetsManifest}
|
|
174
|
+
* or, for manifests produced by an async asset pipeline, `api.setAssetsManifest(manifest)` — the
|
|
175
|
+
* same {@link VitePluginPixivnOptions.typeFilePath} also gets `export const bundleIds` /
|
|
176
|
+
* `export const assetAliasIds` (`as const` arrays) plus `declare module` augmentations for
|
|
177
|
+
* `PixivnBundleIds` / `PixivnAssetAliasIds` in `@drincs/pixi-vn/canvas` — narrowing that module's
|
|
178
|
+
* `BundleIdType` / `AssetAliasIdType` from `string` to unions of known literals, exactly like
|
|
179
|
+
* `PixivnCharacterIds` / `PixivnLabelIds` narrow `CharacterIdType` / `LabelIdType` above. The
|
|
180
|
+
* manifest also immediately backs the `GET /__pixi-vn/assets/manifest` endpoint below.
|
|
181
|
+
*
|
|
101
182
|
* **External label providers**
|
|
102
183
|
*
|
|
103
184
|
* Other Vite plugins can inject label IDs via the plugin API without needing to register
|
|
@@ -113,8 +194,11 @@ interface VitePluginPixivnOptions {
|
|
|
113
194
|
* - `POST /__pixi-vn/characters` — *(deprecated)* update from client; use the `characters` option instead
|
|
114
195
|
* - `GET /__pixi-vn/labels` — retrieve narration labels
|
|
115
196
|
* - `POST /__pixi-vn/labels` — *(deprecated)* update from client; use the `labels` / `content` option instead
|
|
116
|
-
* - `GET /__pixi-vn/assets/manifest` — retrieve PIXI assets manifest
|
|
117
|
-
*
|
|
197
|
+
* - `GET /__pixi-vn/assets/manifest` — retrieve PIXI assets manifest (immediately available
|
|
198
|
+
* when the `assetsManifest` option is set or `api.setAssetsManifest` has been called; otherwise
|
|
199
|
+
* 404 until a client `POST`)
|
|
200
|
+
* - `POST /__pixi-vn/assets/manifest` — *(deprecated)* update from client; use the
|
|
201
|
+
* `assetsManifest` option instead
|
|
118
202
|
* - `GET /__pixi-vn/canvas-options` — retrieve canvas rendering options
|
|
119
203
|
* - `POST /__pixi-vn/canvas-options` — update canvas options from client
|
|
120
204
|
*
|
|
@@ -125,6 +209,9 @@ interface VitePluginPixivnOptions {
|
|
|
125
209
|
* - `api.onReload(cb)` — register a callback that fires after every hot-content-reload.
|
|
126
210
|
* - `api.setExternalLabels(providerId, labels)` — add/replace labels from an external provider.
|
|
127
211
|
* - `api.clearExternalLabels(providerId)` — remove labels previously set for a provider.
|
|
212
|
+
* - `api.setAssetsManifest(manifest)` — register/replace the assets manifest after
|
|
213
|
+
* plugin-creation time (e.g. once an async asset pipeline finishes); see
|
|
214
|
+
* {@link VitePluginPixivnOptions.assetsManifest}.
|
|
128
215
|
*
|
|
129
216
|
* @example
|
|
130
217
|
* ```ts
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetsManifest } from '@drincs/pixi-vn/pixi.js';
|
|
1
2
|
import { Plugin } from 'vite';
|
|
2
3
|
|
|
3
4
|
/** @const {string} API endpoint for characters data - GET to retrieve, POST to update */
|
|
@@ -9,6 +10,11 @@ declare const PIXIVN_DEV_API_ASSETS_MANIFEST = "/__pixi-vn/assets/manifest";
|
|
|
9
10
|
/** @const {string} API endpoint for canvas options - GET to retrieve, POST to update */
|
|
10
11
|
declare const PIXIVN_DEV_API_CANVAS_OPTIONS = "/__pixi-vn/canvas-options";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Either a plain {@link AssetsManifest}, or a function that resolves one — see
|
|
15
|
+
* {@link VitePluginPixivnOptions.assetsManifest}.
|
|
16
|
+
*/
|
|
17
|
+
type AssetsManifestOption = AssetsManifest | ((ssrLoadModule: (id: string) => Promise<unknown>) => AssetsManifest | undefined | Promise<AssetsManifest | undefined>);
|
|
12
18
|
/**
|
|
13
19
|
* Options for {@link vitePluginPixivn}.
|
|
14
20
|
*/
|
|
@@ -68,6 +74,70 @@ interface VitePluginPixivnOptions {
|
|
|
68
74
|
* @example "./src/pixi-vn.keys.gen.ts"
|
|
69
75
|
*/
|
|
70
76
|
typeFilePath?: string;
|
|
77
|
+
/**
|
|
78
|
+
* A PIXI.js {@link AssetsManifest} describing all asset bundles and their aliases — or a
|
|
79
|
+
* function that resolves one, for manifests that aren't known synchronously at
|
|
80
|
+
* plugin-creation time (e.g. one produced by an asset pipeline such as `@assetpack/core`, or
|
|
81
|
+
* merged together from several sources in an app-owned module).
|
|
82
|
+
*
|
|
83
|
+
* **Prefer the function form for anything backed by a generated file.** A *static*
|
|
84
|
+
* `import manifest from "./manifest.gen.json"` in `vite.config.ts` makes Vite treat that file
|
|
85
|
+
* as a config dependency — restarting the whole server on every change to it — which is
|
|
86
|
+
* disastrous when the very same config's own asset pipeline rewrites that file on every
|
|
87
|
+
* startup: an infinite restart loop. The function form sidesteps this entirely: nothing in
|
|
88
|
+
* `vite.config.ts` itself reads or imports the file; the plugin calls your function lazily,
|
|
89
|
+
* from inside its own plugin hooks, whenever it needs a fresh manifest.
|
|
90
|
+
*
|
|
91
|
+
* The function receives an `ssrLoadModule`-like loader (bound to whichever context is
|
|
92
|
+
* available — the running dev server, or a dedicated temporary server with this plugin's own
|
|
93
|
+
* `resolve` forwarded during `vite build`) so it can load `@/`-aliased app modules the same
|
|
94
|
+
* way `content` / `characters` / `labels` do — e.g. to import a module that merges an asset
|
|
95
|
+
* pipeline's generated manifest with hand-written bundles. Return `undefined` if there's
|
|
96
|
+
* nothing to register yet (e.g. the pipeline hasn't produced output on a fresh checkout).
|
|
97
|
+
*
|
|
98
|
+
* The plugin calls this function whenever it (re)loads content — at startup, and on every
|
|
99
|
+
* hot-reload — and, since it generally can't know which file(s) your function's own import
|
|
100
|
+
* depends on, also on every other file change (excluding its own generated
|
|
101
|
+
* {@link VitePluginPixivnOptions.typeFilePath}), so a change to a manifest generated by
|
|
102
|
+
* another plugin is picked up without any direct coupling between the two.
|
|
103
|
+
*
|
|
104
|
+
* Either way — plain value or function — once a manifest is registered, the plugin:
|
|
105
|
+
* - writes `export const bundleIds` and `export const assetAliasIds` — `as const` runtime
|
|
106
|
+
* arrays of every bundle name and every asset alias found in the manifest — to
|
|
107
|
+
* {@link VitePluginPixivnOptions.typeFilePath}, and augments `PixivnBundleIds` /
|
|
108
|
+
* `PixivnAssetAliasIds` in `@drincs/pixi-vn/canvas` (the same `declare module` pattern used
|
|
109
|
+
* for `PixivnCharacterIds` / `PixivnLabelIds`), narrowing `BundleIdType` / `AssetAliasIdType`
|
|
110
|
+
* (also exported from `@drincs/pixi-vn/canvas`) from `string` to unions of known literals.
|
|
111
|
+
* - seeds the dev-server's `GET /__pixi-vn/assets/manifest` endpoint with this manifest
|
|
112
|
+
* immediately, so it is available without the browser having to `POST` it first (see
|
|
113
|
+
* {@link PIXIVN_DEV_API_ASSETS_MANIFEST}). A later `POST` (deprecated) still overrides it.
|
|
114
|
+
*
|
|
115
|
+
* `api.setAssetsManifest(manifest)` remains available as a lower-level escape hatch for
|
|
116
|
+
* pushing an already-computed manifest from outside this plugin entirely (e.g. from a
|
|
117
|
+
* separate Vite plugin that doesn't need `ssrLoadModule` access).
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* // vite.config.ts — a manifest merged from a generated file plus hand-written bundles
|
|
122
|
+
* vitePluginPixivn({
|
|
123
|
+
* typeFilePath: "./src/pixi-vn.keys.gen.ts",
|
|
124
|
+
* assetsManifest: async (ssrLoadModule) => {
|
|
125
|
+
* const mod = await ssrLoadModule("/src/assets/index.ts");
|
|
126
|
+
* return mod.manifest;
|
|
127
|
+
* },
|
|
128
|
+
* })
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* // vite.config.ts — a genuinely static manifest, known up front
|
|
134
|
+
* vitePluginPixivn({
|
|
135
|
+
* assetsManifest: { bundles: [{ name: "ui", assets: { logo: "logo.png" } }] },
|
|
136
|
+
* typeFilePath: "./src/pixi-vn.keys.gen.ts",
|
|
137
|
+
* })
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
assetsManifest?: AssetsManifestOption;
|
|
71
141
|
}
|
|
72
142
|
/**
|
|
73
143
|
* Creates a Vite plugin for Pixi'VN integration.
|
|
@@ -98,6 +168,17 @@ interface VitePluginPixivnOptions {
|
|
|
98
168
|
* `characterIds` and `labelIds`. These arrays can be used for runtime validation
|
|
99
169
|
* (e.g. `z.enum(characterIds)`) and are regenerated on the same triggers as the type file.
|
|
100
170
|
*
|
|
171
|
+
* **Asset bundles / aliases**
|
|
172
|
+
*
|
|
173
|
+
* When a PIXI.js `AssetsManifest` is registered — via {@link VitePluginPixivnOptions.assetsManifest}
|
|
174
|
+
* or, for manifests produced by an async asset pipeline, `api.setAssetsManifest(manifest)` — the
|
|
175
|
+
* same {@link VitePluginPixivnOptions.typeFilePath} also gets `export const bundleIds` /
|
|
176
|
+
* `export const assetAliasIds` (`as const` arrays) plus `declare module` augmentations for
|
|
177
|
+
* `PixivnBundleIds` / `PixivnAssetAliasIds` in `@drincs/pixi-vn/canvas` — narrowing that module's
|
|
178
|
+
* `BundleIdType` / `AssetAliasIdType` from `string` to unions of known literals, exactly like
|
|
179
|
+
* `PixivnCharacterIds` / `PixivnLabelIds` narrow `CharacterIdType` / `LabelIdType` above. The
|
|
180
|
+
* manifest also immediately backs the `GET /__pixi-vn/assets/manifest` endpoint below.
|
|
181
|
+
*
|
|
101
182
|
* **External label providers**
|
|
102
183
|
*
|
|
103
184
|
* Other Vite plugins can inject label IDs via the plugin API without needing to register
|
|
@@ -113,8 +194,11 @@ interface VitePluginPixivnOptions {
|
|
|
113
194
|
* - `POST /__pixi-vn/characters` — *(deprecated)* update from client; use the `characters` option instead
|
|
114
195
|
* - `GET /__pixi-vn/labels` — retrieve narration labels
|
|
115
196
|
* - `POST /__pixi-vn/labels` — *(deprecated)* update from client; use the `labels` / `content` option instead
|
|
116
|
-
* - `GET /__pixi-vn/assets/manifest` — retrieve PIXI assets manifest
|
|
117
|
-
*
|
|
197
|
+
* - `GET /__pixi-vn/assets/manifest` — retrieve PIXI assets manifest (immediately available
|
|
198
|
+
* when the `assetsManifest` option is set or `api.setAssetsManifest` has been called; otherwise
|
|
199
|
+
* 404 until a client `POST`)
|
|
200
|
+
* - `POST /__pixi-vn/assets/manifest` — *(deprecated)* update from client; use the
|
|
201
|
+
* `assetsManifest` option instead
|
|
118
202
|
* - `GET /__pixi-vn/canvas-options` — retrieve canvas rendering options
|
|
119
203
|
* - `POST /__pixi-vn/canvas-options` — update canvas options from client
|
|
120
204
|
*
|
|
@@ -125,6 +209,9 @@ interface VitePluginPixivnOptions {
|
|
|
125
209
|
* - `api.onReload(cb)` — register a callback that fires after every hot-content-reload.
|
|
126
210
|
* - `api.setExternalLabels(providerId, labels)` — add/replace labels from an external provider.
|
|
127
211
|
* - `api.clearExternalLabels(providerId)` — remove labels previously set for a provider.
|
|
212
|
+
* - `api.setAssetsManifest(manifest)` — register/replace the assets manifest after
|
|
213
|
+
* plugin-creation time (e.g. once an async asset pipeline finishes); see
|
|
214
|
+
* {@link VitePluginPixivnOptions.assetsManifest}.
|
|
128
215
|
*
|
|
129
216
|
* @example
|
|
130
217
|
* ```ts
|
package/dist/vite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$1,b,c as c$1,d}from'./chunk-3BBZHKU4.mjs';export{c as PIXIVN_DEV_API_ASSETS_MANIFEST,d as PIXIVN_DEV_API_CANVAS_OPTIONS,a as PIXIVN_DEV_API_CHARACTERS,b as PIXIVN_DEV_API_LABELS}from'./chunk-3BBZHKU4.mjs';import {a,c}from'./chunk-K7JIC2F2.mjs';import {mkdirSync,writeFileSync,readFileSync}from'fs';import {isAbsolute,resolve,dirname}from'path';import {glob}from'tinyglobby';var
|
|
2
|
-
`),"utf-8");}function
|
|
1
|
+
import {a as a$1,b,c as c$1,d}from'./chunk-3BBZHKU4.mjs';export{c as PIXIVN_DEV_API_ASSETS_MANIFEST,d as PIXIVN_DEV_API_CANVAS_OPTIONS,a as PIXIVN_DEV_API_CHARACTERS,b as PIXIVN_DEV_API_LABELS}from'./chunk-3BBZHKU4.mjs';import {a,c}from'./chunk-K7JIC2F2.mjs';import {mkdirSync,writeFileSync,readFileSync}from'fs';import {isAbsolute,resolve,dirname}from'path';import {glob}from'tinyglobby';var k=a((it,N)=>{var A=process||{},V=A.argv||[],w=A.env||{},K=!(w.NO_COLOR||V.includes("--no-color"))&&(!!w.FORCE_COLOR||V.includes("--color")||A.platform==="win32"||(A.stdout||{}).isTTY&&w.TERM!=="dumb"||!!w.CI),z=(r,t,u=r)=>m=>{let o=""+m,a=o.indexOf(t,r.length);return ~a?r+U(o,t,u,a)+t:r+o+t},U=(r,t,u,m)=>{let o="",a=0;do o+=r.substring(a,m)+u,a=m+t.length,m=r.indexOf(t,a);while(~m);return o+r.substring(a)},J=(r=K)=>{let t=r?z:()=>String;return {isColorSupported:r,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};N.exports=J();N.exports.createColors=J;});var R=c(k(),1);var x=R.default.cyan("(pixi-vn)");function _(r){return r?Array.isArray(r)?r:[r]:[]}function et(r){return r?r.bundles.map(t=>t.name):[]}function nt(r){if(!r)return [];let t=new Set;for(let u of r.bundles){let m=u.assets;if(Array.isArray(m))for(let o of m){let a=o.alias;if(a)for(let g of Array.isArray(a)?a:[a])t.add(g);}else if(m&&typeof m=="object")for(let o of Object.keys(m))t.add(o);}return Array.from(t)}function st(r){let t=[],u=[];for(let m of r)try{let o=readFileSync(m,"utf-8"),a=/newLabel\(\s*["']([^"']+)["']/g,g;for(;(g=a.exec(o))!==null;)u.push(g[1]);let h=/new\s+\w*[Cc]haracter\(\s*["']([^"']+)["']/g;for(;(g=h.exec(o))!==null;)t.push(g[1]);}catch{}return {charIds:t,labelIds:u}}function rt(r){let t,u,m=new Promise(e=>{u=e;}),o=[..._(r?.content),..._(r?.characters),..._(r?.labels)],a=[],g=[],h=new Set,L=[],y=typeof r?.assetsManifest=="function",p=typeof r?.assetsManifest=="function"?void 0:r?.assetsManifest;async function P(e){if(typeof r?.assetsManifest=="function")try{let s=await r.assetsManifest(e);p=s,v.manifest=s??null;}catch(s){t?.logger.error(`${x} Failed to resolve the assets manifest.`,{error:s instanceof Error?s:new Error(String(s)),timestamp:true});}}let I=new Map;function B(){if(!r?.typeFilePath||!t)return null;let e=r.typeFilePath;return isAbsolute(e)?e:resolve(t.root,e)}function D(){let e=[...g,...Array.from(I.values()).flat()];return Array.from(new Set(e))}function j(e,s,c,n,l){mkdirSync(dirname(e),{recursive:true});let i=["/* eslint-disable */","// noinspection JSUnusedGlobalSymbols","// This file is auto-generated by @drincs/pixi-vn vite plugin. Do not edit manually."];if(s.length>0){i.push('declare module "@drincs/pixi-vn/characters" {'),i.push(" interface PixivnCharacterIds {");for(let f of s)i.push(` ${JSON.stringify(f)}: never;`);i.push(" }"),i.push("}");}if(c.length>0){i.push('declare module "@drincs/pixi-vn/narration" {'),i.push(" interface PixivnLabelIds {");for(let f of c)i.push(` ${JSON.stringify(f)}: never;`);i.push(" }"),i.push("}");}if(n.length>0||l.length>0){if(i.push('declare module "@drincs/pixi-vn/canvas" {'),n.length>0){i.push(" interface PixivnBundleIds {");for(let f of n)i.push(` ${JSON.stringify(f)}: never;`);i.push(" }");}if(l.length>0){i.push(" interface PixivnAssetAliasIds {");for(let f of l)i.push(` ${JSON.stringify(f)}: never;`);i.push(" }");}i.push("}");}i.push(`export const characterIds = ${JSON.stringify(s)} as const;`);{let f=Object.fromEntries(s.map(d=>[d,d]));i.push(`export const characterIdsEnum = ${JSON.stringify(f)} as const;`);}i.push(`export const labelIds = ${JSON.stringify(c)} as const;`);{let f=Object.fromEntries(c.map(d=>[d,d]));i.push(`export const labelIdsEnum = ${JSON.stringify(f)} as const;`);}i.push(`export const bundleIds = ${JSON.stringify(n)} as const;`);{let f=Object.fromEntries(n.map(d=>[d,d]));i.push(`export const bundleIdsEnum = ${JSON.stringify(f)} as const;`);}i.push(`export const assetAliasIds = ${JSON.stringify(l)} as const;`);{let f=Object.fromEntries(l.map(d=>[d,d]));i.push(`export const assetAliasIdsEnum = ${JSON.stringify(f)} as const;`);}i.push(""),writeFileSync(e,i.join(`
|
|
2
|
+
`),"utf-8");}function b$1(){let e=B();if(e)try{j(e,a.map(s=>s.id),D(),et(p),nt(p));}catch(s){t?.logger.error(`${x} Failed to write keys file "${e}".`,{error:s instanceof Error?s:new Error(String(s)),timestamp:true});}}async function F(e,s=[]){try{a=(await e("@drincs/pixi-vn/characters")).RegisteredCharacters?.values()??[];}catch{a=[];}try{g=(await e("@drincs/pixi-vn/narration")).RegisteredLabels?.keys()??[];}catch{g=[];}if(s.length>0){let{charIds:n,labelIds:l}=st(s),i=new Set(a.map(d=>d.id)),f=new Set(g);for(let d of n)i.has(d)||a.push({id:d});for(let d of l)f.has(d)||g.push(d);}let c=a.map(n=>n.id).join(", ")||"none";t?.logger.info(`${x} ${R.default.dim(`${a.length} character(s): [${c}], ${g.length} label(s)`)}`,{timestamp:true});}async function $(e,s){try{await e("@drincs/pixi-vn/characters");}catch{}try{await e("@drincs/pixi-vn/narration");}catch{}let c=await glob(o,{cwd:s,absolute:true,onlyFiles:true}),n=[];for(let l of c){h.add(l);try{await e(l);}catch{n.push(l);}}await F(e,n),await P(e),b$1(),u();}async function X(e){for(let n of h)for(let l of e.moduleGraph.getModulesByFile(n)??[])e.moduleGraph.invalidateModule(l);try{(await e.ssrLoadModule("@drincs/pixi-vn/characters")).RegisteredCharacters?.clear?.();}catch{}try{(await e.ssrLoadModule("@drincs/pixi-vn/narration")).RegisteredLabels?.clear?.();}catch{}let s=await glob(o,{cwd:t.root,absolute:true,onlyFiles:true}),c=[];for(let n of s){h.add(n);try{await e.ssrLoadModule(n);}catch{c.push(n);}}await F(n=>e.ssrLoadModule(n),c),await P(n=>e.ssrLoadModule(n)),b$1();for(let n of L)n();}let v={characters:null,labels:null,manifest:p??null,canvasOptions:null};function S(e,s){return (c,n)=>{if(n.setHeader("Content-Type","application/json"),c.method==="GET"){let l=v[e];if(l===null){n.statusCode=404,n.end(JSON.stringify({error:`${s} not initialized`}));return}n.statusCode=200,n.end(JSON.stringify(l));return}if(c.method==="POST"){let l="";c.on("data",i=>{l+=i.toString();}),c.on("end",()=>{try{v[e]=JSON.parse(l),n.statusCode=201,n.end(JSON.stringify({message:`${s} updated successfully`}));}catch{n.statusCode=400,n.end(JSON.stringify({error:`Invalid JSON format for ${s}`}));}});}}}return {name:"vite-plugin-pixi-vn",enforce:"pre",api:{contentLoaded:m,get characters(){return a},onReload(e){L.push(e);},setExternalLabels(e,s){I.set(e,s),b$1();},clearExternalLabels(e){I.delete(e),b$1();},setAssetsManifest(e){p=e,v.manifest=e,b$1();}},config(e,s){if(s.command==="serve"&&o.length>0)return {ssr:{noExternal:["@drincs/pixi-vn"]}}},configResolved(e){t=e,o.length===0&&!y&&(b$1(),u());},async buildStart(){if(t?.command!=="build"||o.length===0&&!y)return;let{createServer:e}=await import('vite'),s=await e({root:t.root,configFile:false,resolve:t.resolve,server:{middlewareMode:true},appType:"custom",logLevel:"silent",optimizeDeps:{noDiscovery:true},ssr:{noExternal:["@drincs/pixi-vn"]}});try{await $(c=>s.ssrLoadModule(c),t.root);}catch{u();}finally{await s.close();}},configureServer(e){(o.length>0||y)&&$(s=>e.ssrLoadModule(s),t.root).catch(()=>{u();}),e.middlewares.use(a$1,S("characters","Characters")),e.middlewares.use(b,S("labels","Labels")),e.middlewares.use(c$1,S("manifest","Manifest")),e.middlewares.use(d,S("canvasOptions","Canvas options"));},hotUpdate({file:e,server:s}){let c=B();if(c&&e===c)return [];if(o.length>0&&h.has(e))return X(s).catch(n=>{t?.logger.error(`${x} Failed to reload content.`,{error:n instanceof Error?n:new Error(String(n)),timestamp:true});}),[];y&&P(n=>s.ssrLoadModule(n)).then(()=>b$1()).catch(n=>{t?.logger.error(`${x} Failed to refresh the assets manifest.`,{error:n instanceof Error?n:new Error(String(n)),timestamp:true});});}}}export{rt as vitePluginPixivn};
|