@drincs/pixi-vn 1.5.13 → 1.5.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +8 -3
  2. package/dist/canvas.cjs +3 -2
  3. package/dist/canvas.d.cts +46 -105
  4. package/dist/canvas.d.ts +46 -105
  5. package/dist/canvas.mjs +3 -2
  6. package/dist/characters.cjs +2 -1
  7. package/dist/characters.mjs +2 -1
  8. package/dist/chunk-46QBDRUK.mjs +2 -0
  9. package/dist/chunk-52EK6LYW.mjs +2 -0
  10. package/dist/chunk-INJYRMJ3.mjs +2 -0
  11. package/dist/{chunk-TTRUPDAB.mjs → chunk-JJFD2BVW.mjs} +2 -1
  12. package/dist/chunk-JJFD2BVW.mjs.map +1 -0
  13. package/dist/chunk-OXRIVLY2.mjs +2 -0
  14. package/dist/chunk-SOFV7YZ5.mjs +2 -0
  15. package/dist/chunk-XZMYXKAY.mjs +2 -0
  16. package/dist/core.cjs +1 -0
  17. package/dist/core.d.cts +399 -0
  18. package/dist/core.d.ts +399 -0
  19. package/dist/core.mjs +1 -0
  20. package/dist/history.cjs +2 -1
  21. package/dist/history.d.cts +1 -1
  22. package/dist/history.d.ts +1 -1
  23. package/dist/history.mjs +2 -1
  24. package/dist/index.cjs +3 -2
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +9 -10
  27. package/dist/index.d.ts +9 -10
  28. package/dist/index.mjs +3 -2
  29. package/dist/index.mjs.map +1 -0
  30. package/dist/motion.cjs +2 -0
  31. package/dist/motion.cjs.map +1 -0
  32. package/dist/motion.d.cts +96 -0
  33. package/dist/motion.d.ts +96 -0
  34. package/dist/motion.mjs +2 -0
  35. package/dist/motion.mjs.map +1 -0
  36. package/dist/narration.cjs +3 -2
  37. package/dist/narration.mjs +3 -2
  38. package/dist/pixi/browser.js +170 -167
  39. package/dist/sound.cjs +2 -1
  40. package/dist/sound.mjs +2 -1
  41. package/dist/storage.cjs +2 -1
  42. package/dist/storage.mjs +2 -1
  43. package/dist/vite-listener.cjs +2 -1
  44. package/dist/vite-listener.cjs.map +1 -0
  45. package/dist/vite-listener.mjs +2 -1
  46. package/dist/vite-listener.mjs.map +1 -0
  47. package/dist/vite.cjs +2 -1
  48. package/dist/vite.cjs.map +1 -0
  49. package/dist/vite.mjs +2 -1
  50. package/dist/vite.mjs.map +1 -0
  51. package/package.json +27 -10
  52. package/dist/chunk-6GO4XVS7.mjs +0 -1
  53. package/dist/chunk-6IVCTY6P.mjs +0 -1
  54. package/dist/chunk-GNJIUFU2.mjs +0 -1
  55. package/dist/chunk-HVEJJGVC.mjs +0 -1
  56. package/dist/chunk-XDBHD3IV.mjs +0 -1
  57. package/dist/chunk-XSN6P5JL.mjs +0 -0
  58. package/dist/unifier.cjs +0 -1
  59. package/dist/unifier.mjs +0 -1
package/dist/storage.mjs CHANGED
@@ -1 +1,2 @@
1
- export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-XDBHD3IV.mjs';export{a as SYSTEM_RESERVED_STORAGE_KEYS}from'./chunk-6GO4XVS7.mjs';import'./chunk-6IVCTY6P.mjs';import'./chunk-GNJIUFU2.mjs';
1
+ export{a as StorageManagerStatic,b as StoredClassModel,c as storage}from'./chunk-XZMYXKAY.mjs';export{a as SYSTEM_RESERVED_STORAGE_KEYS}from'./chunk-OXRIVLY2.mjs';import'./chunk-INJYRMJ3.mjs';import'./chunk-46QBDRUK.mjs';//# sourceMappingURL=storage.mjs.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzdG9yYWdlLm1qcyJ9
@@ -1 +1,2 @@
1
- 'use strict';var canvas=require('@drincs/pixi-vn/canvas'),characters=require('@drincs/pixi-vn/characters'),narration=require('@drincs/pixi-vn/narration'),o=require('@drincs/pixi-vn/pixi.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);function h(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(h()){try{let e=characters.RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=narration.RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=o__default.default.Assets.resolver._assetMap,r=o__default.default.Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.canvas.app.screen.height,width:canvas.canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}exports.setupPixivnViteData=l;
1
+ 'use strict';var canvas=require('@drincs/pixi-vn/canvas'),characters=require('@drincs/pixi-vn/characters'),narration=require('@drincs/pixi-vn/narration'),o=require('@drincs/pixi-vn/pixi.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);function h(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(h()){try{let e=characters.RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=narration.RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=o__default.default.Assets.resolver._assetMap,r=o__default.default.Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.canvas.app.screen.height,width:canvas.canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}exports.setupPixivnViteData=l;//# sourceMappingURL=vite-listener.cjs.map
2
+ //# sourceMappingURL=vite-listener.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite-listener/plugins.ts"],"names":["isViteDevelopmentMode","setupPixivnViteData","characters","RegisteredCharacters","labels","RegisteredLabels","assetMap","PIXI","bundles","manifest","bundleName","assets","res","asset","existing","options","canvas"],"mappings":"+SAUA,SAASA,CAAAA,EAAiC,CACtC,GAAI,CAGA,OAAO,IAAI,QAAA,CACP,6GACJ,CAAA,EACJ,CAAA,KAAQ,CACJ,OAAO,MACX,CACJ,CAOO,SAASC,CAAAA,EAAsB,CAElC,GAAKD,CAAAA,EAAsB,CAI3B,CAAA,GAAI,CACA,IAAME,CAAAA,CAAaC,+BAAAA,CAAqB,MAAA,EAAO,CAC/C,KAAA,CAAM,sBAAuB,CACzB,MAAA,CAAQ,MAAA,CACR,OAAA,CAAS,CAAE,cAAA,CAAgB,kBAAmB,CAAA,CAC9C,IAAA,CAAM,KAAK,SAAA,CAAUD,CAAU,CACnC,CAAC,EACL,CAAA,KAAY,CAAC,CACb,GAAI,CACA,IAAME,CAAAA,CAASC,0BAAAA,CAAiB,IAAA,EAAK,CACrC,KAAA,CAAM,kBAAmB,CACrB,MAAA,CAAQ,MAAA,CACR,OAAA,CAAS,CAAE,cAAA,CAAgB,kBAAmB,CAAA,CAC9C,IAAA,CAAM,IAAA,CAAK,SAAA,CAAUD,CAAM,CAC/B,CAAC,EACL,CAAA,KAAY,CAAC,CACb,GAAI,CACA,IAAME,CAAAA,CAAWC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redCharacters } from \"@drincs/pixi-vn/characters\";\nimport { RegisteredLabels } from \"@drincs/pixi-vn/narration\";\nimport type { ApplicationOptions, AssetsManifest, UnresolvedAsset } from \"@drincs/pixi-vn/pixi.js\";\nimport { default as PIXI } from \"@drincs/pixi-vn/pixi.js\";\n\n/**\n * Checks if the code is running in Vite development mode.\n * Uses indirect access to avoid TypeScript compilation issues with import.meta in commonjs modules.\n */\nfunction isViteDevelopmentMode(): boolean {\n try {\n // Use Function constructor to indirectly access import.meta at runtime\n // This avoids direct eval while still bypassing TypeScript's static analysis\n return new Function(\n 'return typeof import !== \"undefined\" && typeof import.meta !== \"undefined\" && import.meta.env?.DEV === true',\n )();\n } catch {\n return false;\n }\n}\n\n/**\n * Function that setup the pixivn vite data.\n * This function should be called in the client side, after the RegisteredCharacters and RegisteredLabels are populated.\n * **Note:** This function only runs in development mode and does nothing in production.\n */\nexport function setupPixivnViteData() {\n // Only run in development mode\n if (!isViteDevelopmentMode()) {\n return;\n }\n\n try {\n const characters = RegisteredCharacters.values();\n fetch(\"/pixi-vn/characters\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(characters),\n });\n } catch (e) {}\n try {\n const labels = RegisteredLabels.keys();\n fetch(\"/pixi-vn/labels\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(labels),\n });\n } catch (e) {}\n try {\n const assetMap = PIXI.Assets.resolver[\"_assetMap\"];\n const bundles: { [key: string]: string[] } = PIXI.Assets.resolver[\"_bundles\"];\n const manifest: AssetsManifest = {\n bundles: [],\n };\n Object.entries(bundles).forEach(([bundleName, assets]) => {\n let res: UnresolvedAsset[] = [];\n assets.forEach((asset) => {\n if (assetMap[asset]) {\n const existing = assetMap[asset];\n res = [...res, ...existing];\n }\n });\n manifest.bundles.push({\n name: bundleName,\n assets: res,\n });\n });\n fetch(\"/pixi-vn/assets/manifest\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(manifest),\n });\n } catch (e) {}\n try {\n const options: Partial<ApplicationOptions> = {\n height: canvas.app.screen.height,\n width: canvas.app.screen.width,\n };\n fetch(\"/pixi-vn/canvas/options\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(options),\n });\n } catch (e) {}\n}\n"]}
@@ -1 +1,2 @@
1
- import'./chunk-TTRUPDAB.mjs';import {canvas}from'@drincs/pixi-vn/canvas';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';import {RegisteredLabels}from'@drincs/pixi-vn/narration';import o from'@drincs/pixi-vn/pixi.js';function h(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(h()){try{let e=RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=o.Assets.resolver._assetMap,r=o.Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.app.screen.height,width:canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}export{l as setupPixivnViteData};
1
+ import'./chunk-JJFD2BVW.mjs';import {canvas}from'@drincs/pixi-vn/canvas';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';import {RegisteredLabels}from'@drincs/pixi-vn/narration';import o from'@drincs/pixi-vn/pixi.js';function h(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(h()){try{let e=RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=o.Assets.resolver._assetMap,r=o.Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.app.screen.height,width:canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}export{l as setupPixivnViteData};//# sourceMappingURL=vite-listener.mjs.map
2
+ //# sourceMappingURL=vite-listener.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite-listener/plugins.ts"],"names":["isViteDevelopmentMode","setupPixivnViteData","characters","RegisteredCharacters","labels","RegisteredLabels","assetMap","PIXI","bundles","manifest","bundleName","assets","res","asset","existing","options","canvas"],"mappings":"uOAUA,SAASA,CAAAA,EAAiC,CACtC,GAAI,CAGA,OAAO,IAAI,QAAA,CACP,6GACJ,CAAA,EACJ,CAAA,KAAQ,CACJ,OAAO,MACX,CACJ,CAOO,SAASC,CAAAA,EAAsB,CAElC,GAAKD,CAAAA,EAAsB,CAI3B,CAAA,GAAI,CACA,IAAME,CAAAA,CAAaC,oBAAAA,CAAqB,MAAA,EAAO,CAC/C,KAAA,CAAM,sBAAuB,CACzB,MAAA,CAAQ,MAAA,CACR,OAAA,CAAS,CAAE,cAAA,CAAgB,kBAAmB,CAAA,CAC9C,IAAA,CAAM,KAAK,SAAA,CAAUD,CAAU,CACnC,CAAC,EACL,CAAA,KAAY,CAAC,CACb,GAAI,CACA,IAAME,CAAAA,CAAS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,yBAAA,CAA2B,CAC7B,MAAA,CAAQ,MAAA,CACR,OAAA,CAAS,CAAE,eAAgB,kBAAmB,CAAA,CAC9C,IAAA,CAAM,IAAA,CAAK,SAAA,CAAUD,CAAO,CAChC,CAAC,EACL,CAAA,KAAY,CAAC,CAAA,CACjB","file":"vite-listener.mjs","sourcesContent":["import { canvas } from \"@drincs/pixi-vn/canvas\";\nimport { RegisteredCharacters } from \"@drincs/pixi-vn/characters\";\nimport { RegisteredLabels } from \"@drincs/pixi-vn/narration\";\nimport type { ApplicationOptions, AssetsManifest, UnresolvedAsset } from \"@drincs/pixi-vn/pixi.js\";\nimport { default as PIXI } from \"@drincs/pixi-vn/pixi.js\";\n\n/**\n * Checks if the code is running in Vite development mode.\n * Uses indirect access to avoid TypeScript compilation issues with import.meta in commonjs modules.\n */\nfunction isViteDevelopmentMode(): boolean {\n try {\n // Use Function constructor to indirectly access import.meta at runtime\n // This avoids direct eval while still bypassing TypeScript's static analysis\n return new Function(\n 'return typeof import !== \"undefined\" && typeof import.meta !== \"undefined\" && import.meta.env?.DEV === true',\n )();\n } catch {\n return false;\n }\n}\n\n/**\n * Function that setup the pixivn vite data.\n * This function should be called in the client side, after the RegisteredCharacters and RegisteredLabels are populated.\n * **Note:** This function only runs in development mode and does nothing in production.\n */\nexport function setupPixivnViteData() {\n // Only run in development mode\n if (!isViteDevelopmentMode()) {\n return;\n }\n\n try {\n const characters = RegisteredCharacters.values();\n fetch(\"/pixi-vn/characters\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(characters),\n });\n } catch (e) {}\n try {\n const labels = RegisteredLabels.keys();\n fetch(\"/pixi-vn/labels\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(labels),\n });\n } catch (e) {}\n try {\n const assetMap = PIXI.Assets.resolver[\"_assetMap\"];\n const bundles: { [key: string]: string[] } = PIXI.Assets.resolver[\"_bundles\"];\n const manifest: AssetsManifest = {\n bundles: [],\n };\n Object.entries(bundles).forEach(([bundleName, assets]) => {\n let res: UnresolvedAsset[] = [];\n assets.forEach((asset) => {\n if (assetMap[asset]) {\n const existing = assetMap[asset];\n res = [...res, ...existing];\n }\n });\n manifest.bundles.push({\n name: bundleName,\n assets: res,\n });\n });\n fetch(\"/pixi-vn/assets/manifest\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(manifest),\n });\n } catch (e) {}\n try {\n const options: Partial<ApplicationOptions> = {\n height: canvas.app.screen.height,\n width: canvas.app.screen.width,\n };\n fetch(\"/pixi-vn/canvas/options\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(options),\n });\n } catch (e) {}\n}\n"]}
package/dist/vite.cjs CHANGED
@@ -1 +1,2 @@
1
- 'use strict';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}exports.vitePluginPixivn=u;
1
+ 'use strict';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}exports.vitePluginPixivn=u;//# sourceMappingURL=vite.cjs.map
2
+ //# sourceMappingURL=vite.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite/plugins.ts"],"names":["characters","labels","manifest","options","vitePluginPixivn","server","req","res","body","chunk"],"mappings":"aAIA,IAAIA,CAAAA,CAA0C,IAAA,CAC1CC,CAAAA,CAA0B,IAAA,CAC1BC,CAAAA,CAAkC,KAClCC,CAAAA,CAA8C,IAAA,CAa3C,SAASC,CAAAA,EAA2B,CACvC,OAAO,CACH,IAAA,CAAM,qBAAA,CACN,KAAA,CAAO,OAAA,CACP,eAAA,CAAgBC,CAAAA,CAAQ,CACpBA,CAAAA,CAAO,WAAA,CAAY,GAAA,CAAI,qBAAA,CAAuB,CAACC,CAAAA,CAAKC,IAAQ,CAGxD,GAFAA,CAAAA,CAAI,SAAA,CAAU,cAAA,CAAgB,kBAAkB,EAE5CD,C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AM,CAAA,CACzCH,CAAAA,CAAI,EAAA,CAAG,KAAA,CAAO,IAAM,CAChB,GAAI,CACAH,CAAAA,CAAU,IAAA,CAAK,KAAA,CAAMK,CAAI,CAAA,CACzBD,CAAAA,CAAI,UAAA,CAAa,GAAA,CACjBA,CAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,SAAA,CAAU,CAAE,QAAS,8BAA+B,CAAC,CAAC,EACvE,CAAA,KAAQ,CACJA,EAAI,UAAA,CAAa,GAAA,CACjBA,CAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,SAAA,CAAU,CAAE,KAAA,CAAO,qBAAsB,CAAC,CAAC,EAC5D,CACJ,CAAC,EACL,CACJ,CAAC,EACL,CACJ,CACJ","file":"vite.cjs","sourcesContent":["import type { CharacterInterface } from \"@drincs/pixi-vn\";\nimport type { ApplicationOptions, AssetsManifest } from \"@drincs/pixi-vn/pixi.js\";\nimport { Plugin } from \"vite\";\n\nlet characters: CharacterInterface[] | null = null;\nlet labels: string[] | null = null;\nlet manifest: AssetsManifest | null = null;\nlet options: Partial<ApplicationOptions> | null = null;\n\n/**\n * Vite plugin to handle pixi-vn related endpoints.\n * This plugin only runs in development mode (serve).\n * Endpoints:\n * - GET /pixi-vn/characters -> list of registered characters\n * - POST /pixi-vn/characters -> update the list of registered characters\n * - GET /pixi-vn/labels -> list of registered labels\n * - POST /pixi-vn/labels -> update the list of registered labels\n * - GET /pixi-vn/assets/manifest -> assets manifest\n * - POST /pixi-vn/assets/manifest -> update assets manifest\n */\nexport function vitePluginPixivn(): Plugin {\n return {\n name: \"vite-plugin-pixi-vn\",\n apply: \"serve\",\n configureServer(server) {\n server.middlewares.use(\"/pixi-vn/characters\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!characters) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Characters not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(characters));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n characters = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Characters updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/labels\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!labels) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Labels not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(labels));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n labels = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Labels updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/assets/manifest\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!manifest) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Manifest not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(manifest));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n manifest = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Manifest updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/canvas/options\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!options) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Options not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(options));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n options = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Options updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n },\n };\n}\n"]}
package/dist/vite.mjs CHANGED
@@ -1 +1,2 @@
1
- import'./chunk-TTRUPDAB.mjs';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}export{u as vitePluginPixivn};
1
+ import'./chunk-JJFD2BVW.mjs';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}export{u as vitePluginPixivn};//# sourceMappingURL=vite.mjs.map
2
+ //# sourceMappingURL=vite.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite/plugins.ts"],"names":["characters","labels","manifest","options","vitePluginPixivn","server","req","res","body","chunk"],"mappings":"6BAIA,IAAIA,CAAAA,CAA0C,IAAA,CAC1CC,CAAAA,CAA0B,IAAA,CAC1BC,CAAAA,CAAkC,KAClCC,CAAAA,CAA8C,IAAA,CAa3C,SAASC,CAAAA,EAA2B,CACvC,OAAO,CACH,IAAA,CAAM,qBAAA,CACN,KAAA,CAAO,OAAA,CACP,eAAA,CAAgBC,CAAAA,CAAQ,CACpBA,CAAAA,CAAO,WAAA,CAAY,GAAA,CAAI,qBAAA,CAAuB,CAACC,CAAAA,CAAKC,IAAQ,CAGxD,GAFAA,CAAAA,CAAI,SAAA,CAAU,cAAA,CAAgB,kBAAkB,EAE5CD,CAAAA,CAAI,MAAA,GAAW,KAAA,CAAO,CACtB,GAAI,CAACN,EAAY,CACbO,CAAAA,CAAI,UAAA,CAAa,GAAA,CACjBA,CAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,SAAA,CAAU,C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CAAa,GAAA,CACjBA,CAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,SAAA,CAAU,CAAE,QAAS,8BAA+B,CAAC,CAAC,EACvE,CAAA,KAAQ,CACJA,EAAI,UAAA,CAAa,GAAA,CACjBA,CAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,SAAA,CAAU,CAAE,KAAA,CAAO,qBAAsB,CAAC,CAAC,EAC5D,CACJ,CAAC,EACL,CACJ,CAAC,EACL,CACJ,CACJ","file":"vite.mjs","sourcesContent":["import type { CharacterInterface } from \"@drincs/pixi-vn\";\nimport type { ApplicationOptions, AssetsManifest } from \"@drincs/pixi-vn/pixi.js\";\nimport { Plugin } from \"vite\";\n\nlet characters: CharacterInterface[] | null = null;\nlet labels: string[] | null = null;\nlet manifest: AssetsManifest | null = null;\nlet options: Partial<ApplicationOptions> | null = null;\n\n/**\n * Vite plugin to handle pixi-vn related endpoints.\n * This plugin only runs in development mode (serve).\n * Endpoints:\n * - GET /pixi-vn/characters -> list of registered characters\n * - POST /pixi-vn/characters -> update the list of registered characters\n * - GET /pixi-vn/labels -> list of registered labels\n * - POST /pixi-vn/labels -> update the list of registered labels\n * - GET /pixi-vn/assets/manifest -> assets manifest\n * - POST /pixi-vn/assets/manifest -> update assets manifest\n */\nexport function vitePluginPixivn(): Plugin {\n return {\n name: \"vite-plugin-pixi-vn\",\n apply: \"serve\",\n configureServer(server) {\n server.middlewares.use(\"/pixi-vn/characters\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!characters) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Characters not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(characters));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n characters = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Characters updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/labels\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!labels) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Labels not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(labels));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n labels = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Labels updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/assets/manifest\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!manifest) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Manifest not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(manifest));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n manifest = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Manifest updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n\n server.middlewares.use(\"/pixi-vn/canvas/options\", (req, res) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n\n if (req.method === \"GET\") {\n if (!options) {\n res.statusCode = 404;\n res.end(JSON.stringify({ error: \"Options not initialized\" }));\n return;\n }\n res.statusCode = 200;\n res.end(JSON.stringify(options));\n }\n\n if (req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => (body += chunk));\n req.on(\"end\", () => {\n try {\n options = JSON.parse(body);\n res.statusCode = 201;\n res.end(JSON.stringify({ message: \"Options updated successfully\" }));\n } catch {\n res.statusCode = 400;\n res.end(JSON.stringify({ error: \"Invalid JSON format\" }));\n }\n });\n }\n });\n },\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drincs/pixi-vn",
3
- "version": "1.5.13",
3
+ "version": "1.5.18",
4
4
  "type": "module",
5
5
  "description": "Pixi'VN is a npm package that provides various features for creating visual novels.",
6
6
  "main": "./dist/index.cjs",
@@ -10,6 +10,7 @@
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {
13
+ "dev": "tsup --watch",
13
14
  "build": "tsup --config tsup.config.ts",
14
15
  "test": "vitest"
15
16
  },
@@ -20,18 +21,18 @@
20
21
  "require": "./dist/index.cjs",
21
22
  "default": "./dist/index.mjs"
22
23
  },
24
+ "./core": {
25
+ "types": "./dist/core.d.ts",
26
+ "import": "./dist/core.mjs",
27
+ "require": "./dist/core.cjs",
28
+ "default": "./dist/core.mjs"
29
+ },
23
30
  "./pixi.js": {
24
31
  "types": "./dist/pixi/index.d.ts",
25
32
  "import": "./dist/pixi/index.js",
26
33
  "require": "./dist/pixi/index.js",
27
34
  "default": "./dist/pixi/index.js"
28
35
  },
29
- "./unifier": {
30
- "types": "./dist/unifier.d.ts",
31
- "import": "./dist/unifier.mjs",
32
- "require": "./dist/unifier.cjs",
33
- "default": "./dist/unifier.mjs"
34
- },
35
36
  "./narration": {
36
37
  "types": "./dist/narration.d.ts",
37
38
  "import": "./dist/narration.mjs",
@@ -79,16 +80,22 @@
79
80
  "import": "./dist/vite-listener.mjs",
80
81
  "require": "./dist/vite-listener.cjs",
81
82
  "default": "./dist/vite-listener.mjs"
83
+ },
84
+ "./motion": {
85
+ "types": "./dist/motion.d.ts",
86
+ "import": "./dist/motion.mjs",
87
+ "require": "./dist/motion.cjs",
88
+ "default": "./dist/motion.mjs"
82
89
  }
83
90
  },
84
91
  "typesVersions": {
85
92
  "*": {
93
+ "core": [
94
+ "./dist/core.d.ts"
95
+ ],
86
96
  "pixi.js": [
87
97
  "./dist/pixi.d.ts"
88
98
  ],
89
- "unifier": [
90
- "./dist/unifier.d.ts"
91
- ],
92
99
  "narration": [
93
100
  "./dist/narration.d.ts"
94
101
  ],
@@ -106,6 +113,15 @@
106
113
  ],
107
114
  "characters": [
108
115
  "./dist/characters.d.ts"
116
+ ],
117
+ "vite": [
118
+ "./dist/vite.d.ts"
119
+ ],
120
+ "vite-listener": [
121
+ "./dist/vite-listener.d.ts"
122
+ ],
123
+ "motion": [
124
+ "./dist/motion.d.ts"
109
125
  ]
110
126
  }
111
127
  },
@@ -146,6 +162,7 @@
146
162
  "ts-node": "^10.9.2",
147
163
  "tsup": "^8.5.1",
148
164
  "typescript": "^5.9.3",
165
+ "vite": "^7.3.1",
149
166
  "vite-tsconfig-paths": "^6.0.3",
150
167
  "vitest": "^4.0.16"
151
168
  },
@@ -1 +0,0 @@
1
- var _={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};export{_ as a};
@@ -1 +0,0 @@
1
- import {d,f as f$1,e,g,h,i}from'./chunk-GNJIUFU2.mjs';var kt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Gt=new Set,zt=typeof process=="object"&&process?process:{},Mt=(_,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(_,e,i,s):console.error(`[${i}] ${e}: ${_}`);},Ft=globalThis.AbortController,Dt=globalThis.AbortSignal;if(typeof Ft>"u"){Dt=class{constructor(){d(this,"onabort");d(this,"_onabort",[]);d(this,"reason");d(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){d(this,"signal",new Dt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let _=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{_&&(_=false,Mt("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 Ht=_=>!Gt.has(_);var tt=_=>_&&_===Math.floor(_)&&_>0&&isFinite(_),jt=_=>tt(_)?_<=Math.pow(2,8)?Uint8Array:_<=Math.pow(2,16)?Uint16Array:_<=Math.pow(2,32)?Uint32Array:_<=Number.MAX_SAFE_INTEGER?yt:null:null,yt=class extends Array{constructor(_){super(_),this.fill(0);}},J,ct,Vt=(J=class{constructor(e$1,i){d(this,"heap");d(this,"length");if(!e(J,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e$1),this.length=0;}static create(e){let i=jt(e);if(!i)return [];g(J,ct,true);let s=new J(e,i);return g(J,ct,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,f$1(J,ct,false),J),Lt,Ut,k,U,H,ot,V,ft,dt,K,F,P,O,S,f,R,G,z,E,B,T,$,q,M,j,X,ht,W,gt,r,xt,rt,Q,St,I,Nt,lt,pt,bt,et,it,Ct,At,Ot,v,Rt,vt,st,Wt,wt,It=(wt=class{constructor(e$1){f$1(this,r);f$1(this,k);f$1(this,U);f$1(this,H);f$1(this,ot);f$1(this,V);f$1(this,ft);f$1(this,dt);f$1(this,K);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,F);f$1(this,P);f$1(this,O);f$1(this,S);f$1(this,f);f$1(this,R);f$1(this,G);f$1(this,z);f$1(this,E);f$1(this,B);f$1(this,T);f$1(this,$);f$1(this,q);f$1(this,M);f$1(this,j);f$1(this,X);f$1(this,ht);f$1(this,W);f$1(this,gt);f$1(this,rt,()=>{});f$1(this,Q,()=>{});f$1(this,St,()=>{});f$1(this,I,()=>false);f$1(this,lt,e=>{});f$1(this,pt,(e,i,s)=>{});f$1(this,bt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});d(this,Lt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:l,updateAgeOnGet:h$1,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:D,disposeAfter:b,noDisposeOnSet:Z,noUpdateTTL:N,maxSize:Y=0,maxEntrySize:y=0,sizeCalculation:m,fetchMethod:d$1,memoMethod:x,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:mt,ignoreFetchAbort:nt,perf:at}=e$1;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(g(this,K,at??kt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?jt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(g(this,k,i),g(this,U,Y),this.maxEntrySize=y||e(this,U),this.sizeCalculation=m,this.sizeCalculation){if(!e(this,U)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(g(this,dt,x),d$1!==void 0&&typeof d$1!="function")throw new TypeError("fetchMethod must be a function if specified");if(g(this,ft,d$1),g(this,ht,!!d$1),g(this,O,new Map),g(this,S,new Array(i).fill(void 0)),g(this,f,new Array(i).fill(void 0)),g(this,R,new ut(i)),g(this,G,new ut(i)),g(this,z,0),g(this,E,0),g(this,B,Vt.create(i)),g(this,F,0),g(this,P,0),typeof w=="function"&&g(this,H,w),typeof D=="function"&&g(this,ot,D),typeof b=="function"?(g(this,V,b),g(this,T,[])):(g(this,V,void 0),g(this,T,void 0)),g(this,X,!!e(this,H)),g(this,gt,!!e(this,ot)),g(this,W,!!e(this,V)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!nt,this.maxEntrySize!==0){if(e(this,U)!==0&&!tt(e(this,U)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,r,Nt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!h$1,this.updateAgeOnHas=!!u,this.ttlResolution=tt(o)||o===0?o:1,this.ttlAutopurge=!!l,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,r,xt).call(this);}if(e(this,k)===0&&this.ttl===0&&e(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,k)&&!e(this,U)){let Tt="LRU_CACHE_UNBOUNDED";Ht(Tt)&&(Gt.add(Tt),Mt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Tt,wt));}}get perf(){return e(this,K)}static unsafeExposeInternals(e$1){return {starts:e(e$1,q),ttls:e(e$1,M),autopurgeTimers:e(e$1,j),sizes:e(e$1,$),keyMap:e(e$1,O),keyList:e(e$1,S),valList:e(e$1,f),next:e(e$1,R),prev:e(e$1,G),get head(){return e(e$1,z)},get tail(){return e(e$1,E)},free:e(e$1,B),isBackgroundFetch:i=>{var s;return h(s=e$1,r,v).call(s,i)},backgroundFetch:(i,s,o,l)=>{var h$1;return h(h$1=e$1,r,Ot).call(h$1,i,s,o,l)},moveToTail:i=>{var s;return h(s=e$1,r,vt).call(s,i)},indexes:i=>{var s;return h(s=e$1,r,et).call(s,i)},rindexes:i=>{var s;return h(s=e$1,r,it).call(s,i)},isStale:i=>{var s;return e(s=e$1,I).call(s,i)}}}get max(){return e(this,k)}get maxSize(){return e(this,U)}get calculatedSize(){return e(this,P)}get size(){return e(this,F)}get fetchMethod(){return e(this,ft)}get memoMethod(){return e(this,dt)}get dispose(){return e(this,H)}get onInsert(){return e(this,ot)}get disposeAfter(){return e(this,V)}getRemainingTTL(e$1){return e(this,O).has(e$1)?1/0:0}*entries(){for(let e$1 of h(this,r,et).call(this))e(this,f)[e$1]!==void 0&&e(this,S)[e$1]!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield [e(this,S)[e$1],e(this,f)[e$1]]);}*rentries(){for(let e$1 of h(this,r,it).call(this))e(this,f)[e$1]!==void 0&&e(this,S)[e$1]!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield [e(this,S)[e$1],e(this,f)[e$1]]);}*keys(){for(let e$1 of h(this,r,et).call(this)){let i=e(this,S)[e$1];i!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield i);}}*rkeys(){for(let e$1 of h(this,r,it).call(this)){let i=e(this,S)[e$1];i!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield i);}}*values(){for(let e$1 of h(this,r,et).call(this))e(this,f)[e$1]!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}*rvalues(){for(let e$1 of h(this,r,it).call(this))e(this,f)[e$1]!==void 0&&!h(this,r,v).call(this,e(this,f)[e$1])&&(yield e(this,f)[e$1]);}[(Ut=Symbol.iterator,Lt=Symbol.toStringTag,Ut)](){return this.entries()}find(e$1,i={}){for(let s of h(this,r,et).call(this)){let o=e(this,f)[s],l=h(this,r,v).call(this,o)?o.__staleWhileFetching:o;if(l!==void 0&&e$1(l,e(this,S)[s],this))return this.get(e(this,S)[s],i)}}forEach(e$1,i=this){for(let s of h(this,r,et).call(this)){let o=e(this,f)[s],l=h(this,r,v).call(this,o)?o.__staleWhileFetching:o;l!==void 0&&e$1.call(i,l,e(this,S)[s],this);}}rforEach(e$1,i=this){for(let s of h(this,r,it).call(this)){let o=e(this,f)[s],l=h(this,r,v).call(this,o)?o.__staleWhileFetching:o;l!==void 0&&e$1.call(i,l,e(this,S)[s],this);}}purgeStale(){let e$1=false;for(let i of h(this,r,it).call(this,{allowStale:true}))e(this,I).call(this,i)&&(h(this,r,st).call(this,e(this,S)[i],"expire"),e$1=true);return e$1}info(e$1){let i=e(this,O).get(e$1);if(i===void 0)return;let s=e(this,f)[i],o=h(this,r,v).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let l={value:o};if(e(this,M)&&e(this,q)){let h=e(this,M)[i],u=e(this,q)[i];if(h&&u){let c=h-(e(this,K).now()-u);l.ttl=c,l.start=Date.now();}}return e(this,$)&&(l.size=e(this,$)[i]),l}dump(){let e$1=[];for(let i of h(this,r,et).call(this,{allowStale:true})){let s=e(this,S)[i],o=e(this,f)[i],l=h(this,r,v).call(this,o)?o.__staleWhileFetching:o;if(l===void 0||s===void 0)continue;let h$1={value:l};if(e(this,M)&&e(this,q)){h$1.ttl=e(this,M)[i];let u=e(this,K).now()-e(this,q)[i];h$1.start=Math.floor(Date.now()-u);}e(this,$)&&(h$1.size=e(this,$)[i]),e$1.unshift([s,h$1]);}return e$1}load(e$1){this.clear();for(let[i,s]of e$1){if(s.start){let o=Date.now()-s.start;s.start=e(this,K).now()-o;}this.set(i,s.value,s);}}set(e$1,i$1,s={}){var Z,N,Y,y;if(i$1===void 0)return this.delete(e$1),this;let{ttl:o=this.ttl,start:l,noDisposeOnSet:h$1=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,D=e(this,bt).call(this,e$1,i$1,s.size||0,u);if(this.maxEntrySize&&D>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),h(this,r,st).call(this,e$1,"set"),this;let b=e(this,F)===0?void 0:e(this,O).get(e$1);if(b===void 0)b=e(this,F)===0?e(this,E):e(this,B).length!==0?e(this,B).pop():e(this,F)===e(this,k)?h(this,r,At).call(this,false):e(this,F),e(this,S)[b]=e$1,e(this,f)[b]=i$1,e(this,O).set(e$1,b),e(this,R)[e(this,E)]=b,e(this,G)[b]=e(this,E),g(this,E,b),i(this,F)._++,e(this,pt).call(this,b,D,c),c&&(c.set="add"),w=false,e(this,gt)&&((Z=e(this,ot))==null||Z.call(this,i$1,e$1,"add"));else {h(this,r,vt).call(this,b);let m=e(this,f)[b];if(i$1!==m){if(e(this,ht)&&h(this,r,v).call(this,m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=m;d!==void 0&&!h$1&&(e(this,X)&&((N=e(this,H))==null||N.call(this,d,e$1,"set")),e(this,W)&&e(this,T)?.push([d,e$1,"set"]));}else h$1||(e(this,X)&&((Y=e(this,H))==null||Y.call(this,m,e$1,"set")),e(this,W)&&e(this,T)?.push([m,e$1,"set"]));if(e(this,lt).call(this,b),e(this,pt).call(this,b,D,c),e(this,f)[b]=i$1,c){c.set="replace";let d=m&&h(this,r,v).call(this,m)?m.__staleWhileFetching:m;d!==void 0&&(c.oldValue=d);}}else c&&(c.set="update");e(this,gt)&&this.onInsert?.(i$1,e$1,i$1===m?"update":"replace");}if(o!==0&&!e(this,M)&&h(this,r,xt).call(this),e(this,M)&&(w||e(this,St).call(this,b,o,l),c&&e(this,Q).call(this,c,b)),!h$1&&e(this,W)&&e(this,T)){let m=e(this,T),d;for(;d=m?.shift();)(y=e(this,V))==null||y.call(this,...d);}return this}pop(){var e$1;try{for(;e(this,F);){let i=e(this,f)[e(this,z)];if(h(this,r,At).call(this,!0),h(this,r,v).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,W)&&e(this,T)){let i=e(this,T),s;for(;s=i?.shift();)(e$1=e(this,V))==null||e$1.call(this,...s);}}}has(e$1,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,l=e(this,O).get(e$1);if(l!==void 0){let h$1=e(this,f)[l];if(h(this,r,v).call(this,h$1)&&h$1.__staleWhileFetching===void 0)return false;if(e(this,I).call(this,l))o&&(o.has="stale",e(this,Q).call(this,o,l));else return s&&e(this,rt).call(this,l),o&&(o.has="hit",e(this,Q).call(this,o,l)),true}else o&&(o.has="miss");return false}peek(e$1,i={}){let{allowStale:s=this.allowStale}=i,o=e(this,O).get(e$1);if(o===void 0||!s&&e(this,I).call(this,o))return;let l=e(this,f)[o];return h(this,r,v).call(this,l)?l.__staleWhileFetching:l}async fetch(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:h$1=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:D=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:y,forceRefresh:m=false,status:d,signal:x}=i;if(!e(this,ht))return d&&(d.fetch="get"),this.get(e$1,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:l,status:d});let L={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:l,ttl:h$1,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:D,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:Y,ignoreFetchAbort:N,status:d,signal:x},C=e(this,O).get(e$1);if(C===void 0){d&&(d.fetch="miss");let A=h(this,r,Ot).call(this,e$1,C,L,y);return A.__returned=A}else {let A=e(this,f)[C];if(h(this,r,v).call(this,A)){let ut=s&&A.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",ut&&(d.returnedStale=true)),ut?A.__staleWhileFetching:A.__returned=A}let mt=e(this,I).call(this,C);if(!m&&!mt)return d&&(d.fetch="hit"),h(this,r,vt).call(this,C),o&&e(this,rt).call(this,C),d&&e(this,Q).call(this,d,C),A;let nt=h(this,r,Ot).call(this,e$1,C,L,y),at=nt.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=mt?"stale":"refresh",at&&mt&&(d.returnedStale=true)),at?nt.__staleWhileFetching:nt.__returned=nt}}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,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:l,...h}=i,u=this.get(e$1,h);if(!l&&u!==void 0)return u;let c=s(e$1,u,{options:h,context:o});return this.set(e$1,c,h),c}get(e$1,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:h$1}=i,u=e(this,O).get(e$1);if(u!==void 0){let c=e(this,f)[u],w=h(this,r,v).call(this,c);return h$1&&e(this,Q).call(this,h$1,u),e(this,I).call(this,u)?(h$1&&(h$1.get="stale"),w?(h$1&&s&&c.__staleWhileFetching!==void 0&&(h$1.returnedStale=true),s?c.__staleWhileFetching:void 0):(l||h(this,r,st).call(this,e$1,"expire"),h$1&&s&&(h$1.returnedStale=true),s?c:void 0)):(h$1&&(h$1.get="hit"),w?c.__staleWhileFetching:(h(this,r,vt).call(this,u),o&&e(this,rt).call(this,u),c))}else h$1&&(h$1.get="miss");}delete(e){return h(this,r,st).call(this,e,"delete")}clear(){return h(this,r,Wt).call(this,"delete")}},k=new WeakMap,U=new WeakMap,H=new WeakMap,ot=new WeakMap,V=new WeakMap,ft=new WeakMap,dt=new WeakMap,K=new WeakMap,F=new WeakMap,P=new WeakMap,O=new WeakMap,S=new WeakMap,f=new WeakMap,R=new WeakMap,G=new WeakMap,z=new WeakMap,E=new WeakMap,B=new WeakMap,T=new WeakMap,$=new WeakMap,q=new WeakMap,M=new WeakMap,j=new WeakMap,X=new WeakMap,ht=new WeakMap,W=new WeakMap,gt=new WeakMap,r=new WeakSet,xt=function(){let e$1=new yt(e(this,k)),i=new yt(e(this,k));g(this,M,e$1),g(this,q,i);let s=this.ttlAutopurge?new Array(e(this,k)):void 0;g(this,j,s),g(this,St,(h$1,u,c=e(this,K).now())=>{if(i[h$1]=u!==0?c:0,e$1[h$1]=u,s?.[h$1]&&(clearTimeout(s[h$1]),s[h$1]=void 0),u!==0&&s){let w=setTimeout(()=>{e(this,I).call(this,h$1)&&h(this,r,st).call(this,e(this,S)[h$1],"expire");},u+1);w.unref&&w.unref(),s[h$1]=w;}}),g(this,rt,h=>{i[h]=e$1[h]!==0?e(this,K).now():0;}),g(this,Q,(h,u)=>{if(e$1[u]){let c=e$1[u],w=i[u];if(!c||!w)return;h.ttl=c,h.start=w,h.now=o||l();let D=h.now-w;h.remainingTTL=c-D;}});let o=0,l=()=>{let h=e(this,K).now();if(this.ttlResolution>0){o=h;let u=setTimeout(()=>o=0,this.ttlResolution);u.unref&&u.unref();}return h};this.getRemainingTTL=h=>{let u=e(this,O).get(h);if(u===void 0)return 0;let c=e$1[u],w=i[u];if(!c||!w)return 1/0;let D=(o||l())-w;return c-D},g(this,I,h=>{let u=i[h],c=e$1[h];return !!c&&!!u&&(o||l())-u>c});},rt=new WeakMap,Q=new WeakMap,St=new WeakMap,I=new WeakMap,Nt=function(){let e$1=new yt(e(this,k));g(this,P,0),g(this,$,e$1),g(this,lt,i=>{g(this,P,e(this,P)-e$1[i]),e$1[i]=0;}),g(this,bt,(i,s,o,l)=>{if(h(this,r,v).call(this,s))return 0;if(!tt(o))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(o=l(s,i),!tt(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),g(this,pt,(i,s,o)=>{if(e$1[i]=s,e(this,U)){let l=e(this,U)-e$1[i];for(;e(this,P)>l;)h(this,r,At).call(this,true);}g(this,P,e(this,P)+e$1[i]),o&&(o.entrySize=s,o.totalCalculatedSize=e(this,P));});},lt=new WeakMap,pt=new WeakMap,bt=new WeakMap,et=function*({allowStale:e$1=this.allowStale}={}){if(e(this,F))for(let i=e(this,E);!(!h(this,r,Ct).call(this,i)||((e$1||!e(this,I).call(this,i))&&(yield i),i===e(this,z)));)i=e(this,G)[i];},it=function*({allowStale:e$1=this.allowStale}={}){if(e(this,F))for(let i=e(this,z);!(!h(this,r,Ct).call(this,i)||((e$1||!e(this,I).call(this,i))&&(yield i),i===e(this,E)));)i=e(this,R)[i];},Ct=function(e$1){return e$1!==void 0&&e(this,O).get(e(this,S)[e$1])===e$1},At=function(e$1){var l;let i$1=e(this,z),s=e(this,S)[i$1],o=e(this,f)[i$1];return e(this,ht)&&h(this,r,v).call(this,o)?o.__abortController.abort(new Error("evicted")):(e(this,X)||e(this,W))&&(e(this,X)&&((l=e(this,H))==null||l.call(this,o,s,"evict")),e(this,W)&&e(this,T)?.push([o,s,"evict"])),e(this,lt).call(this,i$1),e(this,j)?.[i$1]&&(clearTimeout(e(this,j)[i$1]),e(this,j)[i$1]=void 0),e$1&&(e(this,S)[i$1]=void 0,e(this,f)[i$1]=void 0,e(this,B).push(i$1)),e(this,F)===1?(g(this,z,g(this,E,0)),e(this,B).length=0):g(this,z,e(this,R)[i$1]),e(this,O).delete(s),i(this,F)._--,i$1},Ot=function(e$1,i,s,o){let l=i===void 0?void 0:e(this,f)[i];if(h(this,r,v).call(this,l))return l;let h$1=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>h$1.abort(u.reason),{signal:h$1.signal});let c={signal:h$1.signal,options:s,context:o},w=(y,m=false)=>{let{aborted:d}=h$1.signal,x=s.ignoreFetchAbort&&y!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&y!==void 0);if(s.status&&(d&&!m?(s.status.fetchAborted=true,s.status.fetchError=h$1.signal.reason,x&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),d&&!x&&!m)return b(h$1.signal.reason,L);let C=N,A=e(this,f)[i];return (A===N||x&&m&&A===void 0)&&(y===void 0?C.__staleWhileFetching!==void 0?e(this,f)[i]=C.__staleWhileFetching:h(this,r,st).call(this,e$1,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e$1,y,c.options))),y},D=y=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=y),b(y,false)),b=(y,m)=>{let{aborted:d}=h$1.signal,x=d&&s.allowStaleOnFetchAbort,L=x||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,A=N;if(e(this,f)[i]===N&&(!C||!m&&A.__staleWhileFetching===void 0?h(this,r,st).call(this,e$1,"fetch"):x||(e(this,f)[i]=A.__staleWhileFetching)),L)return s.status&&A.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),A.__staleWhileFetching;if(A.__returned===A)throw y},Z=(y,m)=>{var x;let d=(x=e(this,ft))==null?void 0:x.call(this,e$1,l,c);d&&d instanceof Promise&&d.then(L=>y(L===void 0?void 0:L),m),h$1.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let N=new Promise(Z).then(w,D),Y=Object.assign(N,{__abortController:h$1,__staleWhileFetching:l,__returned:void 0});return i===void 0?(this.set(e$1,Y,{...c.options,status:void 0}),i=e(this,O).get(e$1)):e(this,f)[i]=Y,Y},v=function(e$1){if(!e(this,ht))return false;let i=e$1;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Rt=function(e$1,i){e(this,G)[i]=e$1,e(this,R)[e$1]=i;},vt=function(e$1){e$1!==e(this,E)&&(e$1===e(this,z)?g(this,z,e(this,R)[e$1]):h(this,r,Rt).call(this,e(this,G)[e$1],e(this,R)[e$1]),h(this,r,Rt).call(this,e(this,E),e$1),g(this,E,e$1));},st=function(e$1,i$1){var o,l;let s=false;if(e(this,F)!==0){let h$1=e(this,O).get(e$1);if(h$1!==void 0)if(e(this,j)?.[h$1]&&(clearTimeout(e(this,j)?.[h$1]),e(this,j)[h$1]=void 0),s=true,e(this,F)===1)h(this,r,Wt).call(this,i$1);else {e(this,lt).call(this,h$1);let u=e(this,f)[h$1];if(h(this,r,v).call(this,u)?u.__abortController.abort(new Error("deleted")):(e(this,X)||e(this,W))&&(e(this,X)&&((o=e(this,H))==null||o.call(this,u,e$1,i$1)),e(this,W)&&e(this,T)?.push([u,e$1,i$1])),e(this,O).delete(e$1),e(this,S)[h$1]=void 0,e(this,f)[h$1]=void 0,h$1===e(this,E))g(this,E,e(this,G)[h$1]);else if(h$1===e(this,z))g(this,z,e(this,R)[h$1]);else {let c=e(this,G)[h$1];e(this,R)[c]=e(this,R)[h$1];let w=e(this,R)[h$1];e(this,G)[w]=e(this,G)[h$1];}i(this,F)._--,e(this,B).push(h$1);}}if(e(this,W)&&e(this,T)?.length){let h=e(this,T),u;for(;u=h?.shift();)(l=e(this,V))==null||l.call(this,...u);}return s},Wt=function(e$1){var i,s;for(let o of h(this,r,it).call(this,{allowStale:true})){let l=e(this,f)[o];if(h(this,r,v).call(this,l))l.__abortController.abort(new Error("deleted"));else {let h=e(this,S)[o];e(this,X)&&((i=e(this,H))==null||i.call(this,l,h,e$1)),e(this,W)&&e(this,T)?.push([l,h,e$1]);}}if(e(this,O).clear(),e(this,f).fill(void 0),e(this,S).fill(void 0),e(this,M)&&e(this,q)){e(this,M).fill(0),e(this,q).fill(0);for(let o of e(this,j)??[])o!==void 0&&clearTimeout(o);e(this,j)?.fill(void 0);}if(e(this,$)&&e(this,$).fill(0),g(this,z,0),g(this,E,0),e(this,B).length=0,g(this,P,0),g(this,F,0),e(this,W)&&e(this,T)){let o=e(this,T),l;for(;l=o?.shift();)(s=e(this,V))==null||s.call(this,...l);}},wt);var Et=class{constructor(e){d(this,"cache");d(this,"map",new Map);this.cache=new It({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};export{Et as a};
@@ -1 +0,0 @@
1
- var y=Object.create;var x=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var s=r=>{throw TypeError(r)};var P=(r,n,o)=>n in r?x(r,n,{enumerable:true,configurable:true,writable:true,value:o}):r[n]=o;var w=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(n,o)=>(typeof require<"u"?require:n)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var $=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var V=(r,n,o,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of l(n))!E.call(r,e)&&e!==o&&x(r,e,{get:()=>n[e],enumerable:!(t=f(n,e))||t.enumerable});return r};var b=(r,n,o)=>(o=r!=null?y(N(r)):{},V(n||!r||!r.__esModule?x(o,"default",{value:r,enumerable:true}):o,r));var S=(r,n,o)=>P(r,typeof n!="symbol"?n+"":n,o),p=(r,n,o)=>n.has(r)||s("Cannot "+o);var m=(r,n,o)=>(p(r,n,"read from private field"),o?o.call(r):n.get(r)),T=(r,n,o)=>n.has(r)?s("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,o),u=(r,n,o,t)=>(p(r,n,"write to private field"),t?t.call(r,o):n.set(r,o),o),d=(r,n,o)=>(p(r,n,"access private method"),o);var h=(r,n,o,t)=>({set _(e){u(r,n,e,o);},get _(){return m(r,n,t)}});var c;(e=>(e.log=(i,...a)=>console.log(`[Pixi\u2019VN] ${i}`,...a),e.warn=(i,...a)=>console.warn(`[Pixi\u2019VN] ${i}`,...a),e.error=(i,...a)=>console.error(`[Pixi\u2019VN] ${i}`,...a),e.info=(i,...a)=>console.info(`[Pixi\u2019VN] ${i}`,...a)))(c||(c={}));function k(r){try{if(typeof r>"u")return r;let n=JSON.stringify(r);return JSON.parse(n)}catch(n){throw c.error("Error creating exportable element",r,n),new Error("[Pixi\u2019VN] Error creating exportable element")}}export{w as a,$ as b,b as c,S as d,m as e,T as f,u as g,d as h,h as i,c as j,k};
@@ -1 +0,0 @@
1
- import {b,a}from'./chunk-GNJIUFU2.mjs';var L=b((S,I)=>{(function(w,o){typeof S=="object"?I.exports=S=o():typeof define=="function"&&define.amd?define([],o):w.CryptoJS=o();})(S,function(){var w=w||(function(o,x){var a$1;if(typeof window<"u"&&window.crypto&&(a$1=window.crypto),typeof self<"u"&&self.crypto&&(a$1=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a$1=globalThis.crypto),!a$1&&typeof window<"u"&&window.msCrypto&&(a$1=window.msCrypto),!a$1&&typeof global<"u"&&global.crypto&&(a$1=global.crypto),!a$1&&typeof a=="function")try{a$1=a("crypto");}catch{}var _=function(){if(a$1){if(typeof a$1.getRandomValues=="function")try{return a$1.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a$1.randomBytes=="function")try{return a$1.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}})(),d={},B=d.lib={},u=B.Base=(function(){return {extend:function(t){var e=C(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments);}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),l=B.WordArray=u.extend({init:function(t,e){t=this.words=t||[],e!=x?this.sigBytes=e:this.sigBytes=t.length*4;},toString:function(t){return (t||v).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,f=t.sigBytes;if(this.clamp(),r%4)for(var c=0;c<f;c++){var z=n[c>>>2]>>>24-c%4*8&255;e[r+c>>>2]|=z<<24-(r+c)%4*8;}else for(var g=0;g<f;g+=4)e[r+g>>>2]=n[g>>>2];return this.sigBytes+=f,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=o.ceil(e/4);},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(_());return new l.init(e,t)}}),i=d.enc={},v=i.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push((c>>>4).toString(16)),r.push((c&15).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=i.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push(String.fromCharCode(c));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,e)}},p=i.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},y=B.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(t){typeof t=="string"&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e,n=this._data,r=n.words,f=n.sigBytes,c=this.blockSize,z=c*4,g=f/z;t?g=o.ceil(g):g=o.max((g|0)-this._minBufferSize,0);var b=g*c,R=o.min(b*4,f);if(b){for(var A=0;A<b;A+=c)this._doProcessBlock(r,A);e=r.splice(0,b),n.sigBytes-=R;}return new l.init(e,R)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});B.Hasher=y.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:512/32,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new s.HMAC.init(t,n).finalize(e)}}});var s=d.algo={};return d})(Math);return w});});var T=b((H,P)=>{(function(w,o){typeof H=="object"?P.exports=H=o(L()):typeof define=="function"&&define.amd?define(["./core"],o):o(w.CryptoJS);})(H,function(w){return (function(){var o=w,x=o.lib,a=x.WordArray,_=x.Hasher,C=o.algo,d=[],B=C.SHA1=_.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var i=this._hash.words,v=i[0],h=i[1],p=i[2],y=i[3],m=i[4],s=0;s<80;s++){if(s<16)d[s]=u[l+s]|0;else {var t=d[s-3]^d[s-8]^d[s-14]^d[s-16];d[s]=t<<1|t>>>31;}var e=(v<<5|v>>>27)+m+d[s];s<20?e+=(h&p|~h&y)+1518500249:s<40?e+=(h^p^y)+1859775393:s<60?e+=(h&p|h&y|p&y)-1894007588:e+=(h^p^y)-899497514,m=y,y=p,p=h<<30|h>>>2,h=v,v=e;}i[0]=i[0]+v|0,i[1]=i[1]+h|0,i[2]=i[2]+p|0,i[3]=i[3]+y|0,i[4]=i[4]+m|0;},_doFinalize:function(){var u=this._data,l=u.words,i=this._nDataBytes*8,v=u.sigBytes*8;return l[v>>>5]|=128<<24-v%32,l[(v+64>>>9<<4)+14]=Math.floor(i/4294967296),l[(v+64>>>9<<4)+15]=i,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=_.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=_._createHelper(B),o.HmacSHA1=_._createHmacHelper(B);})(),w.SHA1});});export{T as a};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-6IVCTY6P.mjs';import {d,k,j}from'./chunk-GNJIUFU2.mjs';import {GameUnifier}from'@drincs/pixi-vn/unifier';var s=class s{constructor(){}static clearOldTempVariables(e){s.tempStorageDeadlines.forEach((t,a)=>{t>e&&(s.tempStorage.delete(a),s.tempStorageDeadlines.delete(a),s.storage.cache.delete(a));});}static setVariable(e,t){let a=s.tempStorage.has(e);t==null?(s.storage.map.delete(e),!a&&s.storage.cache.delete(e)):(s.storage.map.set(e,t),!a&&s.storage.cache.set(e,t));}static getVariable(e){let t=s.storage.cache.get(e);return t===void 0&&(t=s.tempStorage.get(e)),t===void 0&&(t=s.storage.map.get(e)),t===void 0&&(t=s.default.get(e)),k(t)}static removeVariable(e){s.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let a=this.flags.indexOf(e);a>-1&&this.flags.splice(a,1);}}static getFlag(e){return this.flags.includes(e)}};d(s,"storage",new a({cacheSize:20})),d(s,"default",new a({cacheSize:20})),d(s,"flags",Array()),d(s,"tempStorage",new Map),d(s,"tempStorageDeadlines",new Map);var r=s;var n=class{get storage(){return r.storage.map}get cache(){return r.storage.cache}get flags(){return r.flags}get tempStorage(){return r.tempStorage}get tempStorageDeadlines(){return r.tempStorageDeadlines}set default(e){Object.entries(e).forEach(([t,a])=>{r.default.set(t,a);});}set(e,t){return r.setVariable(e,t)}get(e){return r.getVariable(e)}remove(e){return r.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else r.tempStorage.set(e,t),r.storage.cache.set(e,t),r.tempStorageDeadlines.has(e)||r.tempStorageDeadlines.set(e,GameUnifier.openedLabels);}removeTempVariable(e){r.tempStorage.has(e)&&(r.tempStorage.delete(e),r.tempStorageDeadlines.delete(e),r.storage.cache.delete(e));}setFlag(e,t){return r.setFlag(e,t)}getFlag(e){return r.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),r.flags=[],r.tempStorage.clear(),r.tempStorageDeadlines.clear();}export(){let e=[];[...this.storage.keys()].forEach(o=>{e.push({key:o,value:this.storage.get(o)});});let t=[];[...r.tempStorage.keys()].forEach(o=>{t.push({key:o,value:r.tempStorage.get(o)});});let a=[];return [...r.tempStorageDeadlines.keys()].forEach(o=>{a.push({key:o,value:r.tempStorageDeadlines.get(o)});}),k({base:e,temp:t,tempDeadlines:a,flags:r.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let a=t.value;Object.entries(a).forEach(([o,g])=>{r.tempStorage.set(o,g);});}else if(t.key==="___temp_storage_deadlines___"){let a=t.value;Object.entries(a).forEach(([o,g])=>{r.tempStorageDeadlines.set(o,g);});}else t.key==="___flags___"?t.value.forEach(o=>{r.flags.push(o);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{r.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{r.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,a])=>{t==="___temp_storage___"?Object.entries(a).forEach(([o,g])=>{r.tempStorage.set(o,g);}):t==="___temp_storage_deadlines___"?Object.entries(a).forEach(([o,g])=>{r.tempStorageDeadlines.set(o,g);}):t==="___flags___"?a.forEach(o=>{r.flags.push(o);}):this.storage.set(t,a);})):j.warn("No storage data found");}catch(t){j.error("Error importing data",t);}}};var p=class{constructor(e,t){d(this,"id");d(this,"categoryId");this.categoryId=e,this.id=t;}setStorageProperty(e,t){let a=r.getVariable(this.categoryId);a||(a={}),a.hasOwnProperty(this.id)||(a[this.id]={}),t==null?a[this.id].hasOwnProperty(e)&&delete a[this.id][e]:a[this.id]={...a[this.id],[e]:t},Object.keys(a[this.id]).length===0&&delete a[this.id],r.setVariable(this.categoryId,a);}getStorageProperty(e,t=this.id){let a=r.getVariable(this.categoryId);if(a&&a.hasOwnProperty(t)&&a[t].hasOwnProperty(e))return a[t][e]}};var v=new n;export{r as a,p as b,v as c};
File without changes
package/dist/unifier.cjs DELETED
@@ -1 +0,0 @@
1
- 'use strict';var d=Object.defineProperty;var p=(s,t,n)=>t in s?d(s,t,{enumerable:true,configurable:true,writable:true,value:n}):s[t]=n;var a=(s,t,n)=>p(s,typeof t!="symbol"?t+"":t,n);var i;(l=>(l.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),l.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),l.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),l.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(i||(i={}));var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,t.onPreContinue&&e.addOnPreContinue(t.onPreContinue),e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(n=>n!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(n=>n()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let n=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=n.newValue,await n.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}};a(e,"_navigate",()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),a(e,"_getStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getCurrentGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_restoreGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getOpenedLabels",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_onPreContinueHandlers",[]),a(e,"navigationRequestsCount",0),a(e,"processNavigationLock",Promise.resolve()),a(e,"_processNavigationRequests",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_removeVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_onLabelClosing",()=>{}),a(e,"_addHistoryItem",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"runningStepsCount",0),a(e,"_getCharacter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),a(e,"onEnd"),a(e,"onError");var u=e;exports.GameUnifier=u;
package/dist/unifier.mjs DELETED
@@ -1 +0,0 @@
1
- var d=Object.defineProperty;var p=(s,t,n)=>t in s?d(s,t,{enumerable:true,configurable:true,writable:true,value:n}):s[t]=n;var a=(s,t,n)=>p(s,typeof t!="symbol"?t+"":t,n);var i;(l=>(l.log=(r,...o)=>console.log(`[Pixi\u2019VN] ${r}`,...o),l.warn=(r,...o)=>console.warn(`[Pixi\u2019VN] ${r}`,...o),l.error=(r,...o)=>console.error(`[Pixi\u2019VN] ${r}`,...o),l.info=(r,...o)=>console.info(`[Pixi\u2019VN] ${r}`,...o)))(i||(i={}));var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,t.onPreContinue&&e.addOnPreContinue(t.onPreContinue),e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(n=>n!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(n=>n()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let n=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=n.newValue,await n.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}};a(e,"_navigate",()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),a(e,"_getStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setStepCounter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getCurrentGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_restoreGameStepState",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getOpenedLabels",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_onPreContinueHandlers",[]),a(e,"navigationRequestsCount",0),a(e,"processNavigationLock",Promise.resolve()),a(e,"_processNavigationRequests",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_removeVariable",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_getFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_setFlag",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"_onLabelClosing",()=>{}),a(e,"_addHistoryItem",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),a(e,"runningStepsCount",0),a(e,"_getCharacter",()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),a(e,"onEnd"),a(e,"onError");var u=e;export{u as GameUnifier};