narrat 2.10.4 → 2.10.5

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 (154) hide show
  1. package/dist/app.vue.d.ts +78 -78
  2. package/dist/components/MainMenu.vue.d.ts +7 -7
  3. package/dist/components/SkillsWindow.vue.d.ts +28 -28
  4. package/dist/components/StartMenu.vue.d.ts +46 -46
  5. package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +46 -46
  6. package/dist/components/debug/debug-menu.vue.d.ts +51 -51
  7. package/dist/components/dialog-picture.vue.d.ts +11 -11
  8. package/dist/components/engine-splash/engine-splash.vue.d.ts +54 -54
  9. package/dist/components/game-dialog.vue.d.ts +65 -65
  10. package/dist/components/game-splash/game-splash.vue.d.ts +46 -46
  11. package/dist/components/hud.vue.d.ts +20 -20
  12. package/dist/components/in-game.vue.d.ts +46 -46
  13. package/dist/components/inventory/inventory-section.vue.d.ts +61 -61
  14. package/dist/components/inventory/item-details.vue.d.ts +76 -76
  15. package/dist/components/inventory-ui.vue.d.ts +39 -39
  16. package/dist/components/loading-bar.vue.d.ts +10 -10
  17. package/dist/components/menu-buttons.vue.d.ts +46 -46
  18. package/dist/components/notification-toast.vue.d.ts +6 -6
  19. package/dist/components/quests/QuestDetails.vue.d.ts +64 -64
  20. package/dist/components/quests/QuestDisplay.vue.d.ts +64 -64
  21. package/dist/components/quests/quests-list-section.vue.d.ts +75 -75
  22. package/dist/components/quests-ui.vue.d.ts +22 -22
  23. package/dist/components/save-slots.vue.d.ts +79 -79
  24. package/dist/components/saves/save-slot-ui.vue.d.ts +108 -108
  25. package/dist/components/screen-layer.vue.d.ts +76 -76
  26. package/dist/components/screen-objects/screen-object.vue.d.ts +68 -68
  27. package/dist/components/screens.vue.d.ts +46 -46
  28. package/dist/components/tabs/TabsController.vue.d.ts +72 -72
  29. package/dist/components/tabs/tab-selector.vue.d.ts +82 -82
  30. package/dist/components/tooltips/tooltips-ui.vue.d.ts +46 -46
  31. package/dist/components/transitions/NarratTransition.vue.d.ts +97 -97
  32. package/dist/components/utils/alert-modal.vue.d.ts +82 -82
  33. package/dist/components/utils/floating-tooltip.vue.d.ts +62 -62
  34. package/dist/components/utils/modal-window.vue.d.ts +18 -18
  35. package/dist/components/utils/yes-no.vue.d.ts +106 -106
  36. package/dist/components/volume-controls.vue.d.ts +18 -18
  37. package/dist/config/audio-config.d.ts +58 -58
  38. package/dist/config/buttons-config.d.ts +68 -68
  39. package/dist/config/characters-config.d.ts +36 -36
  40. package/dist/config/common-config.d.ts +80 -80
  41. package/dist/config/config-input.d.ts +231 -231
  42. package/dist/config/config-output.d.ts +232 -232
  43. package/dist/config/items-config.d.ts +71 -71
  44. package/dist/config/layout-config.d.ts +26 -26
  45. package/dist/config/quests-config.d.ts +48 -48
  46. package/dist/config/screens-config.d.ts +133 -133
  47. package/dist/config/skills-config.d.ts +70 -70
  48. package/dist/config/tooltips-config.d.ts +15 -15
  49. package/dist/config.d.ts +182 -182
  50. package/dist/constants.d.ts +12 -12
  51. package/dist/demo/demo.d.ts +1 -1
  52. package/dist/dialog-box.vue.d.ts +71 -71
  53. package/dist/exports/components.d.ts +2 -2
  54. package/dist/exports/config.d.ts +2 -2
  55. package/dist/exports/display.d.ts +2 -2
  56. package/dist/exports/events.d.ts +1 -1
  57. package/dist/exports/inputs.d.ts +1 -1
  58. package/dist/exports/others.d.ts +1 -1
  59. package/dist/exports/plugins.d.ts +67 -67
  60. package/dist/exports/stores.d.ts +16 -16
  61. package/dist/exports/utils.d.ts +12 -12
  62. package/dist/gamepad/gamepad.d.ts +1 -1
  63. package/dist/hooks/util-hooks.d.ts +1 -1
  64. package/dist/inputs/Inputs.d.ts +61 -61
  65. package/dist/lib.d.ts +20 -20
  66. package/dist/main.d.ts +6 -6
  67. package/dist/menu-buttons/menu-buttons.d.ts +7 -7
  68. package/dist/narrat.es.js +756 -754
  69. package/dist/narrat.es.js.map +1 -1
  70. package/dist/narrat.umd.js +5 -5
  71. package/dist/narrat.umd.js.map +1 -1
  72. package/dist/plugins/NarratPlugin.d.ts +12 -12
  73. package/dist/stores/audio-store.d.ts +56 -56
  74. package/dist/stores/config-store.d.ts +6 -6
  75. package/dist/stores/dialog-store.d.ts +35 -35
  76. package/dist/stores/hud-stats-store.d.ts +20 -20
  77. package/dist/stores/inputs-store.d.ts +14 -14
  78. package/dist/stores/inventory-store.d.ts +49 -49
  79. package/dist/stores/main-store.d.ts +1637 -1637
  80. package/dist/stores/menu-store.d.ts +45 -45
  81. package/dist/stores/notification-store.d.ts +15 -15
  82. package/dist/stores/quest-log.d.ts +37 -37
  83. package/dist/stores/rendering-store.d.ts +20 -20
  84. package/dist/stores/screen-objects-store.d.ts +68 -68
  85. package/dist/stores/screens-store.d.ts +34 -34
  86. package/dist/stores/skills.d.ts +39 -39
  87. package/dist/stores/start-menu-store.d.ts +7 -7
  88. package/dist/stores/tooltip-store.d.ts +18 -18
  89. package/dist/stores/vm-store.d.ts +181 -181
  90. package/dist/style.css +1 -1
  91. package/dist/types/app-types.d.ts +8 -8
  92. package/dist/types/dialog-box-types.d.ts +11 -11
  93. package/dist/types/game-save.d.ts +41 -41
  94. package/dist/types/parser.d.ts +93 -93
  95. package/dist/types/state.d.ts +3 -3
  96. package/dist/utils/InputsListener.d.ts +9 -9
  97. package/dist/utils/Vector2.d.ts +49 -49
  98. package/dist/utils/ajax.d.ts +2 -2
  99. package/dist/utils/audio-loader.d.ts +10 -10
  100. package/dist/utils/characters.d.ts +4 -4
  101. package/dist/utils/data-helpers.d.ts +32 -32
  102. package/dist/utils/data-helpers.test.d.ts +1 -1
  103. package/dist/utils/debounce.d.ts +14 -14
  104. package/dist/utils/error-handling.d.ts +4 -4
  105. package/dist/utils/gameloop.d.ts +10 -10
  106. package/dist/utils/getWindow.d.ts +1 -1
  107. package/dist/utils/helpers.d.ts +6 -6
  108. package/dist/utils/images-loader.d.ts +7 -7
  109. package/dist/utils/logger.d.ts +11 -11
  110. package/dist/utils/object-iterators.d.ts +9 -9
  111. package/dist/utils/promises.d.ts +1 -1
  112. package/dist/utils/randomId.d.ts +1 -1
  113. package/dist/utils/save-helpers.d.ts +16 -16
  114. package/dist/utils/skillchecks.d.ts +17 -17
  115. package/dist/utils/string-helpers.d.ts +5 -5
  116. package/dist/utils/time-helpers.d.ts +2 -2
  117. package/dist/utils/tooltip-utils.d.ts +2 -2
  118. package/dist/utils/transition.d.ts +21 -21
  119. package/dist/utils/type-utils.d.ts +2 -2
  120. package/dist/utils/typed-emitter.d.ts +18 -18
  121. package/dist/utils/viewport-utils.d.ts +3 -3
  122. package/dist/utils/vue-directives.d.ts +2 -2
  123. package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
  124. package/dist/vm/commands/array-commands.d.ts +42 -42
  125. package/dist/vm/commands/audio-commands.d.ts +15 -15
  126. package/dist/vm/commands/choice.d.ts +38 -38
  127. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  128. package/dist/vm/commands/command-helpers.d.ts +3 -3
  129. package/dist/vm/commands/command-plugin.d.ts +43 -43
  130. package/dist/vm/commands/flow-commands.d.ts +27 -27
  131. package/dist/vm/commands/if.d.ts +10 -10
  132. package/dist/vm/commands/index.d.ts +2 -2
  133. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  134. package/dist/vm/commands/logic-command.d.ts +42 -42
  135. package/dist/vm/commands/math-commands.d.ts +30 -30
  136. package/dist/vm/commands/notify.d.ts +6 -6
  137. package/dist/vm/commands/quest-commands.d.ts +30 -30
  138. package/dist/vm/commands/random-commands.d.ts +13 -13
  139. package/dist/vm/commands/screen-commands.d.ts +18 -18
  140. package/dist/vm/commands/set.d.ts +6 -6
  141. package/dist/vm/commands/skill-commands.d.ts +33 -33
  142. package/dist/vm/commands/sprite-commands.d.ts +16 -16
  143. package/dist/vm/commands/stats-commands.d.ts +12 -12
  144. package/dist/vm/commands/string-commands.d.ts +9 -9
  145. package/dist/vm/commands/text-field.d.ts +7 -7
  146. package/dist/vm/commands/text.d.ts +14 -14
  147. package/dist/vm/commands/time-commands.d.ts +16 -16
  148. package/dist/vm/commands/util-commands.d.ts +4 -4
  149. package/dist/vm/commands/wait.d.ts +4 -4
  150. package/dist/vm/vm-helpers.d.ts +19 -19
  151. package/dist/vm/vm-parser.d.ts +19 -19
  152. package/dist/vm/vm-parser.test.d.ts +1 -1
  153. package/dist/vm/vm.d.ts +21 -21
  154. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- (function(Ze,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(Ze=typeof globalThis<"u"?globalThis:Ze||self,b(Ze.narrat={},Ze.Vue))})(this,function(Ze,b){"use strict";var ihe=Object.defineProperty;var ohe=(Ze,b,bi)=>b in Ze?ihe(Ze,b,{enumerable:!0,configurable:!0,writable:!0,value:bi}):Ze[b]=bi;var ei=(Ze,b,bi)=>(ohe(Ze,typeof b!="symbol"?b+"":b,bi),bi);var bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cR(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fR(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dk={exports:{}};/*!
1
+ (function(Ze,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(Ze=typeof globalThis<"u"?globalThis:Ze||self,b(Ze.narrat={},Ze.Vue))})(this,function(Ze,b){"use strict";var ohe=Object.defineProperty;var ahe=(Ze,b,bi)=>b in Ze?ohe(Ze,b,{enumerable:!0,configurable:!0,writable:!0,value:bi}):Ze[b]=bi;var ei=(Ze,b,bi)=>(ahe(Ze,typeof b!="symbol"?b+"":b,bi),bi);var bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cR(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fR(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dk={exports:{}};/*!
2
2
  * @overview es6-promise - a tiny implementation of Promises/A+.
3
3
  * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
4
4
  * @license Licensed under MIT license
5
5
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
6
6
  * @version v4.2.8+1e68dce6
7
- */(function(t,e){(function(n,r){t.exports=r()})(bi,function(){function n(we){var Pe=typeof we;return we!==null&&(Pe==="object"||Pe==="function")}function r(we){return typeof we=="function"}var i=void 0;Array.isArray?i=Array.isArray:i=function(we){return Object.prototype.toString.call(we)==="[object Array]"};var o=i,a=0,s=void 0,u=void 0,l=function(Pe,Be){S[a]=Pe,S[a+1]=Be,a+=2,a===2&&(u?u(C):$())};function f(we){u=we}function c(we){l=we}var d=typeof window<"u"?window:void 0,h=d||{},p=h.MutationObserver||h.WebKitMutationObserver,m=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",g=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function v(){return function(){return process.nextTick(C)}}function y(){return typeof s<"u"?function(){s(C)}:_()}function k(){var we=0,Pe=new p(C),Be=document.createTextNode("");return Pe.observe(Be,{characterData:!0}),function(){Be.data=we=++we%2}}function w(){var we=new MessageChannel;return we.port1.onmessage=C,function(){return we.port2.postMessage(0)}}function _(){var we=setTimeout;return function(){return we(C,1)}}var S=new Array(1e3);function C(){for(var we=0;we<a;we+=2){var Pe=S[we],Be=S[we+1];Pe(Be),S[we]=void 0,S[we+1]=void 0}a=0}function A(){try{var we=Function("return this")().require("vertx");return s=we.runOnLoop||we.runOnContext,y()}catch{return _()}}var $=void 0;m?$=v():p?$=k():g?$=w():d===void 0&&typeof fR=="function"?$=A():$=_();function E(we,Pe){var Be=this,et=new this.constructor(P);et[z]===void 0&&le(et);var it=Be._state;if(it){var xe=arguments[it-1];l(function(){return me(it,et,xe,Be._result)})}else q(Be,et,we,Pe);return et}function O(we){var Pe=this;if(we&&typeof we=="object"&&we.constructor===Pe)return we;var Be=new Pe(P);return N(Be,we),Be}var z=Math.random().toString(36).substring(2);function P(){}var M=void 0,H=1,G=2;function V(){return new TypeError("You cannot resolve a promise with itself")}function J(){return new TypeError("A promises callback cannot return that same promise.")}function F(we,Pe,Be,et){try{we.call(Pe,Be,et)}catch(it){return it}}function I(we,Pe,Be){l(function(et){var it=!1,xe=F(Be,Pe,function(Qe){it||(it=!0,Pe!==Qe?N(et,Qe):j(et,Qe))},function(Qe){it||(it=!0,T(et,Qe))},"Settle: "+(et._label||" unknown promise"));!it&&xe&&(it=!0,T(et,xe))},we)}function L(we,Pe){Pe._state===H?j(we,Pe._result):Pe._state===G?T(we,Pe._result):q(Pe,void 0,function(Be){return N(we,Be)},function(Be){return T(we,Be)})}function B(we,Pe,Be){Pe.constructor===we.constructor&&Be===E&&Pe.constructor.resolve===O?L(we,Pe):Be===void 0?j(we,Pe):r(Be)?I(we,Pe,Be):j(we,Pe)}function N(we,Pe){if(we===Pe)T(we,V());else if(n(Pe)){var Be=void 0;try{Be=Pe.then}catch(et){T(we,et);return}B(we,Pe,Be)}else j(we,Pe)}function x(we){we._onerror&&we._onerror(we._result),Q(we)}function j(we,Pe){we._state===M&&(we._result=Pe,we._state=H,we._subscribers.length!==0&&l(Q,we))}function T(we,Pe){we._state===M&&(we._state=G,we._result=Pe,l(x,we))}function q(we,Pe,Be,et){var it=we._subscribers,xe=it.length;we._onerror=null,it[xe]=Pe,it[xe+H]=Be,it[xe+G]=et,xe===0&&we._state&&l(Q,we)}function Q(we){var Pe=we._subscribers,Be=we._state;if(Pe.length!==0){for(var et=void 0,it=void 0,xe=we._result,Qe=0;Qe<Pe.length;Qe+=3)et=Pe[Qe],it=Pe[Qe+Be],et?me(Be,et,it,xe):it(xe);we._subscribers.length=0}}function me(we,Pe,Be,et){var it=r(Be),xe=void 0,Qe=void 0,Nt=!0;if(it){try{xe=Be(et)}catch(Cn){Nt=!1,Qe=Cn}if(Pe===xe){T(Pe,J());return}}else xe=et;Pe._state!==M||(it&&Nt?N(Pe,xe):Nt===!1?T(Pe,Qe):we===H?j(Pe,xe):we===G&&T(Pe,xe))}function ve(we,Pe){try{Pe(function(et){N(we,et)},function(et){T(we,et)})}catch(Be){T(we,Be)}}var R=0;function U(){return R++}function le(we){we[z]=R++,we._state=void 0,we._result=void 0,we._subscribers=[]}function oe(){return new Error("Array Methods must be provided an Array")}var pe=function(){function we(Pe,Be){this._instanceConstructor=Pe,this.promise=new Pe(P),this.promise[z]||le(this.promise),o(Be)?(this.length=Be.length,this._remaining=Be.length,this._result=new Array(this.length),this.length===0?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(Be),this._remaining===0&&j(this.promise,this._result))):T(this.promise,oe())}return we.prototype._enumerate=function(Be){for(var et=0;this._state===M&&et<Be.length;et++)this._eachEntry(Be[et],et)},we.prototype._eachEntry=function(Be,et){var it=this._instanceConstructor,xe=it.resolve;if(xe===O){var Qe=void 0,Nt=void 0,Cn=!1;try{Qe=Be.then}catch(re){Cn=!0,Nt=re}if(Qe===E&&Be._state!==M)this._settledAt(Be._state,et,Be._result);else if(typeof Qe!="function")this._remaining--,this._result[et]=Be;else if(it===Ue){var Ln=new it(P);Cn?T(Ln,Nt):B(Ln,Be,Qe),this._willSettleAt(Ln,et)}else this._willSettleAt(new it(function(re){return re(Be)}),et)}else this._willSettleAt(xe(Be),et)},we.prototype._settledAt=function(Be,et,it){var xe=this.promise;xe._state===M&&(this._remaining--,Be===G?T(xe,it):this._result[et]=it),this._remaining===0&&j(xe,this._result)},we.prototype._willSettleAt=function(Be,et){var it=this;q(Be,void 0,function(xe){return it._settledAt(H,et,xe)},function(xe){return it._settledAt(G,et,xe)})},we}();function Ce(we){return new pe(this,we).promise}function ce(we){var Pe=this;return o(we)?new Pe(function(Be,et){for(var it=we.length,xe=0;xe<it;xe++)Pe.resolve(we[xe]).then(Be,et)}):new Pe(function(Be,et){return et(new TypeError("You must pass an array to race."))})}function X(we){var Pe=this,Be=new Pe(P);return T(Be,we),Be}function ze(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Je(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Ue=function(){function we(Pe){this[z]=U(),this._result=this._state=void 0,this._subscribers=[],P!==Pe&&(typeof Pe!="function"&&ze(),this instanceof we?ve(this,Pe):Je())}return we.prototype.catch=function(Be){return this.then(null,Be)},we.prototype.finally=function(Be){var et=this,it=et.constructor;return r(Be)?et.then(function(xe){return it.resolve(Be()).then(function(){return xe})},function(xe){return it.resolve(Be()).then(function(){throw xe})}):et.then(Be,Be)},we}();Ue.prototype.then=E,Ue.all=Ce,Ue.race=ce,Ue.resolve=O,Ue.reject=X,Ue._setScheduler=f,Ue._setAsap=c,Ue._asap=l;function Me(){var we=void 0;if(typeof bi<"u")we=bi;else if(typeof self<"u")we=self;else try{we=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var Pe=we.Promise;if(Pe){var Be=null;try{Be=Object.prototype.toString.call(Pe.resolve())}catch{}if(Be==="[object Promise]"&&!Pe.cast)return}we.Promise=Ue}return Ue.polyfill=Me,Ue.Promise=Ue,Ue})})(Dk),Dk.exports.polyfill();const ahe="",she="",Rk=b.ref([]),Bk=b.ref(null),zk=b.ref(null),Fk=b.ref(null),Vk=b.ref(null),ti=b.reactive({current:""}),Wm=[],dR=b.ref(!1),Km=b.readonly(Rk),hR=b.readonly(Bk),pR=b.readonly(zk),mR=b.readonly(Fk),vR=b.readonly(Vk),gR=b.readonly(ti),yR=t=>{Rk.value=t},bR=t=>{Bk.value=t},kR=t=>{zk.value=t},wR=t=>{Fk.value=t},_R=t=>{Vk.value=t},qk=(t=hR.value)=>{ti.current=t;const e=Km.value.findIndex(r=>r.name===t),n=Km.value.map(r=>r.name);for(let r=0;r<n.length;r++){if(r>0&&r<n.length-1){const i=n[r]+"Minus",o=n[r]+"Plus";ti[i]=e<=r,ti[o]=e>=r}ti[n[r]]=n[r]===t}},xR=()=>{const t=Object.keys(ti);for(let e of t)delete ti[e];qk(),Hk(),Uk(),Wk()},Hk=(t=pR.value)=>{ti.orientation=t,ti.isLandscape=t==="landscape",ti.isPortrait=t==="portrait"},Uk=(t=mR.value||"light")=>{ti.theme=t,ti.isDark=t==="dark",ti.isLight=t==="light"},Wk=(t=vR.value||"no-preference")=>{ti.motionPreference=t,ti.isMotion=t==="no-preference",ti.isInert=t==="reduce"};function jR(){for(;Wm.length>0;){const t=Wm.shift();if(t&&typeof t=="object"){const{mql:e,cb:n}=t;e.addEventListener&&typeof e.addEventListener=="function"?e.removeEventListener("change",n):e.removeListener(n)}}}function SR(){return Km.value.reduce((e,n,r,i)=>{const o=`(min-width: ${n.min}px)`,a=r<i.length-1?`(max-width: ${i[r+1].min-1}px)`:null,s=o+(a?" and "+a:"");return Object.assign(e,{[n.name]:s})},{})}function id(t,e){if(typeof window>"u"||!window.matchMedia)return!1;if(typeof window<"u"&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{dR.value=!0;const n=window.matchMedia(t),r=({matches:o})=>{o&&e()};Wm.push({mql:n,cb:r}),n.addEventListener&&typeof n.addEventListener=="function"?n.addEventListener("change",r):n.addListener(r),r(n)}}var Jm=Object.freeze(Object.defineProperty({__proto__:null,bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906},wordpress:{mobile:0,small:600,medium:782,large:960,xlarge:1080,wide:1280,huge:1440}},Symbol.toStringTag,{value:"Module"}));const CR=t=>{if(typeof t=="string"&&Jm[t])return Jm[t];{const e=Object.keys(Jm);return console.error(`Vue3 Mq: "${t}" is not a valid preset. Available options are: ${e.join(", ")}`),!1}},$R=t=>["landscape","portrait"].includes(t)===!1?(console.error(`Vue3 Mq: "${t}" is not a valid default orientation. Reverting to unset value.`),null):t,OR=(t=null)=>["dark","light"].includes(t)===!1&&t!==null?(console.error(`Vue3 Mq: "${t}" is not a valid default theme. Reverting to unset value.`),null):t,ER=(t=null)=>["no-preference","reduce"].includes(t)===!1&&t!==null?(console.error(`Vue3 Mq: "${t}" is not a valid default motion preference. Reverting to unset value.`),null):t,Kk=t=>{if(!t||typeof t!="object")return!1;const e=[];for(let i in t){const o=parseFloat(t[i]);if(!i||typeof i!="string"){console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(i)}). Skipping.`);continue}else if(/^[^a-z]/i.test(i)||/[^a-zA-Z0-9_]/.test(i)){console.warn(`Vue3 Mq: "${i}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`);continue}else if(!o&&o!==0||isNaN(o)||o<0){console.warn(`Vue3 Mq: "${i}: ${t[i]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`);continue}e.push({name:i,min:o})}return e.some(i=>i.min===0)||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond."),new Set(e.map(i=>i.min)).size<e.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),e.length===0?!1:e.sort((i,o)=>i.min-o.min)};function Jk({breakpoints:t,preset:e}){const n=CR(e),r=Kk(t);if(n===!1&&!r)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");yR(r||Kk(n)),jR(),xR();const i=SR();for(const o in i){const a=i[o];id(a,()=>{qk(o)})}["portrait","landscape"].forEach(o=>{const a=()=>{Hk(o)};id(`(orientation: ${o})`,a)}),["light","dark"].forEach(o=>{const a=()=>{Uk(o)};id(`(prefers-color-scheme: ${o})`,a)}),["reduce","no-preference"].forEach(o=>{const a=()=>{Wk(o)};id(`(prefers-reduced-motion: ${o})`,a)})}var TR={install:(t,{preset:e="bootstrap5",breakpoints:n,defaultBreakpoint:r,defaultOrientation:i="landscape",defaultMotion:o="no-preference",defaultTheme:a}={})=>{try{const s=$R(i),u=OR(a),l=ER(o);bR(r),kR(s),wR(u),_R(l),t.provide("mq",gR),t.provide("updateBreakpoints",Jk),Jk({breakpoints:n,preset:e})}catch(s){console.error(s)}}};class Gm{constructor(){ei(this,"debug");ei(this,"logger",{log:()=>{}})}setupDebugger(e){this.debug=e,e&&(this.logger.log=console.log.bind(window.console))}}const Qm=new Gm,Zo=Qm.logger;function Fu(t,e){return Date.now()-t+e}function Ym(t){const e=parseInt(t,10);let n=Math.floor(e/3600),r=Math.floor((e-n*3600)/60),i=e-n*3600-r*60;return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),n+":"+r+":"+i}const AR=b.defineComponent({props:{containerCssClass:[String,Object],cantClose:{type:Boolean,default:!1}},methods:{close(){this.cantClose||this.$emit("close")}}}),vhe="",Hi=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},MR={class:"modal-header"},PR=b.createTextVNode(" default header "),NR={class:"modal-body"},IR=b.createTextVNode(" default body "),LR={class:"modal-footer"};function DR(t,e,n,r,i,o){return b.openBlock(),b.createBlock(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.createElementVNode("div",{class:"modal-mask",onClick:e[2]||(e[2]=(...a)=>t.close&&t.close(...a))},[b.createElementVNode("div",{class:b.normalizeClass(["modal-container bg-gray-800 card-4",t.containerCssClass]),onClick:e[1]||(e[1]=a=>a.stopPropagation())},[b.createElementVNode("div",MR,[t.cantClose?b.createCommentVNode("",!0):(b.openBlock(),b.createElementBlock("button",{key:0,class:"close-button",onClick:e[0]||(e[0]=(...a)=>t.close&&t.close(...a))}," X ")),b.renderSlot(t.$slots,"header",{},()=>[PR])]),b.createElementVNode("div",NR,[b.renderSlot(t.$slots,"body",{},()=>[IR])]),b.createElementVNode("div",LR,[b.renderSlot(t.$slots,"footer")])],2)])]),_:3})}const Ws=Hi(AR,[["render",DR]]);function Ia(t){return Array.isArray?Array.isArray(t):Yk(t)==="[object Array]"}const RR=1/0;function BR(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-RR?"-0":e}function zR(t){return t==null?"":BR(t)}function ea(t){return typeof t=="string"}function Gk(t){return typeof t=="number"}function FR(t){return t===!0||t===!1||VR(t)&&Yk(t)=="[object Boolean]"}function Qk(t){return typeof t=="object"}function VR(t){return Qk(t)&&t!==null}function Ui(t){return t!=null}function Xm(t){return!t.trim().length}function Yk(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ghe="Extended search is not available",qR="Incorrect 'index' type",HR=t=>`Invalid value for key ${t}`,UR=t=>`Pattern length exceeds max of ${t}.`,WR=t=>`Missing ${t} property in key`,KR=t=>`Property 'weight' in key '${t}' must be a positive integer`,Xk=Object.prototype.hasOwnProperty;class JR{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let i=Zk(r);n+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Zk(t){let e=null,n=null,r=null,i=1,o=null;if(ea(t)||Ia(t))r=t,e=ew(t),n=Zm(t);else{if(!Xk.call(t,"name"))throw new Error(WR("name"));const a=t.name;if(r=a,Xk.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(KR(a));e=ew(a),n=Zm(a),o=t.getFn}return{path:e,id:n,weight:i,src:r,getFn:o}}function ew(t){return Ia(t)?t:t.split(".")}function Zm(t){return Ia(t)?t.join("."):t}function GR(t,e){let n=[],r=!1;const i=(o,a,s)=>{if(!!Ui(o))if(!a[s])n.push(o);else{let u=a[s];const l=o[u];if(!Ui(l))return;if(s===a.length-1&&(ea(l)||Gk(l)||FR(l)))n.push(zR(l));else if(Ia(l)){r=!0;for(let f=0,c=l.length;f<c;f+=1)i(l[f],a,s+1)}else a.length&&i(l,a,s+1)}};return i(t,ea(e)?e.split("."):e,0),r?n:n[0]}var an={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:GR,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const QR=/[^ ]+/g;function YR(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(i){const o=i.match(QR).length;if(n.has(o))return n.get(o);const a=1/Math.pow(o,.5*t),s=parseFloat(Math.round(a*r)/r);return n.set(o,s),s},clear(){n.clear()}}}class ev{constructor({getFn:e=an.getFn,fieldNormWeight:n=an.fieldNormWeight}={}){this.norm=YR(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ea(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ea(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Ui(e)||Xm(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((i,o)=>{let a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(!!Ui(a)){if(Ia(a)){let s=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:l,value:f}=u.pop();if(!!Ui(f))if(ea(f)&&!Xm(f)){let c={v:f,i:l,n:this.norm.get(f)};s.push(c)}else Ia(f)&&f.forEach((c,d)=>{u.push({nestedArrIndex:d,value:c})})}r.$[o]=s}else if(ea(a)&&!Xm(a)){let s={v:a,n:this.norm.get(a)};r.$[o]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function tw(t,e,{getFn:n=an.getFn,fieldNormWeight:r=an.fieldNormWeight}={}){const i=new ev({getFn:n,fieldNormWeight:r});return i.setKeys(t.map(Zk)),i.setSources(e),i.create(),i}function XR(t,{getFn:e=an.getFn,fieldNormWeight:n=an.fieldNormWeight}={}){const{keys:r,records:i}=t,o=new ev({getFn:e,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o}function od(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:i=an.distance,ignoreLocation:o=an.ignoreLocation}={}){const a=e/t.length;if(o)return a;const s=Math.abs(r-n);return i?a+s/i:s?1:a}function ZR(t=[],e=an.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let a=t.length;o<a;o+=1){let s=t[o];s&&r===-1?r=o:!s&&r!==-1&&(i=o-1,i-r+1>=e&&n.push([r,i]),r=-1)}return t[o-1]&&o-r>=e&&n.push([r,o-1]),n}const Ks=32;function e9(t,e,n,{location:r=an.location,distance:i=an.distance,threshold:o=an.threshold,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,includeMatches:u=an.includeMatches,ignoreLocation:l=an.ignoreLocation}={}){if(e.length>Ks)throw new Error(UR(Ks));const f=e.length,c=t.length,d=Math.max(0,Math.min(r,c));let h=o,p=d;const m=s>1||u,g=m?Array(c):[];let v;for(;(v=t.indexOf(e,p))>-1;){let C=od(e,{currentLocation:v,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(C,h),p=v+f,m){let A=0;for(;A<f;)g[v+A]=1,A+=1}}p=-1;let y=[],k=1,w=f+c;const _=1<<f-1;for(let C=0;C<f;C+=1){let A=0,$=w;for(;A<$;)od(e,{errors:C,currentLocation:d+$,expectedLocation:d,distance:i,ignoreLocation:l})<=h?A=$:w=$,$=Math.floor((w-A)/2+A);w=$;let E=Math.max(1,d-$+1),O=a?c:Math.min(d+$,c)+f,z=Array(O+2);z[O+1]=(1<<C)-1;for(let M=O;M>=E;M-=1){let H=M-1,G=n[t.charAt(H)];if(m&&(g[H]=+!!G),z[M]=(z[M+1]<<1|1)&G,C&&(z[M]|=(y[M+1]|y[M])<<1|1|y[M+1]),z[M]&_&&(k=od(e,{errors:C,currentLocation:H,expectedLocation:d,distance:i,ignoreLocation:l}),k<=h)){if(h=k,p=H,p<=d)break;E=Math.max(1,2*d-p)}}if(od(e,{errors:C+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;y=z}const S={isMatch:p>=0,score:Math.max(.001,k)};if(m){const C=ZR(g,s);C.length?u&&(S.indices=C):S.isMatch=!1}return S}function t9(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<r-n-1}return e}class nw{constructor(e,{location:n=an.location,threshold:r=an.threshold,distance:i=an.distance,includeMatches:o=an.includeMatches,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,isCaseSensitive:u=an.isCaseSensitive,ignoreLocation:l=an.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:l},this.pattern=u?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const f=(d,h)=>{this.chunks.push({pattern:d,alphabet:t9(d),startIndex:h})},c=this.pattern.length;if(c>Ks){let d=0;const h=c%Ks,p=c-h;for(;d<p;)f(this.pattern.substr(d,Ks),d),d+=Ks;if(h){const m=c-Ks;f(this.pattern.substr(m),m)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(e=e.toLowerCase()),this.pattern===e){let p={isMatch:!0,score:0};return r&&(p.indices=[[0,e.length-1]]),p}const{location:i,distance:o,threshold:a,findAllMatches:s,minMatchCharLength:u,ignoreLocation:l}=this.options;let f=[],c=0,d=!1;this.chunks.forEach(({pattern:p,alphabet:m,startIndex:g})=>{const{isMatch:v,score:y,indices:k}=e9(e,p,m,{location:i+g,distance:o,threshold:a,findAllMatches:s,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});v&&(d=!0),c+=y,v&&k&&(f=[...f,...k])});let h={isMatch:d,score:d?c/this.chunks.length:1};return d&&r&&(h.indices=f),h}}class us{constructor(e){this.pattern=e}static isMultiMatch(e){return rw(e,this.multiRegex)}static isSingleMatch(e){return rw(e,this.singleRegex)}search(){}}function rw(t,e){const n=t.match(e);return n?n[1]:null}class n9 extends us{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class r9 extends us{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class i9 extends us{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class o9 extends us{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class a9 extends us{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class s9 extends us{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class iw extends us{constructor(e,{location:n=an.location,threshold:r=an.threshold,distance:i=an.distance,includeMatches:o=an.includeMatches,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,isCaseSensitive:u=an.isCaseSensitive,ignoreLocation:l=an.ignoreLocation}={}){super(e),this._bitapSearch=new nw(e,{location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ow extends us{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const i=[],o=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+o,i.push([r,n-1]);const a=!!i.length;return{isMatch:a,score:a?0:1,indices:i}}}const tv=[n9,ow,i9,o9,s9,a9,r9,iw],aw=tv.length,u9=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,l9="|";function c9(t,e={}){return t.split(l9).map(n=>{let r=n.trim().split(u9).filter(o=>o&&!!o.trim()),i=[];for(let o=0,a=r.length;o<a;o+=1){const s=r[o];let u=!1,l=-1;for(;!u&&++l<aw;){const f=tv[l];let c=f.isMultiMatch(s);c&&(i.push(new f(c,e)),u=!0)}if(!u)for(l=-1;++l<aw;){const f=tv[l];let c=f.isSingleMatch(s);if(c){i.push(new f(c,e));break}}}return i})}const f9=new Set([iw.type,ow.type]);class d9{constructor(e,{isCaseSensitive:n=an.isCaseSensitive,includeMatches:r=an.includeMatches,minMatchCharLength:i=an.minMatchCharLength,ignoreLocation:o=an.ignoreLocation,findAllMatches:a=an.findAllMatches,location:s=an.location,threshold:u=an.threshold,distance:l=an.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:o,location:s,threshold:u,distance:l},this.pattern=n?e:e.toLowerCase(),this.query=c9(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i}=this.options;e=i?e:e.toLowerCase();let o=0,a=[],s=0;for(let u=0,l=n.length;u<l;u+=1){const f=n[u];a.length=0,o=0;for(let c=0,d=f.length;c<d;c+=1){const h=f[c],{isMatch:p,indices:m,score:g}=h.search(e);if(p){if(o+=1,s+=g,r){const v=h.constructor.type;f9.has(v)?a=[...a,...m]:a.push(m)}}else{s=0,o=0,a.length=0;break}}if(o){let c={isMatch:!0,score:s/o};return r&&(c.indices=a),c}}return{isMatch:!1,score:1}}}const nv=[];function h9(...t){nv.push(...t)}function rv(t,e){for(let n=0,r=nv.length;n<r;n+=1){let i=nv[n];if(i.condition(t,e))return new i(t,e)}return new nw(t,e)}const ad={AND:"$and",OR:"$or"},iv={PATH:"$path",PATTERN:"$val"},ov=t=>!!(t[ad.AND]||t[ad.OR]),p9=t=>!!t[iv.PATH],m9=t=>!Ia(t)&&Qk(t)&&!ov(t),sw=t=>({[ad.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function uw(t,e,{auto:n=!0}={}){const r=i=>{let o=Object.keys(i);const a=p9(i);if(!a&&o.length>1&&!ov(i))return r(sw(i));if(m9(i)){const u=a?i[iv.PATH]:o[0],l=a?i[iv.PATTERN]:i[u];if(!ea(l))throw new Error(HR(u));const f={keyId:Zm(u),pattern:l};return n&&(f.searcher=rv(l,e)),f}let s={children:[],operator:o[0]};return o.forEach(u=>{const l=i[u];Ia(l)&&l.forEach(f=>{s.children.push(r(f))})}),s};return ov(t)||(t=sw(t)),r(t)}function v9(t,{ignoreFieldNorm:e=an.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:o,score:a})=>{const s=i?i.weight:null;r*=Math.pow(a===0&&s?Number.EPSILON:a,(s||1)*(e?1:o))}),n.score=r})}function g9(t,e){const n=t.matches;e.matches=[],Ui(n)&&n.forEach(r=>{if(!Ui(r.indices)||!r.indices.length)return;const{indices:i,value:o}=r;let a={indices:i,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),e.matches.push(a)})}function y9(t,e){e.score=t.score}function b9(t,e,{includeMatches:n=an.includeMatches,includeScore:r=an.includeScore}={}){const i=[];return n&&i.push(g9),r&&i.push(y9),t.map(o=>{const{idx:a}=o,s={item:e[a],refIndex:a};return i.length&&i.forEach(u=>{u(o,s)}),s})}class Vu{constructor(e,n={},r){this.options={...an,...n},this.options.useExtendedSearch,this._keyStore=new JR(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof ev))throw new Error(qR);this._myIndex=n||tw(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){!Ui(e)||(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const o=this._docs[r];e(o,r)&&(this.removeAt(r),r-=1,i-=1,n.push(o))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:o,sortFn:a,ignoreFieldNorm:s}=this.options;let u=ea(e)?ea(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return v9(u,{ignoreFieldNorm:s}),o&&u.sort(a),Gk(n)&&n>-1&&(u=u.slice(0,n)),b9(u,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e){const n=rv(e,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:o,i:a,n:s})=>{if(!Ui(o))return;const{isMatch:u,score:l,indices:f}=n.searchIn(o);u&&i.push({item:o,idx:a,matches:[{score:l,value:o,norm:s,indices:f}]})}),i}_searchLogical(e){const n=uw(e,this.options),r=(s,u,l)=>{if(!s.children){const{keyId:c,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(u,c),searcher:d});return h&&h.length?[{idx:l,item:u,matches:h}]:[]}const f=[];for(let c=0,d=s.children.length;c<d;c+=1){const h=s.children[c],p=r(h,u,l);if(p.length)f.push(...p);else if(s.operator===ad.AND)return[]}return f},i=this._myIndex.records,o={},a=[];return i.forEach(({$:s,i:u})=>{if(Ui(s)){let l=r(n,s,u);l.length&&(o[u]||(o[u]={idx:u,item:s,matches:[]},a.push(o[u])),l.forEach(({matches:f})=>{o[u].matches.push(...f)}))}}),a}_searchObjectList(e){const n=rv(e,this.options),{keys:r,records:i}=this._myIndex,o=[];return i.forEach(({$:a,i:s})=>{if(!Ui(a))return;let u=[];r.forEach((l,f)=>{u.push(...this._findMatches({key:l,value:a[f],searcher:n}))}),u.length&&o.push({idx:s,item:a,matches:u})}),o}_findMatches({key:e,value:n,searcher:r}){if(!Ui(n))return[];let i=[];if(Ia(n))n.forEach(({v:o,i:a,n:s})=>{if(!Ui(o))return;const{isMatch:u,score:l,indices:f}=r.searchIn(o);u&&i.push({score:l,key:e,value:o,idx:a,norm:s,indices:f})});else{const{v:o,n:a}=n,{isMatch:s,score:u,indices:l}=r.searchIn(o);s&&i.push({score:u,key:e,value:o,norm:a,indices:l})}return i}}Vu.version="6.6.2",Vu.createIndex=tw,Vu.parseIndex=XR,Vu.config=an,Vu.parseQuery=uw,h9(d9);var lw,cw,fw,dw,hw,pw,mw,vw,gw,yw,bw,kw,ww,_w,xw,jw,Sw,Cw,$w,Ow,Ew,Tw,Aw,Mw,Pw,Nw,Iw,Lw,Dw,Rw,Bw,zw,Fw,Vw,qw,Hw,Uw,Ww,Kw,Jw,Gw,Qw,Yw,Xw,Zw,e_,t_,n_,r_,i_,o_,a_,s_,u_,l_,c_,f_,d_,h_,p_,m_,v_,g_,y_,b_,k_,w_,__,x_,j_,S_,C_,$_,O_,E_,T_,A_,M_,P_,N_,I_,L_,D_,R_,B_,z_,F_,V_,q_,H_,U_,W_,K_,J_,G_,Q_,Y_,X_,Z_,ex,tx,nx,rx,ix,ox,ax,sx,ux,lx,cx,fx,dx,hx,px,mx,vx,gx,yx,bx,kx,wx,_x,xx,jx,Sx,Cx,$x,Ox,Ex,Tx,Ax,Mx,Px,Nx,Ix,Lx,Dx,Rx,Bx,zx,Fx,Vx,qx,Hx,Ux,Wx,Kx,Jx,Gx,Qx,Yx,Xx,Zx,ej,tj,nj,rj,ij,oj,aj,sj,uj,lj,cj,fj,dj,hj,pj,mj,vj,gj,yj,bj,kj,wj,_j,xj,jj,Sj,Cj,$j,Oj,Ej,Tj,Aj,Mj,Pj,Nj,Ij,Lj,Dj,Rj,Bj,zj,Fj,Vj,qj,Hj,Uj,Wj,Kj,Jj,Gj,Qj,Yj,Xj,Zj,e2,t2,n2,r2,i2,o2,a2,s2,u2,l2,c2,f2,d2,h2,p2,m2,v2,g2,y2,b2,k2,w2,_2,x2,j2,S2,C2,$2,O2,E2,T2,A2,M2,P2,N2,I2,L2,D2,R2,B2,z2,F2,V2,q2,H2,U2,W2,K2,J2,G2,Q2,Y2,X2,Z2,eS,tS,nS,rS,iS,oS,aS,sS,uS,lS,cS,fS,dS,hS,pS,mS,vS,gS,yS,bS,kS;function sd(t){var e=typeof Map=="function"?new Map:void 0;return(sd=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return wS(n,arguments,vn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ud(i,n)})(t)}function wS(t,e,n){return(wS=jS()?Reflect.construct.bind():function(r,i,o){var a=[null];a.push.apply(a,i);var s=new(Function.bind.apply(r,a));return o&&ud(s,o.prototype),s}).apply(null,arguments)}function ue(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function At(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */At=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=typeof Symbol=="function"?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(E,O,z){return Object.defineProperty(E,O,{value:z,enumerable:!0,configurable:!0,writable:!0}),E[O]}try{s({},"")}catch{s=function(O,z,P){return O[z]=P}}function u(E,O,z,P){var M=O&&O.prototype instanceof c?O:c,H=Object.create(M.prototype),G=new C(P||[]);return H._invoke=function(V,J,F){var I="suspendedStart";return function(L,B){if(I==="executing")throw new Error("Generator is already running");if(I==="completed"){if(L==="throw")throw B;return $()}for(F.method=L,F.arg=B;;){var N=F.delegate;if(N){var x=w(N,F);if(x){if(x===f)continue;return x}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(I==="suspendedStart")throw I="completed",F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);I="executing";var j=l(V,J,F);if(j.type==="normal"){if(I=F.done?"completed":"suspendedYield",j.arg===f)continue;return{value:j.arg,done:F.done}}j.type==="throw"&&(I="completed",F.method="throw",F.arg=j.arg)}}}(E,z,G),H}function l(E,O,z){try{return{type:"normal",arg:E.call(O,z)}}catch(P){return{type:"throw",arg:P}}}t.wrap=u;var f={};function c(){}function d(){}function h(){}var p={};s(p,i,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(A([])));g&&g!==e&&n.call(g,i)&&(p=g);var v=h.prototype=c.prototype=Object.create(p);function y(E){["next","throw","return"].forEach(function(O){s(E,O,function(z){return this._invoke(O,z)})})}function k(E,O){function z(M,H,G,V){var J=l(E[M],E,H);if(J.type!=="throw"){var F=J.arg,I=F.value;return I&&vt(I)=="object"&&n.call(I,"__await")?O.resolve(I.__await).then(function(L){z("next",L,G,V)},function(L){z("throw",L,G,V)}):O.resolve(I).then(function(L){F.value=L,G(F)},function(L){return z("throw",L,G,V)})}V(J.arg)}var P;this._invoke=function(M,H){function G(){return new O(function(V,J){z(M,H,V,J)})}return P=P?P.then(G,G):G()}}function w(E,O){var z=E.iterator[O.method];if(z===void 0){if(O.delegate=null,O.method==="throw"){if(E.iterator.return&&(O.method="return",O.arg=void 0,w(E,O),O.method==="throw"))return f;O.method="throw",O.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var P=l(z,E.iterator,O.arg);if(P.type==="throw")return O.method="throw",O.arg=P.arg,O.delegate=null,f;var M=P.arg;return M?M.done?(O[E.resultName]=M.value,O.next=E.nextLoc,O.method!=="return"&&(O.method="next",O.arg=void 0),O.delegate=null,f):M:(O.method="throw",O.arg=new TypeError("iterator result is not an object"),O.delegate=null,f)}function _(E){var O={tryLoc:E[0]};1 in E&&(O.catchLoc=E[1]),2 in E&&(O.finallyLoc=E[2],O.afterLoc=E[3]),this.tryEntries.push(O)}function S(E){var O=E.completion||{};O.type="normal",delete O.arg,E.completion=O}function C(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(_,this),this.reset(!0)}function A(E){if(E){var O=E[i];if(O)return O.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var z=-1,P=function M(){for(;++z<E.length;)if(n.call(E,z))return M.value=E[z],M.done=!1,M;return M.value=void 0,M.done=!0,M};return P.next=P}}return{next:$}}function $(){return{value:void 0,done:!0}}return d.prototype=h,s(v,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(E){var O=typeof E=="function"&&E.constructor;return!!O&&(O===d||(O.displayName||O.name)==="GeneratorFunction")},t.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,h):(E.__proto__=h,s(E,a,"GeneratorFunction")),E.prototype=Object.create(v),E},t.awrap=function(E){return{__await:E}},y(k.prototype),s(k.prototype,o,function(){return this}),t.AsyncIterator=k,t.async=function(E,O,z,P,M){M===void 0&&(M=Promise);var H=new k(u(E,O,z,P),M);return t.isGeneratorFunction(O)?H:H.next().then(function(G){return G.done?G.value:H.next()})},y(v),s(v,a,"Generator"),s(v,i,function(){return this}),s(v,"toString",function(){return"[object Generator]"}),t.keys=function(E){var O=[];for(var z in E)O.push(z);return O.reverse(),function P(){for(;O.length;){var M=O.pop();if(M in E)return P.value=M,P.done=!1,P}return P.done=!0,P}},t.values=A,C.prototype={constructor:C,reset:function(E){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!E)for(var O in this)O.charAt(0)==="t"&&n.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=void 0)},stop:function(){this.done=!0;var E=this.tryEntries[0].completion;if(E.type==="throw")throw E.arg;return this.rval},dispatchException:function(E){if(this.done)throw E;var O=this;function z(J,F){return H.type="throw",H.arg=E,O.next=J,F&&(O.method="next",O.arg=void 0),!!F}for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P],H=M.completion;if(M.tryLoc==="root")return z("end");if(M.tryLoc<=this.prev){var G=n.call(M,"catchLoc"),V=n.call(M,"finallyLoc");if(G&&V){if(this.prev<M.catchLoc)return z(M.catchLoc,!0);if(this.prev<M.finallyLoc)return z(M.finallyLoc)}else if(G){if(this.prev<M.catchLoc)return z(M.catchLoc,!0)}else{if(!V)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return z(M.finallyLoc)}}}},abrupt:function(E,O){for(var z=this.tryEntries.length-1;z>=0;--z){var P=this.tryEntries[z];if(P.tryLoc<=this.prev&&n.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var M=P;break}}M&&(E==="break"||E==="continue")&&M.tryLoc<=O&&O<=M.finallyLoc&&(M=null);var H=M?M.completion:{};return H.type=E,H.arg=O,M?(this.method="next",this.next=M.finallyLoc,f):this.complete(H)},complete:function(E,O){if(E.type==="throw")throw E.arg;return E.type==="break"||E.type==="continue"?this.next=E.arg:E.type==="return"?(this.rval=this.arg=E.arg,this.method="return",this.next="end"):E.type==="normal"&&O&&(this.next=O),f},finish:function(E){for(var O=this.tryEntries.length-1;O>=0;--O){var z=this.tryEntries[O];if(z.finallyLoc===E)return this.complete(z.completion,z.afterLoc),S(z),f}},catch:function(E){for(var O=this.tryEntries.length-1;O>=0;--O){var z=this.tryEntries[O];if(z.tryLoc===E){var P=z.completion;if(P.type==="throw"){var M=P.arg;S(z)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(E,O,z){return this.delegate={iterator:A(E),resultName:O,nextLoc:z},this.method==="next"&&(this.arg=void 0),f}},t}function _S(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(l){return void n(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function Un(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(u){_S(o,r,i,a,s,"next",u)}function s(u){_S(o,r,i,a,s,"throw",u)}a(void 0)})}}function fe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=av(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
7
+ */(function(t,e){(function(n,r){t.exports=r()})(bi,function(){function n(we){var Pe=typeof we;return we!==null&&(Pe==="object"||Pe==="function")}function r(we){return typeof we=="function"}var i=void 0;Array.isArray?i=Array.isArray:i=function(we){return Object.prototype.toString.call(we)==="[object Array]"};var o=i,a=0,s=void 0,u=void 0,l=function(Pe,Be){S[a]=Pe,S[a+1]=Be,a+=2,a===2&&(u?u(C):$())};function f(we){u=we}function c(we){l=we}var d=typeof window<"u"?window:void 0,h=d||{},p=h.MutationObserver||h.WebKitMutationObserver,m=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",g=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function v(){return function(){return process.nextTick(C)}}function y(){return typeof s<"u"?function(){s(C)}:_()}function k(){var we=0,Pe=new p(C),Be=document.createTextNode("");return Pe.observe(Be,{characterData:!0}),function(){Be.data=we=++we%2}}function w(){var we=new MessageChannel;return we.port1.onmessage=C,function(){return we.port2.postMessage(0)}}function _(){var we=setTimeout;return function(){return we(C,1)}}var S=new Array(1e3);function C(){for(var we=0;we<a;we+=2){var Pe=S[we],Be=S[we+1];Pe(Be),S[we]=void 0,S[we+1]=void 0}a=0}function A(){try{var we=Function("return this")().require("vertx");return s=we.runOnLoop||we.runOnContext,y()}catch{return _()}}var $=void 0;m?$=v():p?$=k():g?$=w():d===void 0&&typeof fR=="function"?$=A():$=_();function E(we,Pe){var Be=this,et=new this.constructor(P);et[z]===void 0&&le(et);var it=Be._state;if(it){var xe=arguments[it-1];l(function(){return me(it,et,xe,Be._result)})}else q(Be,et,we,Pe);return et}function O(we){var Pe=this;if(we&&typeof we=="object"&&we.constructor===Pe)return we;var Be=new Pe(P);return N(Be,we),Be}var z=Math.random().toString(36).substring(2);function P(){}var M=void 0,H=1,G=2;function V(){return new TypeError("You cannot resolve a promise with itself")}function J(){return new TypeError("A promises callback cannot return that same promise.")}function F(we,Pe,Be,et){try{we.call(Pe,Be,et)}catch(it){return it}}function I(we,Pe,Be){l(function(et){var it=!1,xe=F(Be,Pe,function(Qe){it||(it=!0,Pe!==Qe?N(et,Qe):j(et,Qe))},function(Qe){it||(it=!0,T(et,Qe))},"Settle: "+(et._label||" unknown promise"));!it&&xe&&(it=!0,T(et,xe))},we)}function L(we,Pe){Pe._state===H?j(we,Pe._result):Pe._state===G?T(we,Pe._result):q(Pe,void 0,function(Be){return N(we,Be)},function(Be){return T(we,Be)})}function B(we,Pe,Be){Pe.constructor===we.constructor&&Be===E&&Pe.constructor.resolve===O?L(we,Pe):Be===void 0?j(we,Pe):r(Be)?I(we,Pe,Be):j(we,Pe)}function N(we,Pe){if(we===Pe)T(we,V());else if(n(Pe)){var Be=void 0;try{Be=Pe.then}catch(et){T(we,et);return}B(we,Pe,Be)}else j(we,Pe)}function x(we){we._onerror&&we._onerror(we._result),Q(we)}function j(we,Pe){we._state===M&&(we._result=Pe,we._state=H,we._subscribers.length!==0&&l(Q,we))}function T(we,Pe){we._state===M&&(we._state=G,we._result=Pe,l(x,we))}function q(we,Pe,Be,et){var it=we._subscribers,xe=it.length;we._onerror=null,it[xe]=Pe,it[xe+H]=Be,it[xe+G]=et,xe===0&&we._state&&l(Q,we)}function Q(we){var Pe=we._subscribers,Be=we._state;if(Pe.length!==0){for(var et=void 0,it=void 0,xe=we._result,Qe=0;Qe<Pe.length;Qe+=3)et=Pe[Qe],it=Pe[Qe+Be],et?me(Be,et,it,xe):it(xe);we._subscribers.length=0}}function me(we,Pe,Be,et){var it=r(Be),xe=void 0,Qe=void 0,Nt=!0;if(it){try{xe=Be(et)}catch(Cn){Nt=!1,Qe=Cn}if(Pe===xe){T(Pe,J());return}}else xe=et;Pe._state!==M||(it&&Nt?N(Pe,xe):Nt===!1?T(Pe,Qe):we===H?j(Pe,xe):we===G&&T(Pe,xe))}function ve(we,Pe){try{Pe(function(et){N(we,et)},function(et){T(we,et)})}catch(Be){T(we,Be)}}var R=0;function U(){return R++}function le(we){we[z]=R++,we._state=void 0,we._result=void 0,we._subscribers=[]}function oe(){return new Error("Array Methods must be provided an Array")}var pe=function(){function we(Pe,Be){this._instanceConstructor=Pe,this.promise=new Pe(P),this.promise[z]||le(this.promise),o(Be)?(this.length=Be.length,this._remaining=Be.length,this._result=new Array(this.length),this.length===0?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(Be),this._remaining===0&&j(this.promise,this._result))):T(this.promise,oe())}return we.prototype._enumerate=function(Be){for(var et=0;this._state===M&&et<Be.length;et++)this._eachEntry(Be[et],et)},we.prototype._eachEntry=function(Be,et){var it=this._instanceConstructor,xe=it.resolve;if(xe===O){var Qe=void 0,Nt=void 0,Cn=!1;try{Qe=Be.then}catch(re){Cn=!0,Nt=re}if(Qe===E&&Be._state!==M)this._settledAt(Be._state,et,Be._result);else if(typeof Qe!="function")this._remaining--,this._result[et]=Be;else if(it===Ue){var Ln=new it(P);Cn?T(Ln,Nt):B(Ln,Be,Qe),this._willSettleAt(Ln,et)}else this._willSettleAt(new it(function(re){return re(Be)}),et)}else this._willSettleAt(xe(Be),et)},we.prototype._settledAt=function(Be,et,it){var xe=this.promise;xe._state===M&&(this._remaining--,Be===G?T(xe,it):this._result[et]=it),this._remaining===0&&j(xe,this._result)},we.prototype._willSettleAt=function(Be,et){var it=this;q(Be,void 0,function(xe){return it._settledAt(H,et,xe)},function(xe){return it._settledAt(G,et,xe)})},we}();function Ce(we){return new pe(this,we).promise}function ce(we){var Pe=this;return o(we)?new Pe(function(Be,et){for(var it=we.length,xe=0;xe<it;xe++)Pe.resolve(we[xe]).then(Be,et)}):new Pe(function(Be,et){return et(new TypeError("You must pass an array to race."))})}function X(we){var Pe=this,Be=new Pe(P);return T(Be,we),Be}function ze(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Je(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Ue=function(){function we(Pe){this[z]=U(),this._result=this._state=void 0,this._subscribers=[],P!==Pe&&(typeof Pe!="function"&&ze(),this instanceof we?ve(this,Pe):Je())}return we.prototype.catch=function(Be){return this.then(null,Be)},we.prototype.finally=function(Be){var et=this,it=et.constructor;return r(Be)?et.then(function(xe){return it.resolve(Be()).then(function(){return xe})},function(xe){return it.resolve(Be()).then(function(){throw xe})}):et.then(Be,Be)},we}();Ue.prototype.then=E,Ue.all=Ce,Ue.race=ce,Ue.resolve=O,Ue.reject=X,Ue._setScheduler=f,Ue._setAsap=c,Ue._asap=l;function Me(){var we=void 0;if(typeof bi<"u")we=bi;else if(typeof self<"u")we=self;else try{we=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var Pe=we.Promise;if(Pe){var Be=null;try{Be=Object.prototype.toString.call(Pe.resolve())}catch{}if(Be==="[object Promise]"&&!Pe.cast)return}we.Promise=Ue}return Ue.polyfill=Me,Ue.Promise=Ue,Ue})})(Dk),Dk.exports.polyfill();const she="",uhe="",Rk=b.ref([]),Bk=b.ref(null),zk=b.ref(null),Fk=b.ref(null),Vk=b.ref(null),ti=b.reactive({current:""}),Wm=[],dR=b.ref(!1),Km=b.readonly(Rk),hR=b.readonly(Bk),pR=b.readonly(zk),mR=b.readonly(Fk),vR=b.readonly(Vk),gR=b.readonly(ti),yR=t=>{Rk.value=t},bR=t=>{Bk.value=t},kR=t=>{zk.value=t},wR=t=>{Fk.value=t},_R=t=>{Vk.value=t},qk=(t=hR.value)=>{ti.current=t;const e=Km.value.findIndex(r=>r.name===t),n=Km.value.map(r=>r.name);for(let r=0;r<n.length;r++){if(r>0&&r<n.length-1){const i=n[r]+"Minus",o=n[r]+"Plus";ti[i]=e<=r,ti[o]=e>=r}ti[n[r]]=n[r]===t}},xR=()=>{const t=Object.keys(ti);for(let e of t)delete ti[e];qk(),Hk(),Uk(),Wk()},Hk=(t=pR.value)=>{ti.orientation=t,ti.isLandscape=t==="landscape",ti.isPortrait=t==="portrait"},Uk=(t=mR.value||"light")=>{ti.theme=t,ti.isDark=t==="dark",ti.isLight=t==="light"},Wk=(t=vR.value||"no-preference")=>{ti.motionPreference=t,ti.isMotion=t==="no-preference",ti.isInert=t==="reduce"};function jR(){for(;Wm.length>0;){const t=Wm.shift();if(t&&typeof t=="object"){const{mql:e,cb:n}=t;e.addEventListener&&typeof e.addEventListener=="function"?e.removeEventListener("change",n):e.removeListener(n)}}}function SR(){return Km.value.reduce((e,n,r,i)=>{const o=`(min-width: ${n.min}px)`,a=r<i.length-1?`(max-width: ${i[r+1].min-1}px)`:null,s=o+(a?" and "+a:"");return Object.assign(e,{[n.name]:s})},{})}function id(t,e){if(typeof window>"u"||!window.matchMedia)return!1;if(typeof window<"u"&&!window.matchMedia)return console.error("Vue3 Mq: No MatchMedia support detected in this browser. Responsive breakpoints not available."),!1;{dR.value=!0;const n=window.matchMedia(t),r=({matches:o})=>{o&&e()};Wm.push({mql:n,cb:r}),n.addEventListener&&typeof n.addEventListener=="function"?n.addEventListener("change",r):n.addListener(r),r(n)}}var Jm=Object.freeze(Object.defineProperty({__proto__:null,bootstrap5:{xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},bootstrap4:{xs:0,sm:576,md:768,lg:992,xl:1200},bootstrap3:{xs:0,sm:768,md:992,lg:1200},vuetify:{xs:0,sm:600,md:960,lg:1264,xl:1904},tailwind:{xs:0,sm:640,md:768,lg:1024,xl:1280,xxl:1536},devices:{phone:0,tablet:768,laptop:1370,desktop:1906},wordpress:{mobile:0,small:600,medium:782,large:960,xlarge:1080,wide:1280,huge:1440}},Symbol.toStringTag,{value:"Module"}));const CR=t=>{if(typeof t=="string"&&Jm[t])return Jm[t];{const e=Object.keys(Jm);return console.error(`Vue3 Mq: "${t}" is not a valid preset. Available options are: ${e.join(", ")}`),!1}},$R=t=>["landscape","portrait"].includes(t)===!1?(console.error(`Vue3 Mq: "${t}" is not a valid default orientation. Reverting to unset value.`),null):t,OR=(t=null)=>["dark","light"].includes(t)===!1&&t!==null?(console.error(`Vue3 Mq: "${t}" is not a valid default theme. Reverting to unset value.`),null):t,ER=(t=null)=>["no-preference","reduce"].includes(t)===!1&&t!==null?(console.error(`Vue3 Mq: "${t}" is not a valid default motion preference. Reverting to unset value.`),null):t,Kk=t=>{if(!t||typeof t!="object")return!1;const e=[];for(let i in t){const o=parseFloat(t[i]);if(!i||typeof i!="string"){console.warn(`Vue3 Mq: Invalid or missing breakpoint key (${JSON.stringify(i)}). Skipping.`);continue}else if(/^[^a-z]/i.test(i)||/[^a-zA-Z0-9_]/.test(i)){console.warn(`Vue3 Mq: "${i}" is an invalid breakpoint key. Breakpoint keys must start with a letter and contain only alphanumeric characters and underscores. Skipping.`);continue}else if(!o&&o!==0||isNaN(o)||o<0){console.warn(`Vue3 Mq: "${i}: ${t[i]}" is not a valid breakpoint. Breakpoints should be a number of zero or above. Skipping.`);continue}e.push({name:i,min:o})}return e.some(i=>i.min===0)||console.warn("Vue3 Mq: You have not declared a breakpoint with a minimum value of 0. There may be screen sizes to which Vue3Mq does not respond."),new Set(e.map(i=>i.min)).size<e.length&&console.warn("Vue3 Mq: Your breakpoint configuration contains duplicate values. Behaviour may be unpredictable."),e.length===0?!1:e.sort((i,o)=>i.min-o.min)};function Jk({breakpoints:t,preset:e}){const n=CR(e),r=Kk(t);if(n===!1&&!r)throw new TypeError("Vue3 Mq: You must provide a valid preset, or valid breakpoint settings.");yR(r||Kk(n)),jR(),xR();const i=SR();for(const o in i){const a=i[o];id(a,()=>{qk(o)})}["portrait","landscape"].forEach(o=>{const a=()=>{Hk(o)};id(`(orientation: ${o})`,a)}),["light","dark"].forEach(o=>{const a=()=>{Uk(o)};id(`(prefers-color-scheme: ${o})`,a)}),["reduce","no-preference"].forEach(o=>{const a=()=>{Wk(o)};id(`(prefers-reduced-motion: ${o})`,a)})}var TR={install:(t,{preset:e="bootstrap5",breakpoints:n,defaultBreakpoint:r,defaultOrientation:i="landscape",defaultMotion:o="no-preference",defaultTheme:a}={})=>{try{const s=$R(i),u=OR(a),l=ER(o);bR(r),kR(s),wR(u),_R(l),t.provide("mq",gR),t.provide("updateBreakpoints",Jk),Jk({breakpoints:n,preset:e})}catch(s){console.error(s)}}};class Gm{constructor(){ei(this,"debug");ei(this,"logger",{log:()=>{}})}setupDebugger(e){this.debug=e,e&&(this.logger.log=console.log.bind(window.console))}}const Qm=new Gm,Zo=Qm.logger;function Fu(t,e){return Date.now()-t+e}function Ym(t){const e=parseInt(t,10);let n=Math.floor(e/3600),r=Math.floor((e-n*3600)/60),i=e-n*3600-r*60;return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),n+":"+r+":"+i}const AR=b.defineComponent({props:{containerCssClass:[String,Object],cantClose:{type:Boolean,default:!1}},methods:{close(){this.cantClose||this.$emit("close")}}}),ghe="",Hi=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},MR={class:"modal-header"},PR=b.createTextVNode(" default header "),NR={class:"modal-body"},IR=b.createTextVNode(" default body "),LR={class:"modal-footer"};function DR(t,e,n,r,i,o){return b.openBlock(),b.createBlock(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.createElementVNode("div",{class:"modal-mask",onClick:e[2]||(e[2]=(...a)=>t.close&&t.close(...a))},[b.createElementVNode("div",{class:b.normalizeClass(["modal-container bg-gray-800 card-4",t.containerCssClass]),onClick:e[1]||(e[1]=a=>a.stopPropagation())},[b.createElementVNode("div",MR,[t.cantClose?b.createCommentVNode("",!0):(b.openBlock(),b.createElementBlock("button",{key:0,class:"close-button",onClick:e[0]||(e[0]=(...a)=>t.close&&t.close(...a))}," X ")),b.renderSlot(t.$slots,"header",{},()=>[PR])]),b.createElementVNode("div",NR,[b.renderSlot(t.$slots,"body",{},()=>[IR])]),b.createElementVNode("div",LR,[b.renderSlot(t.$slots,"footer")])],2)])]),_:3})}const Ws=Hi(AR,[["render",DR]]);function Ia(t){return Array.isArray?Array.isArray(t):Yk(t)==="[object Array]"}const RR=1/0;function BR(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-RR?"-0":e}function zR(t){return t==null?"":BR(t)}function ea(t){return typeof t=="string"}function Gk(t){return typeof t=="number"}function FR(t){return t===!0||t===!1||VR(t)&&Yk(t)=="[object Boolean]"}function Qk(t){return typeof t=="object"}function VR(t){return Qk(t)&&t!==null}function Ui(t){return t!=null}function Xm(t){return!t.trim().length}function Yk(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const yhe="Extended search is not available",qR="Incorrect 'index' type",HR=t=>`Invalid value for key ${t}`,UR=t=>`Pattern length exceeds max of ${t}.`,WR=t=>`Missing ${t} property in key`,KR=t=>`Property 'weight' in key '${t}' must be a positive integer`,Xk=Object.prototype.hasOwnProperty;class JR{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let i=Zk(r);n+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Zk(t){let e=null,n=null,r=null,i=1,o=null;if(ea(t)||Ia(t))r=t,e=ew(t),n=Zm(t);else{if(!Xk.call(t,"name"))throw new Error(WR("name"));const a=t.name;if(r=a,Xk.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(KR(a));e=ew(a),n=Zm(a),o=t.getFn}return{path:e,id:n,weight:i,src:r,getFn:o}}function ew(t){return Ia(t)?t:t.split(".")}function Zm(t){return Ia(t)?t.join("."):t}function GR(t,e){let n=[],r=!1;const i=(o,a,s)=>{if(!!Ui(o))if(!a[s])n.push(o);else{let u=a[s];const l=o[u];if(!Ui(l))return;if(s===a.length-1&&(ea(l)||Gk(l)||FR(l)))n.push(zR(l));else if(Ia(l)){r=!0;for(let f=0,c=l.length;f<c;f+=1)i(l[f],a,s+1)}else a.length&&i(l,a,s+1)}};return i(t,ea(e)?e.split("."):e,0),r?n:n[0]}var an={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:GR,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const QR=/[^ ]+/g;function YR(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(i){const o=i.match(QR).length;if(n.has(o))return n.get(o);const a=1/Math.pow(o,.5*t),s=parseFloat(Math.round(a*r)/r);return n.set(o,s),s},clear(){n.clear()}}}class ev{constructor({getFn:e=an.getFn,fieldNormWeight:n=an.fieldNormWeight}={}){this.norm=YR(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ea(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ea(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Ui(e)||Xm(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((i,o)=>{let a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(!!Ui(a)){if(Ia(a)){let s=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:l,value:f}=u.pop();if(!!Ui(f))if(ea(f)&&!Xm(f)){let c={v:f,i:l,n:this.norm.get(f)};s.push(c)}else Ia(f)&&f.forEach((c,d)=>{u.push({nestedArrIndex:d,value:c})})}r.$[o]=s}else if(ea(a)&&!Xm(a)){let s={v:a,n:this.norm.get(a)};r.$[o]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function tw(t,e,{getFn:n=an.getFn,fieldNormWeight:r=an.fieldNormWeight}={}){const i=new ev({getFn:n,fieldNormWeight:r});return i.setKeys(t.map(Zk)),i.setSources(e),i.create(),i}function XR(t,{getFn:e=an.getFn,fieldNormWeight:n=an.fieldNormWeight}={}){const{keys:r,records:i}=t,o=new ev({getFn:e,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o}function od(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:i=an.distance,ignoreLocation:o=an.ignoreLocation}={}){const a=e/t.length;if(o)return a;const s=Math.abs(r-n);return i?a+s/i:s?1:a}function ZR(t=[],e=an.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let a=t.length;o<a;o+=1){let s=t[o];s&&r===-1?r=o:!s&&r!==-1&&(i=o-1,i-r+1>=e&&n.push([r,i]),r=-1)}return t[o-1]&&o-r>=e&&n.push([r,o-1]),n}const Ks=32;function e9(t,e,n,{location:r=an.location,distance:i=an.distance,threshold:o=an.threshold,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,includeMatches:u=an.includeMatches,ignoreLocation:l=an.ignoreLocation}={}){if(e.length>Ks)throw new Error(UR(Ks));const f=e.length,c=t.length,d=Math.max(0,Math.min(r,c));let h=o,p=d;const m=s>1||u,g=m?Array(c):[];let v;for(;(v=t.indexOf(e,p))>-1;){let C=od(e,{currentLocation:v,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(C,h),p=v+f,m){let A=0;for(;A<f;)g[v+A]=1,A+=1}}p=-1;let y=[],k=1,w=f+c;const _=1<<f-1;for(let C=0;C<f;C+=1){let A=0,$=w;for(;A<$;)od(e,{errors:C,currentLocation:d+$,expectedLocation:d,distance:i,ignoreLocation:l})<=h?A=$:w=$,$=Math.floor((w-A)/2+A);w=$;let E=Math.max(1,d-$+1),O=a?c:Math.min(d+$,c)+f,z=Array(O+2);z[O+1]=(1<<C)-1;for(let M=O;M>=E;M-=1){let H=M-1,G=n[t.charAt(H)];if(m&&(g[H]=+!!G),z[M]=(z[M+1]<<1|1)&G,C&&(z[M]|=(y[M+1]|y[M])<<1|1|y[M+1]),z[M]&_&&(k=od(e,{errors:C,currentLocation:H,expectedLocation:d,distance:i,ignoreLocation:l}),k<=h)){if(h=k,p=H,p<=d)break;E=Math.max(1,2*d-p)}}if(od(e,{errors:C+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;y=z}const S={isMatch:p>=0,score:Math.max(.001,k)};if(m){const C=ZR(g,s);C.length?u&&(S.indices=C):S.isMatch=!1}return S}function t9(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<r-n-1}return e}class nw{constructor(e,{location:n=an.location,threshold:r=an.threshold,distance:i=an.distance,includeMatches:o=an.includeMatches,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,isCaseSensitive:u=an.isCaseSensitive,ignoreLocation:l=an.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:l},this.pattern=u?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const f=(d,h)=>{this.chunks.push({pattern:d,alphabet:t9(d),startIndex:h})},c=this.pattern.length;if(c>Ks){let d=0;const h=c%Ks,p=c-h;for(;d<p;)f(this.pattern.substr(d,Ks),d),d+=Ks;if(h){const m=c-Ks;f(this.pattern.substr(m),m)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(e=e.toLowerCase()),this.pattern===e){let p={isMatch:!0,score:0};return r&&(p.indices=[[0,e.length-1]]),p}const{location:i,distance:o,threshold:a,findAllMatches:s,minMatchCharLength:u,ignoreLocation:l}=this.options;let f=[],c=0,d=!1;this.chunks.forEach(({pattern:p,alphabet:m,startIndex:g})=>{const{isMatch:v,score:y,indices:k}=e9(e,p,m,{location:i+g,distance:o,threshold:a,findAllMatches:s,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});v&&(d=!0),c+=y,v&&k&&(f=[...f,...k])});let h={isMatch:d,score:d?c/this.chunks.length:1};return d&&r&&(h.indices=f),h}}class us{constructor(e){this.pattern=e}static isMultiMatch(e){return rw(e,this.multiRegex)}static isSingleMatch(e){return rw(e,this.singleRegex)}search(){}}function rw(t,e){const n=t.match(e);return n?n[1]:null}class n9 extends us{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class r9 extends us{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class i9 extends us{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class o9 extends us{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class a9 extends us{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class s9 extends us{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class iw extends us{constructor(e,{location:n=an.location,threshold:r=an.threshold,distance:i=an.distance,includeMatches:o=an.includeMatches,findAllMatches:a=an.findAllMatches,minMatchCharLength:s=an.minMatchCharLength,isCaseSensitive:u=an.isCaseSensitive,ignoreLocation:l=an.ignoreLocation}={}){super(e),this._bitapSearch=new nw(e,{location:n,threshold:r,distance:i,includeMatches:o,findAllMatches:a,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ow extends us{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const i=[],o=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+o,i.push([r,n-1]);const a=!!i.length;return{isMatch:a,score:a?0:1,indices:i}}}const tv=[n9,ow,i9,o9,s9,a9,r9,iw],aw=tv.length,u9=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,l9="|";function c9(t,e={}){return t.split(l9).map(n=>{let r=n.trim().split(u9).filter(o=>o&&!!o.trim()),i=[];for(let o=0,a=r.length;o<a;o+=1){const s=r[o];let u=!1,l=-1;for(;!u&&++l<aw;){const f=tv[l];let c=f.isMultiMatch(s);c&&(i.push(new f(c,e)),u=!0)}if(!u)for(l=-1;++l<aw;){const f=tv[l];let c=f.isSingleMatch(s);if(c){i.push(new f(c,e));break}}}return i})}const f9=new Set([iw.type,ow.type]);class d9{constructor(e,{isCaseSensitive:n=an.isCaseSensitive,includeMatches:r=an.includeMatches,minMatchCharLength:i=an.minMatchCharLength,ignoreLocation:o=an.ignoreLocation,findAllMatches:a=an.findAllMatches,location:s=an.location,threshold:u=an.threshold,distance:l=an.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:o,location:s,threshold:u,distance:l},this.pattern=n?e:e.toLowerCase(),this.query=c9(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i}=this.options;e=i?e:e.toLowerCase();let o=0,a=[],s=0;for(let u=0,l=n.length;u<l;u+=1){const f=n[u];a.length=0,o=0;for(let c=0,d=f.length;c<d;c+=1){const h=f[c],{isMatch:p,indices:m,score:g}=h.search(e);if(p){if(o+=1,s+=g,r){const v=h.constructor.type;f9.has(v)?a=[...a,...m]:a.push(m)}}else{s=0,o=0,a.length=0;break}}if(o){let c={isMatch:!0,score:s/o};return r&&(c.indices=a),c}}return{isMatch:!1,score:1}}}const nv=[];function h9(...t){nv.push(...t)}function rv(t,e){for(let n=0,r=nv.length;n<r;n+=1){let i=nv[n];if(i.condition(t,e))return new i(t,e)}return new nw(t,e)}const ad={AND:"$and",OR:"$or"},iv={PATH:"$path",PATTERN:"$val"},ov=t=>!!(t[ad.AND]||t[ad.OR]),p9=t=>!!t[iv.PATH],m9=t=>!Ia(t)&&Qk(t)&&!ov(t),sw=t=>({[ad.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function uw(t,e,{auto:n=!0}={}){const r=i=>{let o=Object.keys(i);const a=p9(i);if(!a&&o.length>1&&!ov(i))return r(sw(i));if(m9(i)){const u=a?i[iv.PATH]:o[0],l=a?i[iv.PATTERN]:i[u];if(!ea(l))throw new Error(HR(u));const f={keyId:Zm(u),pattern:l};return n&&(f.searcher=rv(l,e)),f}let s={children:[],operator:o[0]};return o.forEach(u=>{const l=i[u];Ia(l)&&l.forEach(f=>{s.children.push(r(f))})}),s};return ov(t)||(t=sw(t)),r(t)}function v9(t,{ignoreFieldNorm:e=an.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:o,score:a})=>{const s=i?i.weight:null;r*=Math.pow(a===0&&s?Number.EPSILON:a,(s||1)*(e?1:o))}),n.score=r})}function g9(t,e){const n=t.matches;e.matches=[],Ui(n)&&n.forEach(r=>{if(!Ui(r.indices)||!r.indices.length)return;const{indices:i,value:o}=r;let a={indices:i,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),e.matches.push(a)})}function y9(t,e){e.score=t.score}function b9(t,e,{includeMatches:n=an.includeMatches,includeScore:r=an.includeScore}={}){const i=[];return n&&i.push(g9),r&&i.push(y9),t.map(o=>{const{idx:a}=o,s={item:e[a],refIndex:a};return i.length&&i.forEach(u=>{u(o,s)}),s})}class Vu{constructor(e,n={},r){this.options={...an,...n},this.options.useExtendedSearch,this._keyStore=new JR(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof ev))throw new Error(qR);this._myIndex=n||tw(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){!Ui(e)||(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const o=this._docs[r];e(o,r)&&(this.removeAt(r),r-=1,i-=1,n.push(o))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:o,sortFn:a,ignoreFieldNorm:s}=this.options;let u=ea(e)?ea(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return v9(u,{ignoreFieldNorm:s}),o&&u.sort(a),Gk(n)&&n>-1&&(u=u.slice(0,n)),b9(u,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e){const n=rv(e,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:o,i:a,n:s})=>{if(!Ui(o))return;const{isMatch:u,score:l,indices:f}=n.searchIn(o);u&&i.push({item:o,idx:a,matches:[{score:l,value:o,norm:s,indices:f}]})}),i}_searchLogical(e){const n=uw(e,this.options),r=(s,u,l)=>{if(!s.children){const{keyId:c,searcher:d}=s,h=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(u,c),searcher:d});return h&&h.length?[{idx:l,item:u,matches:h}]:[]}const f=[];for(let c=0,d=s.children.length;c<d;c+=1){const h=s.children[c],p=r(h,u,l);if(p.length)f.push(...p);else if(s.operator===ad.AND)return[]}return f},i=this._myIndex.records,o={},a=[];return i.forEach(({$:s,i:u})=>{if(Ui(s)){let l=r(n,s,u);l.length&&(o[u]||(o[u]={idx:u,item:s,matches:[]},a.push(o[u])),l.forEach(({matches:f})=>{o[u].matches.push(...f)}))}}),a}_searchObjectList(e){const n=rv(e,this.options),{keys:r,records:i}=this._myIndex,o=[];return i.forEach(({$:a,i:s})=>{if(!Ui(a))return;let u=[];r.forEach((l,f)=>{u.push(...this._findMatches({key:l,value:a[f],searcher:n}))}),u.length&&o.push({idx:s,item:a,matches:u})}),o}_findMatches({key:e,value:n,searcher:r}){if(!Ui(n))return[];let i=[];if(Ia(n))n.forEach(({v:o,i:a,n:s})=>{if(!Ui(o))return;const{isMatch:u,score:l,indices:f}=r.searchIn(o);u&&i.push({score:l,key:e,value:o,idx:a,norm:s,indices:f})});else{const{v:o,n:a}=n,{isMatch:s,score:u,indices:l}=r.searchIn(o);s&&i.push({score:u,key:e,value:o,norm:a,indices:l})}return i}}Vu.version="6.6.2",Vu.createIndex=tw,Vu.parseIndex=XR,Vu.config=an,Vu.parseQuery=uw,h9(d9);var lw,cw,fw,dw,hw,pw,mw,vw,gw,yw,bw,kw,ww,_w,xw,jw,Sw,Cw,$w,Ow,Ew,Tw,Aw,Mw,Pw,Nw,Iw,Lw,Dw,Rw,Bw,zw,Fw,Vw,qw,Hw,Uw,Ww,Kw,Jw,Gw,Qw,Yw,Xw,Zw,e_,t_,n_,r_,i_,o_,a_,s_,u_,l_,c_,f_,d_,h_,p_,m_,v_,g_,y_,b_,k_,w_,__,x_,j_,S_,C_,$_,O_,E_,T_,A_,M_,P_,N_,I_,L_,D_,R_,B_,z_,F_,V_,q_,H_,U_,W_,K_,J_,G_,Q_,Y_,X_,Z_,ex,tx,nx,rx,ix,ox,ax,sx,ux,lx,cx,fx,dx,hx,px,mx,vx,gx,yx,bx,kx,wx,_x,xx,jx,Sx,Cx,$x,Ox,Ex,Tx,Ax,Mx,Px,Nx,Ix,Lx,Dx,Rx,Bx,zx,Fx,Vx,qx,Hx,Ux,Wx,Kx,Jx,Gx,Qx,Yx,Xx,Zx,ej,tj,nj,rj,ij,oj,aj,sj,uj,lj,cj,fj,dj,hj,pj,mj,vj,gj,yj,bj,kj,wj,_j,xj,jj,Sj,Cj,$j,Oj,Ej,Tj,Aj,Mj,Pj,Nj,Ij,Lj,Dj,Rj,Bj,zj,Fj,Vj,qj,Hj,Uj,Wj,Kj,Jj,Gj,Qj,Yj,Xj,Zj,e2,t2,n2,r2,i2,o2,a2,s2,u2,l2,c2,f2,d2,h2,p2,m2,v2,g2,y2,b2,k2,w2,_2,x2,j2,S2,C2,$2,O2,E2,T2,A2,M2,P2,N2,I2,L2,D2,R2,B2,z2,F2,V2,q2,H2,U2,W2,K2,J2,G2,Q2,Y2,X2,Z2,eS,tS,nS,rS,iS,oS,aS,sS,uS,lS,cS,fS,dS,hS,pS,mS,vS,gS,yS,bS,kS;function sd(t){var e=typeof Map=="function"?new Map:void 0;return(sd=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return wS(n,arguments,vn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ud(i,n)})(t)}function wS(t,e,n){return(wS=jS()?Reflect.construct.bind():function(r,i,o){var a=[null];a.push.apply(a,i);var s=new(Function.bind.apply(r,a));return o&&ud(s,o.prototype),s}).apply(null,arguments)}function ue(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function At(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */At=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=typeof Symbol=="function"?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(E,O,z){return Object.defineProperty(E,O,{value:z,enumerable:!0,configurable:!0,writable:!0}),E[O]}try{s({},"")}catch{s=function(O,z,P){return O[z]=P}}function u(E,O,z,P){var M=O&&O.prototype instanceof c?O:c,H=Object.create(M.prototype),G=new C(P||[]);return H._invoke=function(V,J,F){var I="suspendedStart";return function(L,B){if(I==="executing")throw new Error("Generator is already running");if(I==="completed"){if(L==="throw")throw B;return $()}for(F.method=L,F.arg=B;;){var N=F.delegate;if(N){var x=w(N,F);if(x){if(x===f)continue;return x}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(I==="suspendedStart")throw I="completed",F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);I="executing";var j=l(V,J,F);if(j.type==="normal"){if(I=F.done?"completed":"suspendedYield",j.arg===f)continue;return{value:j.arg,done:F.done}}j.type==="throw"&&(I="completed",F.method="throw",F.arg=j.arg)}}}(E,z,G),H}function l(E,O,z){try{return{type:"normal",arg:E.call(O,z)}}catch(P){return{type:"throw",arg:P}}}t.wrap=u;var f={};function c(){}function d(){}function h(){}var p={};s(p,i,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(A([])));g&&g!==e&&n.call(g,i)&&(p=g);var v=h.prototype=c.prototype=Object.create(p);function y(E){["next","throw","return"].forEach(function(O){s(E,O,function(z){return this._invoke(O,z)})})}function k(E,O){function z(M,H,G,V){var J=l(E[M],E,H);if(J.type!=="throw"){var F=J.arg,I=F.value;return I&&vt(I)=="object"&&n.call(I,"__await")?O.resolve(I.__await).then(function(L){z("next",L,G,V)},function(L){z("throw",L,G,V)}):O.resolve(I).then(function(L){F.value=L,G(F)},function(L){return z("throw",L,G,V)})}V(J.arg)}var P;this._invoke=function(M,H){function G(){return new O(function(V,J){z(M,H,V,J)})}return P=P?P.then(G,G):G()}}function w(E,O){var z=E.iterator[O.method];if(z===void 0){if(O.delegate=null,O.method==="throw"){if(E.iterator.return&&(O.method="return",O.arg=void 0,w(E,O),O.method==="throw"))return f;O.method="throw",O.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var P=l(z,E.iterator,O.arg);if(P.type==="throw")return O.method="throw",O.arg=P.arg,O.delegate=null,f;var M=P.arg;return M?M.done?(O[E.resultName]=M.value,O.next=E.nextLoc,O.method!=="return"&&(O.method="next",O.arg=void 0),O.delegate=null,f):M:(O.method="throw",O.arg=new TypeError("iterator result is not an object"),O.delegate=null,f)}function _(E){var O={tryLoc:E[0]};1 in E&&(O.catchLoc=E[1]),2 in E&&(O.finallyLoc=E[2],O.afterLoc=E[3]),this.tryEntries.push(O)}function S(E){var O=E.completion||{};O.type="normal",delete O.arg,E.completion=O}function C(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(_,this),this.reset(!0)}function A(E){if(E){var O=E[i];if(O)return O.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var z=-1,P=function M(){for(;++z<E.length;)if(n.call(E,z))return M.value=E[z],M.done=!1,M;return M.value=void 0,M.done=!0,M};return P.next=P}}return{next:$}}function $(){return{value:void 0,done:!0}}return d.prototype=h,s(v,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(E){var O=typeof E=="function"&&E.constructor;return!!O&&(O===d||(O.displayName||O.name)==="GeneratorFunction")},t.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,h):(E.__proto__=h,s(E,a,"GeneratorFunction")),E.prototype=Object.create(v),E},t.awrap=function(E){return{__await:E}},y(k.prototype),s(k.prototype,o,function(){return this}),t.AsyncIterator=k,t.async=function(E,O,z,P,M){M===void 0&&(M=Promise);var H=new k(u(E,O,z,P),M);return t.isGeneratorFunction(O)?H:H.next().then(function(G){return G.done?G.value:H.next()})},y(v),s(v,a,"Generator"),s(v,i,function(){return this}),s(v,"toString",function(){return"[object Generator]"}),t.keys=function(E){var O=[];for(var z in E)O.push(z);return O.reverse(),function P(){for(;O.length;){var M=O.pop();if(M in E)return P.value=M,P.done=!1,P}return P.done=!0,P}},t.values=A,C.prototype={constructor:C,reset:function(E){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!E)for(var O in this)O.charAt(0)==="t"&&n.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=void 0)},stop:function(){this.done=!0;var E=this.tryEntries[0].completion;if(E.type==="throw")throw E.arg;return this.rval},dispatchException:function(E){if(this.done)throw E;var O=this;function z(J,F){return H.type="throw",H.arg=E,O.next=J,F&&(O.method="next",O.arg=void 0),!!F}for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P],H=M.completion;if(M.tryLoc==="root")return z("end");if(M.tryLoc<=this.prev){var G=n.call(M,"catchLoc"),V=n.call(M,"finallyLoc");if(G&&V){if(this.prev<M.catchLoc)return z(M.catchLoc,!0);if(this.prev<M.finallyLoc)return z(M.finallyLoc)}else if(G){if(this.prev<M.catchLoc)return z(M.catchLoc,!0)}else{if(!V)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return z(M.finallyLoc)}}}},abrupt:function(E,O){for(var z=this.tryEntries.length-1;z>=0;--z){var P=this.tryEntries[z];if(P.tryLoc<=this.prev&&n.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var M=P;break}}M&&(E==="break"||E==="continue")&&M.tryLoc<=O&&O<=M.finallyLoc&&(M=null);var H=M?M.completion:{};return H.type=E,H.arg=O,M?(this.method="next",this.next=M.finallyLoc,f):this.complete(H)},complete:function(E,O){if(E.type==="throw")throw E.arg;return E.type==="break"||E.type==="continue"?this.next=E.arg:E.type==="return"?(this.rval=this.arg=E.arg,this.method="return",this.next="end"):E.type==="normal"&&O&&(this.next=O),f},finish:function(E){for(var O=this.tryEntries.length-1;O>=0;--O){var z=this.tryEntries[O];if(z.finallyLoc===E)return this.complete(z.completion,z.afterLoc),S(z),f}},catch:function(E){for(var O=this.tryEntries.length-1;O>=0;--O){var z=this.tryEntries[O];if(z.tryLoc===E){var P=z.completion;if(P.type==="throw"){var M=P.arg;S(z)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(E,O,z){return this.delegate={iterator:A(E),resultName:O,nextLoc:z},this.method==="next"&&(this.arg=void 0),f}},t}function _S(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(l){return void n(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function Un(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(u){_S(o,r,i,a,s,"next",u)}function s(u){_S(o,r,i,a,s,"throw",u)}a(void 0)})}}function fe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=av(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function En(){return(En=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=k9(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function k9(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=vn(t))!==null;);return t}function Ft(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,s=[],u=!0,l=!1;try{for(i=i.call(n);!(u=(o=i.next()).done)&&(s.push(o.value),!r||s.length!==r);u=!0);}catch(f){l=!0,a=f}finally{try{u||i.return==null||i.return()}finally{if(l)throw a}}return s}}(t,e)||av(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
9
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ve(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ud(t,e)}function ud(t,e){return(ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n})(t,e)}function qe(t){var e=jS();return function(){var n,r=vn(t);if(e){var i=vn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return xS(this,n)}}function xS(t,e){if(e&&(vt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mt(t)}function Mt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vn(t){return(vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(t)}function SS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?SS(Object(n),!0).forEach(function(r){qu(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):SS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function qu(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pn(t){return function(e){if(Array.isArray(e))return sv(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||av(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function av(t,e){if(t){if(typeof t=="string")return sv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sv(t,e):void 0}}function sv(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CS(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function te(t,e,n){return e&&CS(t.prototype,e),n&&CS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function vt(t){return(vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function rt(){}var $S=function(t){return t};function ls(t,e){for(var n in e)t[n]=e[n];return t}function OS(t){return t()}function ES(){return Object.create(null)}function rr(t){t.forEach(OS)}function Oo(t){return typeof t=="function"}function Tr(t,e){return t!=t?e==e:t!==e||t&&vt(t)==="object"||typeof t=="function"}function _n(t,e){return t!=t?e==e:t!==e}function Eo(t,e,n,r){if(t){var i=TS(t,e,n,r);return t[0](i)}}function TS(t,e,n,r){return t[1]&&r?ls(n.ctx.slice(),t[1](r(e))):n.ctx}function To(t,e,n,r){if(t[2]&&r){var i=t[2](r(n));if(e.dirty===void 0)return i;if(vt(i)==="object"){for(var o=[],a=Math.max(e.dirty.length,i.length),s=0;s<a;s+=1)o[s]=e.dirty[s]|i[s];return o}return e.dirty|i}return e.dirty}function Ao(t,e,n,r,i,o){if(i){var a=TS(e,n,r,o);t.p(a,i)}}function Mo(t){if(t.ctx.length>32){for(var e=[],n=t.ctx.length/32,r=0;r<n;r++)e[r]=-1;return e}return-1}function Cr(t){return t==null?"":t}function sc(t){return t&&Oo(t.destroy)?t.destroy:rt}var ld,AS=typeof window<"u",w9=AS?function(){return window.performance.now()}:function(){return Date.now()},uv=AS?function(t){return requestAnimationFrame(t)}:rt,uc=new Set;function MS(t){uc.forEach(function(e){e.c(t)||(uc.delete(e),e.f())}),uc.size!==0&&uv(MS)}function W(t,e){t.appendChild(e)}function nn(t,e,n){var r=lv(t);if(!r.getElementById(e)){var i=ae("style");i.id=e,i.textContent=n,PS(r,i)}}function lv(t){if(!t)return document;var e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function _9(t){var e=ae("style");return PS(lv(t),e),e.sheet}function PS(t,e){W(t.head||t,e)}function ke(t,e,n){t.insertBefore(e,n||null)}function ye(t){t.parentNode.removeChild(t)}function Ni(t,e){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function ae(t){return document.createElement(t)}function La(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ft(t){return document.createTextNode(t)}function Te(){return ft(" ")}function An(){return ft("")}function He(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function NS(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function D(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function IS(t,e){var n=Object.getOwnPropertyDescriptors(t.__proto__);for(var r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:D(t,r,e[r])}function cd(t,e){for(var n in e)D(t,n,e[n])}function cv(t,e,n){e in t?t[e]=typeof t[e]=="boolean"&&n===""||n:D(t,e,n)}function x9(t){return Array.from(t.childNodes)}function mn(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function cs(t,e){t.value=e==null?"":e}function ta(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function LS(t,e){for(var n=0;n<t.options.length;n+=1){var r=t.options[n];if(r.__value===e)return void(r.selected=!0)}t.selectedIndex=-1}function j9(){if(ld===void 0){ld=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{ld=!0}}return ld}function st(t,e,n){t.classList[n?"add":"remove"](e)}function DS(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.bubbles,i=r!==void 0&&r,o=n.cancelable,a=o!==void 0&&o,s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i,a,e),s}var lc,S9=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];ee(this,t),this.is_svg=!1,this.is_svg=e,this.e=this.n=null}return te(t,[{key:"c",value:function(e){this.h(e)}},{key:"m",value:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this.e||(this.is_svg?this.e=La(n.nodeName):this.e=ae(n.nodeName),this.t=n,this.c(e)),this.i(r)}},{key:"h",value:function(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}},{key:"i",value:function(e){for(var n=0;n<this.n.length;n+=1)ke(this.t,this.n[n],e)}},{key:"p",value:function(e){this.d(),this.h(e),this.i(this.a)}},{key:"d",value:function(){this.n.forEach(ye)}}]),t}(),fd=new Map,fv=0;function C9(t){for(var e=5381,n=t.length;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function $9(t,e){var n={stylesheet:_9(e),rules:{}};return fd.set(t,n),n}function RS(t,e,n,r,i,o,a){for(var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,u=16.666/r,l=`{
@@ -175,7 +175,7 @@ Only state can be modified.`);a[0]="$state",Bl=!1,r.set(o,a,r.state.value),Bl=!0
175
175
  Found in store "${C.$id}".`),p&&o&&n.hydrate&&n.hydrate(C.$state,p),l=!0,f=!0,C}function Jr(t,e,n){let r,i;const o=typeof e=="function";typeof t=="string"?(r=t,i=o?n:e):(i=t,r=t.id);function a(s,u){const l=b.getCurrentInstance();if(s=s||l&&b.inject(P8),s&&Mf(s),!Z1)throw new Error(`[\u{1F34D}]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
176
176
  const pinia = createPinia()
177
177
  app.use(pinia)
178
- This will fail in production.`);s=Z1,s._s.has(r)||(o?ib(r,e,i,s):W8(r,i,s),a._pinia=s);const f=s._s.get(r);if(u){const c="__hot:"+r,d=o?ib(c,e,i,s,!0):W8(c,Ho({},i),s,!0);u._hotUpdate(d),delete s.state.value[c],s._s.delete(c)}if(Ds&&l&&l.proxy&&!u){const c=l.proxy,d="_pStores"in c?c._pStores:c._pStores={};d[r]=f}return f}return a.$id=r,a}function Za(t,e){return Array.isArray(e)?e.reduce((n,r)=>(n[r]=function(){return t(this.$pinia)[r]},n),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const i=t(this.$pinia),o=e[r];return typeof o=="function"?o.call(this,i):i[o]},n),{})}const K8=["music","ambiant","sound"],J8=dZ(K8),Gr=Jr("audio",{state:()=>{const t=new Map;for(const e in J8)t.set(e,{channels:[],options:{volume:1}});return{modes:t,masterVolume:1}},actions:{stopAll(){this.modes.forEach(t=>{t.channels.forEach((e,n)=>{e&&(this.actuallyStopChannel(e),t.channels[n]=null)})})},async stopChannel(t,e){const n=this.getAudioChannel(t,e);if(!!n){if(this.setAudioChannel(t,e,null),Aa().options.musicFadeOutTime){const r=Fl(n.audio);r&&r.fade(r.volume(n.howlerId),0,Aa().options.musicFadeOutTime*1e3,n.howlerId),await _o(Aa().options.musicFadeOutTime*1e3)}this.actuallyStopChannel(n)}},async pauseChannel(t,e){const n=this.getAudioChannel(t,e);if(!n)return;const r=Fl(n.audio);if(!r){Kt(`Could not find audio ${n.audio}`);return}r.pause(n.howlerId)},async playChannel(t,e,n){if(Ya.Howler.ctx.state==="suspended"){console.warn("Audio context not started yet, skipping audio");return}const r=this.getAudioChannel(t,n);if(t==="sound")return this.actuallyPlayChannel(t,n,e);r&&r.audio!==e?await this.changeChannel(t,e,n):r&&r.audio===e||await this.actuallyPlayChannel(t,n,e)},async changeChannel(t,e,n){this.getAudioChannel(t,n)&&t!=="sound"&&await this.stopChannel(t,n),await this.actuallyPlayChannel(t,n,e)},actuallyStopChannel(t){HZ(t.audio,t.howlerId)},getAudioChannel(t,e){return this.modes.get(t).channels[e]||null},setAudioChannel(t,e,n){this.modes.get(t).channels[e]=n},async actuallyPlayChannel(t,e,n){const r=Fl(n);if(!r){Kt(`Could not find audio ${n}`);return}if(t!=="sound"){const i=r.play();r.volume(0,i),r.pause(i),this.setAudioChannel(t,e,{audio:n,howlerId:i}),await _o(Aa().options.musicFadeInDelay*1e3);const o=this.getAudioChannel(t,e);o!==null&&o.audio===n&&(r.play(i),r.fade(0,this.modeVolume(t),Aa().options.musicFadeInTime*1e3,i))}else if(t==="sound"){const i=r.play();r.volume(this.modeVolume(t),i),this.setAudioChannel(t,e,{audio:n,howlerId:i})}},reloadAudio(t){for(const e in t.modes){if(e==="sound")continue;const n=e;this.modes.get(n).options=pi(t.modes[n].options);for(const r in t.modes[n].channels){const i=t.modes[n].channels[r];i&&i.audio&&this.actuallyPlayChannel(n,Number(r),i.audio)}}},stopSound(t){const e=Fl(t);e&&e.stop()},generateSaveData(){const t={};for(const e in J8){const n=this.modes.get(e);t[e]={options:pi(n.options),channels:pi(n.channels).map(r=>r?{audio:r.audio}:{audio:null})}}return{modes:t,masterVolume:this.masterVolume}},loadSaveData(t){this.masterVolume=t.masterVolume},reset(){this.stopAll()},setModeVolume(t,e){const n=this.modes.get(t);n.options.volume=e;for(const r in n.channels){const i=n.channels[r];if(i){const o=Fl(i.audio);o&&o.volume(this.modeVolume(t),i.howlerId)}}},setMasterVolume(t){this.masterVolume=t,Ya.Howler.volume(t)},modeVolume(t){return this.masterVolume*this.modes.get(t).options.volume}}}),G8={};Ya.Howler.volume(.5);let ob={};async function VZ(t){Zo.log("Loading audio");const e=[];Ya.Howler.volume(t.options.volume);for(const n in t.files){const r=t.files[n];r.src||(r.src=r.path,r.path||console.error(`Audio config for ${n} doesn't have any \`src\` value to find the file`),console.warn("Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!")),e.push(qZ(n,t.files[n]))}return t.audioTriggers&&(ob=t.audioTriggers),Promise.all(e)}function Eu(t){ob[t]&&Gr().playChannel("sound",ob[t],0)}async function qZ(t,e){return new Promise((n,r)=>{Zo.log(`Loading audio ${e.src}`);const i=new Ya.Howl({...e,src:Ma(e.src)});i.load(),G8[t]=i,n()})}function HZ(t,e){const n=Fl(t);if(!n){Au(`Could not find music ${t}`);return}n.stop(e)}function Fl(t){return G8[t]}const Vl={};async function UZ(t){return Vl[t]?Vl[t]:Q8(t,t)}async function WZ(t){Zo.log("Loading images");let e=0,n=0;const r=[],i=async(a,s)=>{n++;const u=await Q8(a,s);return e++,console.log(`Loaded ${e} / ${n} images`),u},o=(a,s)=>{r.push(i(a,s))};for(const a in t.images){const s=t.images[a];o(a,s)}for(const a in t.screens.screens){const s=t.screens.screens[a];if(s.background&&!t.images[s.background]&&o(s.background,s.background),s.buttons)for(const u in s.buttons){const l=s.buttons[u];typeof l=="object"&&l.background&&!t.images[l.background]&&o(l.background,l.background)}}return Promise.all(r)}async function Q8(t,e){if(Vl[t])return Vl[t];const n=new Promise((r,i)=>{Zo.log(`Loading image ${t} at ${e}`);const o=new Image;o.onload=()=>{Vl[t]=o,Zo.log(`Loaded image ${t} successfully`),r(o)},o.onerror=a=>{Kt(`Failed to load image ${t} at ${e}`,a),i(a)},o.src=Ma(e)});return Vl[t]=n,n}function ql(){return`${Date.now()}-${Math.floor(Math.random()*1e11)}-${Math.floor(Math.random()*1e11)}`}const Y8="gameSave",am="###_--_~=:;_JUMP",ab="###_--_~=:;_RETURN",KZ="###_--_~=:;_OK",sm="###_--_~=:;_STOP";function JZ(t){return t===am||t===ab||t===KZ||t===sm}const GZ="2.10.4",QZ=new Date("2022-11-15T15:40:33.604Z"),YZ=400,sb=20,X8="1.4.0";let Fr;function Z8(){if(Fr)return Fr;if(!Fr){let t=null;try{const e=localStorage.getItem(Y8);e&&(t=JSON.parse(e)),t&&typeof t=="object"&&t.slots&&t.slots[0]&&t.slots[0].id||(t=null,localStorage.clear())}catch(e){Au(`Save file deleted because it was either broken or an outdated format: ${e}`)}t?Fr=t:Fr=ZZ()}return XZ(Fr),e7(Fr),um(),Fr}function XZ(t){t.version}function ZZ(){const t={version:X8,slots:[]};return e7(t),t}function e7(t){var n;const e=(n=gt().saves.slots)!=null?n:10;t.slots.length<1&&(t.slots[0]={slotType:"auto",id:ql(),saveData:null,slotNumber:0}),t.slots[0].slotType="auto";for(let r=1;r<e+1;r++)t.slots.length<=r&&(t.slots[r]={slotNumber:r,slotType:gt().saves.mode==="manual"?"manual":"auto",id:ql(),saveData:null})}function t7(t,e){const n=nee(e);if(Fr.slots[n])Fr.slots[n].saveData=t;else{Kt(`Tried to save to slot ${e} but it doesn't exist`);return}um()}function eee(t){Fr.lastSaveSlot=t}function um(){localStorage.setItem(Y8,JSON.stringify(Fr))}function tee(){const t=Fr.slots.find(e=>!e.saveData);return t?t.id:!1}function nee(t){return Fr.slots.findIndex(e=>e.id===t)}function Pf(t){return Fr.slots.find(e=>e.id===t)}function ub(){return Fr.slots.find(t=>t.slotType==="auto")}function ree(t){const e=Fr.slots.findIndex(n=>n.id===t);Fr.slots[e].saveData=null,um()}function iee(t,e){const n=Pf(t);n&&n.saveData&&(n.saveData.metadata.name=e),um()}function oee(){return{saveDate:new Date().toISOString(),name:"New Save"}}const lm=Jr("tooltips",{state:()=>({tooltip:null}),actions:{addCustomTooltip(t){t.title&&(t.title=es(t.title)),t.text=es(t.text),this.tooltip=t},addTooltip(t,e){var r,i;const n=QD(t);n&&this.addCustomTooltip({title:n.title,text:n.description,x:(r=e==null?void 0:e.x)!=null?r:window.screenX,y:(i=e==null?void 0:e.y)!=null?i:window.screenY,width:ed().options.width})},deleteTooltip(){this.tooltip=null}}});function lb(){return window}function aee(t){const e=ed().options.keywordsPrefix,n=new RegExp(`${e}(\\w*)`,"gi");return t=t.replace(n,see),t}lb().onTooltipEnter=(t,e)=>{const n={x:t.clientX,y:t.clientY-20};lm().addTooltip(e,n)},lb().onTooltipLeave=()=>{lm().deleteTooltip()};function see(t,e){const n=e.toLowerCase();return QD(n)?`<span class='highlighted-tooltip-keyword'
178
+ This will fail in production.`);s=Z1,s._s.has(r)||(o?ib(r,e,i,s):W8(r,i,s),a._pinia=s);const f=s._s.get(r);if(u){const c="__hot:"+r,d=o?ib(c,e,i,s,!0):W8(c,Ho({},i),s,!0);u._hotUpdate(d),delete s.state.value[c],s._s.delete(c)}if(Ds&&l&&l.proxy&&!u){const c=l.proxy,d="_pStores"in c?c._pStores:c._pStores={};d[r]=f}return f}return a.$id=r,a}function Za(t,e){return Array.isArray(e)?e.reduce((n,r)=>(n[r]=function(){return t(this.$pinia)[r]},n),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const i=t(this.$pinia),o=e[r];return typeof o=="function"?o.call(this,i):i[o]},n),{})}const K8=["music","ambiant","sound"],J8=dZ(K8),Gr=Jr("audio",{state:()=>{const t=new Map;for(const e in J8)t.set(e,{channels:[],options:{volume:1}});return{modes:t,masterVolume:1}},actions:{stopAll(){this.modes.forEach(t=>{t.channels.forEach((e,n)=>{e&&(this.actuallyStopChannel(e),t.channels[n]=null)})})},async stopChannel(t,e){const n=this.getAudioChannel(t,e);if(!!n){if(this.setAudioChannel(t,e,null),Aa().options.musicFadeOutTime){const r=Fl(n.audio);r&&r.fade(r.volume(n.howlerId),0,Aa().options.musicFadeOutTime*1e3,n.howlerId),await _o(Aa().options.musicFadeOutTime*1e3)}this.actuallyStopChannel(n)}},async pauseChannel(t,e){const n=this.getAudioChannel(t,e);if(!n)return;const r=Fl(n.audio);if(!r){Kt(`Could not find audio ${n.audio}`);return}r.pause(n.howlerId)},async playChannel(t,e,n){if(Ya.Howler.ctx.state==="suspended"){console.warn("Audio context not started yet, skipping audio");return}const r=this.getAudioChannel(t,n);if(t==="sound")return this.actuallyPlayChannel(t,n,e);r&&r.audio!==e?await this.changeChannel(t,e,n):r&&r.audio===e||await this.actuallyPlayChannel(t,n,e)},async changeChannel(t,e,n){this.getAudioChannel(t,n)&&t!=="sound"&&await this.stopChannel(t,n),await this.actuallyPlayChannel(t,n,e)},actuallyStopChannel(t){HZ(t.audio,t.howlerId)},getAudioChannel(t,e){return this.modes.get(t).channels[e]||null},setAudioChannel(t,e,n){this.modes.get(t).channels[e]=n},async actuallyPlayChannel(t,e,n){const r=Fl(n);if(!r){Kt(`Could not find audio ${n}`);return}if(t!=="sound"){const i=r.play();r.volume(0,i),r.pause(i),this.setAudioChannel(t,e,{audio:n,howlerId:i}),await _o(Aa().options.musicFadeInDelay*1e3);const o=this.getAudioChannel(t,e);o!==null&&o.audio===n&&(r.play(i),r.fade(0,this.modeVolume(t),Aa().options.musicFadeInTime*1e3,i))}else if(t==="sound"){const i=r.play();r.volume(this.modeVolume(t),i),this.setAudioChannel(t,e,{audio:n,howlerId:i})}},reloadAudio(t){for(const e in t.modes){if(e==="sound")continue;const n=e;this.modes.get(n).options=pi(t.modes[n].options);for(const r in t.modes[n].channels){const i=t.modes[n].channels[r];i&&i.audio&&this.actuallyPlayChannel(n,Number(r),i.audio)}}},stopSound(t){const e=Fl(t);e&&e.stop()},generateSaveData(){const t={};for(const e in J8){const n=this.modes.get(e);t[e]={options:pi(n.options),channels:pi(n.channels).map(r=>r?{audio:r.audio}:{audio:null})}}return{modes:t,masterVolume:this.masterVolume}},loadSaveData(t){this.masterVolume=t.masterVolume},reset(){this.stopAll()},setModeVolume(t,e){const n=this.modes.get(t);n.options.volume=e;for(const r in n.channels){const i=n.channels[r];if(i){const o=Fl(i.audio);o&&o.volume(this.modeVolume(t),i.howlerId)}}},setMasterVolume(t){this.masterVolume=t,Ya.Howler.volume(t)},modeVolume(t){return this.masterVolume*this.modes.get(t).options.volume}}}),G8={};Ya.Howler.volume(.5);let ob={};async function VZ(t){Zo.log("Loading audio");const e=[];Ya.Howler.volume(t.options.volume);for(const n in t.files){const r=t.files[n];r.src||(r.src=r.path,r.path||console.error(`Audio config for ${n} doesn't have any \`src\` value to find the file`),console.warn("Using `path` for audio and musics is deprecated. Please replace `path` with `src` in your config file!")),e.push(qZ(n,t.files[n]))}return t.audioTriggers&&(ob=t.audioTriggers),Promise.all(e)}function Eu(t){ob[t]&&Gr().playChannel("sound",ob[t],0)}async function qZ(t,e){return new Promise((n,r)=>{Zo.log(`Loading audio ${e.src}`);const i=new Ya.Howl({...e,src:Ma(e.src)});i.load(),G8[t]=i,n()})}function HZ(t,e){const n=Fl(t);if(!n){Au(`Could not find music ${t}`);return}n.stop(e)}function Fl(t){return G8[t]}const Vl={};async function UZ(t){return Vl[t]?Vl[t]:Q8(t,t)}async function WZ(t){Zo.log("Loading images");let e=0,n=0;const r=[],i=async(a,s)=>{n++;const u=await Q8(a,s);return e++,console.log(`Loaded ${e} / ${n} images`),u},o=(a,s)=>{r.push(i(a,s))};for(const a in t.images){const s=t.images[a];o(a,s)}for(const a in t.screens.screens){const s=t.screens.screens[a];if(s.background&&!t.images[s.background]&&o(s.background,s.background),s.buttons)for(const u in s.buttons){const l=s.buttons[u];typeof l=="object"&&l.background&&!t.images[l.background]&&o(l.background,l.background)}}return Promise.all(r)}async function Q8(t,e){if(Vl[t])return Vl[t];const n=new Promise((r,i)=>{Zo.log(`Loading image ${t} at ${e}`);const o=new Image;o.onload=()=>{Vl[t]=o,Zo.log(`Loaded image ${t} successfully`),r(o)},o.onerror=a=>{Kt(`Failed to load image ${t} at ${e}`,a),i(a)},o.src=Ma(e)});return Vl[t]=n,n}function ql(){return`${Date.now()}-${Math.floor(Math.random()*1e11)}-${Math.floor(Math.random()*1e11)}`}const Y8="gameSave",am="###_--_~=:;_JUMP",ab="###_--_~=:;_RETURN",KZ="###_--_~=:;_OK",sm="###_--_~=:;_STOP";function JZ(t){return t===am||t===ab||t===KZ||t===sm}const GZ="2.10.5",QZ=new Date("2022-11-28T21:39:06.509Z"),YZ=400,sb=20,X8="1.4.0";let Fr;function Z8(){if(Fr)return Fr;if(!Fr){let t=null;try{const e=localStorage.getItem(Y8);e&&(t=JSON.parse(e)),t&&typeof t=="object"&&t.slots&&t.slots[0]&&t.slots[0].id||(t=null,localStorage.clear())}catch(e){Au(`Save file deleted because it was either broken or an outdated format: ${e}`)}t?Fr=t:Fr=ZZ()}return XZ(Fr),e7(Fr),um(),Fr}function XZ(t){t.version}function ZZ(){const t={version:X8,slots:[]};return e7(t),t}function e7(t){var n;const e=(n=gt().saves.slots)!=null?n:10;t.slots.length<1&&(t.slots[0]={slotType:"auto",id:ql(),saveData:null,slotNumber:0}),t.slots[0].slotType="auto";for(let r=1;r<e+1;r++)t.slots.length<=r&&(t.slots[r]={slotNumber:r,slotType:gt().saves.mode==="manual"?"manual":"auto",id:ql(),saveData:null})}function t7(t,e){const n=nee(e);if(Fr.slots[n])Fr.slots[n].saveData=t;else{Kt(`Tried to save to slot ${e} but it doesn't exist`);return}um()}function eee(t){Fr.lastSaveSlot=t}function um(){localStorage.setItem(Y8,JSON.stringify(Fr))}function tee(){const t=Fr.slots.find(e=>!e.saveData);return t?t.id:!1}function nee(t){return Fr.slots.findIndex(e=>e.id===t)}function Pf(t){return Fr.slots.find(e=>e.id===t)}function ub(){return Fr.slots.find(t=>t.slotType==="auto")}function ree(t){const e=Fr.slots.findIndex(n=>n.id===t);Fr.slots[e].saveData=null,um()}function iee(t,e){const n=Pf(t);n&&n.saveData&&(n.saveData.metadata.name=e),um()}function oee(){return{saveDate:new Date().toISOString(),name:"New Save"}}const lm=Jr("tooltips",{state:()=>({tooltip:null}),actions:{addCustomTooltip(t){t.title&&(t.title=es(t.title)),t.text=es(t.text),this.tooltip=t},addTooltip(t,e){var r,i;const n=QD(t);n&&this.addCustomTooltip({title:n.title,text:n.description,x:(r=e==null?void 0:e.x)!=null?r:window.screenX,y:(i=e==null?void 0:e.y)!=null?i:window.screenY,width:ed().options.width})},deleteTooltip(){this.tooltip=null}}});function lb(){return window}function aee(t){const e=ed().options.keywordsPrefix,n=new RegExp(`${e}(\\w*)`,"gi");return t=t.replace(n,see),t}lb().onTooltipEnter=(t,e)=>{const n={x:t.clientX,y:t.clientY-20};lm().addTooltip(e,n)},lb().onTooltipLeave=()=>{lm().deleteTooltip()};function see(t,e){const n=e.toLowerCase();return QD(n)?`<span class='highlighted-tooltip-keyword'
179
179
  onmouseenter="onTooltipEnter(event, '${n}')"
180
180
  onmouseleave="onTooltipLeave()">${e}</span>`:n}function es(t){const e=t.replace(/%{[^}]*}/g,n=>{const r=n.substr(2,n.length-3);return n7(r)});return aee(e)}function n7(t){const e=ic(),[n,r]=qm(e,t);return n[r]}const r7=/\$\$"/,uee=t=>typeof t=="string"&&t.search(r7)===0;function lee(t){let e=null;const n=[],r=/<[^>]*>/g;do e=r.exec(t),e&&n.push(e);while(e);return n}const zn=Jr("dialog",{state:()=>({dialog:[],playMode:"normal"}),actions:{generateSaveData(){return{dialog:pi(this.dialog)}},loadSaveData(t){this.dialog=t.dialog},addDialog(t){var e;this.dialog.push({...t,interactive:(e=t.interactive)!=null?e:!1,id:ql(),text:es(t.text)}),this.dialog.length>200&&this.dialog.shift()},toggleAutoPlay(){this.playMode=this.playMode==="auto"?"normal":"auto"},toggleSkip(){this.playMode=this.playMode==="skip"?"normal":"skip"},clearDialog(){this.dialog.splice(0,this.dialog.length)},reset(){this.dialog=[],this.playMode="normal"}},getters:{currentDialog(){return this.dialog[this.dialog.length-1]}}});function cee(t,e){return t-e*Co().skillChecks.skillMultiplier}function i7(t,e){const n=cee(t,e),r=Co().skillChecks;let i=!1,o=0,a=r.difficultyText[0][1];for(;!i;)r.difficultyText.length>o&&n>=r.difficultyText[o][0]?a=r.difficultyText[o][1]:i=!0,o++;return a}function fee({skill:t,skillCheckId:e,value:n}){const r=Er(),i=r.getSkillCheck(e),o=Ek(t),a=r.skills[t].level,s=i7(n,a);let u=!0,l=`<span class='skill-check'>[<span class='skill-check-name'>${o.name}</span> - `;return i.happened?i.succeeded?l="":(u=!1,l+=` <span class='skill-check-difficulty'>${s}</span> - <span class='skill-check-failed'>FAILED</span>]</span>`):l+=` <span class='skill-check-difficulty'>${s}</span>]</span>`,{difficultyText:l,allowed:u}}function dee(t,e){const n=Er(),r=Ek(e.skill),i=i7(e.value,n.skills[e.skill].level);return`<span class='passive-skill-check skill-check'>[<span class='skill-check-name'>${r.name}</span> - <span class='skill-check-difficulty'>${i}</span> - ${t?'<span class="skill-check-success">Success</span>':'<span class="skill-check-failed">Failure</span>'}]</span>`}function hee(t){const{skillChecks:e}=Co(),n=Er(),r=Math.floor(Math.random()*e.rollRange),i=n.skills[t].level*e.skillMultiplier,o=r+i;return Zo.log(`[SKILL CHECK] Roll: ${o}. (Base roll: ${r}, modifier: ${i} - Skill level: ${n.skills[t].level})`),{roll:o,unmodifiedRoll:r}}function pee(t){const{skills:e,skillChecks:n}=Co();let r=!0;const{roll:i}=hee(t.skill);i<=n.failureChance-1&&(r=!1);const o=e[t.skill];return i<t.value&&(r=!1),Zo.log(`[SKILL CHECK ${o.name}]: ${r?"\u2705":"\u274C"}`,`(${t.id}) - ${i}/${t.value}`),Eu(r?"onSkillCheckSuccess":"onSkillCheckFailure"),r}function o7(t){const e=Er(),n=e.getSkillCheck(t.id);if(n&&n.happened&&(n.succeeded||!t.repeatable))return n;const r=pee(t);return u7(dee(r,t)),r?e.passSkillCheck(t.id,t.hideAfterRoll):e.failSkillCheck(t.id,t.hideAfterRoll),e.getSkillCheck(t.id)}function mee(t){const e=t.options,n=t.staticOptions,r=!!e.condition;if(r)return n.success;if(!r&&n.failure)return n.failure}function a7(t){return typeof t=="object"}function s7(t){return typeof t=="string"&&t.search(/\$/)===0}function u7(t){const e={speaker:"game",text:t,interactive:!1};zn().addDialog(e)}async function cb(t){zn().addDialog(t)}function vee(t,e){if(e<t.length)return t[e]}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function l7(t){return typeof t>"u"||t===null}function gee(t){return typeof t=="object"&&t!==null}function yee(t){return Array.isArray(t)?t:l7(t)?[]:[t]}function bee(t,e){var n,r,i,o;if(e)for(o=Object.keys(e),n=0,r=o.length;n<r;n+=1)i=o[n],t[i]=e[i];return t}function kee(t,e){var n="",r;for(r=0;r<e;r+=1)n+=t;return n}function wee(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var _ee=l7,xee=gee,jee=yee,See=kee,Cee=wee,$ee=bee,Pr={isNothing:_ee,isObject:xee,toArray:jee,repeat:See,isNegativeZero:Cee,extend:$ee};function c7(t,e){var n="",r=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
181
181
 
@@ -220,7 +220,7 @@ This will fail in production.`);s=Z1,s._s.has(r)||(o?ib(r,e,i,s):W8(r,i,s),a._pi
220
220
  || ${$} === "boolean" || ${C} === null`).assign(E,(0,i._)`[${C}]`)}}}function h({gen:k,parentData:w,parentDataProperty:_},S){k.if((0,i._)`${w} !== undefined`,()=>k.assign((0,i._)`${w}[${_}]`,S))}function p(k,w,_,S=a.Correct){const C=S===a.Correct?i.operators.EQ:i.operators.NEQ;let A;switch(k){case"null":return(0,i._)`${w} ${C} null`;case"array":A=(0,i._)`Array.isArray(${w})`;break;case"object":A=(0,i._)`${w} && typeof ${w} == "object" && !Array.isArray(${w})`;break;case"integer":A=$((0,i._)`!(${w} % 1) && !isNaN(${w})`);break;case"number":A=$();break;default:return(0,i._)`typeof ${w} ${C} ${k}`}return S===a.Correct?A:(0,i.not)(A);function $(E=i.nil){return(0,i.and)((0,i._)`typeof ${w} == "number"`,E,_?(0,i._)`isFinite(${w})`:i.nil)}}t.checkDataType=p;function m(k,w,_,S){if(k.length===1)return p(k[0],w,_,S);let C;const A=(0,o.toHash)(k);if(A.array&&A.object){const $=(0,i._)`typeof ${w} != "object"`;C=A.null?$:(0,i._)`!${w} || ${$}`,delete A.null,delete A.array,delete A.object}else C=i.nil;A.number&&delete A.integer;for(const $ in A)C=(0,i.and)(C,p($,w,_,S));return C}t.checkDataTypes=m;const g={message:({schema:k})=>`must be ${k}`,params:({schema:k,schemaValue:w})=>typeof k=="string"?(0,i._)`{type: ${k}}`:(0,i._)`{type: ${w}}`};function v(k){const w=y(k);(0,r.reportError)(w,g)}t.reportTypeError=v;function y(k){const{gen:w,data:_,schema:S}=k,C=(0,o.schemaRefOrVal)(k,S,"type");return{gen:w,keyword:"type",data:_,schema:S.type,schemaCode:C,schemaValue:C,parentSchema:S,params:{},it:k}}}(Vf);var bm={};Object.defineProperty(bm,"__esModule",{value:!0}),bm.assignDefaults=void 0;const Yl=jn,oie=In;function aie(t,e){const{properties:n,items:r}=t.schema;if(e==="object"&&n)for(const i in n)ZL(t,i,n[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,o)=>ZL(t,o,i.default))}bm.assignDefaults=aie;function ZL(t,e,n){const{gen:r,compositeRule:i,data:o,opts:a}=t;if(n===void 0)return;const s=(0,Yl._)`${o}${(0,Yl.getProperty)(e)}`;if(i){(0,oie.checkStrictMode)(t,`default is ignored for: ${s}`);return}let u=(0,Yl._)`${s} === undefined`;a.useDefaults==="empty"&&(u=(0,Yl._)`${u} || ${s} === null || ${s} === ""`),r.if(u,(0,Yl._)`${s} = ${(0,Yl.stringify)(n)}`)}var Ea={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.validateUnion=Sn.validateArray=Sn.usePattern=Sn.callValidateCode=Sn.schemaProperties=Sn.allSchemaProperties=Sn.noPropertyInData=Sn.propertyInData=Sn.isOwnProperty=Sn.hasPropFunc=Sn.reportMissingProp=Sn.checkMissingProp=Sn.checkReportMissingProp=void 0;const lr=jn,Pb=In,zs=Oa,sie=In;function uie(t,e){const{gen:n,data:r,it:i}=t;n.if(Ib(n,r,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,lr._)`${e}`},!0),t.error()})}Sn.checkReportMissingProp=uie;function lie({gen:t,data:e,it:{opts:n}},r,i){return(0,lr.or)(...r.map(o=>(0,lr.and)(Ib(t,e,o,n.ownProperties),(0,lr._)`${i} = ${o}`)))}Sn.checkMissingProp=lie;function cie(t,e){t.setParams({missingProperty:e},!0),t.error()}Sn.reportMissingProp=cie;function eD(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,lr._)`Object.prototype.hasOwnProperty`})}Sn.hasPropFunc=eD;function Nb(t,e,n){return(0,lr._)`${eD(t)}.call(${e}, ${n})`}Sn.isOwnProperty=Nb;function fie(t,e,n,r){const i=(0,lr._)`${e}${(0,lr.getProperty)(n)} !== undefined`;return r?(0,lr._)`${i} && ${Nb(t,e,n)}`:i}Sn.propertyInData=fie;function Ib(t,e,n,r){const i=(0,lr._)`${e}${(0,lr.getProperty)(n)} === undefined`;return r?(0,lr.or)(i,(0,lr.not)(Nb(t,e,n))):i}Sn.noPropertyInData=Ib;function tD(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Sn.allSchemaProperties=tD;function die(t,e){return tD(e).filter(n=>!(0,Pb.alwaysValidSchema)(t,e[n]))}Sn.schemaProperties=die;function hie({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:o},it:a},s,u,l){const f=l?(0,lr._)`${t}, ${e}, ${r}${i}`:e,c=[[zs.default.instancePath,(0,lr.strConcat)(zs.default.instancePath,o)],[zs.default.parentData,a.parentData],[zs.default.parentDataProperty,a.parentDataProperty],[zs.default.rootData,zs.default.rootData]];a.opts.dynamicRef&&c.push([zs.default.dynamicAnchors,zs.default.dynamicAnchors]);const d=(0,lr._)`${f}, ${n.object(...c)}`;return u!==lr.nil?(0,lr._)`${s}.call(${u}, ${d})`:(0,lr._)`${s}(${d})`}Sn.callValidateCode=hie;const pie=(0,lr._)`new RegExp`;function mie({gen:t,it:{opts:e}},n){const r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(n,r);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,lr._)`${i.code==="new RegExp"?pie:(0,sie.useFunc)(t,i)}(${n}, ${r})`})}Sn.usePattern=mie;function vie(t){const{gen:e,data:n,keyword:r,it:i}=t,o=e.name("valid");if(i.allErrors){const s=e.let("valid",!0);return a(()=>e.assign(s,!1)),s}return e.var(o,!0),a(()=>e.break()),o;function a(s){const u=e.const("len",(0,lr._)`${n}.length`);e.forRange("i",0,u,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:Pb.Type.Num},o),e.if((0,lr.not)(o),s)})}}Sn.validateArray=vie;function gie(t){const{gen:e,schema:n,keyword:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Pb.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;const a=e.let("valid",!1),s=e.name("_valid");e.block(()=>n.forEach((u,l)=>{const f=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},s);e.assign(a,(0,lr._)`${a} || ${s}`),t.mergeValidEvaluated(f,s)||e.if((0,lr.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}Sn.validateUnion=gie,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.validateKeywordUsage=Ea.validSchemaType=Ea.funcKeywordCode=Ea.macroKeywordCode=void 0;const Pi=jn,Nu=Oa,yie=Sn,bie=zf;function kie(t,e){const{gen:n,keyword:r,schema:i,parentSchema:o,it:a}=t,s=e.macro.call(a.self,i,o,a),u=rD(n,r,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);const l=n.name("valid");t.subschema({schema:s,schemaPath:Pi.nil,errSchemaPath:`${a.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Ea.macroKeywordCode=kie;function wie(t,e){var n;const{gen:r,keyword:i,schema:o,parentSchema:a,$data:s,it:u}=t;xie(u,e);const l=!s&&e.compile?e.compile.call(u.self,o,a,u):e.validate,f=rD(r,i,l),c=r.let("valid");t.block$data(c,d),t.ok((n=e.valid)!==null&&n!==void 0?n:c);function d(){if(e.errors===!1)m(),e.modifying&&nD(t),g(()=>t.error());else{const v=e.async?h():p();e.modifying&&nD(t),g(()=>_ie(t,v))}}function h(){const v=r.let("ruleErrs",null);return r.try(()=>m((0,Pi._)`await `),y=>r.assign(c,!1).if((0,Pi._)`${y} instanceof ${u.ValidationError}`,()=>r.assign(v,(0,Pi._)`${y}.errors`),()=>r.throw(y))),v}function p(){const v=(0,Pi._)`${f}.errors`;return r.assign(v,null),m(Pi.nil),v}function m(v=e.async?(0,Pi._)`await `:Pi.nil){const y=u.opts.passContext?Nu.default.this:Nu.default.self,k=!("compile"in e&&!s||e.schema===!1);r.assign(c,(0,Pi._)`${v}${(0,yie.callValidateCode)(t,f,y,k)}`,e.modifying)}function g(v){var y;r.if((0,Pi.not)((y=e.valid)!==null&&y!==void 0?y:c),v)}}Ea.funcKeywordCode=wie;function nD(t){const{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,Pi._)`${r.parentData}[${r.parentDataProperty}]`))}function _ie(t,e){const{gen:n}=t;n.if((0,Pi._)`Array.isArray(${e})`,()=>{n.assign(Nu.default.vErrors,(0,Pi._)`${Nu.default.vErrors} === null ? ${e} : ${Nu.default.vErrors}.concat(${e})`).assign(Nu.default.errors,(0,Pi._)`${Nu.default.vErrors}.length`),(0,bie.extendErrors)(t)},()=>t.error())}function xie({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function rD(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Pi.stringify)(n)})}function jie(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Ea.validSchemaType=jie;function Sie({schema:t,opts:e,self:n,errSchemaPath:r},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(a!=null&&a.some(s=>!Object.prototype.hasOwnProperty.call(t,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){const u=`keyword "${o}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}Ea.validateKeywordUsage=Sie;var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.extendSubschemaMode=Fs.extendSubschemaData=Fs.getSubschema=void 0;const Ta=jn,iD=In;function Cie(t,{keyword:e,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const s=t.schema[e];return n===void 0?{schema:s,schemaPath:(0,Ta._)`${t.schemaPath}${(0,Ta.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:s[n],schemaPath:(0,Ta._)`${t.schemaPath}${(0,Ta.getProperty)(e)}${(0,Ta.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,iD.escapeFragment)(n)}`}}if(r!==void 0){if(i===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Fs.getSubschema=Cie;function $ie(t,e,{dataProp:n,dataPropType:r,data:i,dataTypes:o,propertyName:a}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=e;if(n!==void 0){const{errorPath:l,dataPathArr:f,opts:c}=e,d=s.let("data",(0,Ta._)`${e.data}${(0,Ta.getProperty)(n)}`,!0);u(d),t.errorPath=(0,Ta.str)`${l}${(0,iD.getErrorPath)(n,r,c.jsPropertySyntax)}`,t.parentDataProperty=(0,Ta._)`${n}`,t.dataPathArr=[...f,t.parentDataProperty]}if(i!==void 0){const l=i instanceof Ta.Name?i:s.let("data",i,!0);u(l),a!==void 0&&(t.propertyName=a)}o&&(t.dataTypes=o);function u(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Fs.extendSubschemaData=$ie;function Oie(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:o}){r!==void 0&&(t.compositeRule=r),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=n}Fs.extendSubschemaMode=Oie;var Yr={},oD=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n},aD={exports:{}},Vs=aD.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};km(e,r,i,t,"",t)};Vs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Vs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Vs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Vs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function km(t,e,n,r,i,o,a,s,u,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,o,a,s,u,l);for(var f in r){var c=r[f];if(Array.isArray(c)){if(f in Vs.arrayKeywords)for(var d=0;d<c.length;d++)km(t,e,n,c[d],i+"/"+f+"/"+d,o,i,f,r,d)}else if(f in Vs.propsKeywords){if(c&&typeof c=="object")for(var h in c)km(t,e,n,c[h],i+"/"+f+"/"+Eie(h),o,i,f,r,h)}else(f in Vs.keywords||t.allKeys&&!(f in Vs.skipKeywords))&&km(t,e,n,c,i+"/"+f,o,i,f,r)}n(r,i,o,a,s,u,l)}}function Eie(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.getSchemaRefs=Yr.resolveUrl=Yr.normalizeId=Yr._getFullPath=Yr.getFullPath=Yr.inlineRef=void 0;const Tie=In,Aie=oD,Mie=aD.exports,Pie=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Nie(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Lb(t):e?sD(t)<=e:!1}Yr.inlineRef=Nie;const Iie=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Lb(t){for(const e in t){if(Iie.has(e))return!0;const n=t[e];if(Array.isArray(n)&&n.some(Lb)||typeof n=="object"&&Lb(n))return!0}return!1}function sD(t){let e=0;for(const n in t){if(n==="$ref")return 1/0;if(e++,!Pie.has(n)&&(typeof t[n]=="object"&&(0,Tie.eachItem)(t[n],r=>e+=sD(r)),e===1/0))return 1/0}return e}function uD(t,e="",n){n!==!1&&(e=Xl(e));const r=t.parse(e);return lD(t,r)}Yr.getFullPath=uD;function lD(t,e){return t.serialize(e).split("#")[0]+"#"}Yr._getFullPath=lD;const Lie=/#\/?$/;function Xl(t){return t?t.replace(Lie,""):""}Yr.normalizeId=Xl;function Die(t,e,n){return n=Xl(n),t.resolve(e,n)}Yr.resolveUrl=Die;const Rie=/^[a-z_][-a-z0-9._]*$/i;function Bie(t,e){if(typeof t=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,i=Xl(t[n]||e),o={"":i},a=uD(r,i,!1),s={},u=new Set;return Mie(t,{allKeys:!0},(c,d,h,p)=>{if(p===void 0)return;const m=a+d;let g=o[p];typeof c[n]=="string"&&(g=v.call(this,c[n])),y.call(this,c.$anchor),y.call(this,c.$dynamicAnchor),o[d]=g;function v(k){const w=this.opts.uriResolver.resolve;if(k=Xl(g?w(g,k):k),u.has(k))throw f(k);u.add(k);let _=this.refs[k];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?l(c,_.schema,k):k!==Xl(m)&&(k[0]==="#"?(l(c,s[k],k),s[k]=c):this.refs[k]=m),k}function y(k){if(typeof k=="string"){if(!Rie.test(k))throw new Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),s;function l(c,d,h){if(d!==void 0&&!Aie(c,d))throw f(h)}function f(c){return new Error(`reference "${c}" resolves to more than one schema`)}}Yr.getSchemaRefs=Bie,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.getData=Wo.KeywordCxt=Wo.validateFunctionCode=void 0;const cD=Ql,fD=Vf,Db=ns,wm=Vf,zie=bm,qf=Ea,Rb=Fs,Pt=jn,on=Oa,Fie=Yr,rs=In,Hf=zf;function Vie(t){if(mD(t)&&(vD(t),pD(t))){Uie(t);return}dD(t,()=>(0,cD.topBoolOrEmptySchema)(t))}Wo.validateFunctionCode=Vie;function dD({gen:t,validateName:e,schema:n,schemaEnv:r,opts:i},o){i.code.es5?t.func(e,(0,Pt._)`${on.default.data}, ${on.default.valCxt}`,r.$async,()=>{t.code((0,Pt._)`"use strict"; ${hD(n,i)}`),Hie(t,i),t.code(o)}):t.func(e,(0,Pt._)`${on.default.data}, ${qie(i)}`,r.$async,()=>t.code(hD(n,i)).code(o))}function qie(t){return(0,Pt._)`{${on.default.instancePath}="", ${on.default.parentData}, ${on.default.parentDataProperty}, ${on.default.rootData}=${on.default.data}${t.dynamicRef?(0,Pt._)`, ${on.default.dynamicAnchors}={}`:Pt.nil}}={}`}function Hie(t,e){t.if(on.default.valCxt,()=>{t.var(on.default.instancePath,(0,Pt._)`${on.default.valCxt}.${on.default.instancePath}`),t.var(on.default.parentData,(0,Pt._)`${on.default.valCxt}.${on.default.parentData}`),t.var(on.default.parentDataProperty,(0,Pt._)`${on.default.valCxt}.${on.default.parentDataProperty}`),t.var(on.default.rootData,(0,Pt._)`${on.default.valCxt}.${on.default.rootData}`),e.dynamicRef&&t.var(on.default.dynamicAnchors,(0,Pt._)`${on.default.valCxt}.${on.default.dynamicAnchors}`)},()=>{t.var(on.default.instancePath,(0,Pt._)`""`),t.var(on.default.parentData,(0,Pt._)`undefined`),t.var(on.default.parentDataProperty,(0,Pt._)`undefined`),t.var(on.default.rootData,on.default.data),e.dynamicRef&&t.var(on.default.dynamicAnchors,(0,Pt._)`{}`)})}function Uie(t){const{schema:e,opts:n,gen:r}=t;dD(t,()=>{n.$comment&&e.$comment&&yD(t),Qie(t),r.let(on.default.vErrors,null),r.let(on.default.errors,0),n.unevaluated&&Wie(t),gD(t),Zie(t)})}function Wie(t){const{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Pt._)`${n}.evaluated`),e.if((0,Pt._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Pt._)`${t.evaluated}.props`,(0,Pt._)`undefined`)),e.if((0,Pt._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Pt._)`${t.evaluated}.items`,(0,Pt._)`undefined`))}function hD(t,e){const n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Pt._)`/*# sourceURL=${n} */`:Pt.nil}function Kie(t,e){if(mD(t)&&(vD(t),pD(t))){Jie(t,e);return}(0,cD.boolOrEmptySchema)(t,e)}function pD({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const n in t)if(e.RULES.all[n])return!0;return!1}function mD(t){return typeof t.schema!="boolean"}function Jie(t,e){const{schema:n,gen:r,opts:i}=t;i.$comment&&n.$comment&&yD(t),Yie(t),Xie(t);const o=r.const("_errs",on.default.errors);gD(t,o),r.var(e,(0,Pt._)`${o} === ${on.default.errors}`)}function vD(t){(0,rs.checkUnknownRules)(t),Gie(t)}function gD(t,e){if(t.opts.jtd)return bD(t,[],!1,e);const n=(0,fD.getSchemaTypes)(t.schema),r=(0,fD.coerceAndCheckDataType)(t,n);bD(t,n,!r,e)}function Gie(t){const{schema:e,errSchemaPath:n,opts:r,self:i}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,rs.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function Qie(t){const{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,rs.checkStrictMode)(t,"default is ignored in the schema root")}function Yie(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Fie.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Xie(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function yD({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:i}){const o=n.$comment;if(i.$comment===!0)t.code((0,Pt._)`${on.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){const a=(0,Pt.str)`${r}/$comment`,s=t.scopeValue("root",{ref:e.root});t.code((0,Pt._)`${on.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function Zie(t){const{gen:e,schemaEnv:n,validateName:r,ValidationError:i,opts:o}=t;n.$async?e.if((0,Pt._)`${on.default.errors} === 0`,()=>e.return(on.default.data),()=>e.throw((0,Pt._)`new ${i}(${on.default.vErrors})`)):(e.assign((0,Pt._)`${r}.errors`,on.default.vErrors),o.unevaluated&&eoe(t),e.return((0,Pt._)`${on.default.errors} === 0`))}function eoe({gen:t,evaluated:e,props:n,items:r}){n instanceof Pt.Name&&t.assign((0,Pt._)`${e}.props`,n),r instanceof Pt.Name&&t.assign((0,Pt._)`${e}.items`,r)}function bD(t,e,n,r){const{gen:i,schema:o,data:a,allErrors:s,opts:u,self:l}=t,{RULES:f}=l;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,rs.schemaHasRulesButRef)(o,f))){i.block(()=>xD(t,"$ref",f.all.$ref.definition));return}u.jtd||toe(t,e),i.block(()=>{for(const d of f.rules)c(d);c(f.post)});function c(d){!(0,Db.shouldUseGroup)(o,d)||(d.type?(i.if((0,wm.checkDataType)(d.type,a,u.strictNumbers)),kD(t,d),e.length===1&&e[0]===d.type&&n&&(i.else(),(0,wm.reportTypeError)(t)),i.endIf()):kD(t,d),s||i.if((0,Pt._)`${on.default.errors} === ${r||0}`))}}function kD(t,e){const{gen:n,schema:r,opts:{useDefaults:i}}=t;i&&(0,zie.assignDefaults)(t,e.type),n.block(()=>{for(const o of e.rules)(0,Db.shouldUseRule)(r,o)&&xD(t,o.keyword,o.definition,e.type)})}function toe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(noe(t,e),t.opts.allowUnionTypes||roe(t,e),ioe(t,t.dataTypes))}function noe(t,e){if(!!e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{wD(t.dataTypes,n)||Bb(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),t.dataTypes=t.dataTypes.filter(n=>wD(e,n))}}function roe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Bb(t,"use allowUnionTypes to allow union type keyword")}function ioe(t,e){const n=t.self.RULES.all;for(const r in n){const i=n[r];if(typeof i=="object"&&(0,Db.shouldUseRule)(t.schema,i)){const{type:o}=i.definition;o.length&&!o.some(a=>ooe(e,a))&&Bb(t,`missing type "${o.join(",")}" for keyword "${r}"`)}}}function ooe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function wD(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Bb(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,rs.checkStrictMode)(t,e,t.opts.strictTypes)}class _D{constructor(e,n,r){if((0,qf.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,rs.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",jD(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,qf.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",on.default.errors))}result(e,n,r){this.failResult((0,Pt.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Pt.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:n}=this;this.fail((0,Pt._)`${n} !== undefined && (${(0,Pt.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?Hf.reportExtraError:Hf.reportError)(this,this.def.error,n)}$dataError(){(0,Hf.reportError)(this,this.def.$dataError||Hf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Hf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=Pt.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=Pt.nil,n=Pt.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:o,def:a}=this;r.if((0,Pt.or)((0,Pt._)`${i} === undefined`,n)),e!==Pt.nil&&r.assign(e,!0),(o.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Pt.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:n,schemaType:r,def:i,it:o}=this;return(0,Pt.or)(a(),s());function a(){if(r.length){if(!(n instanceof Pt.Name))throw new Error("ajv implementation error");const u=Array.isArray(r)?r:[r];return(0,Pt._)`${(0,wm.checkDataTypes)(u,n,o.opts.strictNumbers,wm.DataType.Wrong)}`}return Pt.nil}function s(){if(i.validateSchema){const u=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Pt._)`!${u}(${n})`}return Pt.nil}}subschema(e,n){const r=(0,Rb.getSubschema)(this.it,e);(0,Rb.extendSubschemaData)(r,this.it,e),(0,Rb.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return Kie(i,n),i}mergeEvaluated(e,n){const{it:r,gen:i}=this;!r.opts.unevaluated||(r.props!==!0&&e.props!==void 0&&(r.props=rs.mergeEvaluated.props(i,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=rs.mergeEvaluated.items(i,e.items,r.items,n)))}mergeValidEvaluated(e,n){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(e,Pt.Name)),!0}}Wo.KeywordCxt=_D;function xD(t,e,n,r){const i=new _D(t,n,e);"code"in n?n.code(i,r):i.$data&&n.validate?(0,qf.funcKeywordCode)(i,n):"macro"in n?(0,qf.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,qf.funcKeywordCode)(i,n)}const aoe=/^\/(?:[^~]|~0|~1)*$/,soe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jD(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let i,o;if(t==="")return on.default.rootData;if(t[0]==="/"){if(!aoe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=on.default.rootData}else{const l=soe.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);const f=+l[1];if(i=l[2],i==="#"){if(f>=e)throw new Error(u("property/index",f));return r[e-f]}if(f>e)throw new Error(u("data",f));if(o=n[e-f],!i)return o}let a=o;const s=i.split("/");for(const l of s)l&&(o=(0,Pt._)`${o}${(0,Pt.getProperty)((0,rs.unescapeJsonPointer)(l))}`,a=(0,Pt._)`${a} && ${o}`);return a;function u(l,f){return`Cannot access ${l} ${f} levels up, current level is ${e}`}}Wo.getData=jD;var _m={};Object.defineProperty(_m,"__esModule",{value:!0});class uoe extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}_m.default=uoe;var xm={};Object.defineProperty(xm,"__esModule",{value:!0});const zb=Yr;class loe extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,zb.resolveUrl)(e,n,r),this.missingSchema=(0,zb.normalizeId)((0,zb.getFullPath)(e,this.missingRef))}}xm.default=loe;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.resolveSchema=Fi.getCompilingSchema=Fi.resolveRef=Fi.compileSchema=Fi.SchemaEnv=void 0;const Ko=jn,coe=_m,Iu=Oa,Jo=Yr,SD=In,foe=Wo;class jm{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Jo.normalizeId)(r==null?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Fi.SchemaEnv=jm;function Fb(t){const e=CD.call(this,t);if(e)return e;const n=(0,Jo.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Ko.CodeGen(this.scope,{es5:r,lines:i,ownProperties:o});let s;t.$async&&(s=a.scopeValue("Error",{ref:coe.default,code:(0,Ko._)`require("ajv/dist/runtime/validation_error").default`}));const u=a.scopeName("validate");t.validateName=u;const l={gen:a,allErrors:this.opts.allErrors,data:Iu.default.data,parentData:Iu.default.parentData,parentDataProperty:Iu.default.parentDataProperty,dataNames:[Iu.default.data],dataPathArr:[Ko.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ko.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Ko.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ko._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(t),(0,foe.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);const c=a.toString();f=`${a.scopeRefs(Iu.default.scope)}return ${c}`,this.opts.code.process&&(f=this.opts.code.process(f,t));const h=new Function(`${Iu.default.self}`,`${Iu.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:c,scopeValues:a._values}),this.opts.unevaluated){const{props:p,items:m}=l;h.evaluated={props:p instanceof Ko.Name?void 0:p,items:m instanceof Ko.Name?void 0:m,dynamicProps:p instanceof Ko.Name,dynamicItems:m instanceof Ko.Name},h.source&&(h.source.evaluated=(0,Ko.stringify)(h.evaluated))}return t.validate=h,t}catch(c){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),c}finally{this._compilations.delete(t)}}Fi.compileSchema=Fb;function doe(t,e,n){var r;n=(0,Jo.resolveUrl)(this.opts.uriResolver,e,n);const i=t.refs[n];if(i)return i;let o=moe.call(this,t,n);if(o===void 0){const a=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:s}=this.opts;a&&(o=new jm({schema:a,schemaId:s,root:t,baseId:e}))}if(o!==void 0)return t.refs[n]=hoe.call(this,o)}Fi.resolveRef=doe;function hoe(t){return(0,Jo.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Fb.call(this,t)}function CD(t){for(const e of this._compilations)if(poe(e,t))return e}Fi.getCompilingSchema=CD;function poe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function moe(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||Sm.call(this,t,e)}function Sm(t,e){const n=this.opts.uriResolver.parse(e),r=(0,Jo._getFullPath)(this.opts.uriResolver,n);let i=(0,Jo.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===i)return Vb.call(this,n,t);const o=(0,Jo.normalizeId)(r),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){const s=Sm.call(this,t,a);return typeof(s==null?void 0:s.schema)!="object"?void 0:Vb.call(this,n,s)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Fb.call(this,a),o===(0,Jo.normalizeId)(e)){const{schema:s}=a,{schemaId:u}=this.opts,l=s[u];return l&&(i=(0,Jo.resolveUrl)(this.opts.uriResolver,i,l)),new jm({schema:s,schemaId:u,root:t,baseId:i})}return Vb.call(this,n,a)}}Fi.resolveSchema=Sm;const voe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Vb(t,{baseId:e,schema:n,root:r}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const s of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const u=n[(0,SD.unescapeFragment)(s)];if(u===void 0)return;n=u;const l=typeof n=="object"&&n[this.opts.schemaId];!voe.has(s)&&l&&(e=(0,Jo.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,SD.schemaHasRulesButRef)(n,this.RULES)){const s=(0,Jo.resolveUrl)(this.opts.uriResolver,e,n.$ref);o=Sm.call(this,r,s)}const{schemaId:a}=this.opts;if(o=o||new jm({schema:n,schemaId:a,root:r,baseId:e}),o.schema!==o.root.schema)return o}const goe={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var qb={},Hb={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(n,r){r(e)})(bi,function(n){function r(){for(var de=arguments.length,ie=Array(de),ge=0;ge<de;ge++)ie[ge]=arguments[ge];if(ie.length>1){ie[0]=ie[0].slice(0,-1);for(var Ae=ie.length-1,Ee=1;Ee<Ae;++Ee)ie[Ee]=ie[Ee].slice(1,-1);return ie[Ae]=ie[Ae].slice(1),ie.join("")}else return ie[0]}function i(de){return"(?:"+de+")"}function o(de){return de===void 0?"undefined":de===null?"null":Object.prototype.toString.call(de).split(" ").pop().split("]").shift().toLowerCase()}function a(de){return de.toUpperCase()}function s(de){return de!=null?de instanceof Array?de:typeof de.length!="number"||de.split||de.setInterval||de.call?[de]:Array.prototype.slice.call(de):[]}function u(de,ie){var ge=de;if(ie)for(var Ae in ie)ge[Ae]=ie[Ae];return ge}function l(de){var ie="[A-Za-z]",ge="[0-9]",Ae=r(ge,"[A-Fa-f]"),Ee=i(i("%[EFef]"+Ae+"%"+Ae+Ae+"%"+Ae+Ae)+"|"+i("%[89A-Fa-f]"+Ae+"%"+Ae+Ae)+"|"+i("%"+Ae+Ae)),bt="[\\:\\/\\?\\#\\[\\]\\@]",kt="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",$t=r(bt,kt),Xe=de?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",xt=de?"[\\uE000-\\uF8FF]":"[]",Xt=r(ie,ge,"[\\-\\.\\_\\~]",Xe);i(ie+r(ie,ge,"[\\+\\-\\.]")+"*"),i(i(Ee+"|"+r(Xt,kt,"[\\:]"))+"*");var yn=i(i("25[0-5]")+"|"+i("2[0-4]"+ge)+"|"+i("1"+ge+ge)+"|"+i("0?[1-9]"+ge)+"|0?0?"+ge),On=i(yn+"\\."+yn+"\\."+yn+"\\."+yn),Qt=i(Ae+"{1,4}"),Wn=i(i(Qt+"\\:"+Qt)+"|"+On),Qn=i(i(Qt+"\\:")+"{6}"+Wn),Kn=i("\\:\\:"+i(Qt+"\\:")+"{5}"+Wn),Vr=i(i(Qt)+"?\\:\\:"+i(Qt+"\\:")+"{4}"+Wn),mi=i(i(i(Qt+"\\:")+"{0,1}"+Qt)+"?\\:\\:"+i(Qt+"\\:")+"{3}"+Wn),Ir=i(i(i(Qt+"\\:")+"{0,2}"+Qt)+"?\\:\\:"+i(Qt+"\\:")+"{2}"+Wn),qi=i(i(i(Qt+"\\:")+"{0,3}"+Qt)+"?\\:\\:"+Qt+"\\:"+Wn),vi=i(i(i(Qt+"\\:")+"{0,4}"+Qt)+"?\\:\\:"+Wn),Hn=i(i(i(Qt+"\\:")+"{0,5}"+Qt)+"?\\:\\:"+Qt),gi=i(i(i(Qt+"\\:")+"{0,6}"+Qt)+"?\\:\\:"),Lr=i([Qn,Kn,Vr,mi,Ir,qi,vi,Hn,gi].join("|")),Zr=i(i(Xt+"|"+Ee)+"+");i("[vV]"+Ae+"+\\."+r(Xt,kt,"[\\:]")+"+"),i(i(Ee+"|"+r(Xt,kt))+"*");var Pa=i(Ee+"|"+r(Xt,kt,"[\\:\\@]"));return i(i(Ee+"|"+r(Xt,kt,"[\\@]"))+"+"),i(i(Pa+"|"+r("[\\/\\?]",xt))+"*"),{NOT_SCHEME:new RegExp(r("[^]",ie,ge,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",Xt,kt),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",Xt,kt),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",Xt,kt),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",Xt,kt),"g"),NOT_QUERY:new RegExp(r("[^\\%]",Xt,kt,"[\\:\\@\\/\\?]",xt),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",Xt,kt,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",Xt,kt),"g"),UNRESERVED:new RegExp(Xt,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",Xt,$t),"g"),PCT_ENCODED:new RegExp(Ee,"g"),IPV4ADDRESS:new RegExp("^("+On+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Lr+")"+i(i("\\%25|\\%(?!"+Ae+"{2})")+"("+Zr+")")+"?\\]?$")}}var f=l(!1),c=l(!0),d=function(){function de(ie,ge){var Ae=[],Ee=!0,bt=!1,kt=void 0;try{for(var $t=ie[Symbol.iterator](),Xe;!(Ee=(Xe=$t.next()).done)&&(Ae.push(Xe.value),!(ge&&Ae.length===ge));Ee=!0);}catch(xt){bt=!0,kt=xt}finally{try{!Ee&&$t.return&&$t.return()}finally{if(bt)throw kt}}return Ae}return function(ie,ge){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return de(ie,ge);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(de){if(Array.isArray(de)){for(var ie=0,ge=Array(de.length);ie<de.length;ie++)ge[ie]=de[ie];return ge}else return Array.from(de)},p=2147483647,m=36,g=1,v=26,y=38,k=700,w=72,_=128,S="-",C=/^xn--/,A=/[^\0-\x7E]/,$=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=m-g,z=Math.floor,P=String.fromCharCode;function M(de){throw new RangeError(E[de])}function H(de,ie){for(var ge=[],Ae=de.length;Ae--;)ge[Ae]=ie(de[Ae]);return ge}function G(de,ie){var ge=de.split("@"),Ae="";ge.length>1&&(Ae=ge[0]+"@",de=ge[1]),de=de.replace($,".");var Ee=de.split("."),bt=H(Ee,ie).join(".");return Ae+bt}function V(de){for(var ie=[],ge=0,Ae=de.length;ge<Ae;){var Ee=de.charCodeAt(ge++);if(Ee>=55296&&Ee<=56319&&ge<Ae){var bt=de.charCodeAt(ge++);(bt&64512)==56320?ie.push(((Ee&1023)<<10)+(bt&1023)+65536):(ie.push(Ee),ge--)}else ie.push(Ee)}return ie}var J=function(ie){return String.fromCodePoint.apply(String,h(ie))},F=function(ie){return ie-48<10?ie-22:ie-65<26?ie-65:ie-97<26?ie-97:m},I=function(ie,ge){return ie+22+75*(ie<26)-((ge!=0)<<5)},L=function(ie,ge,Ae){var Ee=0;for(ie=Ae?z(ie/k):ie>>1,ie+=z(ie/ge);ie>O*v>>1;Ee+=m)ie=z(ie/O);return z(Ee+(O+1)*ie/(ie+y))},B=function(ie){var ge=[],Ae=ie.length,Ee=0,bt=_,kt=w,$t=ie.lastIndexOf(S);$t<0&&($t=0);for(var Xe=0;Xe<$t;++Xe)ie.charCodeAt(Xe)>=128&&M("not-basic"),ge.push(ie.charCodeAt(Xe));for(var xt=$t>0?$t+1:0;xt<Ae;){for(var Xt=Ee,yn=1,On=m;;On+=m){xt>=Ae&&M("invalid-input");var Qt=F(ie.charCodeAt(xt++));(Qt>=m||Qt>z((p-Ee)/yn))&&M("overflow"),Ee+=Qt*yn;var Wn=On<=kt?g:On>=kt+v?v:On-kt;if(Qt<Wn)break;var Qn=m-Wn;yn>z(p/Qn)&&M("overflow"),yn*=Qn}var Kn=ge.length+1;kt=L(Ee-Xt,Kn,Xt==0),z(Ee/Kn)>p-bt&&M("overflow"),bt+=z(Ee/Kn),Ee%=Kn,ge.splice(Ee++,0,bt)}return String.fromCodePoint.apply(String,ge)},N=function(ie){var ge=[];ie=V(ie);var Ae=ie.length,Ee=_,bt=0,kt=w,$t=!0,Xe=!1,xt=void 0;try{for(var Xt=ie[Symbol.iterator](),yn;!($t=(yn=Xt.next()).done);$t=!0){var On=yn.value;On<128&&ge.push(P(On))}}catch(Qo){Xe=!0,xt=Qo}finally{try{!$t&&Xt.return&&Xt.return()}finally{if(Xe)throw xt}}var Qt=ge.length,Wn=Qt;for(Qt&&ge.push(S);Wn<Ae;){var Qn=p,Kn=!0,Vr=!1,mi=void 0;try{for(var Ir=ie[Symbol.iterator](),qi;!(Kn=(qi=Ir.next()).done);Kn=!0){var vi=qi.value;vi>=Ee&&vi<Qn&&(Qn=vi)}}catch(Qo){Vr=!0,mi=Qo}finally{try{!Kn&&Ir.return&&Ir.return()}finally{if(Vr)throw mi}}var Hn=Wn+1;Qn-Ee>z((p-bt)/Hn)&&M("overflow"),bt+=(Qn-Ee)*Hn,Ee=Qn;var gi=!0,Lr=!1,Zr=void 0;try{for(var Pa=ie[Symbol.iterator](),Na;!(gi=(Na=Pa.next()).done);gi=!0){var oc=Na.value;if(oc<Ee&&++bt>p&&M("overflow"),oc==Ee){for(var as=bt,Pn=m;;Pn+=m){var yi=Pn<=kt?g:Pn>=kt+v?v:Pn-kt;if(as<yi)break;var ss=as-yi,nr=m-yi;ge.push(P(I(yi+ss%nr,0))),as=z(ss/nr)}ge.push(P(I(as,0))),kt=L(bt,Hn,Wn==Qt),bt=0,++Wn}}}catch(Qo){Lr=!0,Zr=Qo}finally{try{!gi&&Pa.return&&Pa.return()}finally{if(Lr)throw Zr}}++bt,++Ee}return ge.join("")},x=function(ie){return G(ie,function(ge){return C.test(ge)?B(ge.slice(4).toLowerCase()):ge})},j=function(ie){return G(ie,function(ge){return A.test(ge)?"xn--"+N(ge):ge})},T={version:"2.1.0",ucs2:{decode:V,encode:J},decode:B,encode:N,toASCII:j,toUnicode:x},q={};function Q(de){var ie=de.charCodeAt(0),ge=void 0;return ie<16?ge="%0"+ie.toString(16).toUpperCase():ie<128?ge="%"+ie.toString(16).toUpperCase():ie<2048?ge="%"+(ie>>6|192).toString(16).toUpperCase()+"%"+(ie&63|128).toString(16).toUpperCase():ge="%"+(ie>>12|224).toString(16).toUpperCase()+"%"+(ie>>6&63|128).toString(16).toUpperCase()+"%"+(ie&63|128).toString(16).toUpperCase(),ge}function me(de){for(var ie="",ge=0,Ae=de.length;ge<Ae;){var Ee=parseInt(de.substr(ge+1,2),16);if(Ee<128)ie+=String.fromCharCode(Ee),ge+=3;else if(Ee>=194&&Ee<224){if(Ae-ge>=6){var bt=parseInt(de.substr(ge+4,2),16);ie+=String.fromCharCode((Ee&31)<<6|bt&63)}else ie+=de.substr(ge,6);ge+=6}else if(Ee>=224){if(Ae-ge>=9){var kt=parseInt(de.substr(ge+4,2),16),$t=parseInt(de.substr(ge+7,2),16);ie+=String.fromCharCode((Ee&15)<<12|(kt&63)<<6|$t&63)}else ie+=de.substr(ge,9);ge+=9}else ie+=de.substr(ge,3),ge+=3}return ie}function ve(de,ie){function ge(Ae){var Ee=me(Ae);return Ee.match(ie.UNRESERVED)?Ee:Ae}return de.scheme&&(de.scheme=String(de.scheme).replace(ie.PCT_ENCODED,ge).toLowerCase().replace(ie.NOT_SCHEME,"")),de.userinfo!==void 0&&(de.userinfo=String(de.userinfo).replace(ie.PCT_ENCODED,ge).replace(ie.NOT_USERINFO,Q).replace(ie.PCT_ENCODED,a)),de.host!==void 0&&(de.host=String(de.host).replace(ie.PCT_ENCODED,ge).toLowerCase().replace(ie.NOT_HOST,Q).replace(ie.PCT_ENCODED,a)),de.path!==void 0&&(de.path=String(de.path).replace(ie.PCT_ENCODED,ge).replace(de.scheme?ie.NOT_PATH:ie.NOT_PATH_NOSCHEME,Q).replace(ie.PCT_ENCODED,a)),de.query!==void 0&&(de.query=String(de.query).replace(ie.PCT_ENCODED,ge).replace(ie.NOT_QUERY,Q).replace(ie.PCT_ENCODED,a)),de.fragment!==void 0&&(de.fragment=String(de.fragment).replace(ie.PCT_ENCODED,ge).replace(ie.NOT_FRAGMENT,Q).replace(ie.PCT_ENCODED,a)),de}function R(de){return de.replace(/^0*(.*)/,"$1")||"0"}function U(de,ie){var ge=de.match(ie.IPV4ADDRESS)||[],Ae=d(ge,2),Ee=Ae[1];return Ee?Ee.split(".").map(R).join("."):de}function le(de,ie){var ge=de.match(ie.IPV6ADDRESS)||[],Ae=d(ge,3),Ee=Ae[1],bt=Ae[2];if(Ee){for(var kt=Ee.toLowerCase().split("::").reverse(),$t=d(kt,2),Xe=$t[0],xt=$t[1],Xt=xt?xt.split(":").map(R):[],yn=Xe.split(":").map(R),On=ie.IPV4ADDRESS.test(yn[yn.length-1]),Qt=On?7:8,Wn=yn.length-Qt,Qn=Array(Qt),Kn=0;Kn<Qt;++Kn)Qn[Kn]=Xt[Kn]||yn[Wn+Kn]||"";On&&(Qn[Qt-1]=U(Qn[Qt-1],ie));var Vr=Qn.reduce(function(Hn,gi,Lr){if(!gi||gi==="0"){var Zr=Hn[Hn.length-1];Zr&&Zr.index+Zr.length===Lr?Zr.length++:Hn.push({index:Lr,length:1})}return Hn},[]),mi=Vr.sort(function(Hn,gi){return gi.length-Hn.length})[0],Ir=void 0;if(mi&&mi.length>1){var qi=Qn.slice(0,mi.index),vi=Qn.slice(mi.index+mi.length);Ir=qi.join(":")+"::"+vi.join(":")}else Ir=Qn.join(":");return bt&&(Ir+="%"+bt),Ir}else return de}var oe=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,pe="".match(/(){0}/)[1]===void 0;function Ce(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge={},Ae=ie.iri!==!1?c:f;ie.reference==="suffix"&&(de=(ie.scheme?ie.scheme+":":"")+"//"+de);var Ee=de.match(oe);if(Ee){pe?(ge.scheme=Ee[1],ge.userinfo=Ee[3],ge.host=Ee[4],ge.port=parseInt(Ee[5],10),ge.path=Ee[6]||"",ge.query=Ee[7],ge.fragment=Ee[8],isNaN(ge.port)&&(ge.port=Ee[5])):(ge.scheme=Ee[1]||void 0,ge.userinfo=de.indexOf("@")!==-1?Ee[3]:void 0,ge.host=de.indexOf("//")!==-1?Ee[4]:void 0,ge.port=parseInt(Ee[5],10),ge.path=Ee[6]||"",ge.query=de.indexOf("?")!==-1?Ee[7]:void 0,ge.fragment=de.indexOf("#")!==-1?Ee[8]:void 0,isNaN(ge.port)&&(ge.port=de.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?Ee[4]:void 0)),ge.host&&(ge.host=le(U(ge.host,Ae),Ae)),ge.scheme===void 0&&ge.userinfo===void 0&&ge.host===void 0&&ge.port===void 0&&!ge.path&&ge.query===void 0?ge.reference="same-document":ge.scheme===void 0?ge.reference="relative":ge.fragment===void 0?ge.reference="absolute":ge.reference="uri",ie.reference&&ie.reference!=="suffix"&&ie.reference!==ge.reference&&(ge.error=ge.error||"URI is not a "+ie.reference+" reference.");var bt=q[(ie.scheme||ge.scheme||"").toLowerCase()];if(!ie.unicodeSupport&&(!bt||!bt.unicodeSupport)){if(ge.host&&(ie.domainHost||bt&&bt.domainHost))try{ge.host=T.toASCII(ge.host.replace(Ae.PCT_ENCODED,me).toLowerCase())}catch(kt){ge.error=ge.error||"Host's domain name can not be converted to ASCII via punycode: "+kt}ve(ge,f)}else ve(ge,Ae);bt&&bt.parse&&bt.parse(ge,ie)}else ge.error=ge.error||"URI can not be parsed.";return ge}function ce(de,ie){var ge=ie.iri!==!1?c:f,Ae=[];return de.userinfo!==void 0&&(Ae.push(de.userinfo),Ae.push("@")),de.host!==void 0&&Ae.push(le(U(String(de.host),ge),ge).replace(ge.IPV6ADDRESS,function(Ee,bt,kt){return"["+bt+(kt?"%25"+kt:"")+"]"})),(typeof de.port=="number"||typeof de.port=="string")&&(Ae.push(":"),Ae.push(String(de.port))),Ae.length?Ae.join(""):void 0}var X=/^\.\.?\//,ze=/^\/\.(\/|$)/,Je=/^\/\.\.(\/|$)/,Ue=/^\/?(?:.|\n)*?(?=\/|$)/;function Me(de){for(var ie=[];de.length;)if(de.match(X))de=de.replace(X,"");else if(de.match(ze))de=de.replace(ze,"/");else if(de.match(Je))de=de.replace(Je,"/"),ie.pop();else if(de==="."||de==="..")de="";else{var ge=de.match(Ue);if(ge){var Ae=ge[0];de=de.slice(Ae.length),ie.push(Ae)}else throw new Error("Unexpected dot segment condition")}return ie.join("")}function we(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=ie.iri?c:f,Ae=[],Ee=q[(ie.scheme||de.scheme||"").toLowerCase()];if(Ee&&Ee.serialize&&Ee.serialize(de,ie),de.host&&!ge.IPV6ADDRESS.test(de.host)){if(ie.domainHost||Ee&&Ee.domainHost)try{de.host=ie.iri?T.toUnicode(de.host):T.toASCII(de.host.replace(ge.PCT_ENCODED,me).toLowerCase())}catch($t){de.error=de.error||"Host's domain name can not be converted to "+(ie.iri?"Unicode":"ASCII")+" via punycode: "+$t}}ve(de,ge),ie.reference!=="suffix"&&de.scheme&&(Ae.push(de.scheme),Ae.push(":"));var bt=ce(de,ie);if(bt!==void 0&&(ie.reference!=="suffix"&&Ae.push("//"),Ae.push(bt),de.path&&de.path.charAt(0)!=="/"&&Ae.push("/")),de.path!==void 0){var kt=de.path;!ie.absolutePath&&(!Ee||!Ee.absolutePath)&&(kt=Me(kt)),bt===void 0&&(kt=kt.replace(/^\/\//,"/%2F")),Ae.push(kt)}return de.query!==void 0&&(Ae.push("?"),Ae.push(de.query)),de.fragment!==void 0&&(Ae.push("#"),Ae.push(de.fragment)),Ae.join("")}function Pe(de,ie){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ae=arguments[3],Ee={};return Ae||(de=Ce(we(de,ge),ge),ie=Ce(we(ie,ge),ge)),ge=ge||{},!ge.tolerant&&ie.scheme?(Ee.scheme=ie.scheme,Ee.userinfo=ie.userinfo,Ee.host=ie.host,Ee.port=ie.port,Ee.path=Me(ie.path||""),Ee.query=ie.query):(ie.userinfo!==void 0||ie.host!==void 0||ie.port!==void 0?(Ee.userinfo=ie.userinfo,Ee.host=ie.host,Ee.port=ie.port,Ee.path=Me(ie.path||""),Ee.query=ie.query):(ie.path?(ie.path.charAt(0)==="/"?Ee.path=Me(ie.path):((de.userinfo!==void 0||de.host!==void 0||de.port!==void 0)&&!de.path?Ee.path="/"+ie.path:de.path?Ee.path=de.path.slice(0,de.path.lastIndexOf("/")+1)+ie.path:Ee.path=ie.path,Ee.path=Me(Ee.path)),Ee.query=ie.query):(Ee.path=de.path,ie.query!==void 0?Ee.query=ie.query:Ee.query=de.query),Ee.userinfo=de.userinfo,Ee.host=de.host,Ee.port=de.port),Ee.scheme=de.scheme),Ee.fragment=ie.fragment,Ee}function Be(de,ie,ge){var Ae=u({scheme:"null"},ge);return we(Pe(Ce(de,Ae),Ce(ie,Ae),Ae,!0),Ae)}function et(de,ie){return typeof de=="string"?de=we(Ce(de,ie),ie):o(de)==="object"&&(de=Ce(we(de,ie),ie)),de}function it(de,ie,ge){return typeof de=="string"?de=we(Ce(de,ge),ge):o(de)==="object"&&(de=we(de,ge)),typeof ie=="string"?ie=we(Ce(ie,ge),ge):o(ie)==="object"&&(ie=we(ie,ge)),de===ie}function xe(de,ie){return de&&de.toString().replace(!ie||!ie.iri?f.ESCAPE:c.ESCAPE,Q)}function Qe(de,ie){return de&&de.toString().replace(!ie||!ie.iri?f.PCT_ENCODED:c.PCT_ENCODED,me)}var Nt={scheme:"http",domainHost:!0,parse:function(ie,ge){return ie.host||(ie.error=ie.error||"HTTP URIs must have a host."),ie},serialize:function(ie,ge){var Ae=String(ie.scheme).toLowerCase()==="https";return(ie.port===(Ae?443:80)||ie.port==="")&&(ie.port=void 0),ie.path||(ie.path="/"),ie}},Cn={scheme:"https",domainHost:Nt.domainHost,parse:Nt.parse,serialize:Nt.serialize};function Ln(de){return typeof de.secure=="boolean"?de.secure:String(de.scheme).toLowerCase()==="wss"}var re={scheme:"ws",domainHost:!0,parse:function(ie,ge){var Ae=ie;return Ae.secure=Ln(Ae),Ae.resourceName=(Ae.path||"/")+(Ae.query?"?"+Ae.query:""),Ae.path=void 0,Ae.query=void 0,Ae},serialize:function(ie,ge){if((ie.port===(Ln(ie)?443:80)||ie.port==="")&&(ie.port=void 0),typeof ie.secure=="boolean"&&(ie.scheme=ie.secure?"wss":"ws",ie.secure=void 0),ie.resourceName){var Ae=ie.resourceName.split("?"),Ee=d(Ae,2),bt=Ee[0],kt=Ee[1];ie.path=bt&&bt!=="/"?bt:void 0,ie.query=kt,ie.resourceName=void 0}return ie.fragment=void 0,ie}},he={scheme:"wss",domainHost:re.domainHost,parse:re.parse,serialize:re.serialize},_e={},je="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ne="[0-9A-Fa-f]",Ye=i(i("%[EFef]"+Ne+"%"+Ne+Ne+"%"+Ne+Ne)+"|"+i("%[89A-Fa-f]"+Ne+"%"+Ne+Ne)+"|"+i("%"+Ne+Ne)),pt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ct="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",$e=r(Ct,'[\\"\\\\]'),lt="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",wt=new RegExp(je,"g"),ct=new RegExp(Ye,"g"),_t=new RegExp(r("[^]",pt,"[\\.]",'[\\"]',$e),"g"),Ht=new RegExp(r("[^]",je,lt),"g"),Et=Ht;function zt(de){var ie=me(de);return ie.match(wt)?ie:de}var Yt={scheme:"mailto",parse:function(ie,ge){var Ae=ie,Ee=Ae.to=Ae.path?Ae.path.split(","):[];if(Ae.path=void 0,Ae.query){for(var bt=!1,kt={},$t=Ae.query.split("&"),Xe=0,xt=$t.length;Xe<xt;++Xe){var Xt=$t[Xe].split("=");switch(Xt[0]){case"to":for(var yn=Xt[1].split(","),On=0,Qt=yn.length;On<Qt;++On)Ee.push(yn[On]);break;case"subject":Ae.subject=Qe(Xt[1],ge);break;case"body":Ae.body=Qe(Xt[1],ge);break;default:bt=!0,kt[Qe(Xt[0],ge)]=Qe(Xt[1],ge);break}}bt&&(Ae.headers=kt)}Ae.query=void 0;for(var Wn=0,Qn=Ee.length;Wn<Qn;++Wn){var Kn=Ee[Wn].split("@");if(Kn[0]=Qe(Kn[0]),ge.unicodeSupport)Kn[1]=Qe(Kn[1],ge).toLowerCase();else try{Kn[1]=T.toASCII(Qe(Kn[1],ge).toLowerCase())}catch(Vr){Ae.error=Ae.error||"Email address's domain name can not be converted to ASCII via punycode: "+Vr}Ee[Wn]=Kn.join("@")}return Ae},serialize:function(ie,ge){var Ae=ie,Ee=s(ie.to);if(Ee){for(var bt=0,kt=Ee.length;bt<kt;++bt){var $t=String(Ee[bt]),Xe=$t.lastIndexOf("@"),xt=$t.slice(0,Xe).replace(ct,zt).replace(ct,a).replace(_t,Q),Xt=$t.slice(Xe+1);try{Xt=ge.iri?T.toUnicode(Xt):T.toASCII(Qe(Xt,ge).toLowerCase())}catch(Wn){Ae.error=Ae.error||"Email address's domain name can not be converted to "+(ge.iri?"Unicode":"ASCII")+" via punycode: "+Wn}Ee[bt]=xt+"@"+Xt}Ae.path=Ee.join(",")}var yn=ie.headers=ie.headers||{};ie.subject&&(yn.subject=ie.subject),ie.body&&(yn.body=ie.body);var On=[];for(var Qt in yn)yn[Qt]!==_e[Qt]&&On.push(Qt.replace(ct,zt).replace(ct,a).replace(Ht,Q)+"="+yn[Qt].replace(ct,zt).replace(ct,a).replace(Et,Q));return On.length&&(Ae.query=On.join("&")),Ae}},en=/^([^\:]+)\:(.*)/,Ke={scheme:"urn",parse:function(ie,ge){var Ae=ie.path&&ie.path.match(en),Ee=ie;if(Ae){var bt=ge.scheme||Ee.scheme||"urn",kt=Ae[1].toLowerCase(),$t=Ae[2],Xe=bt+":"+(ge.nid||kt),xt=q[Xe];Ee.nid=kt,Ee.nss=$t,Ee.path=void 0,xt&&(Ee=xt.parse(Ee,ge))}else Ee.error=Ee.error||"URN can not be parsed.";return Ee},serialize:function(ie,ge){var Ae=ge.scheme||ie.scheme||"urn",Ee=ie.nid,bt=Ae+":"+(ge.nid||Ee),kt=q[bt];kt&&(ie=kt.serialize(ie,ge));var $t=ie,Xe=ie.nss;return $t.path=(Ee||ge.nid)+":"+Xe,$t}},pr=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$n={scheme:"urn:uuid",parse:function(ie,ge){var Ae=ie;return Ae.uuid=Ae.nss,Ae.nss=void 0,!ge.tolerant&&(!Ae.uuid||!Ae.uuid.match(pr))&&(Ae.error=Ae.error||"UUID is not valid."),Ae},serialize:function(ie,ge){var Ae=ie;return Ae.nss=(ie.uuid||"").toLowerCase(),Ae}};q[Nt.scheme]=Nt,q[Cn.scheme]=Cn,q[re.scheme]=re,q[he.scheme]=he,q[Yt.scheme]=Yt,q[Ke.scheme]=Ke,q[$n.scheme]=$n,n.SCHEMES=q,n.pctEncChar=Q,n.pctDecChars=me,n.parse=Ce,n.removeDotSegments=Me,n.serialize=we,n.resolveComponents=Pe,n.resolve=Be,n.normalize=et,n.equal=it,n.escapeComponent=xe,n.unescapeComponent=Qe,Object.defineProperty(n,"__esModule",{value:!0})})})(Hb,Hb.exports),Object.defineProperty(qb,"__esModule",{value:!0});const $D=Hb.exports;$D.code='require("ajv/dist/runtime/uri").default',qb.default=$D,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Wo;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var n=jn;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=_m,i=xm,o=Pu,a=Fi,s=jn,u=Yr,l=Vf,f=In,c=goe,d=qb,h=(I,L)=>new RegExp(I,L);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function k(I){var L,B,N,x,j,T,q,Q,me,ve,R,U,le,oe,pe,Ce,ce,X,ze,Je,Ue,Me,we,Pe,Be;const et=I.strict,it=(L=I.code)===null||L===void 0?void 0:L.optimize,xe=it===!0||it===void 0?1:it||0,Qe=(N=(B=I.code)===null||B===void 0?void 0:B.regExp)!==null&&N!==void 0?N:h,Nt=(x=I.uriResolver)!==null&&x!==void 0?x:d.default;return{strictSchema:(T=(j=I.strictSchema)!==null&&j!==void 0?j:et)!==null&&T!==void 0?T:!0,strictNumbers:(Q=(q=I.strictNumbers)!==null&&q!==void 0?q:et)!==null&&Q!==void 0?Q:!0,strictTypes:(ve=(me=I.strictTypes)!==null&&me!==void 0?me:et)!==null&&ve!==void 0?ve:"log",strictTuples:(U=(R=I.strictTuples)!==null&&R!==void 0?R:et)!==null&&U!==void 0?U:"log",strictRequired:(oe=(le=I.strictRequired)!==null&&le!==void 0?le:et)!==null&&oe!==void 0?oe:!1,code:I.code?{...I.code,optimize:xe,regExp:Qe}:{optimize:xe,regExp:Qe},loopRequired:(pe=I.loopRequired)!==null&&pe!==void 0?pe:y,loopEnum:(Ce=I.loopEnum)!==null&&Ce!==void 0?Ce:y,meta:(ce=I.meta)!==null&&ce!==void 0?ce:!0,messages:(X=I.messages)!==null&&X!==void 0?X:!0,inlineRefs:(ze=I.inlineRefs)!==null&&ze!==void 0?ze:!0,schemaId:(Je=I.schemaId)!==null&&Je!==void 0?Je:"$id",addUsedSchema:(Ue=I.addUsedSchema)!==null&&Ue!==void 0?Ue:!0,validateSchema:(Me=I.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(we=I.validateFormats)!==null&&we!==void 0?we:!0,unicodeRegExp:(Pe=I.unicodeRegExp)!==null&&Pe!==void 0?Pe:!0,int32range:(Be=I.int32range)!==null&&Be!==void 0?Be:!0,uriResolver:Nt}}class w{constructor(L={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,L=this.opts={...L,...k(L)};const{es5:B,lines:N}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:B,lines:N}),this.logger=z(L.logger);const x=L.validateFormats;L.validateFormats=!1,this.RULES=(0,o.getRules)(),_.call(this,g,L,"NOT SUPPORTED"),_.call(this,v,L,"DEPRECATED","warn"),this._metaOpts=E.call(this),L.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),L.keywords&&$.call(this,L.keywords),typeof L.meta=="object"&&this.addMetaSchema(L.meta),C.call(this),L.validateFormats=x}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:L,meta:B,schemaId:N}=this.opts;let x=c;N==="id"&&(x={...c},x.id=x.$id,delete x.$id),B&&L&&this.addMetaSchema(x,x[N],!1)}defaultMeta(){const{meta:L,schemaId:B}=this.opts;return this.opts.defaultMeta=typeof L=="object"?L[B]||L:void 0}validate(L,B){let N;if(typeof L=="string"){if(N=this.getSchema(L),!N)throw new Error(`no schema with key or ref "${L}"`)}else N=this.compile(L);const x=N(B);return"$async"in N||(this.errors=N.errors),x}compile(L,B){const N=this._addSchema(L,B);return N.validate||this._compileSchemaEnv(N)}compileAsync(L,B){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return x.call(this,L,B);async function x(ve,R){await j.call(this,ve.$schema);const U=this._addSchema(ve,R);return U.validate||T.call(this,U)}async function j(ve){ve&&!this.getSchema(ve)&&await x.call(this,{$ref:ve},!0)}async function T(ve){try{return this._compileSchemaEnv(ve)}catch(R){if(!(R instanceof i.default))throw R;return q.call(this,R),await Q.call(this,R.missingSchema),T.call(this,ve)}}function q({missingSchema:ve,missingRef:R}){if(this.refs[ve])throw new Error(`AnySchema ${ve} is loaded but ${R} cannot be resolved`)}async function Q(ve){const R=await me.call(this,ve);this.refs[ve]||await j.call(this,R.$schema),this.refs[ve]||this.addSchema(R,ve,B)}async function me(ve){const R=this._loading[ve];if(R)return R;try{return await(this._loading[ve]=N(ve))}finally{delete this._loading[ve]}}}addSchema(L,B,N,x=this.opts.validateSchema){if(Array.isArray(L)){for(const T of L)this.addSchema(T,void 0,N,x);return this}let j;if(typeof L=="object"){const{schemaId:T}=this.opts;if(j=L[T],j!==void 0&&typeof j!="string")throw new Error(`schema ${T} must be string`)}return B=(0,u.normalizeId)(B||j),this._checkUnique(B),this.schemas[B]=this._addSchema(L,N,B,x,!0),this}addMetaSchema(L,B,N=this.opts.validateSchema){return this.addSchema(L,B,!0,N),this}validateSchema(L,B){if(typeof L=="boolean")return!0;let N;if(N=L.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const x=this.validate(N,L);if(!x&&B){const j="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(j);else throw new Error(j)}return x}getSchema(L){let B;for(;typeof(B=S.call(this,L))=="string";)L=B;if(B===void 0){const{schemaId:N}=this.opts,x=new a.SchemaEnv({schema:{},schemaId:N});if(B=a.resolveSchema.call(this,x,L),!B)return;this.refs[L]=B}return B.validate||this._compileSchemaEnv(B)}removeSchema(L){if(L instanceof RegExp)return this._removeAllSchemas(this.schemas,L),this._removeAllSchemas(this.refs,L),this;switch(typeof L){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const B=S.call(this,L);return typeof B=="object"&&this._cache.delete(B.schema),delete this.schemas[L],delete this.refs[L],this}case"object":{const B=L;this._cache.delete(B);let N=L[this.opts.schemaId];return N&&(N=(0,u.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(L){for(const B of L)this.addKeyword(B);return this}addKeyword(L,B){let N;if(typeof L=="string")N=L,typeof B=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),B.keyword=N);else if(typeof L=="object"&&B===void 0){if(B=L,N=B.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(M.call(this,N,B),!B)return(0,f.eachItem)(N,j=>H.call(this,j)),this;V.call(this,B);const x={...B,type:(0,l.getJSONTypes)(B.type),schemaType:(0,l.getJSONTypes)(B.schemaType)};return(0,f.eachItem)(N,x.type.length===0?j=>H.call(this,j,x):j=>x.type.forEach(T=>H.call(this,j,x,T))),this}getKeyword(L){const B=this.RULES.all[L];return typeof B=="object"?B.definition:!!B}removeKeyword(L){const{RULES:B}=this;delete B.keywords[L],delete B.all[L];for(const N of B.rules){const x=N.rules.findIndex(j=>j.keyword===L);x>=0&&N.rules.splice(x,1)}return this}addFormat(L,B){return typeof B=="string"&&(B=new RegExp(B)),this.formats[L]=B,this}errorsText(L=this.errors,{separator:B=", ",dataVar:N="data"}={}){return!L||L.length===0?"No errors":L.map(x=>`${N}${x.instancePath} ${x.message}`).reduce((x,j)=>x+B+j)}$dataMetaSchema(L,B){const N=this.RULES.all;L=JSON.parse(JSON.stringify(L));for(const x of B){const j=x.split("/").slice(1);let T=L;for(const q of j)T=T[q];for(const q in N){const Q=N[q];if(typeof Q!="object")continue;const{$data:me}=Q.definition,ve=T[q];me&&ve&&(T[q]=F(ve))}}return L}_removeAllSchemas(L,B){for(const N in L){const x=L[N];(!B||B.test(N))&&(typeof x=="string"?delete L[N]:x&&!x.meta&&(this._cache.delete(x.schema),delete L[N]))}}_addSchema(L,B,N,x=this.opts.validateSchema,j=this.opts.addUsedSchema){let T;const{schemaId:q}=this.opts;if(typeof L=="object")T=L[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof L!="boolean")throw new Error("schema must be object or boolean")}let Q=this._cache.get(L);if(Q!==void 0)return Q;N=(0,u.normalizeId)(T||N);const me=u.getSchemaRefs.call(this,L,N);return Q=new a.SchemaEnv({schema:L,schemaId:q,meta:B,baseId:N,localRefs:me}),this._cache.set(Q.schema,Q),j&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=Q),x&&this.validateSchema(L,!0),Q}_checkUnique(L){if(this.schemas[L]||this.refs[L])throw new Error(`schema with key or id "${L}" already exists`)}_compileSchemaEnv(L){if(L.meta?this._compileMetaSchema(L):a.compileSchema.call(this,L),!L.validate)throw new Error("ajv implementation error");return L.validate}_compileMetaSchema(L){const B=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,L)}finally{this.opts=B}}}t.default=w,w.ValidationError=r.default,w.MissingRefError=i.default;function _(I,L,B,N="error"){for(const x in I){const j=x;j in L&&this.logger[N](`${B}: option ${x}. ${I[j]}`)}}function S(I){return I=(0,u.normalizeId)(I),this.schemas[I]||this.refs[I]}function C(){const I=this.opts.schemas;if(!!I)if(Array.isArray(I))this.addSchema(I);else for(const L in I)this.addSchema(I[L],L)}function A(){for(const I in this.opts.formats){const L=this.opts.formats[I];L&&this.addFormat(I,L)}}function $(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const L in I){const B=I[L];B.keyword||(B.keyword=L),this.addKeyword(B)}}function E(){const I={...this.opts};for(const L of p)delete I[L];return I}const O={log(){},warn(){},error(){}};function z(I){if(I===!1)return O;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw new Error("logger must implement log, warn and error methods")}const P=/^[a-z_$][a-z0-9_$:-]*$/i;function M(I,L){const{RULES:B}=this;if((0,f.eachItem)(I,N=>{if(B.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!P.test(N))throw new Error(`Keyword ${N} has invalid name`)}),!!L&&L.$data&&!("code"in L||"validate"in L))throw new Error('$data keyword must have "code" or "validate" function')}function H(I,L,B){var N;const x=L==null?void 0:L.post;if(B&&x)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:j}=this;let T=x?j.post:j.rules.find(({type:Q})=>Q===B);if(T||(T={type:B,rules:[]},j.rules.push(T)),j.keywords[I]=!0,!L)return;const q={keyword:I,definition:{...L,type:(0,l.getJSONTypes)(L.type),schemaType:(0,l.getJSONTypes)(L.schemaType)}};L.before?G.call(this,T,q,L.before):T.rules.push(q),j.all[I]=q,(N=L.implements)===null||N===void 0||N.forEach(Q=>this.addKeyword(Q))}function G(I,L,B){const N=I.rules.findIndex(x=>x.keyword===B);N>=0?I.rules.splice(N,0,L):(I.rules.push(L),this.logger.warn(`rule ${B} is not defined`))}function V(I){let{metaSchema:L}=I;L!==void 0&&(I.$data&&this.opts.$data&&(L=F(L)),I.validateSchema=this.compile(L,!0))}const J={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F(I){return{anyOf:[I,J]}}}(GL);var Ub={},Wb={},Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});const yoe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Kb.default=yoe;var Lu={};Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.callRef=Lu.getValidate=void 0;const boe=xm,OD=Sn,Vi=jn,Zl=Oa,ED=Fi,Cm=In,koe={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:n,it:r}=t,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:u}=r,{root:l}=o;if((n==="#"||n==="#/")&&i===l.baseId)return c();const f=ED.resolveRef.call(u,l,i,n);if(f===void 0)throw new boe.default(r.opts.uriResolver,i,n);if(f instanceof ED.SchemaEnv)return d(f);return h(f);function c(){if(o===l)return $m(t,a,o,o.$async);const p=e.scopeValue("root",{ref:l});return $m(t,(0,Vi._)`${p}.validate`,l,l.$async)}function d(p){const m=TD(t,p);$m(t,m,p,p.$async)}function h(p){const m=e.scopeValue("schema",s.code.source===!0?{ref:p,code:(0,Vi.stringify)(p)}:{ref:p}),g=e.name("valid"),v=t.subschema({schema:p,dataTypes:[],schemaPath:Vi.nil,topSchemaRef:m,errSchemaPath:n},g);t.mergeEvaluated(v),t.ok(g)}}};function TD(t,e){const{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,Vi._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Lu.getValidate=TD;function $m(t,e,n,r){const{gen:i,it:o}=t,{allErrors:a,schemaEnv:s,opts:u}=o,l=u.passContext?Zl.default.this:Vi.nil;r?f():c();function f(){if(!s.$async)throw new Error("async schema referenced by sync schema");const p=i.let("valid");i.try(()=>{i.code((0,Vi._)`await ${(0,OD.callValidateCode)(t,e,l)}`),h(e),a||i.assign(p,!0)},m=>{i.if((0,Vi._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),d(m),a||i.assign(p,!1)}),t.ok(p)}function c(){t.result((0,OD.callValidateCode)(t,e,l),()=>h(e),()=>d(e))}function d(p){const m=(0,Vi._)`${p}.errors`;i.assign(Zl.default.vErrors,(0,Vi._)`${Zl.default.vErrors} === null ? ${m} : ${Zl.default.vErrors}.concat(${m})`),i.assign(Zl.default.errors,(0,Vi._)`${Zl.default.vErrors}.length`)}function h(p){var m;if(!o.opts.unevaluated)return;const g=(m=n==null?void 0:n.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=Cm.mergeEvaluated.props(i,g.props,o.props));else{const v=i.var("props",(0,Vi._)`${p}.evaluated.props`);o.props=Cm.mergeEvaluated.props(i,v,o.props,Vi.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=Cm.mergeEvaluated.items(i,g.items,o.items));else{const v=i.var("items",(0,Vi._)`${p}.evaluated.items`);o.items=Cm.mergeEvaluated.items(i,v,o.items,Vi.Name)}}}Lu.callRef=$m,Lu.default=koe,Object.defineProperty(Wb,"__esModule",{value:!0});const woe=Kb,_oe=Lu,xoe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",woe.default,_oe.default];Wb.default=xoe;var Jb={},Gb={};Object.defineProperty(Gb,"__esModule",{value:!0});const Om=jn,qs=Om.operators,Em={maximum:{okStr:"<=",ok:qs.LTE,fail:qs.GT},minimum:{okStr:">=",ok:qs.GTE,fail:qs.LT},exclusiveMaximum:{okStr:"<",ok:qs.LT,fail:qs.GTE},exclusiveMinimum:{okStr:">",ok:qs.GT,fail:qs.LTE}},joe={message:({keyword:t,schemaCode:e})=>(0,Om.str)`must be ${Em[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Om._)`{comparison: ${Em[t].okStr}, limit: ${e}}`},Soe={keyword:Object.keys(Em),type:"number",schemaType:"number",$data:!0,error:joe,code(t){const{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,Om._)`${n} ${Em[e].fail} ${r} || isNaN(${n})`)}};Gb.default=Soe;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0});const Uf=jn,Coe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>(0,Uf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Uf._)`{multipleOf: ${t}}`},code(t){const{gen:e,data:n,schemaCode:r,it:i}=t,o=i.opts.multipleOfPrecision,a=e.let("res"),s=o?(0,Uf._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Uf._)`${a} !== parseInt(${a})`;t.fail$data((0,Uf._)`(${r} === 0 || (${a} = ${n}/${r}, ${s}))`)}};Qb.default=Coe;var Yb={},Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});function AD(t){const e=t.length;let n=0,r=0,i;for(;r<e;)n++,i=t.charCodeAt(r++),i>=55296&&i<=56319&&r<e&&(i=t.charCodeAt(r),(i&64512)===56320&&r++);return n}Xb.default=AD,AD.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(Yb,"__esModule",{value:!0});const Du=jn,$oe=In,Ooe=Xb,Eoe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const n=t==="maxLength"?"more":"fewer";return(0,Du.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,Du._)`{limit: ${t}}`},code(t){const{keyword:e,data:n,schemaCode:r,it:i}=t,o=e==="maxLength"?Du.operators.GT:Du.operators.LT,a=i.opts.unicode===!1?(0,Du._)`${n}.length`:(0,Du._)`${(0,$oe.useFunc)(t.gen,Ooe.default)}(${n})`;t.fail$data((0,Du._)`${a} ${o} ${r}`)}};Yb.default=Eoe;var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0});const Toe=Sn,Tm=jn,Aoe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,Tm.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Tm._)`{pattern: ${t}}`},code(t){const{data:e,$data:n,schema:r,schemaCode:i,it:o}=t,a=o.opts.unicodeRegExp?"u":"",s=n?(0,Tm._)`(new RegExp(${i}, ${a}))`:(0,Toe.usePattern)(t,r);t.fail$data((0,Tm._)`!${s}.test(${e})`)}};Zb.default=Aoe;var ek={};Object.defineProperty(ek,"__esModule",{value:!0});const Wf=jn,Moe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const n=t==="maxProperties"?"more":"fewer";return(0,Wf.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,Wf._)`{limit: ${t}}`},code(t){const{keyword:e,data:n,schemaCode:r}=t,i=e==="maxProperties"?Wf.operators.GT:Wf.operators.LT;t.fail$data((0,Wf._)`Object.keys(${n}).length ${i} ${r}`)}};ek.default=Moe;var tk={};Object.defineProperty(tk,"__esModule",{value:!0});const Kf=Sn,Jf=jn,Poe=In,Noe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>(0,Jf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Jf._)`{missingProperty: ${t}}`},code(t){const{gen:e,schema:n,schemaCode:r,data:i,$data:o,it:a}=t,{opts:s}=a;if(!o&&n.length===0)return;const u=n.length>=s.loopRequired;if(a.allErrors?l():f(),s.strictRequired){const h=t.parentSchema.properties,{definedProperties:p}=t.it;for(const m of n)if((h==null?void 0:h[m])===void 0&&!p.has(m)){const g=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,Poe.checkStrictMode)(a,v,a.opts.strictRequired)}}function l(){if(u||o)t.block$data(Jf.nil,c);else for(const h of n)(0,Kf.checkReportMissingProp)(t,h)}function f(){const h=e.let("missing");if(u||o){const p=e.let("valid",!0);t.block$data(p,()=>d(h,p)),t.ok(p)}else e.if((0,Kf.checkMissingProp)(t,n,h)),(0,Kf.reportMissingProp)(t,h),e.else()}function c(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,Kf.noPropertyInData)(e,i,h,s.ownProperties),()=>t.error())})}function d(h,p){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(p,(0,Kf.propertyInData)(e,i,h,s.ownProperties)),e.if((0,Jf.not)(p),()=>{t.error(),e.break()})},Jf.nil)}}};tk.default=Noe;var nk={};Object.defineProperty(nk,"__esModule",{value:!0});const Gf=jn,Ioe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const n=t==="maxItems"?"more":"fewer";return(0,Gf.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Gf._)`{limit: ${t}}`},code(t){const{keyword:e,data:n,schemaCode:r}=t,i=e==="maxItems"?Gf.operators.GT:Gf.operators.LT;t.fail$data((0,Gf._)`${n}.length ${i} ${r}`)}};nk.default=Ioe;var rk={},Qf={};Object.defineProperty(Qf,"__esModule",{value:!0});const MD=oD;MD.code='require("ajv/dist/runtime/equal").default',Qf.default=MD,Object.defineProperty(rk,"__esModule",{value:!0});const ik=Vf,Xr=jn,Loe=In,Doe=Qf,Roe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>(0,Xr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Xr._)`{i: ${t}, j: ${e}}`},code(t){const{gen:e,data:n,$data:r,schema:i,parentSchema:o,schemaCode:a,it:s}=t;if(!r&&!i)return;const u=e.let("valid"),l=o.items?(0,ik.getSchemaTypes)(o.items):[];t.block$data(u,f,(0,Xr._)`${a} === false`),t.ok(u);function f(){const p=e.let("i",(0,Xr._)`${n}.length`),m=e.let("j");t.setParams({i:p,j:m}),e.assign(u,!0),e.if((0,Xr._)`${p} > 1`,()=>(c()?d:h)(p,m))}function c(){return l.length>0&&!l.some(p=>p==="object"||p==="array")}function d(p,m){const g=e.name("item"),v=(0,ik.checkDataTypes)(l,g,s.opts.strictNumbers,ik.DataType.Wrong),y=e.const("indices",(0,Xr._)`{}`);e.for((0,Xr._)`;${p}--;`,()=>{e.let(g,(0,Xr._)`${n}[${p}]`),e.if(v,(0,Xr._)`continue`),l.length>1&&e.if((0,Xr._)`typeof ${g} == "string"`,(0,Xr._)`${g} += "_"`),e.if((0,Xr._)`typeof ${y}[${g}] == "number"`,()=>{e.assign(m,(0,Xr._)`${y}[${g}]`),t.error(),e.assign(u,!1).break()}).code((0,Xr._)`${y}[${g}] = ${p}`)})}function h(p,m){const g=(0,Loe.useFunc)(e,Doe.default),v=e.name("outer");e.label(v).for((0,Xr._)`;${p}--;`,()=>e.for((0,Xr._)`${m} = ${p}; ${m}--;`,()=>e.if((0,Xr._)`${g}(${n}[${p}], ${n}[${m}])`,()=>{t.error(),e.assign(u,!1).break(v)})))}}};rk.default=Roe;var ok={};Object.defineProperty(ok,"__esModule",{value:!0});const ak=jn,Boe=In,zoe=Qf,Foe={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>(0,ak._)`{allowedValue: ${t}}`},code(t){const{gen:e,data:n,$data:r,schemaCode:i,schema:o}=t;r||o&&typeof o=="object"?t.fail$data((0,ak._)`!${(0,Boe.useFunc)(e,zoe.default)}(${n}, ${i})`):t.fail((0,ak._)`${o} !== ${n}`)}};ok.default=Foe;var sk={};Object.defineProperty(sk,"__esModule",{value:!0});const Yf=jn,Voe=In,qoe=Qf,Hoe={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Yf._)`{allowedValues: ${t}}`},code(t){const{gen:e,data:n,$data:r,schema:i,schemaCode:o,it:a}=t;if(!r&&i.length===0)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let u;const l=()=>u!=null?u:u=(0,Voe.useFunc)(e,qoe.default);let f;if(s||r)f=e.let("valid"),t.block$data(f,c);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=e.const("vSchema",o);f=(0,Yf.or)(...i.map((p,m)=>d(h,m)))}t.pass(f);function c(){e.assign(f,!1),e.forOf("v",o,h=>e.if((0,Yf._)`${l()}(${n}, ${h})`,()=>e.assign(f,!0).break()))}function d(h,p){const m=i[p];return typeof m=="object"&&m!==null?(0,Yf._)`${l()}(${n}, ${h}[${p}])`:(0,Yf._)`${n} === ${m}`}}};sk.default=Hoe,Object.defineProperty(Jb,"__esModule",{value:!0});const Uoe=Gb,Woe=Qb,Koe=Yb,Joe=Zb,Goe=ek,Qoe=tk,Yoe=nk,Xoe=rk,Zoe=ok,eae=sk,tae=[Uoe.default,Woe.default,Koe.default,Joe.default,Goe.default,Qoe.default,Yoe.default,Xoe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Zoe.default,eae.default];Jb.default=tae;var uk={},ec={};Object.defineProperty(ec,"__esModule",{value:!0}),ec.validateAdditionalItems=void 0;const Ru=jn,lk=In,nae={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,Ru.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ru._)`{limit: ${t}}`},code(t){const{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,lk.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}PD(t,r)}};function PD(t,e){const{gen:n,schema:r,data:i,keyword:o,it:a}=t;a.items=!0;const s=n.const("len",(0,Ru._)`${i}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,Ru._)`${s} <= ${e.length}`);else if(typeof r=="object"&&!(0,lk.alwaysValidSchema)(a,r)){const l=n.var("valid",(0,Ru._)`${s} <= ${e.length}`);n.if((0,Ru.not)(l),()=>u(l)),t.ok(l)}function u(l){n.forRange("i",e.length,s,f=>{t.subschema({keyword:o,dataProp:f,dataPropType:lk.Type.Num},l),a.allErrors||n.if((0,Ru.not)(l),()=>n.break())})}}ec.validateAdditionalItems=PD,ec.default=nae;var ck={},tc={};Object.defineProperty(tc,"__esModule",{value:!0}),tc.validateTuple=void 0;const ND=jn,Am=In,rae=Sn,iae={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:n}=t;if(Array.isArray(e))return ID(t,"additionalItems",e);n.items=!0,!(0,Am.alwaysValidSchema)(n,e)&&t.ok((0,rae.validateArray)(t))}};function ID(t,e,n=t.schema){const{gen:r,parentSchema:i,data:o,keyword:a,it:s}=t;f(i),s.opts.unevaluated&&n.length&&s.items!==!0&&(s.items=Am.mergeEvaluated.items(r,n.length,s.items));const u=r.name("valid"),l=r.const("len",(0,ND._)`${o}.length`);n.forEach((c,d)=>{(0,Am.alwaysValidSchema)(s,c)||(r.if((0,ND._)`${l} > ${d}`,()=>t.subschema({keyword:a,schemaProp:d,dataProp:d},u)),t.ok(u))});function f(c){const{opts:d,errSchemaPath:h}=s,p=n.length,m=p===c.minItems&&(p===c.maxItems||c[e]===!1);if(d.strictTuples&&!m){const g=`"${a}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,Am.checkStrictMode)(s,g,d.strictTuples)}}}tc.validateTuple=ID,tc.default=iae,Object.defineProperty(ck,"__esModule",{value:!0});const oae=tc,aae={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,oae.validateTuple)(t,"items")};ck.default=aae;var fk={};Object.defineProperty(fk,"__esModule",{value:!0});const LD=jn,sae=In,uae=Sn,lae=ec,cae={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,LD.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,LD._)`{limit: ${t}}`},code(t){const{schema:e,parentSchema:n,it:r}=t,{prefixItems:i}=n;r.items=!0,!(0,sae.alwaysValidSchema)(r,e)&&(i?(0,lae.validateAdditionalItems)(t,i):t.ok((0,uae.validateArray)(t)))}};fk.default=cae;var dk={};Object.defineProperty(dk,"__esModule",{value:!0});const So=jn,Mm=In,fae={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>e===void 0?(0,So.str)`must contain at least ${t} valid item(s)`:(0,So.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,So._)`{minContains: ${t}}`:(0,So._)`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:n,parentSchema:r,data:i,it:o}=t;let a,s;const{minContains:u,maxContains:l}=r;o.opts.next?(a=u===void 0?1:u,s=l):a=1;const f=e.const("len",(0,So._)`${i}.length`);if(t.setParams({min:a,max:s}),s===void 0&&a===0){(0,Mm.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Mm.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Mm.alwaysValidSchema)(o,n)){let m=(0,So._)`${f} >= ${a}`;s!==void 0&&(m=(0,So._)`${m} && ${f} <= ${s}`),t.pass(m);return}o.items=!0;const c=e.name("valid");s===void 0&&a===1?h(c,()=>e.if(c,()=>e.break())):a===0?(e.let(c,!0),s!==void 0&&e.if((0,So._)`${i}.length > 0`,d)):(e.let(c,!1),d()),t.result(c,()=>t.reset());function d(){const m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>p(g)))}function h(m,g){e.forRange("i",0,f,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:Mm.Type.Num,compositeRule:!0},m),g()})}function p(m){e.code((0,So._)`${m}++`),s===void 0?e.if((0,So._)`${m} >= ${a}`,()=>e.assign(c,!0).break()):(e.if((0,So._)`${m} > ${s}`,()=>e.assign(c,!1).break()),a===1?e.assign(c,!0):e.if((0,So._)`${m} >= ${a}`,()=>e.assign(c,!0)))}}};dk.default=fae;var DD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=jn,n=In,r=Sn;t.error={message:({params:{property:u,depsCount:l,deps:f}})=>{const c=l===1?"property":"properties";return(0,e.str)`must have ${c} ${f} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:f,missingProperty:c}})=>(0,e._)`{property: ${u},
221
221
  missingProperty: ${c},
222
222
  depsCount: ${l},
223
- deps: ${f}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[l,f]=o(u);a(u,l),s(u,f)}};function o({schema:u}){const l={},f={};for(const c in u){if(c==="__proto__")continue;const d=Array.isArray(u[c])?l:f;d[c]=u[c]}return[l,f]}function a(u,l=u.schema){const{gen:f,data:c,it:d}=u;if(Object.keys(l).length===0)return;const h=f.let("missing");for(const p in l){const m=l[p];if(m.length===0)continue;const g=(0,r.propertyInData)(f,c,p,d.opts.ownProperties);u.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?f.if(g,()=>{for(const v of m)(0,r.checkReportMissingProp)(u,v)}):(f.if((0,e._)`${g} && (${(0,r.checkMissingProp)(u,m,h)})`),(0,r.reportMissingProp)(u,h),f.else())}}t.validatePropertyDeps=a;function s(u,l=u.schema){const{gen:f,data:c,keyword:d,it:h}=u,p=f.name("valid");for(const m in l)(0,n.alwaysValidSchema)(h,l[m])||(f.if((0,r.propertyInData)(f,c,m,h.opts.ownProperties),()=>{const g=u.subschema({keyword:d,schemaProp:m},p);u.mergeValidEvaluated(g,p)},()=>f.var(p,!0)),u.ok(p))}t.validateSchemaDeps=s,t.default=i})(DD);var hk={};Object.defineProperty(hk,"__esModule",{value:!0});const RD=jn,dae=In,hae={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>(0,RD._)`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:n,data:r,it:i}=t;if((0,dae.alwaysValidSchema)(i,n))return;const o=e.name("valid");e.forIn("key",r,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),e.if((0,RD.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};hk.default=hae;var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0});const Nm=Sn,Go=jn,pae=Oa,Im=In,mae={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>(0,Go._)`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:n,parentSchema:r,data:i,errsCount:o,it:a}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Im.alwaysValidSchema)(a,n))return;const l=(0,Nm.allSchemaProperties)(r.properties),f=(0,Nm.allSchemaProperties)(r.patternProperties);c(),t.ok((0,Go._)`${o} === ${pae.default.errors}`);function c(){e.forIn("key",i,g=>{!l.length&&!f.length?p(g):e.if(d(g),()=>p(g))})}function d(g){let v;if(l.length>8){const y=(0,Im.schemaRefOrVal)(a,r.properties,"properties");v=(0,Nm.isOwnProperty)(e,y,g)}else l.length?v=(0,Go.or)(...l.map(y=>(0,Go._)`${g} === ${y}`)):v=Go.nil;return f.length&&(v=(0,Go.or)(v,...f.map(y=>(0,Go._)`${(0,Nm.usePattern)(t,y)}.test(${g})`))),(0,Go.not)(v)}function h(g){e.code((0,Go._)`delete ${i}[${g}]`)}function p(g){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){h(g);return}if(n===!1){t.setParams({additionalProperty:g}),t.error(),s||e.break();return}if(typeof n=="object"&&!(0,Im.alwaysValidSchema)(a,n)){const v=e.name("valid");u.removeAdditional==="failing"?(m(g,v,!1),e.if((0,Go.not)(v),()=>{t.reset(),h(g)})):(m(g,v),s||e.if((0,Go.not)(v),()=>e.break()))}}function m(g,v,y){const k={keyword:"additionalProperties",dataProp:g,dataPropType:Im.Type.Str};y===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,v)}}};Pm.default=mae;var pk={};Object.defineProperty(pk,"__esModule",{value:!0});const vae=Wo,BD=Sn,mk=In,zD=Pm,gae={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:n,parentSchema:r,data:i,it:o}=t;o.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&zD.default.code(new vae.KeywordCxt(o,zD.default,"additionalProperties"));const a=(0,BD.allSchemaProperties)(n);for(const c of a)o.definedProperties.add(c);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=mk.mergeEvaluated.props(e,(0,mk.toHash)(a),o.props));const s=a.filter(c=>!(0,mk.alwaysValidSchema)(o,n[c]));if(s.length===0)return;const u=e.name("valid");for(const c of s)l(c)?f(c):(e.if((0,BD.propertyInData)(e,i,c,o.opts.ownProperties)),f(c),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(c),t.ok(u);function l(c){return o.opts.useDefaults&&!o.compositeRule&&n[c].default!==void 0}function f(c){t.subschema({keyword:"properties",schemaProp:c,dataProp:c},u)}}};pk.default=gae;var vk={};Object.defineProperty(vk,"__esModule",{value:!0});const FD=Sn,Lm=jn,VD=In,qD=In,yae={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:n,data:r,parentSchema:i,it:o}=t,{opts:a}=o,s=(0,FD.allSchemaProperties)(n),u=s.filter(m=>(0,VD.alwaysValidSchema)(o,n[m]));if(s.length===0||u.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;const l=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=e.name("valid");o.props!==!0&&!(o.props instanceof Lm.Name)&&(o.props=(0,qD.evaluatedPropsToName)(e,o.props));const{props:c}=o;d();function d(){for(const m of s)l&&h(m),o.allErrors?p(m):(e.var(f,!0),p(m),e.if(f))}function h(m){for(const g in l)new RegExp(m).test(g)&&(0,VD.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){e.forIn("key",r,g=>{e.if((0,Lm._)`${(0,FD.usePattern)(t,m)}.test(${g})`,()=>{const v=u.includes(m);v||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:qD.Type.Str},f),o.opts.unevaluated&&c!==!0?e.assign((0,Lm._)`${c}[${g}]`,!0):!v&&!o.allErrors&&e.if((0,Lm.not)(f),()=>e.break())})})}}};vk.default=yae;var gk={};Object.defineProperty(gk,"__esModule",{value:!0});const bae=In,kae={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:n,it:r}=t;if((0,bae.alwaysValidSchema)(r,n)){t.fail();return}const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};gk.default=kae;var yk={};Object.defineProperty(yk,"__esModule",{value:!0});const wae={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Sn.validateUnion,error:{message:"must match a schema in anyOf"}};yk.default=wae;var bk={};Object.defineProperty(bk,"__esModule",{value:!0});const Dm=jn,_ae=In,xae={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Dm._)`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:n,parentSchema:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const o=n,a=e.let("valid",!1),s=e.let("passing",null),u=e.name("_valid");t.setParams({passing:s}),e.block(l),t.result(a,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((f,c)=>{let d;(0,_ae.alwaysValidSchema)(i,f)?e.var(u,!0):d=t.subschema({keyword:"oneOf",schemaProp:c,compositeRule:!0},u),c>0&&e.if((0,Dm._)`${u} && ${a}`).assign(a,!1).assign(s,(0,Dm._)`[${s}, ${c}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(s,c),d&&t.mergeEvaluated(d,Dm.Name)})})}}};bk.default=xae;var kk={};Object.defineProperty(kk,"__esModule",{value:!0});const jae=In,Sae={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=e.name("valid");n.forEach((o,a)=>{if((0,jae.alwaysValidSchema)(r,o))return;const s=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(s)})}};kk.default=Sae;var wk={};Object.defineProperty(wk,"__esModule",{value:!0});const Rm=jn,HD=In,Cae={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>(0,Rm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Rm._)`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,HD.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=UD(r,"then"),o=UD(r,"else");if(!i&&!o)return;const a=e.let("valid",!0),s=e.name("_valid");if(u(),t.reset(),i&&o){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(s,l("then",f),l("else",f))}else i?e.if(s,l("then")):e.if((0,Rm.not)(s),l("else"));t.pass(a,()=>t.error(!0));function u(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(f)}function l(f,c){return()=>{const d=t.subschema({keyword:f},s);e.assign(a,s),t.mergeValidEvaluated(d,a),c?e.assign(c,(0,Rm._)`${f}`):t.setParams({ifClause:f})}}}};function UD(t,e){const n=t.schema[e];return n!==void 0&&!(0,HD.alwaysValidSchema)(t,n)}wk.default=Cae;var _k={};Object.defineProperty(_k,"__esModule",{value:!0});const $ae=In,Oae={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,$ae.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};_k.default=Oae,Object.defineProperty(uk,"__esModule",{value:!0});const Eae=ec,Tae=ck,Aae=tc,Mae=fk,Pae=dk,Nae=DD,Iae=hk,Lae=Pm,Dae=pk,Rae=vk,Bae=gk,zae=yk,Fae=bk,Vae=kk,qae=wk,Hae=_k;function Uae(t=!1){const e=[Bae.default,zae.default,Fae.default,Vae.default,qae.default,Hae.default,Iae.default,Lae.default,Nae.default,Dae.default,Rae.default];return t?e.push(Tae.default,Mae.default):e.push(Eae.default,Aae.default),e.push(Pae.default),e}uk.default=Uae;var xk={},jk={};Object.defineProperty(jk,"__esModule",{value:!0});const jr=jn,Wae={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,jr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jr._)`{format: ${t}}`},code(t,e){const{gen:n,data:r,$data:i,schema:o,schemaCode:a,it:s}=t,{opts:u,errSchemaPath:l,schemaEnv:f,self:c}=s;if(!u.validateFormats)return;i?d():h();function d(){const p=n.scopeValue("formats",{ref:c.formats,code:u.code.formats}),m=n.const("fDef",(0,jr._)`${p}[${a}]`),g=n.let("fType"),v=n.let("format");n.if((0,jr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(g,(0,jr._)`${m}.type || "string"`).assign(v,(0,jr._)`${m}.validate`),()=>n.assign(g,(0,jr._)`"string"`).assign(v,m)),t.fail$data((0,jr.or)(y(),k()));function y(){return u.strictSchema===!1?jr.nil:(0,jr._)`${a} && !${v}`}function k(){const w=f.$async?(0,jr._)`(${m}.async ? await ${v}(${r}) : ${v}(${r}))`:(0,jr._)`${v}(${r})`,_=(0,jr._)`(typeof ${v} == "function" ? ${w} : ${v}.test(${r}))`;return(0,jr._)`${v} && ${v} !== true && ${g} === ${e} && !${_}`}}function h(){const p=c.formats[o];if(!p){y();return}if(p===!0)return;const[m,g,v]=k(p);m===e&&t.pass(w());function y(){if(u.strictSchema===!1){c.logger.warn(_());return}throw new Error(_());function _(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function k(_){const S=_ instanceof RegExp?(0,jr.regexpCode)(_):u.code.formats?(0,jr._)`${u.code.formats}${(0,jr.getProperty)(o)}`:void 0,C=n.scopeValue("formats",{key:o,ref:_,code:S});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,jr._)`${C}.validate`]:["string",_,C]}function w(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!f.$async)throw new Error("async format in sync schema");return(0,jr._)`await ${v}(${r})`}return typeof g=="function"?(0,jr._)`${v}(${r})`:(0,jr._)`${v}.test(${r})`}}}};jk.default=Wae,Object.defineProperty(xk,"__esModule",{value:!0});const Kae=[jk.default];xk.default=Kae;var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.contentVocabulary=nc.metadataVocabulary=void 0,nc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],nc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(Ub,"__esModule",{value:!0});const Jae=Wb,Gae=Jb,Qae=uk,Yae=xk,WD=nc,Xae=[Jae.default,Gae.default,(0,Qae.default)(),Yae.default,WD.metadataVocabulary,WD.contentVocabulary];Ub.default=Xae;var Sk={},KD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(KD),Object.defineProperty(Sk,"__esModule",{value:!0});const rc=jn,Ck=KD,JD=Fi,Zae=In,ese={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===Ck.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,rc._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},code(t){const{gen:e,data:n,schema:r,parentSchema:i,it:o}=t,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=r.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const u=e.let("valid",!1),l=e.const("tag",(0,rc._)`${n}${(0,rc.getProperty)(s)}`);e.if((0,rc._)`typeof ${l} == "string"`,()=>f(),()=>t.error(!1,{discrError:Ck.DiscrError.Tag,tag:l,tagName:s})),t.ok(u);function f(){const h=d();e.if(!1);for(const p in h)e.elseIf((0,rc._)`${l} === ${p}`),e.assign(u,c(h[p]));e.else(),t.error(!1,{discrError:Ck.DiscrError.Mapping,tag:l,tagName:s}),e.endIf()}function c(h){const p=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},p);return t.mergeEvaluated(m,rc.Name),p}function d(){var h;const p={},m=v(i);let g=!0;for(let w=0;w<a.length;w++){let _=a[w];(_==null?void 0:_.$ref)&&!(0,Zae.schemaHasRulesButRef)(_,o.self.RULES)&&(_=JD.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,_==null?void 0:_.$ref),_ instanceof JD.SchemaEnv&&(_=_.schema));const S=(h=_==null?void 0:_.properties)===null||h===void 0?void 0:h[s];if(typeof S!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&(m||v(_)),y(S,w)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return p;function v({required:w}){return Array.isArray(w)&&w.includes(s)}function y(w,_){if(w.const)k(w.const,_);else if(w.enum)for(const S of w.enum)k(S,_);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function k(w,_){if(typeof w!="string"||w in p)throw new Error(`discriminator: "${s}" values must be unique strings`);p[w]=_}}}};Sk.default=ese;const tse={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const n=GL,r=Ub,i=Sk,o=tse,a=["/properties"],s="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(d=>this.addVocabulary(d)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const d=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(d,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.exports=e=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=Wo;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var f=jn;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})})(Ab,Ab.exports);const GD=cR(Ab.exports);let Xf;const nse=[["items",EL,TL],["screens",DL,RL],["skills",VL,qL],["buttons",NL,IL],["scripts",JL,Ure],["audio",SL,CL],["quests",AL,ML],["tooltips",WL,KL],["characters",HL,UL]],rse=["baseAssetsPath","baseDataPath","gameTitle","images","layout","gameFlow","dialogPanel","splashScreens","notifications","hudStats","interactionTags","transitions","menuButtons","debugging","saves"];async function ise(t){const e={...Mu};for(const n of rse){const r=t[n];r&&(typeof r=="object"&&!Array.isArray(r)?e[n]={...e[n],...r}:e[n]=r)}for(const n of nse){const r=n[0],i=n[1],o=n[2];let a=t[r];if(a&&typeof a=="string")try{a=await vm(YD(t.baseDataPath,a));const s=new GD({allErrors:!0});if(!s.validate(i,a))throw console.error(s.errors),new Error(`${s.errorsText()}`)}catch(s){console.error(s),Kt(`${r} config error: ${s}`),a={...o}}a&&(Array.isArray(a)?e[r]=a:typeof a=="object"?e[r]={...o,...a}:e[r]=a)}if(Xf=e,Xf.transitions)for(const n in Xf.transitions)ym[n]?Object.assign(ym[n],Xf.transitions[n]):ym[n]=Xf.transitions[n];return e}async function ose(t){const e=await vm(t.configPath);t.baseAssetsPath?e.baseAssetsPath=t.baseAssetsPath:e.baseAssetsPath=e.baseAssetsPath||"",t.baseDataPath?e.baseDataPath=t.baseDataPath:e.baseDataPath=e.baseDataPath||"";const n=new GD({allErrors:!0});return n.validate(Wre,e)||(Kt("Config file validation failed."),console.log(n.errors),Kt(n.errorsText())),ise(e)}function gt(){return Tb().config}function Aa(){return gt().audio}function Co(){return gt().skills}function Bm(){return gt().items}function Zf(){return gt().quests}function zm(){return gt().screens}function $k(){return gt().buttons}function ed(){return gt().tooltips}function Ok(){return gt().characters}function QD(t){const n=ed().tooltips.find(r=>r.keywords.includes(t));return n||(Kt(`Tooltip config for keyword ${t} not found`),null)}function Ek(t){const e=gt().skills.skills[t];return e||Kt(`Skill config for skill ${t} doesn't exist`),e}function td(t){return t.startsWith("http")?t:gt().images[t]?Ma(gt().images[t]):Ma(t)}function Ma(t){return t.startsWith("http")?t:gt().baseAssetsPath?`${gt().baseAssetsPath}${t}`:t}function YD(t,e){return`${t}${e}`}function Tk(t){return gt().baseDataPath?`${gt().baseDataPath}${t}`:t}function Hs(t){const e=$k().buttons[t];return e||Kt(`Button config for button ${t} doesn't exist`),e}function XD(t){const e=zm().screens[t];return e||Kt(`Screen config for screen ${t} doesn't exist`),e}function is(t){const e=Bm().items[t];return e||Kt(`Item config for skill ${t} doesn't exist`),e}function Bu(t){return Zf().quests[t]}function Fm(t,e){return Bu(t).objectives[e]}function Vm(){var e;return(e=gt().dialogPanel.width)!=null?e:YZ}function ZD(t,e,n){if(!n.startsWith("$"))return isNaN(Number(n))?[null,n]:[null,Number(n)];n=n.substring(1);const r=/\[/,i=/\]/;let o=n.search(r);n.search(i);let a=n,s=e,u=0;for(;u<n.length;){if(o>u||o===-1){const l=o>u?o:n.length;let f=n.substring(u,l);isNaN(Number(f))||(f=Number(f)),u>0&&(s=s[a]),[s,a]=sse(s,f)}if(o!==-1){u=o;const l=n.substring(o+1),f=ase(l)+o,c=n.substring(o+1,f),[d,h]=ZD(t,t,c);let p=h;d&&(p=d[h]),typeof p=="number"||!isNaN(Number(p))?p=Number(p):typeof p!="string"&&console.error(`invalid array index (${p}) key type when compiling: ${n}`),s=s[a],a=p,u=f+1;const m=n.substring(u);o=m.search(r),o!==-1&&(o+=u),m.search(i)}else u=n.length}return[s,a]}function ase(t){let e=!1,n=0,r,i=1;for(;!e;){r=t.substring(n);const o=r.search(/\[/),a=r.search(/\]/);o!==-1&&o<a?(n+=o+1,i++):(n+=a+1,i--),i===0&&(e=!0),o===-1&&a===-1&&!e&&Kt(`Could not find closing bracket in ${t}`)}return n}function sse(t,e){if(typeof e=="number")return[t,e];e.startsWith(".")&&(e=e.substring(1));const n=e.split(".");let r=t;const i=n.length-1;let o=n[0],a=0;for(a=0;a<i;a++)o=n[a],typeof r[o]>"u"&&(r[o]={}),r=r[o];return o=n[a],[r,o]}function qm(t,e){return ZD(t,t,e)}function use(t,e){return qm(t,e)}function eR(t,e,n){const[r,i]=qm(t,e);r[i]=n}function tR(t,e,n){const[r,i]=qm(t,e),o=r[i]||0;r[i]=n+o}function ic(){const t=wn(),e=Er(),n=Uo(),r=Nr(),i=wn().scope,o={data:t.data,skills:e.skills,buttons:n.buttons,items:r.items,quests:di().quests,stats:$a().hudStats,scope:i,config:gt(),gameOptions:Gt().options};return new Proxy(o,{get:(s,u,l)=>{const f=wn().scope,c=wn().data;return typeof f[u]<"u"?f[u]:typeof c[u]<"u"?c[u]:Reflect.get(s,u,l)},set:(s,u,l,f)=>{const c=wn().scope,d=wn().data;if(typeof c[u]<"u")c[u]=l;else{if(typeof s[u]<"u")return Reflect.set(s,u,l,f);typeof l=="object"?d[u]={}:d[u]=l}return!0}})}function pi(t){if(t===null)return null;if(typeof t=="object")if(Array.isArray(t)){const e=[];for(const n in t)e[n]=pi(t[n]);return e}else{const e={};for(const n in t)e[n]=pi(t[n]);return e}else return t}function Ak(t,e){if(t===null)return null;if(typeof t=="object"){const n=e(t);if(e(t))return n;if(Array.isArray(t)){const r=[];for(const i in t)r[i]=Ak(t[i],e);return r}else{const r={};for(const i in t)r[i]=Ak(t[i],e);return r}}else return e(t)}const Er=Jr("skills",{state:()=>({skillChecks:{},skills:{}}),actions:{setupSkillCheck(t,e){this.skillChecks[e]=t},passSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!0,e&&(this.skillChecks[t].hidden=!0)},failSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!1,e&&(this.skillChecks[t].hidden=!0)},resetSkillCheck(t){this.skillChecks[t].happened=!1,this.skillChecks[t].succeeded=!1,this.skillChecks[t].hidden=!1},generateSaveData(){return{skillChecks:pi(this.skillChecks),skills:pi(this.skills)}},getSkillCheck(t){return this.skillChecks[t]||this.setupSkillCheck(this.createSkillCheckState(),t),this.skillChecks[t]},createSkillCheckState(){return{happened:!1,succeeded:!1,hidden:!1}},loadSaveData(t){this.skillChecks=gm(this.skillChecks,t.skillChecks),this.skills=gm(this.skills,t.skills)},setupSkills(t){const e=t.skills;for(const n in e)this.skills[n]={id:n,level:e[n].startingLevel||0,xp:0}},getSkill(t){return this.skills[t]},getSkillLevel(t){return this.getSkill(t).level},getSkillXp(t){return this.getSkill(t).xp},addXp(t,e){const n=this.getSkill(t);n||Kt(`Skill ${t} doesn't exist`),n.xp+=e,n.xp>=Co().skillOptions.xpPerLevel&&(n.xp=0,n.level++,this.levelledUp(t))},setSkillLevel(t,e){const n=this.getSkill(t);n||Kt(`Skill ${t} doesn't exist`),n.level=e,this.levelledUp(t)},incrementSkill(t,e){this.getSkill(t).level+=e,this.levelledUp(t)},levelledUp(t){const e=Co().skills[t].name,n=this.skills[t].level;Co().skillOptions.notifyLevelUp&&oo().addNotification(`Your skill in ${e} is now level ${n}`)}}});let nR;const lse=b.defineComponent({components:{Modal:Ws},setup(){const t=Er(),e=b.computed(()=>t.skills),n=b.computed(()=>t.skillChecks);return{skills:e,skillChecks:n}},data(){return{showDebug:!1,jumping:!1,searchString:"",matches:[],matchCursor:0}},mounted(){window.addEventListener("keydown",t=>{if(this.jumping||(t.key==="d"&&this.toggle(),t.key==="j"&&this.jump()),t.key==="ArrowDown"&&(t.preventDefault(),this.matches.length>this.matchCursor+1?this.matchCursor+=1:this.matchCursor=0),t.key==="ArrowUp"&&(t.preventDefault(),this.matchCursor>0?this.matchCursor-=1:this.matchCursor=this.matches.length-1),t.key==="Escape"&&this.finishJumping(),this.jumping&&t.key==="Enter"&&this.matchCursor<this.matches.length){const e=this.matches[this.matchCursor];wn().jumpToLabel(e),this.finishJumping()}})},methods:{finishJumping(){this.jumping=!1,this.matches=[],this.searchString="",this.close()},labelSelected(t){const e=t.target.value;wn().jumpToLabel(e),this.close()},close(){this.showDebug=!1,this.endDebug()},closeErrors(){Gt().clearErrors()},open(){this.showDebug=!0,this.startDebug();const t=wn(),e=Gt(),n=di(),r=Nr(),i=Er();this.$nextTick(()=>{new S8({target:this.$refs.variablesViewer,props:{content:{text:void 0,json:{data:this.variables,quests:n.quests,items:r.items,skills:i.skills,skillChecks:i.skillChecks}},onChange:o=>{t.overrideData(o.json.data),n.quests=o.json.quests,r.items=o.json.items,i.skills=o.json.skills,i.skillChecks=o.json.skillChecks}}}),new S8({target:this.$refs.stateViewer,props:{content:{text:void 0,json:e.getAllStates()},onChange:o=>{e.overrideStates(o.json)}}})})},toggle(){this.jumping?this.finishJumping():this.showDebug?this.close():this.open()},startDebug(){Gt().debugMode=!0},endDebug(){Gt().debugMode=!1},jump(){nR=new Vu(this.labels,{includeScore:!0}),this.jumping=!0,this.startDebug(),setTimeout(()=>{this.$nextTick(()=>{this.$refs.search.focus()})},10),this.matchCursor=0,this.matches=this.labels},getMatchResultStyle(t){if(t===this.matchCursor)return{background:"var(--light-background)"}},onSearchInput(){const t=this.searchString,e=nR.search(t);this.matches=e.map(n=>n.item),this.matches.length>0&&this.matchCursor>this.matches.length-1&&(this.matchCursor=this.matches.length-1)},save(){Gt().autoSaveGame({})},wordCount(){const e=Object.values(this.script).reduce((n,r)=>(Zo.log(n),n+this.countWordsInScriptBranch(r.branch)),0);alert(`You have ${e} words`)},countWordsInScriptLine(t){if(t.command.commandType==="talk"&&typeof t.command.args[2]=="string")return this.countWordsInString(t.command.args[2]);if(t.command.commandType==="text")return this.countWordsInString(t.code);if(t.command.commandType==="choice"){const e=t.command.staticOptions;let n=this.countWordsInScriptLine(e.prompt);return n+=e.choices.reduce((i,o)=>i+this.countWordsInString(o.prompt.code),0),e.choices.reduce((i,o)=>o.branch?i+this.countWordsInScriptBranch(o.branch):i,n)}if(t.command.commandType==="if"){const e=t.command.staticOptions;return[e.success,e.failure].reduce((r,i)=>i?r+this.countWordsInScriptBranch(i):r,0)}return 0},countWordsInString(t){return t.split(" ").length},countWordsInScriptBranch(t){return t.reduce((e,n)=>n?e+this.countWordsInScriptLine(n):e,0)},getPlayTimeString(){const t=Fu(this.playTime.start,this.playTime.previousPlaytime);return Ym(t/1e3)}},computed:{...Za(wn,["script","data"]),...Za(Gt,["playTime","errors","playing","flowState"]),labels(){const t=this.script;return Object.keys(t).sort()},variables(){return this.data}}}),epe="",cse={class:"debug-menu"},fse={key:0,class:"debug-info"},dse=[b.createStaticVNode("<h3>Debug mode is ON</h3><ul><li><b>j</b>: Quick Label Jump</li><li><b>d</b>: Debug Menu</li><li><b>a</b>: Auto Play</li><li><b>s</b>: Skip</li><li><b>Space</b>: New Game</li><li><b>c</b>: Continue</li><li><b>Escape</b>: Toggle Menu</li></ul>",2)],hse=b.createElementVNode("h3",{class:"title"},"Jump to label",-1),pse={key:0,class:"search-results"},mse={key:1},vse=[b.createElementVNode("h3",null,"No matches found",-1)],gse=b.createElementVNode("h3",{class:"title"},"Error(s)",-1),yse=b.createTextVNode(" There are errors in your dialogue scripts. Open the developer console for more details. "),bse=["innerHTML"],kse=b.createElementVNode("h3",{class:"title"},"Debug Menu!",-1),wse={class:"container"},_se=b.createTextVNode(" Hello this is the debug menu. "),xse=b.createElementVNode("option",{class:"option",selected:"",disabled:""},"Jump to a label",-1),jse=["value"],Sse={class:"grid grid-cols-3 gap-4"},Cse=b.createElementVNode("h2",null,"Variables Editor",-1),$se={ref:"variablesViewer"},Ose=b.createElementVNode("h2",null,"Skill Checks",-1),Ese={class:"table-auto"},Tse=b.createElementVNode("thead",null,[b.createElementVNode("tr",null,[b.createElementVNode("th",null,"Skill Check"),b.createElementVNode("th",null,"Happened"),b.createElementVNode("th",null,"Succeeded")])],-1),Ase=b.createElementVNode("h2",null,"App State editor (entire app and engine",-1),Mse=b.createElementVNode("h3",{style:{color:"pink"}}," Use for debugging, editing some of those things can cause issues ",-1),Pse={ref:"stateViewer"};function Nse(t,e,n,r,i,o){const a=b.resolveComponent("modal");return b.openBlock(),b.createElementBlock("div",cse,[b.createElementVNode("button",{onClick:e[0]||(e[0]=(...s)=>t.open&&t.open(...s)),class:"button debug-button"},"Debug Menu"),!t.playing&&t.flowState==="menu"?(b.openBlock(),b.createElementBlock("div",fse,dse)):b.createCommentVNode("",!0),t.jumping?(b.openBlock(),b.createBlock(a,{key:1,onClose:t.finishJumping,containerCssClass:"jump-menu-container"},{header:b.withCtx(()=>[hse]),body:b.withCtx(()=>[b.withDirectives(b.createElementVNode("input",{type:"text",class:"label-input input",ref:"search","onUpdate:modelValue":e[1]||(e[1]=s=>t.searchString=s),onInput:e[2]||(e[2]=(...s)=>t.onSearchInput&&t.onSearchInput(...s))},null,544),[[b.vModelText,t.searchString]]),t.matches.length>0?(b.openBlock(),b.createElementBlock("div",pse,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.matches,(s,u)=>(b.openBlock(),b.createElementBlock("div",{class:"search-result",style:b.normalizeStyle(t.getMatchResultStyle(u)),key:u},b.toDisplayString(s),5))),128))])):(b.openBlock(),b.createElementBlock("div",mse,vse))]),_:1},8,["onClose"])):b.createCommentVNode("",!0),t.errors.length>0?(b.openBlock(),b.createBlock(a,{key:2,onClose:t.closeErrors,containerCssClass:"debug-menu-container"},{header:b.withCtx(()=>[gse]),body:b.withCtx(()=>[yse,b.createElementVNode("ul",null,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.errors,(s,u)=>(b.openBlock(),b.createElementBlock("li",{key:u,class:b.normalizeClass(["error-message list-disc",s.type==="error"?"error":"warning"]),innerHTML:s.text},null,10,bse))),128))])]),_:1},8,["onClose"])):b.createCommentVNode("",!0),t.showDebug?(b.openBlock(),b.createBlock(a,{key:3,onClose:t.close,containerCssClass:"debug-menu-container"},{header:b.withCtx(()=>[kse]),body:b.withCtx(()=>[b.createElementVNode("div",wse,[_se,b.createElementVNode("select",{class:"select",name:"label-selector",onChange:e[3]||(e[3]=s=>t.labelSelected(s))},[xse,(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.labels,s=>(b.openBlock(),b.createElementBlock("option",{class:"option",value:s,key:s},b.toDisplayString(s),9,jse))),128))],32),b.createElementVNode("div",Sse,[b.createElementVNode("button",{onClick:e[4]||(e[4]=(...s)=>t.wordCount&&t.wordCount(...s)),class:"button"},"Word Count"),b.createElementVNode("button",{onClick:e[5]||(e[5]=(...s)=>t.save&&t.save(...s)),class:"button"},"Save Game")]),b.createElementVNode("h3",null,"Play time: "+b.toDisplayString(t.getPlayTimeString()),1),Cse,b.createElementVNode("div",$se,null,512),Ose,b.createElementVNode("table",Ese,[Tse,b.createElementVNode("tbody",null,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.skillChecks,(s,u)=>(b.openBlock(),b.createElementBlock("tr",{key:u},[b.createElementVNode("td",null,b.toDisplayString(u),1),b.createElementVNode("td",null,b.toDisplayString(s.happened?"\u2705":"\u274C"),1),b.createElementVNode("td",null,b.toDisplayString(s.happened?s.succeeded?"\u2705":"\u274C":"NA"),1)]))),128))])]),Ase,Mse,b.createElementVNode("div",Pse,null,512)])]),_:1},8,["onClose"])):b.createCommentVNode("",!0)])}const Ise=Hi(lse,[["render",Nse]]),Lse=b.defineComponent({computed:{...Za(oo,["notifications"])}}),rpe="",Dse=["innerHTML"];function Rse(t,e,n,r,i,o){return b.openBlock(),b.createBlock(b.TransitionGroup,{name:"notification",tag:"div",class:"notifications-holder"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.notifications,(a,s)=>(b.openBlock(),b.createElementBlock("div",{class:"notification",key:s},[b.createElementVNode("h3",{innerHTML:a.text},null,8,Dse)]))),128))]),_:1})}const Bse=Hi(Lse,[["render",Rse]]);function rR(t,e=50,n={}){var c,d;let r;const i=(c=n.isImmediate)!=null?c:!1,o=(d=n.callback)!=null?d:!1,a=n.maxWait;let s=Date.now(),u=[];function l(){if(a!==void 0){const h=Date.now()-s;if(h+e>=a)return a-h}return e}const f=function(...h){const p=this;return new Promise((m,g)=>{const v=function(){if(r=void 0,s=Date.now(),!i){const w=t.apply(p,h);o&&o(w),u.forEach(({resolve:_})=>_(w)),u=[]}},y=i&&r===void 0;r!==void 0&&clearTimeout(r);const k=l();if(r=setTimeout(v,k),y){const w=t.apply(p,h);return o&&o(w),m(w)}u.push({resolve:m,reject:g})})};return f.cancel=function(h){r!==void 0&&clearTimeout(r),u.forEach(({reject:p})=>p(h)),u=[]},f}const zse={class:"save-slot flex flex-row"},Fse={class:"used-save-slot flex flex-row justify-between items-center grow"},Vse={class:"flex flex-col save-slot-number-container"},qse={class:"save-slot-number"},Hse={class:"flex flex-col justify-center save-info"},Use={key:1,class:"save-name"},Wse={class:"flex flex-col"},Kse={key:0},Jse={key:1},Gse={key:2},Qse={class:"flex flex-row"},Yse=["onClick"],Mk=b.defineComponent({__name:"save-slot-ui",props:{saveSlot:{type:Object,required:!0},id:{type:String,required:!0},actions:{type:Array,required:!0}},emits:["choice"],setup(t,{emit:e}){var d,h;const n=t,r=b.ref((h=(d=n.saveSlot.saveData)==null?void 0:d.metadata.name)!=null?h:"Empty Save"),i=b.computed(()=>n.saveSlot.saveData!==null),o=b.computed(()=>n.saveSlot.saveData),a=b.computed(()=>gt().saves.mode),s=b.computed(()=>{const p=n.saveSlot.saveData;if(p&&p.screen.layers[0]){const m=zm().screens[p.screen.layers[0]];if(m)return{backgroundImage:`url(${td(m.background)})`}}return!1});function u(p){e("choice",p)}function l(p){return o.value?Ym(o.value.main.playTime/1e3):"00:00:00"}function f(){o.value&&iee(n.saveSlot.id,r.value)}function c(){const p=gt().saves.slots;let m="";const g=n.saveSlot.slotNumber;return g===0&&gt().saves.mode==="manual"?"AUTO":(p>=10&&g<10&&(m+="0"),p>=100&&g<100&&(m+="0"),m+g)}return(p,m)=>(b.openBlock(),b.createElementBlock("div",zse,[b.createElementVNode("div",Fse,[b.createElementVNode("div",Vse,[b.createElementVNode("h1",qse,b.toDisplayString(c()),1)]),b.unref(s)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"save-slot-screenshot",style:b.normalizeStyle(b.unref(s))},null,4)):b.createCommentVNode("",!0),b.createElementVNode("div",Hse,[b.unref(i)?b.withDirectives((b.openBlock(),b.createElementBlock("input",{key:0,type:"text",class:"save-name","onUpdate:modelValue":m[0]||(m[0]=g=>r.value=g),onInput:f},null,544)),[[b.vModelText,r.value]]):(b.openBlock(),b.createElementBlock("h3",Use,b.toDisplayString(r.value),1)),b.createElementVNode("div",Wse,[b.unref(o)?(b.openBlock(),b.createElementBlock("p",Kse,b.toDisplayString(new Date(b.unref(o).metadata.saveDate).toLocaleString()),1)):b.createCommentVNode("",!0),b.unref(o)?(b.openBlock(),b.createElementBlock("p",Jse,"Play time: "+b.toDisplayString(l(t.saveSlot)),1)):b.createCommentVNode("",!0),b.unref(a)==="game-slots"?(b.openBlock(),b.createElementBlock("p",Gse,b.toDisplayString(t.saveSlot.slotType==="auto"?"Auto Save":"Manual Save"),1)):b.createCommentVNode("",!0)])]),b.createElementVNode("div",Qse,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.actions,(g,v)=>(b.openBlock(),b.createElementBlock("button",{class:"button",onClick:()=>u(v),key:v},[b.createElementVNode("h3",null,b.toDisplayString(g),1)],8,Yse))),128))])])]))}}),ipe="",Xse=b.createElementVNode("h3",{class:"title"},"Confirmation",-1),Zse={class:"flex justify-center"},Hm=b.defineComponent({__name:"yes-no",props:{prompt:{type:String,required:!0},onConfirm:{type:Function,required:!1},onRefuse:{type:Function,required:!1}},emits:["choice"],setup(t,{emit:e}){const n=t;function r(i){i===!0&&n.onConfirm?n.onConfirm():i===!1&&n.onRefuse&&n.onRefuse(),e("choice",i)}return(i,o)=>(b.openBlock(),b.createBlock(Ws,{onClose:o[2]||(o[2]=()=>r(!1)),containerCssClass:"yes-no-modal"},{header:b.withCtx(()=>[Xse]),body:b.withCtx(()=>[b.createElementVNode("h3",null,b.toDisplayString(t.prompt),1),b.createElementVNode("div",Zse,[b.createElementVNode("button",{class:"button",onClick:o[0]||(o[0]=()=>r(!0))},"Yes"),b.createElementVNode("button",{class:"button",onClick:o[1]||(o[1]=()=>r(!1))},"No")])]),_:1}))}}),ope="",eue={class:"title"},tue={key:0},nue={class:"saves-section"},rue=b.createElementVNode("h3",{class:"saves-section-title"},"Auto save",-1),iue={class:"saves-section"},oue=b.createElementVNode("h3",{class:"saves-section-title"},"Manual Saves",-1),aue={key:1,class:"saves-section"},sue=b.createElementVNode("h3",{class:"saves-section-title"},"Save Slots",-1),uue={class:"saves-container flex flex-col"},iR=b.defineComponent({__name:"save-slots",props:{mode:{type:String,required:!0}},emits:["chosen","close"],setup(t,{emit:e}){const n=t,r=b.reactive([]),i=b.computed(()=>r.slice(0,1)),o=b.computed(()=>r.slice(1)),a=b.reactive(n.mode==="load"?["Load","Delete"]:["Choose"]),s=b.computed(()=>gt().saves.mode),u=b.reactive({prompt:"Are you sure you want to delete this save file?",saveToDelete:null,onConfirm:()=>{d(u.saveToDelete),u.saveToDelete=null},onRefuse:()=>{u.saveToDelete=null}}),l=b.reactive({prompt:"Are you sure you want to overwrite this save file?",saveToOverwrite:null,onConfirm:()=>{f(l.saveToOverwrite),l.saveToOverwrite=null},onRefuse:()=>{l.saveToOverwrite=null}});b.onMounted(()=>{const v=Z8().slots;console.log(v),v.forEach((y,k)=>{r[k]=y})});function f(g){e("chosen",{slotId:g})}function c(g){const v=m(g);if(v){if(gt().saves.mode==="manual"&&v.slotType==="auto"){Gt().alert("Sorry","Can't delete the auto save slot!");return}u.saveToDelete=g}}function d(g){ree(g);const v=r.find(y=>y.id===g);v&&(v.saveData=null)}function h(){e("close")}function p(g,v){const y=a[v];y==="Load"?f(g):y==="Delete"?c(g):y==="Choose"&&(l.saveToOverwrite=g)}function m(g){return r.find(v=>v.id===g)}return(g,v)=>(b.openBlock(),b.createBlock(Ws,{onClose:h,containerCssClass:"save-modal",cantClose:!1},{header:b.withCtx(()=>[b.createElementVNode("h3",eue,b.toDisplayString(t.mode==="load"?"Choose a save to load":"Pick a slot to save the game"),1)]),body:b.withCtx(()=>[b.unref(s)==="manual"?(b.openBlock(),b.createElementBlock("div",tue,[b.createElementVNode("div",nue,[rue,b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})]),b.createElementVNode("div",iue,[oue,b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(o),y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})])])):(b.openBlock(),b.createElementBlock("div",aue,[sue,b.createElementVNode("div",uue,[b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(r,y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})])])),u.saveToDelete?(b.openBlock(),b.createBlock(Hm,{key:2,prompt:u.prompt,onRefuse:u.onRefuse,onConfirm:u.onConfirm},null,8,["prompt","onRefuse","onConfirm"])):b.createCommentVNode("",!0),l.saveToOverwrite?(b.openBlock(),b.createBlock(Hm,{key:3,prompt:l.prompt,onRefuse:l.onRefuse,onConfirm:l.onConfirm},null,8,["prompt","onRefuse","onConfirm"])):b.createCommentVNode("",!0)]),_:1}))}}),ape="";class oR extends Eb{setup(e=!1){const r=e?"keydown":"keyup",i=rR(o=>{$o.emit("debouncedKeydown",o)},10,{isImmediate:!0,maxWait:10});window.addEventListener("keydown",o=>{$o.emit("keydown",o)}),window.addEventListener(r,o=>{i(o)})}}const $o=new oR,aR=Jr("startMenu",{state:()=>({buttons:[]}),actions:{addButtonsFromPlugins(){Fn.plugins.forEach(e=>{e.startMenuButtons&&e.startMenuButtons.forEach(n=>{const r=window.narrat.app;n.popupComponent&&r.component(n.popupComponent.name,n.popupComponent.component),this.buttons.push(n)})})}}}),lue={id:"game-menu"},cue={id:"game-header",class:"flex flex-col justify-between items-center"},fue={id:"game-title-container"},due={id:"game-title-text"},hue={class:"flex flex-col start-menu-buttons-container"},pue=["onClick"],mue={class:"title"},vue=b.defineComponent({__name:"StartMenu",setup(t){const e=b.ref(!1),n=b.ref(!1),r=b.ref(null),i=b.ref(null),o=b.ref(!1),a=b.ref(!1),s=b.ref(null),u=aR(),l=b.ref(!1),f=b.computed(()=>u.buttons);async function c(){e.value&&gt().saves.mode==="manual"?a.value=!0:d()}async function d(){const _=Gt();if(i.value===null)if(gt().saves.mode==="manual"){const S=ub();if(!S){Kt("No autosave found");return}i.value=S.id}else{const S=tee();if(!S){Kt("No free slot found");return}i.value=S}a.value=!1,await _.startGame(i.value)}function h(_){_.action&&_.action(),_.popupComponent&&(l.value=_)}function p(){l.value=!1}function m(){a.value=!1}async function g(){if(!i.value)return;const _=Pf(i.value);if(!_){Kt("No save file found");return}Gt().loadGame(_,i.value)}function v(){typeof r.value=="string"&&(i.value=r.value,g())}function y(){o.value=!0}function k({slotId:_}){const S=Pf(_);S&&S.saveData?(i.value=_,g()):c()}b.onMounted(()=>{const _=gt();_.audio.options.defaultMusic&&Gr().playChannel("music",_.audio.options.defaultMusic,0);const S=Z8();S.slots.some(C=>C.saveData)&&(e.value=!0),(gt().saves.mode==="manual"||S.slots.some(C=>!C.saveData))&&(n.value=!0),S.lastSaveSlot&&Pf(S.lastSaveSlot)&&(r.value=S.lastSaveSlot),s.value=$o.on("debouncedKeydown",C=>{C.key===" "&&d(),C.key==="c"&&v()})}),b.onUnmounted(()=>{s.value&&$o.off("debouncedKeydown",s.value)});const w=b.computed(()=>gt().gameTitle);return(_,S)=>(b.openBlock(),b.createElementBlock("div",lue,[o.value?(b.openBlock(),b.createBlock(iR,{key:0,mode:"load",onChosen:k,onClose:S[0]||(S[0]=C=>o.value=!1)})):b.createCommentVNode("",!0),a.value?(b.openBlock(),b.createBlock(Hm,{key:1,prompt:"This will override your previous autosave, are you sure?",onConfirm:d,onRefuse:m})):b.createCommentVNode("",!0),b.createElementVNode("div",cue,[b.createElementVNode("div",fue,[b.createElementVNode("h1",due,b.toDisplayString(b.unref(w)),1)]),b.createElementVNode("div",hue,[r.value?(b.openBlock(),b.createElementBlock("button",{key:0,class:"button menu-button main-menu-button large continue-button override",onClick:v}," Continue ")):b.createCommentVNode("",!0),n.value?(b.openBlock(),b.createElementBlock("button",{key:1,class:"button menu-button main-menu-button large start-button override",onClick:c}," New Game ")):b.createCommentVNode("",!0),e.value?(b.openBlock(),b.createElementBlock("button",{key:2,class:"button menu-button main-menu-button large continue-button override",onClick:y}," Load Game ")):b.createCommentVNode("",!0),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(f),C=>(b.openBlock(),b.createElementBlock("button",{key:C.id,class:b.normalizeClass(["button menu-button main-menu-button large override",`${C.id}-start-menu-button`]),onClick:A=>h(C)},b.toDisplayString(C.text),11,pue))),128))])]),l.value?(b.openBlock(),b.createBlock(b.Teleport,{key:2,to:"#app-container"},[b.createVNode(Ws,{onClose:p,class:b.normalizeClass(`start-menu-popup-${l.value.id}`)},{header:b.withCtx(()=>[b.createElementVNode("h3",mue,b.toDisplayString(l.value.text),1)]),body:b.withCtx(()=>[l.value.popupComponent?(b.openBlock(),b.createBlock(b.resolveDynamicComponent(l.value.popupComponent.component),{key:0,onClose:p},null,32)):b.createCommentVNode("",!0)]),_:1},8,["class"])])):b.createCommentVNode("",!0)]))}}),spe="",gue={class:"title"},yue=b.defineComponent({__name:"alert-modal",props:{title:{type:String,required:!1},text:{type:String,required:!1}},setup(t){return(e,n)=>(b.openBlock(),b.createBlock(Ws,{onClose:n[0]||(n[0]=r=>e.$emit("close")),containerCssClass:"yes-no-modal"},{header:b.withCtx(()=>{var r;return[b.createElementVNode("h3",gue,b.toDisplayString((r=t.title)!=null?r:"Alert"),1)]}),body:b.withCtx(()=>[b.createElementVNode("h3",null,b.toDisplayString(t.text),1)]),_:1}))}}),upe="";function Pk(t){const e=Ok().characters[t];return e||Kt(`Character ${t} not found`),e}function bue(t,e){const n=Pk(t);if(!!n&&(e||(e="default"),n.sprites)){const r=`${Ok().config.imagesPath}${n.sprites[e]}`;return r||Kt(`Character ${t} pose ${e} not found`),r}}function Um(t){var e;return t?((e=Pk(t))==null?void 0:e.style)||{}:{}}const kue=b.defineComponent({props:{pictureUrl:String},methods:{getAssetUrl(t){return Ma(t)}},computed:{...Za(ao,["layoutMode"]),boxStyle(){var o,a,s,u,l;const t=ao(),e=gt().layout;let n=0,r=0;const i=e.portraits;if(this.layoutMode==="vertical"){const f=(a=(o=i.offset)==null?void 0:o.portrait)!=null?a:{right:0,bottom:0};n=20+f.right,r=t.dialogHeight+f.bottom}else{const f=(u=(s=i.offset)==null?void 0:s.landscape)!=null?u:{right:0,bottom:0},c=(l=gt().dialogPanel.rightOffset)!=null?l:Mu.dialogPanel.rightOffset;n=Vm()-10+f.right+c,r=200+f.bottom}return{right:`${n}px`,bottom:`${r}px`,width:`${e.portraits.width}px`,height:`${e.portraits.height}px`}}}}),lpe="",wue=["src"];function _ue(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",{class:"dialog-picture override",style:b.normalizeStyle(t.boxStyle)},[b.createElementVNode("img",{src:t.getAssetUrl(t.pictureUrl),class:"picture override"},null,8,wue)],4)}const xue=Hi(kue,[["render",_ue]]),jue=b.defineComponent({data(){return{playerText:"",passed:!1,timeout:null,textAnimation:null,mounted:!1,autoTimer:null,skipTimer:null,nextLineTimer:null}},props:{options:{type:Object,required:!0},active:Boolean},mounted(){this.startTextAnimation(),this.registerKeyboardShortcuts(),this.mounted=!0},unmounted(){this.clearListeners(),this.endTextAnimation({unmounted:!0})},computed:{...Za(Gt,["paused"]),preText(){return this.options.title?" &nbsp;\u2013&nbsp; ":""},style(){return Um(this.options.styleId)},dialogBoxStyle(){const t=Um(this.options.styleId),e={opacity:this.options.old?"0.7":"1"};return{...t.boxCss,...e}},isBasicChoice(){return!this.choices&&!this.options.textField},dialogBoxClass(){return this.options.title?!1:"dialog-box-followup"},titleStyle(){const t=Um(this.options.styleId);return{color:t.color,...t.nameCss}},textStyle(){return Um(this.options.styleId).textCss},text(){return this.textAnimation?this.textAnimation.text:this.options.text},choices(){if(this.options.choices)return this.options.choices},skipping(){return zn().playMode==="skip"},canInteract(){return this.active&&this.mounted&&!this.passed&&!this.nextLineTimer&&!this.textAnimation&&this.options.interactive&&!this.paused}},watch:{options(t,e){!e.old&&t.old&&this.textAnimation&&this.endTextAnimation({unmounted:!0})},skipping(t,e){t&&!e&&this.startSkip()}},methods:{clearListeners(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},keyboardEvent(t){if(!this.canInteract){this.mounted&&this.textAnimation&&t.key===" "&&this.endTextAnimation({pressedSpace:!0});return}if(this.canInteract&&this.options.textField&&t.key==="Enter"&&this.submitText(),this.canInteract&&!this.options.textField){let e=-1;switch(t.key){case" ":e=0;break;case"1":e=0;break;case"2":e=1;break;case"3":e=2;break;case"4":e=3;break;case"5":e=4;break;case"6":e=5;break;case"7":e=6;break;case"8":e=7;break}e!==-1&&(this.choices&&e<this.choices.length?this.chooseOption(this.choices[e]):this.chooseOption(e))}},next(){this.passed||this.chooseOption(0)},chooseOption(t){this.finishLine();let e;typeof t=="object"?e=t.originalIndex:e=t,Gt().playerAnswered(e)},finishLine(){this.clearListeners(),this.endTextAnimation({unmounted:!0}),this.passed=!0},dialogStyle(t){const e={};return t.allowed||(e.pointerEvents="none",e.textDecoration="line-through"),e},dialogClass(t){if(!t.allowed)return"strike-anim"},submitText(){const t=this.playerText;Gt().playerAnswered(t)},addTextSection(t,e){const n=this.options.text.substring(t,e);return this.textAnimation.text+=n,e},addHtmlTag(t){const e=t[0];return this.textAnimation.text+=e,this.textAnimation.skippedChars+=e.length,e.length},startTextAnimation(){var t;if(!this.options.old)if(zn().playMode==="skip")this.startSkip();else if(gt().dialogPanel.animateText){this.textAnimation={text:"",index:0,startTime:Date.now(),timer:null,skippedChars:0,tags:lee(this.options.text),finished:!1};const e=this.textAnimation;e.timer=setInterval(()=>{this.updateTextAnimation()},30)}else zn().playMode!=="auto"&&this.isBasicChoice&&(this.autoTimer=setTimeout(()=>{this.endTextAnimation()},((t=gt().dialogPanel.textSpeed)!=null?t:sb)*this.options.text.length))},startSkip(){zn().playMode==="skip"&&!this.options.old&&(this.isBasicChoice?this.skipTimer=setTimeout(()=>{this.endTextAnimation()},100):(zn().toggleSkip(),this.endTextAnimation({unmounted:!0})))},updateTextAnimation(){var o;const t=this.textAnimation;if(!t)return;const e=t.index,n=Date.now()-t.startTime;let r=!1,i=Math.round(n/((o=gt().dialogPanel.textSpeed)!=null?o:sb))+t.skippedChars;if(i>this.options.text.length&&(r=!0,t.finished=!0,i=this.options.text.length),i!==t.index){let a=e;for(;t.tags.length>0&&i>=t.tags[0].index;){a=this.addTextSection(a,t.tags[0].index);const s=this.addHtmlTag(t.tags.shift());a+=s,i+=s}a=this.addTextSection(a,i),t.index=a}r&&this.endTextAnimation()},endTextAnimation({unmounted:t,pressedSpace:e}={}){var n;this.textAnimation&&(this.textAnimation.timer&&clearInterval(this.textAnimation.timer),this.textAnimation=null),this.autoTimer&&!e&&clearTimeout(this.autoTimer),this.skipTimer&&clearTimeout(this.skipTimer),this.nextLineTimer&&clearTimeout(this.nextLineTimer),!t&&!e&&zn().playMode!=="normal"&&this.isBasicChoice&&(this.nextLineTimer=setTimeout(()=>{this.next()},zn().playMode==="auto"?(n=gt().dialogPanel.timeBetweenLines)!=null?n:Mu.dialogPanel.timeBetweenLines:0))},registerKeyboardShortcuts(){this.timeout=setTimeout(()=>{this.options.textField&&this.canInteract&&this.$refs.playerInput.focus()},10)}}}),cpe="",Sue={class:"dialog-content"},Cue=["innerHTML"],$ue=["innerHTML"],Oue=["innerHTML"],Eue={key:1},Tue={key:0,class:"dialog-choices"},Aue=["onClick","innerHTML"],Mue={key:1},Pue={key:2,class:"buttons-container"};function Nue(t,e,n,r,i,o){const a=b.resolveDirective("visible");return b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["dialog-box w-full override",t.dialogBoxClass]),style:b.normalizeStyle(t.dialogBoxStyle)},[b.createElementVNode("div",Sue,[t.options.title?(b.openBlock(),b.createElementBlock("span",{key:0,class:"dialog-title override",style:b.normalizeStyle(t.titleStyle),innerHTML:t.options.title},null,12,Cue)):b.createCommentVNode("",!0),b.createElementVNode("span",{class:"dialog-text dialog-separator override",style:b.normalizeStyle(t.textStyle),innerHTML:t.preText},null,12,$ue),b.createElementVNode("span",{class:b.normalizeClass(["dialog-text override",t.options.cssClass]),style:b.normalizeStyle(t.textStyle),innerHTML:t.text},null,14,Oue),t.options.old?b.createCommentVNode("",!0):b.withDirectives((b.openBlock(),b.createElementBlock("div",Eue,[t.choices?(b.openBlock(),b.createElementBlock("div",Tue,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.choices,(s,u)=>(b.openBlock(),b.createElementBlock("p",{key:u,style:b.normalizeStyle(t.dialogStyle(s)),class:b.normalizeClass([t.dialogClass(s),"dialog-choice override"]),onClick:l=>t.chooseOption(s),ref_for:!0,ref:"choices",innerHTML:`${u+1}. \u2013\xA0 ${s.choice}`},null,14,Aue))),128))])):t.options.textField?(b.openBlock(),b.createElementBlock("div",Mue,[b.withDirectives(b.createElementVNode("input",{type:"text",class:"label-input input",ref:"playerInput",id:"player-input-field","onUpdate:modelValue":e[0]||(e[0]=s=>t.playerText=s)},null,512),[[b.vModelText,t.playerText]]),b.createElementVNode("button",{onClick:e[1]||(e[1]=(...s)=>t.submitText&&t.submitText(...s)),class:"button",id:"player-input-submit"}," Submit ")])):(b.openBlock(),b.createElementBlock("div",Pue,[b.createElementVNode("div",{onClick:e[2]||(e[2]=s=>t.chooseOption(0)),ref:"continue",class:"interact-button button override"}," Continue ",512)]))])),[[a,t.canInteract]])])],6)}const Iue=Hi(jue,[["render",Nue]]),Lue=b.createElementVNode("div",{class:"anchor"},null,-1),Due=b.defineComponent({__name:"game-dialog",props:{layoutMode:String,inGame:Boolean},setup(t){const e=t,n=b.ref(Gt().inScript),r=b.ref(null),i=ao(),o=wn(),a=b.computed(()=>o.stack),s=zn(),u=b.computed(()=>s.dialog),l=b.ref(null),f=b.ref(null),c=b.ref(null),d=b.computed(()=>{let S="0px";const C=gt().layout.dialogBottomPadding;return typeof C=="number"?S=`${C}px`:typeof C=="string"&&(S=C),{paddingBottom:S}}),h=b.computed(()=>{if(u.value.length>0)return u.value[u.value.length-1]}),p=b.computed(()=>{if(h.value){const S=h.value.speaker;let C=h.value.pose;return S?(C||(C="idle"),bue(S,C)):void 0}}),m=b.computed(()=>i.dialogWidth),g=b.computed(()=>Gt().inScript);b.watch(g,S=>{S?n.value=!0:zn().playMode!=="normal"?(zn().playMode==="skip"&&(zn().playMode="normal"),r.value=setTimeout(()=>{n.value=!1},500)):n.value=!1}),b.onMounted(()=>{const S=C=>{f.value&&f.value.keyboardEvent&&f.value.keyboardEvent(C)};c.value=$o.on("debouncedKeydown",S)}),b.onUnmounted(()=>{c.value&&$o.off("debouncedKeydown",c.value),r.value&&clearTimeout(r.value)});const v=b.computed(()=>{var $,E;let S;const C=`${ao().dialogHeight}px`,A={};if(ao().overlayMode){A.position="absolute";const O=($=gt().dialogPanel.rightOffset)!=null?$:Mu.dialogPanel.rightOffset;A.right=`${O}px`;const z=(E=gt().dialogPanel.bottomOffset)!=null?E:Mu.dialogPanel.bottomOffset;A.bottom=`${z}px`}return{...A,width:e.layoutMode==="horizontal"?`${m.value}px`:"100%",height:C,transform:S,transformOrigin:"right"}});function y(){zn().toggleAutoPlay()}function k(){zn().toggleSkip()}function w(S,C){var E;const A=Pk(S.speaker);let $=(E=A==null?void 0:A.name)!=null?E:"Missing Character";return C>=1&&u.value[C-1].speaker===S.speaker&&($=void 0),S.choices&&S.choices.forEach(O=>{O.choice=es(O.choice)}),{title:$!=null?$:"",text:S.text,cssClass:S.cssClass,styleId:S.speaker,choices:S.choices,old:C<u.value.length-1,interactive:S.interactive,textField:S.textField}}function _(S){return S===s.dialog.length-1&&a.value.length>0}return b.watch(u.value,S=>{if(l.value){const C=l.value;C.scrollTop=C.scrollHeight+1e8}}),(S,C)=>(b.openBlock(),b.createElementBlock(b.Fragment,null,[b.createVNode(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.unref(p)&&b.unref(i).showDialog?(b.openBlock(),b.createBlock(xue,{key:0,pictureUrl:b.unref(p)},null,8,["pictureUrl"])):b.createCommentVNode("",!0)]),_:1}),b.createVNode(b.Transition,{name:"dialog-transition"},{default:b.withCtx(()=>[t.inGame&&b.unref(i).showDialog?(b.openBlock(),b.createElementBlock("div",{key:0,class:"dialog override",ref_key:"dialogRef",ref:l,style:b.normalizeStyle(b.unref(v))},[b.createVNode(b.TransitionGroup,{name:"list",tag:"div",class:"dialog-container w-full override",style:b.normalizeStyle(b.unref(d))},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(u),(A,$)=>(b.openBlock(),b.createBlock(Iue,{ref_for:!0,ref:E=>f.value=E,key:A.id,options:w(A,$),active:_($)},null,8,["options","active"]))),128))]),_:1},8,["style"]),(b.openBlock(),b.createBlock(b.Teleport,{to:"#app"},[b.createElementVNode("div",{class:"auto-skip-buttons flex"},[b.createElementVNode("div",{class:"button menu-toggle-button auto-button auto",onClick:y}," Auto "),b.createElementVNode("div",{class:"button menu-toggle-button auto-button skip",onClick:k}," Skip ")])])),Lue],4)):b.createCommentVNode("",!0)]),_:1})],64))}}),fpe="",Rue=["id"],Bue=["src"],zue={class:"tab-title"},Fue=b.defineComponent({__name:"tab-selector",props:{tab:null,active:{type:Boolean}},emits:["click"],setup(t,{emit:e}){const n=t,r=b.computed(()=>n.active?"tab-active":"tab-inactive");function i(){e("click")}return(o,a)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["tab",b.unref(r)]),id:`tab-${t.tab.id}`,onClick:i},[b.createElementVNode("div",{class:b.normalizeClass(["tab-title-container",t.active?"active":""])},[t.tab.icon?(b.openBlock(),b.createElementBlock("img",{key:0,src:t.tab.icon,alt:"tab icon",class:"tab-icon"},null,8,Bue)):b.createCommentVNode("",!0),b.createElementVNode("span",zue,b.toDisplayString(t.tab.label),1)],2)],10,Rue))}}),dpe="",Vue={class:"tabs-controller"},que={key:0,class:"tabs-controller__tabs"},Hue={key:1,class:"tab-content"},Uue={key:2},Wue=[b.createElementVNode("div",{class:"tab-content__empty"},[b.createElementVNode("p",null,"No tab selected")],-1)],Kue=b.defineComponent({__name:"TabsController",props:{tabs:null,defaultTab:null},emits:["tab-change","close"],setup(t,{emit:e}){var a,s;const n=t,r=b.ref((s=(a=n.tabs[n.defaultTab])==null?void 0:a.id)!=null?s:null);function i(u){r.value=n.tabs[u].id,e("tab-change",u)}const o=b.computed(()=>n.tabs.find(u=>u.id===r.value));return(u,l)=>(b.openBlock(),b.createElementBlock("div",Vue,[t.tabs.length>1?(b.openBlock(),b.createElementBlock("div",que,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.tabs,(f,c)=>(b.openBlock(),b.createBlock(Fue,{key:f.id,tab:f,active:f.id===r.value,onClick:()=>i(c)},null,8,["tab","active","onClick"]))),128))])):b.createCommentVNode("",!0),b.unref(o)?(b.openBlock(),b.createElementBlock("div",Hue,[b.unref(o)?(b.openBlock(),b.createBlock(b.resolveDynamicComponent(b.unref(o).component),{key:0,onClose:l[0]||(l[0]=f=>u.$emit("close"))},null,32)):b.createCommentVNode("",!0)])):(b.openBlock(),b.createElementBlock("div",Uue,Wue))]))}}),ppe="",Jue={class:"menu-container"},Gue=["onClick","id"],Que={class:"title"},Yue=b.defineComponent({__name:"menu-buttons",setup(t){const e=jo(),n=b.ref(null);b.onMounted(()=>{n.value=$o.on("keydown",f=>{f.key==="Escape"&&jo().toggleMenu()}),Fn.callHook("onGameMounted")}),b.onUnmounted(()=>{$o.off("keydown",n.value),Fn.callHook("onGameUnmounted")});function r(f){jo().activeMenu=f}const i=b.computed(()=>e.menus),o=b.computed(()=>e.menu),a=b.computed(()=>{var f,c;return((c=(f=o.value)==null?void 0:f.tabs)!=null?c:[]).filter(d=>d.condition?d.condition():!0).map(d=>({id:d.id,label:d.text,component:d.component}))});function s(){e.closeMenu()}function u(f){e.setActiveTab(f)}function l(){return s()}return(f,c)=>(b.openBlock(),b.createElementBlock("div",Jue,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),(d,h)=>{var p;return b.openBlock(),b.createElementBlock("button",{key:d.id,onClick:m=>r(d.id),id:(p=d.cssId)!=null?p:`${h}-menu-button`,class:"button menu-toggle-button"},b.toDisplayString(d.label),9,Gue)}),128)),b.unref(o)?(b.openBlock(),b.createBlock(b.Teleport,{key:0,to:"#app-container"},[b.createVNode(Ws,{containerCssClass:{[b.unref(o).cssClass]:!0,"menu-modal":!0},onClose:s},{header:b.withCtx(()=>{var d,h;return[b.createElementVNode("h3",Que,b.toDisplayString((h=(d=b.unref(e).tab)==null?void 0:d.text)!=null?h:b.unref(o).label),1)]}),body:b.withCtx(()=>[b.createVNode(Kue,{onTabChange:u,onClose:l,tabs:b.unref(a),defaultTab:b.unref(o).activeTab},null,8,["tabs","defaultTab"])]),_:1},8,["containerCssClass"])])):b.createCommentVNode("",!0)]))}}),mpe="",Xue=["id"],Zue=b.defineComponent({__name:"screen-object",props:{screenObject:null,transitioning:{type:Boolean}},setup(t){const e=t;function n(o){e.transitioning||e.screenObject.onClick&&io().clickObject(o)}const r=b.computed(()=>{const o={};return e.screenObject.onClick?o.interactable=!0:o.disabled=!0,e.screenObject.cssClass&&(o[e.screenObject.cssClass]=!0),o}),i=b.computed(()=>{const o={};e.screenObject.opacity!==1&&(o.opacity=e.screenObject.opacity);let a=e.screenObject.x,s=e.screenObject.y,u=e.screenObject.width,l=e.screenObject.height;if(e.screenObject.anchor){const c=e.screenObject.anchor;a=e.screenObject.x-u*c.x,s=e.screenObject.y-l*c.y,o.transformOrigin=`${c.x*100}% ${c.y*100}%`}e.screenObject.scale&&(u=u*e.screenObject.scale,l=l*e.screenObject.scale);const f={...o,left:`${a}px`,top:`${s}px`,width:`${u}px`,height:`${l}px`};return Gne(e.screenObject)&&(f.backgroundImage=`url(${td(e.screenObject.image)})`),f});return(o,a)=>{const s=b.resolveComponent("ScreenObject",!0);return b.openBlock(),b.createElementBlock("div",{tabindex:"-1",class:b.normalizeClass(["viewport-object",b.unref(r)]),id:`viewport-object-${e.screenObject.id}`,onClick:a[0]||(a[0]=u=>n(t.screenObject)),style:b.normalizeStyle(b.unref(i))},[b.createTextVNode(b.toDisplayString(e.screenObject.text?b.unref(es)(e.screenObject.text):void 0)+" ",1),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(e.screenObject.children,u=>(b.openBlock(),b.createBlock(s,{transitioning:t.transitioning,key:u.id,screenObject:u},null,8,["transitioning","screenObject"]))),128))],14,Xue)}}}),vpe="",ele=["id"],tle=["id","onClick","innerHTML"],Nk=b.defineComponent({__name:"screen-layer",props:{layer:String,transitioning:{type:Boolean,default:!1}},setup(t){const e=t,n=wn(),r=Gt(),i=Uo(),o=io(),a=b.computed(()=>gt().layout.backgrounds.width),s=b.computed(()=>gt().layout.backgrounds.height),u=b.computed(()=>e.layer),l=b.computed(()=>i.buttons),f=b.computed(()=>{const _=zm().screens[u.value];return _||(console.log(u),Kt(`Screen ${u.value} doesn't have a config`)),_}),c=b.computed(()=>r.isInGame),d=b.computed(()=>f.value.buttons||[]);function h(_){const C=Hs(_).background;if(!!C)return td(C)}function p(_){const S=Hs(_),C=l.value[_],A=S.tag||"default",$=C.state;return $===!0&&Nr().isInteractionTagBlocked(A)?"greyed":$}function m(_){const S=p(_);return S==="hidden"||S==="greyed"||S===!1}function g(_){const S=p(_),C={};S===!0?C.interactable=!0:(C.disabled=!0,S==="greyed"?C.greyed=!0:(S==="hidden"||S===!1)&&(C.hidden=!0));const A=Hs(_);return A.cssClass&&(C[A.cssClass]=!0),C}function v(_){const S=Hs(_),C={};p(_),S.position.width&&(C.width=`${S.position.width}px`),S.position.height&&(C.height=`${S.position.height}px`),S.background&&(C.backgroundImage=`url(${h(_)})`);let A=S.position.left,$=S.position.top;return S.anchor&&(A=S.position.left-S.position.width*S.anchor.x,$=S.position.top-S.position.height*S.anchor.y),{...C,left:`${A}px`,top:`${$}px`}}function y(_){if(m(_)||e.transitioning)return;const S=Hs(_);if(!yL(S))return!1;if(l.value[_].state===!0){Eu("onButtonClicked");const A=S.action;if(!A)return;S.actionType==="run"?n.runLabelFunction(A):n.jumpToLabel(A)}}function k(_){var A;const C=(A=Hs(_).text)!=null?A:"";return es(C)}const w=b.computed(()=>({backgroundImage:`url(${td(f.value.background)})`,width:`${a.value}px`,height:`${s.value}px`}));return(_,S)=>b.unref(c)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"viewport-layer",id:`viewport-layer-${b.unref(u)}`,style:b.normalizeStyle(b.unref(w))},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(d),(C,A)=>(b.openBlock(),b.createElementBlock("div",{key:A,tabindex:"-1",class:b.normalizeClass(["viewport-button",g(C)]),id:`viewport-button-${C}`,onClick:$=>y(C),style:b.normalizeStyle(v(C)),innerHTML:k(C)},null,14,tle))),128)),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(o).tree,C=>(b.openBlock(),b.createBlock(Zue,{key:C.id,screenObject:C,transitioning:t.transitioning},null,8,["screenObject","transitioning"]))),128))],12,ele)):b.createCommentVNode("",!0)}}),gpe="",nle=b.defineComponent({__name:"NarratTransition",props:{name:{type:String,required:!0},duration:{type:Number,required:!0},delay:Number},emits:["complete"],setup(t,{emit:e}){const n=t,r=b.useSlots(),i=b.ref("start"),o=b.reactive({oldSlotClasses:{},oldSlotStyle:{},newSlotClasses:{},newSlotStyle:{}});return b.computed(()=>r.oldElement&&r.oldElement.length>0),b.computed(()=>r.newElement&&r.newElement.length>0),b.onMounted(async()=>{var s;const a=`narrat-transition-${n.name}`;o.newSlotClasses={[`${a}-enter-from`]:!0,[`${a}-enter-active`]:!0},o.oldSlotStyle={transitionDuration:`${n.duration/1e3}s`},o.newSlotStyle={transitionDuration:`${n.duration/1e3}s`},o.oldSlotClasses={[`${a}-leave-active`]:!0},await _o(30),o.oldSlotClasses[`${a}-leave-to`]=!0,await _o((s=n.delay)!=null?s:0),delete o.newSlotClasses[`${a}-enter-from`],await _o(n.duration),delete o.newSlotClasses[`${a}-enter-active`],delete o.oldSlotClasses[`${a}-leave-active`],i.value="end",e("complete")}),(a,s)=>(b.openBlock(),b.createElementBlock(b.Fragment,null,[i.value!=="end"?(b.openBlock(),b.createElementBlock("div",{key:0,class:b.normalizeClass(["transition-holder",o.oldSlotClasses]),style:b.normalizeStyle(o.oldSlotStyle)},[b.renderSlot(a.$slots,"oldElement")],6)):b.createCommentVNode("",!0),b.createElementVNode("div",{class:b.normalizeClass(["transition-holder",o.newSlotClasses]),style:b.normalizeStyle(o.newSlotStyle)},[b.renderSlot(a.$slots,"newElement")],6)],64))}}),ype="",rle=b.defineComponent({__name:"screens",setup(t){const e=ao(),n=Gt(),r=Uo(),i=b.computed(()=>r.nonEmptyLayers),o=b.computed(()=>e.layoutMode),a=b.computed(()=>gt().layout.backgrounds.width),s=b.computed(()=>gt().layout.backgrounds.height),u=b.computed(()=>n.isInGame);function l(c){r.finishTransition(c)}const f=b.computed(()=>{const c=a.value,d=s.value;return o.value,{height:`${d}px`,width:`${c}px`}});return(c,d)=>b.unref(u)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"viewport",id:"narrat-viewport",style:b.normalizeStyle(b.unref(f))},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),(h,p)=>(b.openBlock(),b.createElementBlock("div",{key:p,class:"layer-container"},[h.transition?(b.openBlock(),b.createBlock(nle,{key:0,name:h.transition.transition,duration:h.transition.duration,delay:h.transition.delay,onComplete:()=>l(p)},{oldElement:b.withCtx(()=>[h.transition.oldScreen?(b.openBlock(),b.createBlock(Nk,{key:0,layer:h.transition.oldScreen,transitioning:!0},null,8,["layer"])):b.createCommentVNode("",!0)]),newElement:b.withCtx(()=>[h.screen?(b.openBlock(),b.createBlock(Nk,{key:0,layer:h.screen,transitioning:!0},null,8,["layer"])):b.createCommentVNode("",!0)]),_:2},1032,["name","duration","delay","onComplete"])):h.screen?(b.openBlock(),b.createBlock(Nk,{key:1,layer:h.screen},null,8,["layer"])):b.createCommentVNode("",!0)]))),128))],4)):b.createCommentVNode("",!0)}}),bpe="",ile=b.defineComponent({data(){return{}},methods:{getStatImage(t){return Ma(this.statsConfig[t].icon)}},computed:{...Za($a,["hudStats"]),...Za(ao,["layoutMode"]),statsConfig(){return gt().hudStats},stats(){return this.hudStats},hudStyle(){var e;let t="0";return this.layoutMode==="horizontal"&&(t=`${Vm()+((e=gt().dialogPanel.rightOffset)!=null?e:Mu.dialogPanel.rightOffset)}px`),{right:t}}}}),kpe="",ole=["src"],ale={class:"bold hud-text"},sle=b.createTextVNode(": ");function ule(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",{class:"hud",style:b.normalizeStyle(t.hudStyle)},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.stats,(a,s)=>(b.openBlock(),b.createElementBlock("div",{key:s,class:"hud-stat"},[b.createElementVNode("img",{class:"hud-icon",src:t.getStatImage(s)},null,8,ole),b.createElementVNode("span",ale,b.toDisplayString(t.statsConfig[s].name),1),sle,b.createElementVNode("span",null,b.toDisplayString(Math.floor(a.value*100)/100),1)]))),128))],4)}const lle=Hi(ile,[["render",ule]]),cle={key:0,class:"auto-play-feedback-container"},fle=b.defineComponent({__name:"AutoPlayFeedback",setup(t){const e=zn(),n=b.computed(()=>e.playMode==="auto"),r=b.computed(()=>e.playMode==="skip"),i=b.computed(()=>n.value?"auto-play-feedback-auto":r.value?"auto-play-feedback-skip":{}),o=b.computed(()=>n.value?"Auto Play":r.value?"Skip":"");return(a,s)=>b.unref(o)?(b.openBlock(),b.createElementBlock("div",cle,[b.createElementVNode("div",{class:b.normalizeClass(["auto-play-feedback",b.unref(i)])},b.toDisplayString(b.unref(o)),3)])):b.createCommentVNode("",!0)}}),wpe="",dle=b.defineComponent({__name:"in-game",setup(t){const e=Gt(),n=ao(),r=b.computed(()=>n.layoutMode),i=b.computed(()=>e.saving),o=b.ref(null),a=zn(),s=b.ref(null),u=b.computed(()=>i.value&&!i.value.withPrompt||i.value&&o.value),l=b.computed(()=>{let h="row";return r.value==="vertical"&&(h="column"),{flexDirection:h}});function f(h){if(o.value=null,h===null){Gt().finishManualSave(h,!1);return}Gt().finishManualSave(h,!0)}function c(){o.value=!0}function d(){o.value=!1,e.finishManualSave(null,!1),o.value=null}return b.onMounted(()=>{s.value=$o.on("debouncedKeydown",h=>{Gt().debugMode||((h.key==="a"||h.key==="A")&&a.toggleAutoPlay(),(h.key==="s"||h.key==="S")&&a.toggleSkip())})}),b.onUnmounted(()=>{s.value&&$o.off("debouncedKeydown",s.value)}),(h,p)=>(b.openBlock(),b.createElementBlock("div",{class:"game",style:b.normalizeStyle(b.unref(l))},[b.createVNode(lle),b.createVNode(Yue,{class:"menu-toggle"}),b.createVNode(rle),b.createVNode(Due,{inGame:!0,layoutMode:b.unref(r)},null,8,["layoutMode"]),b.unref(u)?(b.openBlock(),b.createBlock(iR,{key:0,mode:"pick",onChosen:f,onClose:p[0]||(p[0]=()=>f(null))})):b.createCommentVNode("",!0),b.createVNode(fle),b.unref(i)&&b.unref(i).withPrompt&&o.value===null?(b.openBlock(),b.createBlock(Hm,{key:1,prompt:"Would you like to save the game?",onConfirm:c,onRefuse:d})):b.createCommentVNode("",!0)],4))}}),_pe="",hle=b.defineComponent({props:{percentage:Number,step:String},methods:{loadingStyle(){return{width:`${this.percentage*60}vw`}}},computed:{}}),xpe="",ple={id:"loading-bar"},mle={id:"loading-text"};function vle(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",ple,[b.createElementVNode("div",{id:"inner-loading-bar",style:b.normalizeStyle(t.loadingStyle())},null,4),b.createElementVNode("div",mle,[b.createElementVNode("h3",null,"Loading "+b.toDisplayString(Math.floor(t.percentage*100))+"% - "+b.toDisplayString(t.step),1)])])}const gle=Hi(hle,[["render",vle]]),yle="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IlJhdCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDU5NS4zIDU5NS4zIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OTUuMyA1OTUuMzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNFMjNCMzM7fQo8L3N0eWxlPgo8cGF0aCBpZD0iUmF0X1NoYXBlIiBjbGFzcz0ic3QwIiBkPSJNNTU2LjksODIuNWMtMTAuOC0yNC4zLTQ3LTU3LjEtNzEuMy02NS42Yy0yNC4zLTguNC02NC4xLTAuMy04OC43LDIyLjMKCWMtMjAsMTguNC0yNiwyOC4yLTI5LjEsMzdjLTIuMSw1LjktNC44LDEzLjUtNiwyMC45djBjLTAuNSw0LjEtNC41LDctOC42LDYuMWMtMTAuNC0yLjMtMjkuNS02LTQ0LjQtNi4zCgljLTEzLjctMC4yLTMwLjEsMy4yLTQwLjQsNS43Yy00LjUsMS4xLTguOC0yLjItOC44LTYuOGMtMC4xLTUuMy0xLjEtMTIuMy00LjgtMTkuNmMtOC41LTE2LjktMTkuNi0zMi42LTU3LjgtNDcuNAoJYy0zMS45LTEyLjQtNzUuMS05LjctMTAwLjgsMS44Yy0yOC4xLDEyLjYtNDIuNCwzNy45LTU0LDYxLjhjLTE0LjQsMjkuOC0xNC45LDgzLjYtNi40LDEwNGMxMi44LDMwLjcsMzUuOCw0Ny4yLDUyLjYsNTMKCWMxMS4zLDMuOCwyOC4yLDMuNywzOC4yLDMuM2M0LjItMC4yLDcuNywzLjMsNy41LDcuNWMtMC43LDEzLjYtMC45LDQxLjUsNyw2MS40YzcuNywxOS40LDI5LjcsNjIuMyw1MC43LDEwMS4yCgljMCwwLjEtMTQuNiwyLjktMzEuNCw2LjhjLTIzLjksNS41LTUyLjYsMTIuNy01NC4zLDEzLjdjLTMuNSwyLjEtMywxMC0yLjcsMTJjMC41LDMuNCw1LjMsOC4xLDYuOSw4LjNjMy45LDAuMywzMS4zLTcuNiw1NS43LTE0LjYKCWMxOC41LTUuMywzNC45LTkuMywzNS41LTguMmM1LjEsOS4zLDEwLDE4LDE0LjQsMjUuOGM1LjIsOS4xLDEwLjcsMTYuNCwxNC4xLDIzLjZjMS4xLDIuMy0xNi42LDUuOC0zMi41LDE0LjcKCWMtMTYuNCw5LjEtMjkuNywyMS0zMi4zLDI0Yy0xLjgsMi4xLTMsNi0xLjIsMTAuN2MxLjEsMi45LDEwLDUuNywxMi40LDUuMWM2LjgtMS43LDE2LjUtMTIuNSwzMy4xLTIxLjEKCWMxNi4zLTguNSwzMi45LTE0LjksMzMuOC0xMy42YzkuNywxNC4zLDE2LjksMjEuNiwyMi42LDMxLjJjOS44LDE2LjUsMjcuMyw0NS45LDQ2LjYsMzkuNWM2LjQtMi4xLDMxLjEtMzMuNiw1My4zLTY4LjYKCWMxLjMtMi4xLDE2LjEsMTEuMywzMC40LDIzLjJjMTMuOCwxMS40LDIyLjcsMjAuNiwyNy4xLDIxLjRjNS40LDEsMTQuMi03LjcsMTQuMS0xNC43Yy0wLjEtMi43LTE0LjMtMTMuOC0yOS4xLTI2LjIKCWMtMTQuNS0xMi4xLTMwLjEtMjIuOC0yOS4yLTI0LjNjNy42LTEyLDE0LjUtMjMuNywyMC4xLTMzLjljNC4zLTcuOCw4LjktMTYsMTMtMjQuN2MwLjYtMS4yLDE1LjksMywzMS40LDcuMWMxNS4zLDQsMjYuNywxMCwzMSw4CgljNi45LTMsMTEuNi0xMy44LDkuNC0xOC4zYy0xLjEtMi4zLTE3LTcuMy0zMy4yLTEyYy0xNC4yLTQuMS0yOC02LjUtMjcuNy03LjNjMTUuNS0zNCwyOC44LTY0LjgsMjcuNi02OS42CgljLTEuNy03LjEsMi42LTExLjksNy0zNi41YzMuMi0xOC4xLDQuNy00MC45LDUuMi01MS43YzAuMi0zLjUsMi44LTYuMyw2LjMtNi43YzMuMS0wLjMsNi45LTAuOSwxMC41LTEuOWM3LjgtMiwxOC42LTcuOCwzNi40LTIwLjYKCWMxNy45LTEyLjgsMzguNy00OS42LDQ0LjQtNjcuOFM1NjcuNiwxMDYuOCw1NTYuOSw4Mi41eiBNMjY1LjEsMzM2LjJjLTguMSw0LTEzLDctMjYuNCw5LjZjLTYuOSwxLjQtMjkuNC0wLjItNDAuNy00LjYKCWMtMTAuNS00LjEtMTkuOS03LjYtMzAtMTUuNHMtMTUuNy0xMy4yLTE1LjctMTUuM2MwLTQuNCw2LTkuNCwxMS05LjRjNS4xLDAsMTQuNSw5LjIsMjkuNywxNi42YzE0LjMsNywxNy45LDYuMSwyNS40LDcuMwoJYzIuOSwwLjUsNy43LDAuNiwxMC43LDAuNGMxNC4xLTEuMywyMS40LTUuOSwyNS4zLTguOGM0LTMsMTMuNy0xMi45LDE3LjItMTIuNWM4LDEsMTguOSwzLjQsMTguOSw3LjEKCUMyOTAuNCwzMTksMjczLjIsMzMyLjEsMjY1LjEsMzM2LjJ6IE0zMjAuOSw1MjEuNGMtNC4zLDMuNy0xNy43LDEzLjUtMjMuMywxMy41Yy0yLjgsMC03LjQtOC4yLTExLjUtMTYuOAoJYy00LjEtOC41LTkuMS0yMS4xLTkuMS0zMS42YzAtNC42LDYtNy40LDEzLjQtOS4yYzcuMi0xLjcsMjcuMy0xLjgsMjkuOS0xLjFjNi44LDEuNywxMi45LDIuMiwxMi43LDYuNGMtMC40LDEyLjctNywxOC45LTguMywyNC4zCglDMzIzLjQsNTEyLjMsMzIzLjQsNTE5LjIsMzIwLjksNTIxLjR6IE00MzEuMSwzMjAuM2MtOS4yLDcuNC0xMC42LDguMS0yNC45LDEzLjdjLTExLjMsNC40LTI4LjYsNS44LTQxLjYsMy42CgljLTEyLjItMi4xLTIyLjMtNC42LTI5LjUtMTAuMWMtOS43LTcuMy0xNi40LTE1LjEtMTYuNC0xOS44YzAtMy43LDYuNC00LjMsMTQuNS00LjljMy41LTAuMyw5LjMsNS45LDEzLjIsOS4yCgljOC4xLDYuOCwxNC44LDgsMjguOCw5LjljMi45LDAuNCw3LjgsMC40LDEwLjcsMC4xYzcuNS0wLjksMTItMC40LDI1LjgtOC4yYzIwLTExLjIsMTcuOC0xNC40LDI1LjEtMTIuNmMyLjIsMC42LDUuOCwxLjIsNS42LDUuNgoJQzQ0Mi40LDMwOSw0NDAuNSwzMTIuNyw0MzEuMSwzMjAuM3oiLz4KPC9zdmc+Cg==",ble={id:"engine-splash-screen",class:"flex justify-center items-center"},kle={id:"engine-splash-title"},wle=["src"],_le=b.defineComponent({__name:"engine-splash",emits:["finished"],setup(t,{emit:e}){const n=b.ref("hidden"),r=b.computed(()=>({transitionDuration:`${l.value}s`})),i=b.computed(()=>({invisible:n.value!=="appear"})),o=Gt(),a=b.computed(()=>{var d,h;return(h=(d=gt().splashScreens)==null?void 0:d.engineSplashScreen)!=null?h:{}}),s=b.computed(()=>typeof a.value.overrideText=="string"?a.value.overrideText:"Made with narrat engine"),u=b.computed(()=>{var d;return(d=a.value.overrideLogo)!=null?d:yle}),l=b.computed(()=>typeof a.value.fadeDuration=="number"?a.value.fadeDuration:2),f=b.computed(()=>typeof a.value.timeBeforeFadeout=="number"?a.value.timeBeforeFadeout:3);b.onMounted(async()=>{if(await _o(10),n.value="appear",a.value.skip||o.options.debug){c();return}await _o(l.value*1e3),await _o(f.value*1e3),n.value="disappear",await _o(l.value*1e3),c()});function c(){o.loading.loaded?e("finished"):o.listener.once("gameLoaded",()=>{e("finished")})}return(d,h)=>(b.openBlock(),b.createElementBlock("div",ble,[b.createElementVNode("div",{id:"engine-splash-header",class:b.normalizeClass(["flex justify-center flex-col items-center",b.unref(i)]),style:b.normalizeStyle(b.unref(r))},[b.createElementVNode("h1",kle,b.toDisplayString(b.unref(s)),1),b.createElementVNode("img",{src:b.unref(u),alt:"Narrat Logo",id:"engine-splash-logo"},null,8,wle),b.createVNode(gle,{percentage:b.unref(o).loading.percentage,step:b.unref(o).loading.step},null,8,["percentage","step"])],6)]))}}),jpe="",xle={id:"game-splash-screen",style:{height:"100%",padding:"20px"},class:"flex justify-center items-center"},jle={id:"game-splash-screen-header flex justify-center flex-col items-center",class:"flex justify-center flex-col items-center"},Sle={class:"title",id:"game-splash-title"},Cle=b.defineComponent({__name:"game-splash",setup(t){const e=Gt(),n=b.computed(()=>{var s,u;return(u=(s=gt().splashScreens)==null?void 0:s.gameSplashScreen)!=null?u:{}}),r=b.computed(()=>typeof n.value.startButtonText=="string"?n.value.startButtonText:"Press to start"),i=b.computed(()=>e.loading.loaded),o=b.computed(()=>gt().gameTitle||"Narrat Game");function a(){e.flowState="menu"}return b.onMounted(()=>{e.options.debug&&a()}),(s,u)=>(b.openBlock(),b.createElementBlock("div",xle,[b.createElementVNode("div",jle,[b.createElementVNode("h1",Sle,b.toDisplayString(b.unref(o)),1),b.unref(i)?(b.openBlock(),b.createElementBlock("button",{key:0,class:"button menu-button main-menu-button large splash-start-button override",onClick:a},b.toDisplayString(b.unref(r)),1)):b.createCommentVNode("",!0)])]))}}),Spe="",$le={key:0,class:"floating-tooltip-title"},Ole=b.createElementVNode("hr",null,null,-1),Ele={class:"floating-tooltip-text"},Tle=b.defineComponent({__name:"floating-tooltip",props:{title:null,text:null,width:null,x:null,y:null},setup(t){const e=t,n=b.ref(150),r=b.ref(null),i=b.computed(()=>{const o={};let a=e.x-e.width/2;a=Math.min(a,window.innerWidth-e.width-5),a=Math.max(5,a),o.left=`${a}px`;let s=window.innerHeight-e.y;return s=Math.max(s,5),s=Math.min(s,window.innerHeight-n.value-5),o.bottom=`${s}px`,o.width=`${e.width}px`,o});return b.onMounted(()=>{r.value&&(n.value=r.value.clientHeight)}),(o,a)=>(b.openBlock(),b.createBlock(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.createElementVNode("div",{class:"floating-tooltip",style:b.normalizeStyle(b.unref(i)),ref_key:"element",ref:r},[t.title?(b.openBlock(),b.createElementBlock("div",$le,[b.createTextVNode(b.toDisplayString(e.title)+" ",1),Ole])):b.createCommentVNode("",!0),b.createElementVNode("div",Ele,b.toDisplayString(e.text),1)],4)]),_:1}))}}),Cpe="",Ale={class:"tooltips-ui"},Mle=b.defineComponent({__name:"tooltips-ui",setup(t){const e=b.computed(()=>lm().tooltip);return b.computed(()=>ed().options.width),(n,r)=>(b.openBlock(),b.createElementBlock("div",Ale,[b.unref(e)?(b.openBlock(),b.createBlock(Tle,b.normalizeProps(b.mergeProps({key:0},b.unref(e))),null,16)):b.createCommentVNode("",!0)]))}}),Ple=b.defineComponent({setup(){const t=zn(),e=wn(),n=Gt();return{dialog:b.computed(()=>t.dialog),stack:b.computed(()=>e.stack),flowState:b.computed(()=>n.flowState),alerts:b.computed(()=>n.alerts)}},$refs:{dialogContainer:HTMLInputElement},inject:["mq"],components:{DebugMenu:Ise,NotificationToast:Bse,StartMenu:vue,AlertModal:yue,InGame:dle,EngineSplash:_le,GameSplash:Cle,TooltipsUi:Mle},data(){return{lineTitle:"title",lineText:"hello"}},props:{options:Object},async mounted(){Fn.callHook("onAppMounted"),await Gt().engineLoading(),window.addEventListener("resize",rR(()=>{this.updateScreenSize()},100,{maxWait:200})),$o.setup(this.options.debug),setTimeout(()=>{this.updateScreenSize()},50)},computed:{...Za(ao,["screenWidth","screenHeight","layoutMode","gameWidth","gameHeight","gameScaleRatio","actualGameHeight"]),...Za(wn,["currentLine"]),appStyle(){return{transform:`scale(${this.gameScaleRatio}, ${this.gameScaleRatio})`,width:`${this.gameWidth}px`,height:`${this.actualGameHeight}px`}},appClass(){return jo().activeMenu?"app-blurred-by-modal":{}}},methods:{closeAlert(t){Gt().closeAlert(t)},engineSplashDone(){Gt().flowState="game-splash"},updateScreenSize(){ao().updateScreenSize(window.innerWidth,window.innerHeight)}}}),$pe="";function Nle(t,e,n,r,i,o){const a=b.resolveComponent("EngineSplash"),s=b.resolveComponent("GameSplash"),u=b.resolveComponent("StartMenu"),l=b.resolveComponent("InGame"),f=b.resolveComponent("DebugMenu"),c=b.resolveComponent("NotificationToast"),d=b.resolveComponent("AlertModal"),h=b.resolveComponent("TooltipsUi");return b.openBlock(),b.createElementBlock(b.Fragment,null,[b.createElementVNode("div",{id:"app-container",style:b.normalizeStyle(t.appStyle)},[b.createElementVNode("div",{id:"app",class:b.normalizeClass(t.appClass)},[t.flowState==="engine-splash"?(b.openBlock(),b.createBlock(a,{key:0,onFinished:t.engineSplashDone},null,8,["onFinished"])):(b.openBlock(),b.createBlock(b.Transition,{key:1,name:"screens-fade"},{default:b.withCtx(()=>[t.flowState==="game-splash"?(b.openBlock(),b.createBlock(s,{key:"1"})):t.flowState==="menu"?(b.openBlock(),b.createBlock(u,{key:"2"})):t.flowState==="playing"?(b.openBlock(),b.createBlock(l,{key:"3"})):b.createCommentVNode("",!0)]),_:1})),t.options.debug?(b.openBlock(),b.createBlock(f,{key:2})):b.createCommentVNode("",!0),b.createVNode(c),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.alerts,p=>(b.openBlock(),b.createBlock(d,{key:p.id,title:p.title,text:p.text,onClose:()=>t.closeAlert(p.id)},null,8,["title","text","onClose"]))),128))],2)],4),b.createVNode(h)],64)}const Ile=Hi(Ple,[["render",Nle]]);function qt(t,e){console.error("Runtime error ========================="),console.error(`Command: ${t.commandType}`),console.error("Args: ",t.args),console.error("Options: ",t.options),Kt(`Runtime error at ${t.fileName}:${t.line} (${t.commandType}) ${t.code}. -
223
+ deps: ${f}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[l,f]=o(u);a(u,l),s(u,f)}};function o({schema:u}){const l={},f={};for(const c in u){if(c==="__proto__")continue;const d=Array.isArray(u[c])?l:f;d[c]=u[c]}return[l,f]}function a(u,l=u.schema){const{gen:f,data:c,it:d}=u;if(Object.keys(l).length===0)return;const h=f.let("missing");for(const p in l){const m=l[p];if(m.length===0)continue;const g=(0,r.propertyInData)(f,c,p,d.opts.ownProperties);u.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?f.if(g,()=>{for(const v of m)(0,r.checkReportMissingProp)(u,v)}):(f.if((0,e._)`${g} && (${(0,r.checkMissingProp)(u,m,h)})`),(0,r.reportMissingProp)(u,h),f.else())}}t.validatePropertyDeps=a;function s(u,l=u.schema){const{gen:f,data:c,keyword:d,it:h}=u,p=f.name("valid");for(const m in l)(0,n.alwaysValidSchema)(h,l[m])||(f.if((0,r.propertyInData)(f,c,m,h.opts.ownProperties),()=>{const g=u.subschema({keyword:d,schemaProp:m},p);u.mergeValidEvaluated(g,p)},()=>f.var(p,!0)),u.ok(p))}t.validateSchemaDeps=s,t.default=i})(DD);var hk={};Object.defineProperty(hk,"__esModule",{value:!0});const RD=jn,dae=In,hae={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>(0,RD._)`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:n,data:r,it:i}=t;if((0,dae.alwaysValidSchema)(i,n))return;const o=e.name("valid");e.forIn("key",r,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),e.if((0,RD.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};hk.default=hae;var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0});const Nm=Sn,Go=jn,pae=Oa,Im=In,mae={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>(0,Go._)`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:n,parentSchema:r,data:i,errsCount:o,it:a}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Im.alwaysValidSchema)(a,n))return;const l=(0,Nm.allSchemaProperties)(r.properties),f=(0,Nm.allSchemaProperties)(r.patternProperties);c(),t.ok((0,Go._)`${o} === ${pae.default.errors}`);function c(){e.forIn("key",i,g=>{!l.length&&!f.length?p(g):e.if(d(g),()=>p(g))})}function d(g){let v;if(l.length>8){const y=(0,Im.schemaRefOrVal)(a,r.properties,"properties");v=(0,Nm.isOwnProperty)(e,y,g)}else l.length?v=(0,Go.or)(...l.map(y=>(0,Go._)`${g} === ${y}`)):v=Go.nil;return f.length&&(v=(0,Go.or)(v,...f.map(y=>(0,Go._)`${(0,Nm.usePattern)(t,y)}.test(${g})`))),(0,Go.not)(v)}function h(g){e.code((0,Go._)`delete ${i}[${g}]`)}function p(g){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){h(g);return}if(n===!1){t.setParams({additionalProperty:g}),t.error(),s||e.break();return}if(typeof n=="object"&&!(0,Im.alwaysValidSchema)(a,n)){const v=e.name("valid");u.removeAdditional==="failing"?(m(g,v,!1),e.if((0,Go.not)(v),()=>{t.reset(),h(g)})):(m(g,v),s||e.if((0,Go.not)(v),()=>e.break()))}}function m(g,v,y){const k={keyword:"additionalProperties",dataProp:g,dataPropType:Im.Type.Str};y===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,v)}}};Pm.default=mae;var pk={};Object.defineProperty(pk,"__esModule",{value:!0});const vae=Wo,BD=Sn,mk=In,zD=Pm,gae={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:n,parentSchema:r,data:i,it:o}=t;o.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&zD.default.code(new vae.KeywordCxt(o,zD.default,"additionalProperties"));const a=(0,BD.allSchemaProperties)(n);for(const c of a)o.definedProperties.add(c);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=mk.mergeEvaluated.props(e,(0,mk.toHash)(a),o.props));const s=a.filter(c=>!(0,mk.alwaysValidSchema)(o,n[c]));if(s.length===0)return;const u=e.name("valid");for(const c of s)l(c)?f(c):(e.if((0,BD.propertyInData)(e,i,c,o.opts.ownProperties)),f(c),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(c),t.ok(u);function l(c){return o.opts.useDefaults&&!o.compositeRule&&n[c].default!==void 0}function f(c){t.subschema({keyword:"properties",schemaProp:c,dataProp:c},u)}}};pk.default=gae;var vk={};Object.defineProperty(vk,"__esModule",{value:!0});const FD=Sn,Lm=jn,VD=In,qD=In,yae={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:n,data:r,parentSchema:i,it:o}=t,{opts:a}=o,s=(0,FD.allSchemaProperties)(n),u=s.filter(m=>(0,VD.alwaysValidSchema)(o,n[m]));if(s.length===0||u.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;const l=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=e.name("valid");o.props!==!0&&!(o.props instanceof Lm.Name)&&(o.props=(0,qD.evaluatedPropsToName)(e,o.props));const{props:c}=o;d();function d(){for(const m of s)l&&h(m),o.allErrors?p(m):(e.var(f,!0),p(m),e.if(f))}function h(m){for(const g in l)new RegExp(m).test(g)&&(0,VD.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){e.forIn("key",r,g=>{e.if((0,Lm._)`${(0,FD.usePattern)(t,m)}.test(${g})`,()=>{const v=u.includes(m);v||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:qD.Type.Str},f),o.opts.unevaluated&&c!==!0?e.assign((0,Lm._)`${c}[${g}]`,!0):!v&&!o.allErrors&&e.if((0,Lm.not)(f),()=>e.break())})})}}};vk.default=yae;var gk={};Object.defineProperty(gk,"__esModule",{value:!0});const bae=In,kae={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:n,it:r}=t;if((0,bae.alwaysValidSchema)(r,n)){t.fail();return}const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};gk.default=kae;var yk={};Object.defineProperty(yk,"__esModule",{value:!0});const wae={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Sn.validateUnion,error:{message:"must match a schema in anyOf"}};yk.default=wae;var bk={};Object.defineProperty(bk,"__esModule",{value:!0});const Dm=jn,_ae=In,xae={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Dm._)`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:n,parentSchema:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const o=n,a=e.let("valid",!1),s=e.let("passing",null),u=e.name("_valid");t.setParams({passing:s}),e.block(l),t.result(a,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((f,c)=>{let d;(0,_ae.alwaysValidSchema)(i,f)?e.var(u,!0):d=t.subschema({keyword:"oneOf",schemaProp:c,compositeRule:!0},u),c>0&&e.if((0,Dm._)`${u} && ${a}`).assign(a,!1).assign(s,(0,Dm._)`[${s}, ${c}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(s,c),d&&t.mergeEvaluated(d,Dm.Name)})})}}};bk.default=xae;var kk={};Object.defineProperty(kk,"__esModule",{value:!0});const jae=In,Sae={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=e.name("valid");n.forEach((o,a)=>{if((0,jae.alwaysValidSchema)(r,o))return;const s=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(s)})}};kk.default=Sae;var wk={};Object.defineProperty(wk,"__esModule",{value:!0});const Rm=jn,HD=In,Cae={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>(0,Rm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Rm._)`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,HD.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=UD(r,"then"),o=UD(r,"else");if(!i&&!o)return;const a=e.let("valid",!0),s=e.name("_valid");if(u(),t.reset(),i&&o){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(s,l("then",f),l("else",f))}else i?e.if(s,l("then")):e.if((0,Rm.not)(s),l("else"));t.pass(a,()=>t.error(!0));function u(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(f)}function l(f,c){return()=>{const d=t.subschema({keyword:f},s);e.assign(a,s),t.mergeValidEvaluated(d,a),c?e.assign(c,(0,Rm._)`${f}`):t.setParams({ifClause:f})}}}};function UD(t,e){const n=t.schema[e];return n!==void 0&&!(0,HD.alwaysValidSchema)(t,n)}wk.default=Cae;var _k={};Object.defineProperty(_k,"__esModule",{value:!0});const $ae=In,Oae={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,$ae.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};_k.default=Oae,Object.defineProperty(uk,"__esModule",{value:!0});const Eae=ec,Tae=ck,Aae=tc,Mae=fk,Pae=dk,Nae=DD,Iae=hk,Lae=Pm,Dae=pk,Rae=vk,Bae=gk,zae=yk,Fae=bk,Vae=kk,qae=wk,Hae=_k;function Uae(t=!1){const e=[Bae.default,zae.default,Fae.default,Vae.default,qae.default,Hae.default,Iae.default,Lae.default,Nae.default,Dae.default,Rae.default];return t?e.push(Tae.default,Mae.default):e.push(Eae.default,Aae.default),e.push(Pae.default),e}uk.default=Uae;var xk={},jk={};Object.defineProperty(jk,"__esModule",{value:!0});const jr=jn,Wae={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,jr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jr._)`{format: ${t}}`},code(t,e){const{gen:n,data:r,$data:i,schema:o,schemaCode:a,it:s}=t,{opts:u,errSchemaPath:l,schemaEnv:f,self:c}=s;if(!u.validateFormats)return;i?d():h();function d(){const p=n.scopeValue("formats",{ref:c.formats,code:u.code.formats}),m=n.const("fDef",(0,jr._)`${p}[${a}]`),g=n.let("fType"),v=n.let("format");n.if((0,jr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(g,(0,jr._)`${m}.type || "string"`).assign(v,(0,jr._)`${m}.validate`),()=>n.assign(g,(0,jr._)`"string"`).assign(v,m)),t.fail$data((0,jr.or)(y(),k()));function y(){return u.strictSchema===!1?jr.nil:(0,jr._)`${a} && !${v}`}function k(){const w=f.$async?(0,jr._)`(${m}.async ? await ${v}(${r}) : ${v}(${r}))`:(0,jr._)`${v}(${r})`,_=(0,jr._)`(typeof ${v} == "function" ? ${w} : ${v}.test(${r}))`;return(0,jr._)`${v} && ${v} !== true && ${g} === ${e} && !${_}`}}function h(){const p=c.formats[o];if(!p){y();return}if(p===!0)return;const[m,g,v]=k(p);m===e&&t.pass(w());function y(){if(u.strictSchema===!1){c.logger.warn(_());return}throw new Error(_());function _(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function k(_){const S=_ instanceof RegExp?(0,jr.regexpCode)(_):u.code.formats?(0,jr._)`${u.code.formats}${(0,jr.getProperty)(o)}`:void 0,C=n.scopeValue("formats",{key:o,ref:_,code:S});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,jr._)`${C}.validate`]:["string",_,C]}function w(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!f.$async)throw new Error("async format in sync schema");return(0,jr._)`await ${v}(${r})`}return typeof g=="function"?(0,jr._)`${v}(${r})`:(0,jr._)`${v}.test(${r})`}}}};jk.default=Wae,Object.defineProperty(xk,"__esModule",{value:!0});const Kae=[jk.default];xk.default=Kae;var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.contentVocabulary=nc.metadataVocabulary=void 0,nc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],nc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(Ub,"__esModule",{value:!0});const Jae=Wb,Gae=Jb,Qae=uk,Yae=xk,WD=nc,Xae=[Jae.default,Gae.default,(0,Qae.default)(),Yae.default,WD.metadataVocabulary,WD.contentVocabulary];Ub.default=Xae;var Sk={},KD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(KD),Object.defineProperty(Sk,"__esModule",{value:!0});const rc=jn,Ck=KD,JD=Fi,Zae=In,ese={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===Ck.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,rc._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},code(t){const{gen:e,data:n,schema:r,parentSchema:i,it:o}=t,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=r.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const u=e.let("valid",!1),l=e.const("tag",(0,rc._)`${n}${(0,rc.getProperty)(s)}`);e.if((0,rc._)`typeof ${l} == "string"`,()=>f(),()=>t.error(!1,{discrError:Ck.DiscrError.Tag,tag:l,tagName:s})),t.ok(u);function f(){const h=d();e.if(!1);for(const p in h)e.elseIf((0,rc._)`${l} === ${p}`),e.assign(u,c(h[p]));e.else(),t.error(!1,{discrError:Ck.DiscrError.Mapping,tag:l,tagName:s}),e.endIf()}function c(h){const p=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},p);return t.mergeEvaluated(m,rc.Name),p}function d(){var h;const p={},m=v(i);let g=!0;for(let w=0;w<a.length;w++){let _=a[w];(_==null?void 0:_.$ref)&&!(0,Zae.schemaHasRulesButRef)(_,o.self.RULES)&&(_=JD.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,_==null?void 0:_.$ref),_ instanceof JD.SchemaEnv&&(_=_.schema));const S=(h=_==null?void 0:_.properties)===null||h===void 0?void 0:h[s];if(typeof S!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&(m||v(_)),y(S,w)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return p;function v({required:w}){return Array.isArray(w)&&w.includes(s)}function y(w,_){if(w.const)k(w.const,_);else if(w.enum)for(const S of w.enum)k(S,_);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function k(w,_){if(typeof w!="string"||w in p)throw new Error(`discriminator: "${s}" values must be unique strings`);p[w]=_}}}};Sk.default=ese;const tse={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const n=GL,r=Ub,i=Sk,o=tse,a=["/properties"],s="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(d=>this.addVocabulary(d)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const d=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(d,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.exports=e=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=Wo;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var f=jn;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})})(Ab,Ab.exports);const GD=cR(Ab.exports);let Xf;const nse=[["items",EL,TL],["screens",DL,RL],["skills",VL,qL],["buttons",NL,IL],["scripts",JL,Ure],["audio",SL,CL],["quests",AL,ML],["tooltips",WL,KL],["characters",HL,UL]],rse=["baseAssetsPath","baseDataPath","gameTitle","images","layout","gameFlow","dialogPanel","splashScreens","notifications","hudStats","interactionTags","transitions","menuButtons","debugging","saves"];async function ise(t){const e={...Mu};for(const n of rse){const r=t[n];r&&(typeof r=="object"&&!Array.isArray(r)?e[n]={...e[n],...r}:e[n]=r)}for(const n of nse){const r=n[0],i=n[1],o=n[2];let a=t[r];if(a&&typeof a=="string")try{a=await vm(YD(t.baseDataPath,a));const s=new GD({allErrors:!0});if(!s.validate(i,a))throw console.error(s.errors),new Error(`${s.errorsText()}`)}catch(s){console.error(s),Kt(`${r} config error: ${s}`),a={...o}}a&&(Array.isArray(a)?e[r]=a:typeof a=="object"?e[r]={...o,...a}:e[r]=a)}if(Xf=e,Xf.transitions)for(const n in Xf.transitions)ym[n]?Object.assign(ym[n],Xf.transitions[n]):ym[n]=Xf.transitions[n];return e}async function ose(t){const e=await vm(t.configPath);t.baseAssetsPath?e.baseAssetsPath=t.baseAssetsPath:e.baseAssetsPath=e.baseAssetsPath||"",t.baseDataPath?e.baseDataPath=t.baseDataPath:e.baseDataPath=e.baseDataPath||"";const n=new GD({allErrors:!0});return n.validate(Wre,e)||(Kt("Config file validation failed."),console.log(n.errors),Kt(n.errorsText())),ise(e)}function gt(){return Tb().config}function Aa(){return gt().audio}function Co(){return gt().skills}function Bm(){return gt().items}function Zf(){return gt().quests}function zm(){return gt().screens}function $k(){return gt().buttons}function ed(){return gt().tooltips}function Ok(){return gt().characters}function QD(t){const n=ed().tooltips.find(r=>r.keywords.includes(t));return n||(Kt(`Tooltip config for keyword ${t} not found`),null)}function Ek(t){const e=gt().skills.skills[t];return e||Kt(`Skill config for skill ${t} doesn't exist`),e}function td(t){return t.startsWith("http")?t:gt().images[t]?Ma(gt().images[t]):Ma(t)}function Ma(t){return t.startsWith("http")?t:gt().baseAssetsPath?`${gt().baseAssetsPath}${t}`:t}function YD(t,e){return`${t}${e}`}function Tk(t){return gt().baseDataPath?`${gt().baseDataPath}${t}`:t}function Hs(t){const e=$k().buttons[t];return e||Kt(`Button config for button ${t} doesn't exist`),e}function XD(t){const e=zm().screens[t];return e||Kt(`Screen config for screen ${t} doesn't exist`),e}function is(t){const e=Bm().items[t];return e||Kt(`Item config for skill ${t} doesn't exist`),e}function Bu(t){return Zf().quests[t]}function Fm(t,e){return Bu(t).objectives[e]}function Vm(){var e;return(e=gt().dialogPanel.width)!=null?e:YZ}function ZD(t,e,n){if(!n.startsWith("$"))return isNaN(Number(n))?[null,n]:[null,Number(n)];n=n.substring(1);const r=/\[/,i=/\]/;let o=n.search(r);n.search(i);let a=n,s=e,u=0;for(;u<n.length;){if(o>u||o===-1){const l=o>u?o:n.length;let f=n.substring(u,l);isNaN(Number(f))||(f=Number(f)),u>0&&(s=s[a]),[s,a]=sse(s,f)}if(o!==-1){u=o;const l=n.substring(o+1),f=ase(l)+o,c=n.substring(o+1,f),[d,h]=ZD(t,t,c);let p=h;d&&(p=d[h]),typeof p=="number"||!isNaN(Number(p))?p=Number(p):typeof p!="string"&&console.error(`invalid array index (${p}) key type when compiling: ${n}`),s=s[a],a=p,u=f+1;const m=n.substring(u);o=m.search(r),o!==-1&&(o+=u),m.search(i)}else u=n.length}return[s,a]}function ase(t){let e=!1,n=0,r,i=1;for(;!e;){r=t.substring(n);const o=r.search(/\[/),a=r.search(/\]/);o!==-1&&o<a?(n+=o+1,i++):(n+=a+1,i--),i===0&&(e=!0),o===-1&&a===-1&&!e&&Kt(`Could not find closing bracket in ${t}`)}return n}function sse(t,e){if(typeof e=="number")return[t,e];e.startsWith(".")&&(e=e.substring(1));const n=e.split(".");let r=t;const i=n.length-1;let o=n[0],a=0;for(a=0;a<i;a++)o=n[a],typeof r[o]>"u"&&(r[o]={}),r=r[o];return o=n[a],[r,o]}function qm(t,e){return ZD(t,t,e)}function use(t,e){return qm(t,e)}function eR(t,e,n){const[r,i]=qm(t,e);r[i]=n}function tR(t,e,n){const[r,i]=qm(t,e),o=r[i]||0;r[i]=n+o}function ic(){const t=wn(),e=Er(),n=Uo(),r=Nr(),i=wn().scope,o={data:t.data,skills:e.skills,buttons:n.buttons,items:r.items,quests:di().quests,stats:$a().hudStats,scope:i,config:gt(),gameOptions:Gt().options};return new Proxy(o,{get:(s,u,l)=>{const f=wn().scope,c=wn().data;return typeof f[u]<"u"?f[u]:typeof c[u]<"u"?c[u]:Reflect.get(s,u,l)},set:(s,u,l,f)=>{const c=wn().scope,d=wn().data;if(typeof c[u]<"u")c[u]=l;else{if(typeof s[u]<"u")return Reflect.set(s,u,l,f);typeof l=="object"?d[u]={}:d[u]=l}return!0}})}function pi(t){if(t===null)return null;if(typeof t=="object")if(Array.isArray(t)){const e=[];for(const n in t)e[n]=pi(t[n]);return e}else{const e={};for(const n in t)e[n]=pi(t[n]);return e}else return t}function Ak(t,e){if(t===null)return null;if(typeof t=="object"){const n=e(t);if(e(t))return n;if(Array.isArray(t)){const r=[];for(const i in t)r[i]=Ak(t[i],e);return r}else{const r={};for(const i in t)r[i]=Ak(t[i],e);return r}}else return e(t)}const Er=Jr("skills",{state:()=>({skillChecks:{},skills:{}}),actions:{setupSkillCheck(t,e){this.skillChecks[e]=t},passSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!0,e&&(this.skillChecks[t].hidden=!0)},failSkillCheck(t,e){this.skillChecks[t].happened=!0,this.skillChecks[t].succeeded=!1,e&&(this.skillChecks[t].hidden=!0)},resetSkillCheck(t){this.skillChecks[t].happened=!1,this.skillChecks[t].succeeded=!1,this.skillChecks[t].hidden=!1},generateSaveData(){return{skillChecks:pi(this.skillChecks),skills:pi(this.skills)}},getSkillCheck(t){return this.skillChecks[t]||this.setupSkillCheck(this.createSkillCheckState(),t),this.skillChecks[t]},createSkillCheckState(){return{happened:!1,succeeded:!1,hidden:!1}},loadSaveData(t){this.skillChecks=gm(this.skillChecks,t.skillChecks),this.skills=gm(this.skills,t.skills)},setupSkills(t){const e=t.skills;for(const n in e)this.skills[n]={id:n,level:e[n].startingLevel||0,xp:0}},getSkill(t){return this.skills[t]},getSkillLevel(t){return this.getSkill(t).level},getSkillXp(t){return this.getSkill(t).xp},addXp(t,e){const n=this.getSkill(t);n||Kt(`Skill ${t} doesn't exist`),n.xp+=e,n.xp>=Co().skillOptions.xpPerLevel&&(n.xp=0,n.level++,this.levelledUp(t))},setSkillLevel(t,e){const n=this.getSkill(t);n||Kt(`Skill ${t} doesn't exist`),n.level=e,this.levelledUp(t)},incrementSkill(t,e){this.getSkill(t).level+=e,this.levelledUp(t)},levelledUp(t){const e=Co().skills[t].name,n=this.skills[t].level;Co().skillOptions.notifyLevelUp&&oo().addNotification(`Your skill in ${e} is now level ${n}`)}}});let nR;const lse=b.defineComponent({components:{Modal:Ws},setup(){const t=Er(),e=b.computed(()=>t.skills),n=b.computed(()=>t.skillChecks);return{skills:e,skillChecks:n}},data(){return{showDebug:!1,jumping:!1,searchString:"",matches:[],matchCursor:0}},mounted(){window.addEventListener("keydown",t=>{if(this.jumping||(t.key==="d"&&this.toggle(),t.key==="j"&&this.jump()),t.key==="ArrowDown"&&(t.preventDefault(),this.matches.length>this.matchCursor+1?this.matchCursor+=1:this.matchCursor=0),t.key==="ArrowUp"&&(t.preventDefault(),this.matchCursor>0?this.matchCursor-=1:this.matchCursor=this.matches.length-1),t.key==="Escape"&&this.finishJumping(),this.jumping&&t.key==="Enter"&&this.matchCursor<this.matches.length){const e=this.matches[this.matchCursor];wn().jumpToLabel(e),this.finishJumping()}})},methods:{finishJumping(){this.jumping=!1,this.matches=[],this.searchString="",this.close()},labelSelected(t){const e=t.target.value;wn().jumpToLabel(e),this.close()},close(){this.showDebug=!1,this.endDebug()},closeErrors(){Gt().clearErrors()},open(){this.showDebug=!0,this.startDebug();const t=wn(),e=Gt(),n=di(),r=Nr(),i=Er();this.$nextTick(()=>{new S8({target:this.$refs.variablesViewer,props:{content:{text:void 0,json:{data:this.variables,quests:n.quests,items:r.items,skills:i.skills,skillChecks:i.skillChecks}},onChange:o=>{t.overrideData(o.json.data),n.quests=o.json.quests,r.items=o.json.items,i.skills=o.json.skills,i.skillChecks=o.json.skillChecks}}}),new S8({target:this.$refs.stateViewer,props:{content:{text:void 0,json:e.getAllStates()},onChange:o=>{e.overrideStates(o.json)}}})})},toggle(){this.jumping?this.finishJumping():this.showDebug?this.close():this.open()},startDebug(){Gt().debugMode=!0},endDebug(){Gt().debugMode=!1},jump(){nR=new Vu(this.labels,{includeScore:!0}),this.jumping=!0,this.startDebug(),setTimeout(()=>{this.$nextTick(()=>{this.$refs.search.focus()})},10),this.matchCursor=0,this.matches=this.labels},getMatchResultStyle(t){if(t===this.matchCursor)return{background:"var(--light-background)"}},onSearchInput(){const t=this.searchString,e=nR.search(t);this.matches=e.map(n=>n.item),this.matches.length>0&&this.matchCursor>this.matches.length-1&&(this.matchCursor=this.matches.length-1)},save(){Gt().autoSaveGame({})},wordCount(){const e=Object.values(this.script).reduce((n,r)=>(Zo.log(n),n+this.countWordsInScriptBranch(r.branch)),0);alert(`You have ${e} words`)},countWordsInScriptLine(t){if(t.command.commandType==="talk"&&typeof t.command.args[2]=="string")return this.countWordsInString(t.command.args[2]);if(t.command.commandType==="text")return this.countWordsInString(t.code);if(t.command.commandType==="choice"){const e=t.command.staticOptions;let n=this.countWordsInScriptLine(e.prompt);return n+=e.choices.reduce((i,o)=>i+this.countWordsInString(o.prompt.code),0),e.choices.reduce((i,o)=>o.branch?i+this.countWordsInScriptBranch(o.branch):i,n)}if(t.command.commandType==="if"){const e=t.command.staticOptions;return[e.success,e.failure].reduce((r,i)=>i?r+this.countWordsInScriptBranch(i):r,0)}return 0},countWordsInString(t){return t.split(" ").length},countWordsInScriptBranch(t){return t.reduce((e,n)=>n?e+this.countWordsInScriptLine(n):e,0)},getPlayTimeString(){const t=Fu(this.playTime.start,this.playTime.previousPlaytime);return Ym(t/1e3)}},computed:{...Za(wn,["script","data"]),...Za(Gt,["playTime","errors","playing","flowState"]),labels(){const t=this.script;return Object.keys(t).sort()},variables(){return this.data}}}),tpe="",cse={class:"debug-menu"},fse={key:0,class:"debug-info"},dse=[b.createStaticVNode("<h3>Debug mode is ON</h3><ul><li><b>j</b>: Quick Label Jump</li><li><b>d</b>: Debug Menu</li><li><b>a</b>: Auto Play</li><li><b>s</b>: Skip</li><li><b>Space</b>: New Game</li><li><b>c</b>: Continue</li><li><b>Escape</b>: Toggle Menu</li></ul>",2)],hse=b.createElementVNode("h3",{class:"title"},"Jump to label",-1),pse={key:0,class:"search-results"},mse={key:1},vse=[b.createElementVNode("h3",null,"No matches found",-1)],gse=b.createElementVNode("h3",{class:"title"},"Error(s)",-1),yse=b.createTextVNode(" There are errors in your dialogue scripts. Open the developer console for more details. "),bse=["innerHTML"],kse=b.createElementVNode("h3",{class:"title"},"Debug Menu!",-1),wse={class:"container"},_se=b.createTextVNode(" Hello this is the debug menu. "),xse=b.createElementVNode("option",{class:"option",selected:"",disabled:""},"Jump to a label",-1),jse=["value"],Sse={class:"grid grid-cols-3 gap-4"},Cse=b.createElementVNode("h2",null,"Variables Editor",-1),$se={ref:"variablesViewer"},Ose=b.createElementVNode("h2",null,"Skill Checks",-1),Ese={class:"table-auto"},Tse=b.createElementVNode("thead",null,[b.createElementVNode("tr",null,[b.createElementVNode("th",null,"Skill Check"),b.createElementVNode("th",null,"Happened"),b.createElementVNode("th",null,"Succeeded")])],-1),Ase=b.createElementVNode("h2",null,"App State editor (entire app and engine",-1),Mse=b.createElementVNode("h3",{style:{color:"pink"}}," Use for debugging, editing some of those things can cause issues ",-1),Pse={ref:"stateViewer"};function Nse(t,e,n,r,i,o){const a=b.resolveComponent("modal");return b.openBlock(),b.createElementBlock("div",cse,[b.createElementVNode("button",{onClick:e[0]||(e[0]=(...s)=>t.open&&t.open(...s)),class:"button debug-button"},"Debug Menu"),!t.playing&&t.flowState==="menu"?(b.openBlock(),b.createElementBlock("div",fse,dse)):b.createCommentVNode("",!0),t.jumping?(b.openBlock(),b.createBlock(a,{key:1,onClose:t.finishJumping,containerCssClass:"jump-menu-container"},{header:b.withCtx(()=>[hse]),body:b.withCtx(()=>[b.withDirectives(b.createElementVNode("input",{type:"text",class:"label-input input",ref:"search","onUpdate:modelValue":e[1]||(e[1]=s=>t.searchString=s),onInput:e[2]||(e[2]=(...s)=>t.onSearchInput&&t.onSearchInput(...s))},null,544),[[b.vModelText,t.searchString]]),t.matches.length>0?(b.openBlock(),b.createElementBlock("div",pse,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.matches,(s,u)=>(b.openBlock(),b.createElementBlock("div",{class:"search-result",style:b.normalizeStyle(t.getMatchResultStyle(u)),key:u},b.toDisplayString(s),5))),128))])):(b.openBlock(),b.createElementBlock("div",mse,vse))]),_:1},8,["onClose"])):b.createCommentVNode("",!0),t.errors.length>0?(b.openBlock(),b.createBlock(a,{key:2,onClose:t.closeErrors,containerCssClass:"debug-menu-container"},{header:b.withCtx(()=>[gse]),body:b.withCtx(()=>[yse,b.createElementVNode("ul",null,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.errors,(s,u)=>(b.openBlock(),b.createElementBlock("li",{key:u,class:b.normalizeClass(["error-message list-disc",s.type==="error"?"error":"warning"]),innerHTML:s.text},null,10,bse))),128))])]),_:1},8,["onClose"])):b.createCommentVNode("",!0),t.showDebug?(b.openBlock(),b.createBlock(a,{key:3,onClose:t.close,containerCssClass:"debug-menu-container"},{header:b.withCtx(()=>[kse]),body:b.withCtx(()=>[b.createElementVNode("div",wse,[_se,b.createElementVNode("select",{class:"select",name:"label-selector",onChange:e[3]||(e[3]=s=>t.labelSelected(s))},[xse,(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.labels,s=>(b.openBlock(),b.createElementBlock("option",{class:"option",value:s,key:s},b.toDisplayString(s),9,jse))),128))],32),b.createElementVNode("div",Sse,[b.createElementVNode("button",{onClick:e[4]||(e[4]=(...s)=>t.wordCount&&t.wordCount(...s)),class:"button"},"Word Count"),b.createElementVNode("button",{onClick:e[5]||(e[5]=(...s)=>t.save&&t.save(...s)),class:"button"},"Save Game")]),b.createElementVNode("h3",null,"Play time: "+b.toDisplayString(t.getPlayTimeString()),1),Cse,b.createElementVNode("div",$se,null,512),Ose,b.createElementVNode("table",Ese,[Tse,b.createElementVNode("tbody",null,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.skillChecks,(s,u)=>(b.openBlock(),b.createElementBlock("tr",{key:u},[b.createElementVNode("td",null,b.toDisplayString(u),1),b.createElementVNode("td",null,b.toDisplayString(s.happened?"\u2705":"\u274C"),1),b.createElementVNode("td",null,b.toDisplayString(s.happened?s.succeeded?"\u2705":"\u274C":"NA"),1)]))),128))])]),Ase,Mse,b.createElementVNode("div",Pse,null,512)])]),_:1},8,["onClose"])):b.createCommentVNode("",!0)])}const Ise=Hi(lse,[["render",Nse]]),Lse=b.defineComponent({computed:{...Za(oo,["notifications"])}}),ipe="",Dse=["innerHTML"];function Rse(t,e,n,r,i,o){return b.openBlock(),b.createBlock(b.TransitionGroup,{name:"notification",tag:"div",class:"notifications-holder"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.notifications,(a,s)=>(b.openBlock(),b.createElementBlock("div",{class:"notification",key:s},[b.createElementVNode("h3",{innerHTML:a.text},null,8,Dse)]))),128))]),_:1})}const Bse=Hi(Lse,[["render",Rse]]);function rR(t,e=50,n={}){var c,d;let r;const i=(c=n.isImmediate)!=null?c:!1,o=(d=n.callback)!=null?d:!1,a=n.maxWait;let s=Date.now(),u=[];function l(){if(a!==void 0){const h=Date.now()-s;if(h+e>=a)return a-h}return e}const f=function(...h){const p=this;return new Promise((m,g)=>{const v=function(){if(r=void 0,s=Date.now(),!i){const w=t.apply(p,h);o&&o(w),u.forEach(({resolve:_})=>_(w)),u=[]}},y=i&&r===void 0;r!==void 0&&clearTimeout(r);const k=l();if(r=setTimeout(v,k),y){const w=t.apply(p,h);return o&&o(w),m(w)}u.push({resolve:m,reject:g})})};return f.cancel=function(h){r!==void 0&&clearTimeout(r),u.forEach(({reject:p})=>p(h)),u=[]},f}const zse={class:"save-slot flex flex-row"},Fse={class:"used-save-slot flex flex-row justify-between items-center grow"},Vse={class:"flex flex-col save-slot-number-container"},qse={class:"save-slot-number"},Hse={class:"flex flex-col justify-center save-info"},Use={key:1,class:"save-name"},Wse={class:"flex flex-col"},Kse={key:0},Jse={key:1},Gse={key:2},Qse={class:"flex flex-row"},Yse=["onClick"],Mk=b.defineComponent({__name:"save-slot-ui",props:{saveSlot:{type:Object,required:!0},id:{type:String,required:!0},actions:{type:Array,required:!0}},emits:["choice"],setup(t,{emit:e}){var d,h;const n=t,r=b.ref((h=(d=n.saveSlot.saveData)==null?void 0:d.metadata.name)!=null?h:"Empty Save"),i=b.computed(()=>n.saveSlot.saveData!==null),o=b.computed(()=>n.saveSlot.saveData),a=b.computed(()=>gt().saves.mode),s=b.computed(()=>{const p=n.saveSlot.saveData;if(p&&p.screen.layers[0]){const m=zm().screens[p.screen.layers[0]];if(m)return{backgroundImage:`url(${td(m.background)})`}}return!1});function u(p){e("choice",p)}function l(p){return o.value?Ym(o.value.main.playTime/1e3):"00:00:00"}function f(){o.value&&iee(n.saveSlot.id,r.value)}function c(){const p=gt().saves.slots;let m="";const g=n.saveSlot.slotNumber;return g===0&&gt().saves.mode==="manual"?"AUTO":(p>=10&&g<10&&(m+="0"),p>=100&&g<100&&(m+="0"),m+g)}return(p,m)=>(b.openBlock(),b.createElementBlock("div",zse,[b.createElementVNode("div",Fse,[b.createElementVNode("div",Vse,[b.createElementVNode("h1",qse,b.toDisplayString(c()),1)]),b.unref(s)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"save-slot-screenshot",style:b.normalizeStyle(b.unref(s))},null,4)):b.createCommentVNode("",!0),b.createElementVNode("div",Hse,[b.unref(i)?b.withDirectives((b.openBlock(),b.createElementBlock("input",{key:0,type:"text",class:"save-name","onUpdate:modelValue":m[0]||(m[0]=g=>r.value=g),onInput:f},null,544)),[[b.vModelText,r.value]]):(b.openBlock(),b.createElementBlock("h3",Use,b.toDisplayString(r.value),1)),b.createElementVNode("div",Wse,[b.unref(o)?(b.openBlock(),b.createElementBlock("p",Kse,b.toDisplayString(new Date(b.unref(o).metadata.saveDate).toLocaleString()),1)):b.createCommentVNode("",!0),b.unref(o)?(b.openBlock(),b.createElementBlock("p",Jse,"Play time: "+b.toDisplayString(l(t.saveSlot)),1)):b.createCommentVNode("",!0),b.unref(a)==="game-slots"?(b.openBlock(),b.createElementBlock("p",Gse,b.toDisplayString(t.saveSlot.slotType==="auto"?"Auto Save":"Manual Save"),1)):b.createCommentVNode("",!0)])]),b.createElementVNode("div",Qse,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.actions,(g,v)=>(b.openBlock(),b.createElementBlock("button",{class:"button",onClick:()=>u(v),key:v},[b.createElementVNode("h3",null,b.toDisplayString(g),1)],8,Yse))),128))])])]))}}),ope="",Xse=b.createElementVNode("h3",{class:"title"},"Confirmation",-1),Zse={class:"flex justify-center"},Hm=b.defineComponent({__name:"yes-no",props:{prompt:{type:String,required:!0},onConfirm:{type:Function,required:!1},onRefuse:{type:Function,required:!1}},emits:["choice"],setup(t,{emit:e}){const n=t;function r(i){i===!0&&n.onConfirm?n.onConfirm():i===!1&&n.onRefuse&&n.onRefuse(),e("choice",i)}return(i,o)=>(b.openBlock(),b.createBlock(Ws,{onClose:o[2]||(o[2]=()=>r(!1)),containerCssClass:"yes-no-modal"},{header:b.withCtx(()=>[Xse]),body:b.withCtx(()=>[b.createElementVNode("h3",null,b.toDisplayString(t.prompt),1),b.createElementVNode("div",Zse,[b.createElementVNode("button",{class:"button",onClick:o[0]||(o[0]=()=>r(!0))},"Yes"),b.createElementVNode("button",{class:"button",onClick:o[1]||(o[1]=()=>r(!1))},"No")])]),_:1}))}}),ape="",eue={class:"title"},tue={key:0},nue={class:"saves-section"},rue=b.createElementVNode("h3",{class:"saves-section-title"},"Auto save",-1),iue={class:"saves-section"},oue=b.createElementVNode("h3",{class:"saves-section-title"},"Manual Saves",-1),aue={key:1,class:"saves-section"},sue=b.createElementVNode("h3",{class:"saves-section-title"},"Save Slots",-1),uue={class:"saves-container flex flex-col"},iR=b.defineComponent({__name:"save-slots",props:{mode:{type:String,required:!0}},emits:["chosen","close"],setup(t,{emit:e}){const n=t,r=b.reactive([]),i=b.computed(()=>r.slice(0,1)),o=b.computed(()=>r.slice(1)),a=b.reactive(n.mode==="load"?["Load","Delete"]:["Choose"]),s=b.computed(()=>gt().saves.mode),u=b.reactive({prompt:"Are you sure you want to delete this save file?",saveToDelete:null,onConfirm:()=>{d(u.saveToDelete),u.saveToDelete=null},onRefuse:()=>{u.saveToDelete=null}}),l=b.reactive({prompt:"Are you sure you want to overwrite this save file?",saveToOverwrite:null,onConfirm:()=>{f(l.saveToOverwrite),l.saveToOverwrite=null},onRefuse:()=>{l.saveToOverwrite=null}});b.onMounted(()=>{const v=Z8().slots;console.log(v),v.forEach((y,k)=>{r[k]=y})});function f(g){e("chosen",{slotId:g})}function c(g){const v=m(g);if(v){if(gt().saves.mode==="manual"&&v.slotType==="auto"){Gt().alert("Sorry","Can't delete the auto save slot!");return}u.saveToDelete=g}}function d(g){ree(g);const v=r.find(y=>y.id===g);v&&(v.saveData=null)}function h(){e("close")}function p(g,v){const y=a[v];y==="Load"?f(g):y==="Delete"?c(g):y==="Choose"&&(l.saveToOverwrite=g)}function m(g){return r.find(v=>v.id===g)}return(g,v)=>(b.openBlock(),b.createBlock(Ws,{onClose:h,containerCssClass:"save-modal",cantClose:!1},{header:b.withCtx(()=>[b.createElementVNode("h3",eue,b.toDisplayString(t.mode==="load"?"Choose a save to load":"Pick a slot to save the game"),1)]),body:b.withCtx(()=>[b.unref(s)==="manual"?(b.openBlock(),b.createElementBlock("div",tue,[b.createElementVNode("div",nue,[rue,b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})]),b.createElementVNode("div",iue,[oue,b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(o),y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})])])):(b.openBlock(),b.createElementBlock("div",aue,[sue,b.createElementVNode("div",uue,[b.createVNode(b.TransitionGroup,{name:"list",tag:"div"},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(r,y=>(b.openBlock(),b.createBlock(Mk,{key:y.id,saveSlot:y,id:y.id,actions:a,onChoice:k=>p(y.id,k)},null,8,["saveSlot","id","actions","onChoice"]))),128))]),_:1})])])),u.saveToDelete?(b.openBlock(),b.createBlock(Hm,{key:2,prompt:u.prompt,onRefuse:u.onRefuse,onConfirm:u.onConfirm},null,8,["prompt","onRefuse","onConfirm"])):b.createCommentVNode("",!0),l.saveToOverwrite?(b.openBlock(),b.createBlock(Hm,{key:3,prompt:l.prompt,onRefuse:l.onRefuse,onConfirm:l.onConfirm},null,8,["prompt","onRefuse","onConfirm"])):b.createCommentVNode("",!0)]),_:1}))}}),spe="";class oR extends Eb{setup(e=!1){const r=e?"keydown":"keyup",i=rR(o=>{$o.emit("debouncedKeydown",o)},10,{isImmediate:!0,maxWait:10});window.addEventListener("keydown",o=>{$o.emit("keydown",o)}),window.addEventListener(r,o=>{i(o)})}}const $o=new oR,aR=Jr("startMenu",{state:()=>({buttons:[]}),actions:{addButtonsFromPlugins(){Fn.plugins.forEach(e=>{e.startMenuButtons&&e.startMenuButtons.forEach(n=>{const r=window.narrat.app;n.popupComponent&&r.component(n.popupComponent.name,n.popupComponent.component),this.buttons.push(n)})})}}}),lue={id:"game-menu"},cue={id:"game-header",class:"flex flex-col justify-between items-center"},fue={id:"game-title-container"},due={id:"game-title-text"},hue={class:"flex flex-col start-menu-buttons-container"},pue=["onClick"],mue={class:"title"},vue=b.defineComponent({__name:"StartMenu",setup(t){const e=b.ref(!1),n=b.ref(!1),r=b.ref(null),i=b.ref(null),o=b.ref(!1),a=b.ref(!1),s=b.ref(null),u=aR(),l=b.ref(!1),f=b.computed(()=>u.buttons);async function c(){e.value&&gt().saves.mode==="manual"?a.value=!0:d()}async function d(){const _=Gt();if(i.value===null)if(gt().saves.mode==="manual"){const S=ub();if(!S){Kt("No autosave found");return}i.value=S.id}else{const S=tee();if(!S){Kt("No free slot found");return}i.value=S}a.value=!1,await _.startGame(i.value)}function h(_){_.action&&_.action(),_.popupComponent&&(l.value=_)}function p(){l.value=!1}function m(){a.value=!1}async function g(){if(!i.value)return;const _=Pf(i.value);if(!_){Kt("No save file found");return}Gt().loadGame(_,i.value)}function v(){typeof r.value=="string"&&(i.value=r.value,g())}function y(){o.value=!0}function k({slotId:_}){const S=Pf(_);S&&S.saveData?(i.value=_,g()):c()}b.onMounted(()=>{const _=gt();_.audio.options.defaultMusic&&Gr().playChannel("music",_.audio.options.defaultMusic,0);const S=Z8();S.slots.some(C=>C.saveData)&&(e.value=!0),(gt().saves.mode==="manual"||S.slots.some(C=>!C.saveData))&&(n.value=!0),S.lastSaveSlot&&Pf(S.lastSaveSlot)&&(r.value=S.lastSaveSlot),s.value=$o.on("debouncedKeydown",C=>{C.key===" "&&d(),C.key==="c"&&v()})}),b.onUnmounted(()=>{s.value&&$o.off("debouncedKeydown",s.value)});const w=b.computed(()=>gt().gameTitle);return(_,S)=>(b.openBlock(),b.createElementBlock("div",lue,[o.value?(b.openBlock(),b.createBlock(iR,{key:0,mode:"load",onChosen:k,onClose:S[0]||(S[0]=C=>o.value=!1)})):b.createCommentVNode("",!0),a.value?(b.openBlock(),b.createBlock(Hm,{key:1,prompt:"This will override your previous autosave, are you sure?",onConfirm:d,onRefuse:m})):b.createCommentVNode("",!0),b.createElementVNode("div",cue,[b.createElementVNode("div",fue,[b.createElementVNode("h1",due,b.toDisplayString(b.unref(w)),1)]),b.createElementVNode("div",hue,[r.value?(b.openBlock(),b.createElementBlock("button",{key:0,class:"button menu-button main-menu-button large continue-button override",onClick:v}," Continue ")):b.createCommentVNode("",!0),n.value?(b.openBlock(),b.createElementBlock("button",{key:1,class:"button menu-button main-menu-button large start-button override",onClick:c}," New Game ")):b.createCommentVNode("",!0),e.value?(b.openBlock(),b.createElementBlock("button",{key:2,class:"button menu-button main-menu-button large continue-button override",onClick:y}," Load Game ")):b.createCommentVNode("",!0),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(f),C=>(b.openBlock(),b.createElementBlock("button",{key:C.id,class:b.normalizeClass(["button menu-button main-menu-button large override",`${C.id}-start-menu-button`]),onClick:A=>h(C)},b.toDisplayString(C.text),11,pue))),128))])]),l.value?(b.openBlock(),b.createBlock(b.Teleport,{key:2,to:"#app-container"},[b.createVNode(Ws,{onClose:p,class:b.normalizeClass(`start-menu-popup-${l.value.id}`)},{header:b.withCtx(()=>[b.createElementVNode("h3",mue,b.toDisplayString(l.value.text),1)]),body:b.withCtx(()=>[l.value.popupComponent?(b.openBlock(),b.createBlock(b.resolveDynamicComponent(l.value.popupComponent.component),{key:0,onClose:p},null,32)):b.createCommentVNode("",!0)]),_:1},8,["class"])])):b.createCommentVNode("",!0)]))}}),upe="",gue={class:"title"},yue=b.defineComponent({__name:"alert-modal",props:{title:{type:String,required:!1},text:{type:String,required:!1}},setup(t){return(e,n)=>(b.openBlock(),b.createBlock(Ws,{onClose:n[0]||(n[0]=r=>e.$emit("close")),containerCssClass:"yes-no-modal"},{header:b.withCtx(()=>{var r;return[b.createElementVNode("h3",gue,b.toDisplayString((r=t.title)!=null?r:"Alert"),1)]}),body:b.withCtx(()=>[b.createElementVNode("h3",null,b.toDisplayString(t.text),1)]),_:1}))}}),lpe="";function Pk(t){const e=Ok().characters[t];return e||Kt(`Character ${t} not found`),e}function bue(t,e){const n=Pk(t);if(!!n&&(e||(e="default"),n.sprites)){const r=`${Ok().config.imagesPath}${n.sprites[e]}`;return r||Kt(`Character ${t} pose ${e} not found`),r}}function Um(t){var e;return t?((e=Pk(t))==null?void 0:e.style)||{}:{}}const kue=b.defineComponent({props:{pictureUrl:String},methods:{getAssetUrl(t){return Ma(t)}},computed:{...Za(ao,["layoutMode"]),boxStyle(){var o,a,s,u,l;const t=ao(),e=gt().layout;let n=0,r=0;const i=e.portraits;if(this.layoutMode==="vertical"){const f=(a=(o=i.offset)==null?void 0:o.portrait)!=null?a:{right:0,bottom:0};n=20+f.right,r=t.dialogHeight+f.bottom}else{const f=(u=(s=i.offset)==null?void 0:s.landscape)!=null?u:{right:0,bottom:0},c=(l=gt().dialogPanel.rightOffset)!=null?l:Mu.dialogPanel.rightOffset;n=Vm()-10+f.right+c,r=200+f.bottom}return{right:`${n}px`,bottom:`${r}px`,width:`${e.portraits.width}px`,height:`${e.portraits.height}px`}}}}),cpe="",wue=["src"];function _ue(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",{class:"dialog-picture override",style:b.normalizeStyle(t.boxStyle)},[b.createElementVNode("img",{src:t.getAssetUrl(t.pictureUrl),class:"picture override"},null,8,wue)],4)}const xue=Hi(kue,[["render",_ue]]),jue=b.defineComponent({data(){return{playerText:"",passed:!1,timeout:null,textAnimation:null,mounted:!1,autoTimer:null,skipTimer:null,nextLineTimer:null}},props:{options:{type:Object,required:!0},active:Boolean},mounted(){this.startTextAnimation(),this.registerKeyboardShortcuts(),this.mounted=!0},unmounted(){this.clearListeners(),this.endTextAnimation({unmounted:!0})},computed:{...Za(Gt,["paused"]),preText(){return this.options.title?" &nbsp;\u2013&nbsp; ":""},style(){return Um(this.options.styleId)},dialogBoxStyle(){const t=Um(this.options.styleId),e={opacity:this.options.old?"0.7":"1"};return{...t.boxCss,...e}},isBasicChoice(){return!this.choices&&!this.options.textField},dialogBoxClass(){return this.options.title?!1:"dialog-box-followup"},titleStyle(){const t=Um(this.options.styleId);return{color:t.color,...t.nameCss}},textStyle(){return Um(this.options.styleId).textCss},text(){return this.textAnimation?this.textAnimation.text:this.options.text},choices(){if(this.options.choices)return this.options.choices},skipping(){return zn().playMode==="skip"},canInteract(){return this.active&&this.mounted&&!this.passed&&!this.nextLineTimer&&!this.textAnimation&&this.options.interactive&&!this.paused}},watch:{options(t,e){!e.old&&t.old&&this.textAnimation&&this.endTextAnimation({unmounted:!0})},skipping(t,e){t&&!e&&this.startSkip()}},methods:{clearListeners(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},keyboardEvent(t){if(!this.canInteract){this.mounted&&this.textAnimation&&t.key===" "&&this.endTextAnimation({pressedSpace:!0});return}if(this.canInteract&&this.options.textField&&t.key==="Enter"&&this.submitText(),this.canInteract&&!this.options.textField){let e=-1;switch(t.key){case" ":e=0;break;case"1":e=0;break;case"2":e=1;break;case"3":e=2;break;case"4":e=3;break;case"5":e=4;break;case"6":e=5;break;case"7":e=6;break;case"8":e=7;break}e!==-1&&(this.choices&&e<this.choices.length?this.chooseOption(this.choices[e]):this.chooseOption(e))}},next(){this.passed||this.chooseOption(0)},chooseOption(t){this.finishLine();let e;typeof t=="object"?e=t.originalIndex:e=t,Gt().playerAnswered(e)},finishLine(){this.clearListeners(),this.endTextAnimation({unmounted:!0}),this.passed=!0},dialogStyle(t){const e={};return t.allowed||(e.pointerEvents="none",e.textDecoration="line-through"),e},dialogClass(t){if(!t.allowed)return"strike-anim"},submitText(){const t=this.playerText;Gt().playerAnswered(t)},addTextSection(t,e){const n=this.options.text.substring(t,e);return this.textAnimation.text+=n,e},addHtmlTag(t){const e=t[0];return this.textAnimation.text+=e,this.textAnimation.skippedChars+=e.length,e.length},startTextAnimation(){var t;if(!this.options.old)if(zn().playMode==="skip")this.startSkip();else if(gt().dialogPanel.animateText){this.textAnimation={text:"",index:0,startTime:Date.now(),timer:null,skippedChars:0,tags:lee(this.options.text),finished:!1};const e=this.textAnimation;e.timer=setInterval(()=>{this.updateTextAnimation()},30)}else zn().playMode!=="auto"&&this.isBasicChoice&&(this.autoTimer=setTimeout(()=>{this.endTextAnimation()},((t=gt().dialogPanel.textSpeed)!=null?t:sb)*this.options.text.length))},startSkip(){zn().playMode==="skip"&&!this.options.old&&(this.isBasicChoice?this.skipTimer=setTimeout(()=>{this.endTextAnimation()},100):(zn().toggleSkip(),this.endTextAnimation({unmounted:!0})))},updateTextAnimation(){var o;const t=this.textAnimation;if(!t)return;const e=t.index,n=Date.now()-t.startTime;let r=!1,i=Math.round(n/((o=gt().dialogPanel.textSpeed)!=null?o:sb))+t.skippedChars;if(i>this.options.text.length&&(r=!0,t.finished=!0,i=this.options.text.length),i!==t.index){let a=e;for(;t.tags.length>0&&i>=t.tags[0].index;){a=this.addTextSection(a,t.tags[0].index);const s=this.addHtmlTag(t.tags.shift());a+=s,i+=s}a=this.addTextSection(a,i),t.index=a}r&&this.endTextAnimation()},endTextAnimation({unmounted:t,pressedSpace:e}={}){var n;this.textAnimation&&(this.textAnimation.timer&&clearInterval(this.textAnimation.timer),this.textAnimation=null),this.autoTimer&&!e&&clearTimeout(this.autoTimer),this.skipTimer&&clearTimeout(this.skipTimer),this.nextLineTimer&&clearTimeout(this.nextLineTimer),!t&&!e&&zn().playMode!=="normal"&&this.isBasicChoice&&(this.nextLineTimer=setTimeout(()=>{this.next()},zn().playMode==="auto"?(n=gt().dialogPanel.timeBetweenLines)!=null?n:Mu.dialogPanel.timeBetweenLines:0))},registerKeyboardShortcuts(){this.timeout=setTimeout(()=>{this.options.textField&&this.canInteract&&this.$refs.playerInput.focus()},10)}}}),fpe="",Sue={class:"dialog-content"},Cue=["innerHTML"],$ue=["innerHTML"],Oue=["innerHTML"],Eue={key:1},Tue={key:0,class:"dialog-choices"},Aue=["onClick","innerHTML"],Mue={key:1},Pue={key:2,class:"buttons-container"};function Nue(t,e,n,r,i,o){const a=b.resolveDirective("visible");return b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["dialog-box w-full override",t.dialogBoxClass]),style:b.normalizeStyle(t.dialogBoxStyle)},[b.createElementVNode("div",Sue,[t.options.title?(b.openBlock(),b.createElementBlock("span",{key:0,class:"dialog-title override",style:b.normalizeStyle(t.titleStyle),innerHTML:t.options.title},null,12,Cue)):b.createCommentVNode("",!0),b.createElementVNode("span",{class:"dialog-text dialog-separator override",style:b.normalizeStyle(t.textStyle),innerHTML:t.preText},null,12,$ue),b.createElementVNode("span",{class:b.normalizeClass(["dialog-text override",t.options.cssClass]),style:b.normalizeStyle(t.textStyle),innerHTML:t.text},null,14,Oue),t.options.old?b.createCommentVNode("",!0):b.withDirectives((b.openBlock(),b.createElementBlock("div",Eue,[t.choices?(b.openBlock(),b.createElementBlock("div",Tue,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.choices,(s,u)=>(b.openBlock(),b.createElementBlock("p",{key:u,style:b.normalizeStyle(t.dialogStyle(s)),class:b.normalizeClass([t.dialogClass(s),"dialog-choice override"]),onClick:l=>t.chooseOption(s),ref_for:!0,ref:"choices",innerHTML:`${u+1}. \u2013\xA0 ${s.choice}`},null,14,Aue))),128))])):t.options.textField?(b.openBlock(),b.createElementBlock("div",Mue,[b.withDirectives(b.createElementVNode("input",{type:"text",class:"label-input input",ref:"playerInput",id:"player-input-field","onUpdate:modelValue":e[0]||(e[0]=s=>t.playerText=s)},null,512),[[b.vModelText,t.playerText]]),b.createElementVNode("button",{onClick:e[1]||(e[1]=(...s)=>t.submitText&&t.submitText(...s)),class:"button",id:"player-input-submit"}," Submit ")])):(b.openBlock(),b.createElementBlock("div",Pue,[b.createElementVNode("div",{onClick:e[2]||(e[2]=s=>t.chooseOption(0)),ref:"continue",class:"interact-button button override"}," Continue ",512)]))])),[[a,t.canInteract]])])],6)}const Iue=Hi(jue,[["render",Nue]]),Lue=b.createElementVNode("div",{class:"anchor"},null,-1),Due=b.defineComponent({__name:"game-dialog",props:{layoutMode:String,inGame:Boolean},setup(t){const e=t,n=b.ref(Gt().inScript),r=b.ref(null),i=ao(),o=wn(),a=b.computed(()=>o.stack),s=zn(),u=b.computed(()=>s.dialog),l=b.ref(null),f=b.ref(null),c=b.ref(null),d=b.computed(()=>{let S="0px";const C=gt().layout.dialogBottomPadding;return typeof C=="number"?S=`${C}px`:typeof C=="string"&&(S=C),{paddingBottom:S}}),h=b.computed(()=>{if(u.value.length>0)return u.value[u.value.length-1]}),p=b.computed(()=>{if(h.value){const S=h.value.speaker;let C=h.value.pose;return S?(C||(C="idle"),bue(S,C)):void 0}}),m=b.computed(()=>i.dialogWidth),g=b.computed(()=>Gt().inScript);b.watch(g,S=>{S?n.value=!0:zn().playMode!=="normal"?(zn().playMode==="skip"&&(zn().playMode="normal"),r.value=setTimeout(()=>{n.value=!1},500)):n.value=!1}),b.onMounted(()=>{const S=C=>{f.value&&f.value.keyboardEvent&&f.value.keyboardEvent(C)};c.value=$o.on("debouncedKeydown",S)}),b.onUnmounted(()=>{c.value&&$o.off("debouncedKeydown",c.value),r.value&&clearTimeout(r.value)});const v=b.computed(()=>{var $,E;let S;const C=`${ao().dialogHeight}px`,A={};if(ao().overlayMode){A.position="absolute";const O=($=gt().dialogPanel.rightOffset)!=null?$:Mu.dialogPanel.rightOffset;A.right=`${O}px`;const z=(E=gt().dialogPanel.bottomOffset)!=null?E:Mu.dialogPanel.bottomOffset;A.bottom=`${z}px`}return{...A,width:e.layoutMode==="horizontal"?`${m.value}px`:"100%",height:C,transform:S,transformOrigin:"right"}});function y(){zn().toggleAutoPlay()}function k(){zn().toggleSkip()}function w(S,C){var E;const A=Pk(S.speaker);let $=(E=A==null?void 0:A.name)!=null?E:"Missing Character";return C>=1&&u.value[C-1].speaker===S.speaker&&($=void 0),S.choices&&S.choices.forEach(O=>{O.choice=es(O.choice)}),{title:$!=null?$:"",text:S.text,cssClass:S.cssClass,styleId:S.speaker,choices:S.choices,old:C<u.value.length-1,interactive:S.interactive,textField:S.textField}}function _(S){return S===s.dialog.length-1&&a.value.length>0}return b.watch(u.value,S=>{if(l.value){const C=l.value;C.scrollTop=C.scrollHeight+1e8}}),(S,C)=>(b.openBlock(),b.createElementBlock(b.Fragment,null,[b.createVNode(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.unref(p)&&b.unref(i).showDialog?(b.openBlock(),b.createBlock(xue,{key:0,pictureUrl:b.unref(p)},null,8,["pictureUrl"])):b.createCommentVNode("",!0)]),_:1}),b.createVNode(b.Transition,{name:"dialog-transition"},{default:b.withCtx(()=>[t.inGame&&b.unref(i).showDialog?(b.openBlock(),b.createElementBlock("div",{key:0,class:"dialog override",ref_key:"dialogRef",ref:l,style:b.normalizeStyle(b.unref(v))},[b.createVNode(b.TransitionGroup,{name:"list",tag:"div",class:"dialog-container w-full override",style:b.normalizeStyle(b.unref(d))},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(u),(A,$)=>(b.openBlock(),b.createBlock(Iue,{ref_for:!0,ref:E=>f.value=E,key:A.id,options:w(A,$),active:_($)},null,8,["options","active"]))),128))]),_:1},8,["style"]),(b.openBlock(),b.createBlock(b.Teleport,{to:"#app"},[b.createElementVNode("div",{class:"auto-skip-buttons flex"},[b.createElementVNode("div",{class:"button menu-toggle-button auto-button auto",onClick:y}," Auto "),b.createElementVNode("div",{class:"button menu-toggle-button auto-button skip",onClick:k}," Skip ")])])),Lue],4)):b.createCommentVNode("",!0)]),_:1})],64))}}),dpe="",Rue=["id"],Bue=["src"],zue={class:"tab-title"},Fue=b.defineComponent({__name:"tab-selector",props:{tab:null,active:{type:Boolean}},emits:["click"],setup(t,{emit:e}){const n=t,r=b.computed(()=>n.active?"tab-active":"tab-inactive");function i(){e("click")}return(o,a)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["tab",b.unref(r)]),id:`tab-${t.tab.id}`,onClick:i},[b.createElementVNode("div",{class:b.normalizeClass(["tab-title-container",t.active?"active":""])},[t.tab.icon?(b.openBlock(),b.createElementBlock("img",{key:0,src:t.tab.icon,alt:"tab icon",class:"tab-icon"},null,8,Bue)):b.createCommentVNode("",!0),b.createElementVNode("span",zue,b.toDisplayString(t.tab.label),1)],2)],10,Rue))}}),hpe="",Vue={class:"tabs-controller"},que={key:0,class:"tabs-controller__tabs"},Hue={key:1,class:"tab-content"},Uue={key:2},Wue=[b.createElementVNode("div",{class:"tab-content__empty"},[b.createElementVNode("p",null,"No tab selected")],-1)],Kue=b.defineComponent({__name:"TabsController",props:{tabs:null,defaultTab:null},emits:["tab-change","close"],setup(t,{emit:e}){var a,s;const n=t,r=b.ref((s=(a=n.tabs[n.defaultTab])==null?void 0:a.id)!=null?s:null);function i(u){r.value=n.tabs[u].id,e("tab-change",u)}const o=b.computed(()=>n.tabs.find(u=>u.id===r.value));return(u,l)=>(b.openBlock(),b.createElementBlock("div",Vue,[t.tabs.length>1?(b.openBlock(),b.createElementBlock("div",que,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.tabs,(f,c)=>(b.openBlock(),b.createBlock(Fue,{key:f.id,tab:f,active:f.id===r.value,onClick:()=>i(c)},null,8,["tab","active","onClick"]))),128))])):b.createCommentVNode("",!0),b.unref(o)?(b.openBlock(),b.createElementBlock("div",Hue,[b.unref(o)?(b.openBlock(),b.createBlock(b.resolveDynamicComponent(b.unref(o).component),{key:0,onClose:l[0]||(l[0]=f=>u.$emit("close"))},null,32)):b.createCommentVNode("",!0)])):(b.openBlock(),b.createElementBlock("div",Uue,Wue))]))}}),mpe="",Jue={class:"menu-container"},Gue=["onClick","id"],Que={class:"title"},Yue=b.defineComponent({__name:"menu-buttons",setup(t){const e=jo(),n=b.ref(null);b.onMounted(()=>{n.value=$o.on("keydown",f=>{f.key==="Escape"&&jo().toggleMenu()}),Fn.callHook("onGameMounted")}),b.onUnmounted(()=>{$o.off("keydown",n.value),Fn.callHook("onGameUnmounted")});function r(f){jo().activeMenu=f}const i=b.computed(()=>e.menus),o=b.computed(()=>e.menu),a=b.computed(()=>{var f,c;return((c=(f=o.value)==null?void 0:f.tabs)!=null?c:[]).filter(d=>d.condition?d.condition():!0).map(d=>({id:d.id,label:d.text,component:d.component}))});function s(){e.closeMenu()}function u(f){e.setActiveTab(f)}function l(){return s()}return(f,c)=>(b.openBlock(),b.createElementBlock("div",Jue,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),(d,h)=>{var p;return b.openBlock(),b.createElementBlock("button",{key:d.id,onClick:m=>r(d.id),id:(p=d.cssId)!=null?p:`${h}-menu-button`,class:"button menu-toggle-button"},b.toDisplayString(d.label),9,Gue)}),128)),b.unref(o)?(b.openBlock(),b.createBlock(b.Teleport,{key:0,to:"#app-container"},[b.createVNode(Ws,{containerCssClass:{[b.unref(o).cssClass]:!0,"menu-modal":!0},onClose:s},{header:b.withCtx(()=>{var d,h;return[b.createElementVNode("h3",Que,b.toDisplayString((h=(d=b.unref(e).tab)==null?void 0:d.text)!=null?h:b.unref(o).label),1)]}),body:b.withCtx(()=>[b.createVNode(Kue,{onTabChange:u,onClose:l,tabs:b.unref(a),defaultTab:b.unref(o).activeTab},null,8,["tabs","defaultTab"])]),_:1},8,["containerCssClass"])])):b.createCommentVNode("",!0)]))}}),vpe="",Xue=["id"],Zue=["innerHTML"],ele=b.defineComponent({__name:"screen-object",props:{screenObject:null,transitioning:{type:Boolean}},setup(t){const e=t;function n(o){e.transitioning||e.screenObject.onClick&&io().clickObject(o)}const r=b.computed(()=>{const o={};return e.screenObject.onClick?o.interactable=!0:o.disabled=!0,e.screenObject.cssClass&&(o[e.screenObject.cssClass]=!0),o}),i=b.computed(()=>{const o={};e.screenObject.opacity!==1&&(o.opacity=e.screenObject.opacity);let a=e.screenObject.x,s=e.screenObject.y,u=e.screenObject.width,l=e.screenObject.height;if(e.screenObject.anchor){const c=e.screenObject.anchor;a=e.screenObject.x-u*c.x,s=e.screenObject.y-l*c.y,o.transformOrigin=`${c.x*100}% ${c.y*100}%`}e.screenObject.scale&&(u=u*e.screenObject.scale,l=l*e.screenObject.scale);const f={...o,left:`${a}px`,top:`${s}px`,width:`${u}px`,height:`${l}px`};return Gne(e.screenObject)&&(f.backgroundImage=`url(${td(e.screenObject.image)})`),f});return(o,a)=>{const s=b.resolveComponent("ScreenObject",!0);return b.openBlock(),b.createElementBlock("div",{tabindex:"-1",class:b.normalizeClass(["viewport-object",b.unref(r)]),id:`viewport-object-${e.screenObject.id}`,onClick:a[0]||(a[0]=u=>n(t.screenObject)),style:b.normalizeStyle(b.unref(i))},[b.createElementVNode("span",{innerHTML:e.screenObject.text?b.unref(es)(e.screenObject.text):void 0},null,8,Zue),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(e.screenObject.children,u=>(b.openBlock(),b.createBlock(s,{transitioning:t.transitioning,key:u.id,screenObject:u},null,8,["transitioning","screenObject"]))),128))],14,Xue)}}}),gpe="",tle=["id"],nle=["id","onClick","innerHTML"],Nk=b.defineComponent({__name:"screen-layer",props:{layer:String,transitioning:{type:Boolean,default:!1}},setup(t){const e=t,n=wn(),r=Gt(),i=Uo(),o=io(),a=b.computed(()=>gt().layout.backgrounds.width),s=b.computed(()=>gt().layout.backgrounds.height),u=b.computed(()=>e.layer),l=b.computed(()=>i.buttons),f=b.computed(()=>{const _=zm().screens[u.value];return _||(console.log(u),Kt(`Screen ${u.value} doesn't have a config`)),_}),c=b.computed(()=>r.isInGame),d=b.computed(()=>f.value.buttons||[]);function h(_){const C=Hs(_).background;if(!!C)return td(C)}function p(_){const S=Hs(_),C=l.value[_],A=S.tag||"default",$=C.state;return $===!0&&Nr().isInteractionTagBlocked(A)?"greyed":$}function m(_){const S=p(_);return S==="hidden"||S==="greyed"||S===!1}function g(_){const S=p(_),C={};S===!0?C.interactable=!0:(C.disabled=!0,S==="greyed"?C.greyed=!0:(S==="hidden"||S===!1)&&(C.hidden=!0));const A=Hs(_);return A.cssClass&&(C[A.cssClass]=!0),C}function v(_){const S=Hs(_),C={};p(_),S.position.width&&(C.width=`${S.position.width}px`),S.position.height&&(C.height=`${S.position.height}px`),S.background&&(C.backgroundImage=`url(${h(_)})`);let A=S.position.left,$=S.position.top;return S.anchor&&(A=S.position.left-S.position.width*S.anchor.x,$=S.position.top-S.position.height*S.anchor.y),{...C,left:`${A}px`,top:`${$}px`}}function y(_){if(m(_)||e.transitioning)return;const S=Hs(_);if(!yL(S))return!1;if(l.value[_].state===!0){Eu("onButtonClicked");const A=S.action;if(!A)return;S.actionType==="run"?n.runLabelFunction(A):n.jumpToLabel(A)}}function k(_){var A;const C=(A=Hs(_).text)!=null?A:"";return es(C)}const w=b.computed(()=>({backgroundImage:`url(${td(f.value.background)})`,width:`${a.value}px`,height:`${s.value}px`}));return(_,S)=>b.unref(c)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"viewport-layer",id:`viewport-layer-${b.unref(u)}`,style:b.normalizeStyle(b.unref(w))},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(d),(C,A)=>(b.openBlock(),b.createElementBlock("div",{key:A,tabindex:"-1",class:b.normalizeClass(["viewport-button",g(C)]),id:`viewport-button-${C}`,onClick:$=>y(C),style:b.normalizeStyle(v(C)),innerHTML:k(C)},null,14,nle))),128)),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(o).tree,C=>(b.openBlock(),b.createBlock(ele,{key:C.id,screenObject:C,transitioning:t.transitioning},null,8,["screenObject","transitioning"]))),128))],12,tle)):b.createCommentVNode("",!0)}}),ype="",rle=b.defineComponent({__name:"NarratTransition",props:{name:{type:String,required:!0},duration:{type:Number,required:!0},delay:Number},emits:["complete"],setup(t,{emit:e}){const n=t,r=b.useSlots(),i=b.ref("start"),o=b.reactive({oldSlotClasses:{},oldSlotStyle:{},newSlotClasses:{},newSlotStyle:{}});return b.computed(()=>r.oldElement&&r.oldElement.length>0),b.computed(()=>r.newElement&&r.newElement.length>0),b.onMounted(async()=>{var s;const a=`narrat-transition-${n.name}`;o.newSlotClasses={[`${a}-enter-from`]:!0,[`${a}-enter-active`]:!0},o.oldSlotStyle={transitionDuration:`${n.duration/1e3}s`},o.newSlotStyle={transitionDuration:`${n.duration/1e3}s`},o.oldSlotClasses={[`${a}-leave-active`]:!0},await _o(30),o.oldSlotClasses[`${a}-leave-to`]=!0,await _o((s=n.delay)!=null?s:0),delete o.newSlotClasses[`${a}-enter-from`],await _o(n.duration),delete o.newSlotClasses[`${a}-enter-active`],delete o.oldSlotClasses[`${a}-leave-active`],i.value="end",e("complete")}),(a,s)=>(b.openBlock(),b.createElementBlock(b.Fragment,null,[i.value!=="end"?(b.openBlock(),b.createElementBlock("div",{key:0,class:b.normalizeClass(["transition-holder",o.oldSlotClasses]),style:b.normalizeStyle(o.oldSlotStyle)},[b.renderSlot(a.$slots,"oldElement")],6)):b.createCommentVNode("",!0),b.createElementVNode("div",{class:b.normalizeClass(["transition-holder",o.newSlotClasses]),style:b.normalizeStyle(o.newSlotStyle)},[b.renderSlot(a.$slots,"newElement")],6)],64))}}),bpe="",ile=b.defineComponent({__name:"screens",setup(t){const e=ao(),n=Gt(),r=Uo(),i=b.computed(()=>r.nonEmptyLayers),o=b.computed(()=>e.layoutMode),a=b.computed(()=>gt().layout.backgrounds.width),s=b.computed(()=>gt().layout.backgrounds.height),u=b.computed(()=>n.isInGame);function l(c){r.finishTransition(c)}const f=b.computed(()=>{const c=a.value,d=s.value;return o.value,{height:`${d}px`,width:`${c}px`}});return(c,d)=>b.unref(u)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"viewport",id:"narrat-viewport",style:b.normalizeStyle(b.unref(f))},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),(h,p)=>(b.openBlock(),b.createElementBlock("div",{key:p,class:"layer-container"},[h.transition?(b.openBlock(),b.createBlock(rle,{key:0,name:h.transition.transition,duration:h.transition.duration,delay:h.transition.delay,onComplete:()=>l(p)},{oldElement:b.withCtx(()=>[h.transition.oldScreen?(b.openBlock(),b.createBlock(Nk,{key:0,layer:h.transition.oldScreen,transitioning:!0},null,8,["layer"])):b.createCommentVNode("",!0)]),newElement:b.withCtx(()=>[h.screen?(b.openBlock(),b.createBlock(Nk,{key:0,layer:h.screen,transitioning:!0},null,8,["layer"])):b.createCommentVNode("",!0)]),_:2},1032,["name","duration","delay","onComplete"])):h.screen?(b.openBlock(),b.createBlock(Nk,{key:1,layer:h.screen},null,8,["layer"])):b.createCommentVNode("",!0)]))),128))],4)):b.createCommentVNode("",!0)}}),kpe="",ole=b.defineComponent({data(){return{}},methods:{getStatImage(t){return Ma(this.statsConfig[t].icon)}},computed:{...Za($a,["hudStats"]),...Za(ao,["layoutMode"]),statsConfig(){return gt().hudStats},stats(){return this.hudStats},hudStyle(){var e;let t="0";return this.layoutMode==="horizontal"&&(t=`${Vm()+((e=gt().dialogPanel.rightOffset)!=null?e:Mu.dialogPanel.rightOffset)}px`),{right:t}}}}),wpe="",ale=["src"],sle={class:"bold hud-text"},ule=b.createTextVNode(": ");function lle(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",{class:"hud",style:b.normalizeStyle(t.hudStyle)},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.stats,(a,s)=>(b.openBlock(),b.createElementBlock("div",{key:s,class:"hud-stat"},[b.createElementVNode("img",{class:"hud-icon",src:t.getStatImage(s)},null,8,ale),b.createElementVNode("span",sle,b.toDisplayString(t.statsConfig[s].name),1),ule,b.createElementVNode("span",null,b.toDisplayString(Math.floor(a.value*100)/100),1)]))),128))],4)}const cle=Hi(ole,[["render",lle]]),fle={key:0,class:"auto-play-feedback-container"},dle=b.defineComponent({__name:"AutoPlayFeedback",setup(t){const e=zn(),n=b.computed(()=>e.playMode==="auto"),r=b.computed(()=>e.playMode==="skip"),i=b.computed(()=>n.value?"auto-play-feedback-auto":r.value?"auto-play-feedback-skip":{}),o=b.computed(()=>n.value?"Auto Play":r.value?"Skip":"");return(a,s)=>b.unref(o)?(b.openBlock(),b.createElementBlock("div",fle,[b.createElementVNode("div",{class:b.normalizeClass(["auto-play-feedback",b.unref(i)])},b.toDisplayString(b.unref(o)),3)])):b.createCommentVNode("",!0)}}),_pe="",hle=b.defineComponent({__name:"in-game",setup(t){const e=Gt(),n=ao(),r=b.computed(()=>n.layoutMode),i=b.computed(()=>e.saving),o=b.ref(null),a=zn(),s=b.ref(null),u=b.computed(()=>i.value&&!i.value.withPrompt||i.value&&o.value),l=b.computed(()=>{let h="row";return r.value==="vertical"&&(h="column"),{flexDirection:h}});function f(h){if(o.value=null,h===null){Gt().finishManualSave(h,!1);return}Gt().finishManualSave(h,!0)}function c(){o.value=!0}function d(){o.value=!1,e.finishManualSave(null,!1),o.value=null}return b.onMounted(()=>{s.value=$o.on("debouncedKeydown",h=>{Gt().debugMode||((h.key==="a"||h.key==="A")&&a.toggleAutoPlay(),(h.key==="s"||h.key==="S")&&a.toggleSkip())})}),b.onUnmounted(()=>{s.value&&$o.off("debouncedKeydown",s.value)}),(h,p)=>(b.openBlock(),b.createElementBlock("div",{class:"game",style:b.normalizeStyle(b.unref(l))},[b.createVNode(cle),b.createVNode(Yue,{class:"menu-toggle"}),b.createVNode(ile),b.createVNode(Due,{inGame:!0,layoutMode:b.unref(r)},null,8,["layoutMode"]),b.unref(u)?(b.openBlock(),b.createBlock(iR,{key:0,mode:"pick",onChosen:f,onClose:p[0]||(p[0]=()=>f(null))})):b.createCommentVNode("",!0),b.createVNode(dle),b.unref(i)&&b.unref(i).withPrompt&&o.value===null?(b.openBlock(),b.createBlock(Hm,{key:1,prompt:"Would you like to save the game?",onConfirm:c,onRefuse:d})):b.createCommentVNode("",!0)],4))}}),xpe="",ple=b.defineComponent({props:{percentage:Number,step:String},methods:{loadingStyle(){return{width:`${this.percentage*60}vw`}}},computed:{}}),jpe="",mle={id:"loading-bar"},vle={id:"loading-text"};function gle(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",mle,[b.createElementVNode("div",{id:"inner-loading-bar",style:b.normalizeStyle(t.loadingStyle())},null,4),b.createElementVNode("div",vle,[b.createElementVNode("h3",null,"Loading "+b.toDisplayString(Math.floor(t.percentage*100))+"% - "+b.toDisplayString(t.step),1)])])}const yle=Hi(ple,[["render",gle]]),ble="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IlJhdCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDU5NS4zIDU5NS4zIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OTUuMyA1OTUuMzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNFMjNCMzM7fQo8L3N0eWxlPgo8cGF0aCBpZD0iUmF0X1NoYXBlIiBjbGFzcz0ic3QwIiBkPSJNNTU2LjksODIuNWMtMTAuOC0yNC4zLTQ3LTU3LjEtNzEuMy02NS42Yy0yNC4zLTguNC02NC4xLTAuMy04OC43LDIyLjMKCWMtMjAsMTguNC0yNiwyOC4yLTI5LjEsMzdjLTIuMSw1LjktNC44LDEzLjUtNiwyMC45djBjLTAuNSw0LjEtNC41LDctOC42LDYuMWMtMTAuNC0yLjMtMjkuNS02LTQ0LjQtNi4zCgljLTEzLjctMC4yLTMwLjEsMy4yLTQwLjQsNS43Yy00LjUsMS4xLTguOC0yLjItOC44LTYuOGMtMC4xLTUuMy0xLjEtMTIuMy00LjgtMTkuNmMtOC41LTE2LjktMTkuNi0zMi42LTU3LjgtNDcuNAoJYy0zMS45LTEyLjQtNzUuMS05LjctMTAwLjgsMS44Yy0yOC4xLDEyLjYtNDIuNCwzNy45LTU0LDYxLjhjLTE0LjQsMjkuOC0xNC45LDgzLjYtNi40LDEwNGMxMi44LDMwLjcsMzUuOCw0Ny4yLDUyLjYsNTMKCWMxMS4zLDMuOCwyOC4yLDMuNywzOC4yLDMuM2M0LjItMC4yLDcuNywzLjMsNy41LDcuNWMtMC43LDEzLjYtMC45LDQxLjUsNyw2MS40YzcuNywxOS40LDI5LjcsNjIuMyw1MC43LDEwMS4yCgljMCwwLjEtMTQuNiwyLjktMzEuNCw2LjhjLTIzLjksNS41LTUyLjYsMTIuNy01NC4zLDEzLjdjLTMuNSwyLjEtMywxMC0yLjcsMTJjMC41LDMuNCw1LjMsOC4xLDYuOSw4LjNjMy45LDAuMywzMS4zLTcuNiw1NS43LTE0LjYKCWMxOC41LTUuMywzNC45LTkuMywzNS41LTguMmM1LjEsOS4zLDEwLDE4LDE0LjQsMjUuOGM1LjIsOS4xLDEwLjcsMTYuNCwxNC4xLDIzLjZjMS4xLDIuMy0xNi42LDUuOC0zMi41LDE0LjcKCWMtMTYuNCw5LjEtMjkuNywyMS0zMi4zLDI0Yy0xLjgsMi4xLTMsNi0xLjIsMTAuN2MxLjEsMi45LDEwLDUuNywxMi40LDUuMWM2LjgtMS43LDE2LjUtMTIuNSwzMy4xLTIxLjEKCWMxNi4zLTguNSwzMi45LTE0LjksMzMuOC0xMy42YzkuNywxNC4zLDE2LjksMjEuNiwyMi42LDMxLjJjOS44LDE2LjUsMjcuMyw0NS45LDQ2LjYsMzkuNWM2LjQtMi4xLDMxLjEtMzMuNiw1My4zLTY4LjYKCWMxLjMtMi4xLDE2LjEsMTEuMywzMC40LDIzLjJjMTMuOCwxMS40LDIyLjcsMjAuNiwyNy4xLDIxLjRjNS40LDEsMTQuMi03LjcsMTQuMS0xNC43Yy0wLjEtMi43LTE0LjMtMTMuOC0yOS4xLTI2LjIKCWMtMTQuNS0xMi4xLTMwLjEtMjIuOC0yOS4yLTI0LjNjNy42LTEyLDE0LjUtMjMuNywyMC4xLTMzLjljNC4zLTcuOCw4LjktMTYsMTMtMjQuN2MwLjYtMS4yLDE1LjksMywzMS40LDcuMWMxNS4zLDQsMjYuNywxMCwzMSw4CgljNi45LTMsMTEuNi0xMy44LDkuNC0xOC4zYy0xLjEtMi4zLTE3LTcuMy0zMy4yLTEyYy0xNC4yLTQuMS0yOC02LjUtMjcuNy03LjNjMTUuNS0zNCwyOC44LTY0LjgsMjcuNi02OS42CgljLTEuNy03LjEsMi42LTExLjksNy0zNi41YzMuMi0xOC4xLDQuNy00MC45LDUuMi01MS43YzAuMi0zLjUsMi44LTYuMyw2LjMtNi43YzMuMS0wLjMsNi45LTAuOSwxMC41LTEuOWM3LjgtMiwxOC42LTcuOCwzNi40LTIwLjYKCWMxNy45LTEyLjgsMzguNy00OS42LDQ0LjQtNjcuOFM1NjcuNiwxMDYuOCw1NTYuOSw4Mi41eiBNMjY1LjEsMzM2LjJjLTguMSw0LTEzLDctMjYuNCw5LjZjLTYuOSwxLjQtMjkuNC0wLjItNDAuNy00LjYKCWMtMTAuNS00LjEtMTkuOS03LjYtMzAtMTUuNHMtMTUuNy0xMy4yLTE1LjctMTUuM2MwLTQuNCw2LTkuNCwxMS05LjRjNS4xLDAsMTQuNSw5LjIsMjkuNywxNi42YzE0LjMsNywxNy45LDYuMSwyNS40LDcuMwoJYzIuOSwwLjUsNy43LDAuNiwxMC43LDAuNGMxNC4xLTEuMywyMS40LTUuOSwyNS4zLTguOGM0LTMsMTMuNy0xMi45LDE3LjItMTIuNWM4LDEsMTguOSwzLjQsMTguOSw3LjEKCUMyOTAuNCwzMTksMjczLjIsMzMyLjEsMjY1LjEsMzM2LjJ6IE0zMjAuOSw1MjEuNGMtNC4zLDMuNy0xNy43LDEzLjUtMjMuMywxMy41Yy0yLjgsMC03LjQtOC4yLTExLjUtMTYuOAoJYy00LjEtOC41LTkuMS0yMS4xLTkuMS0zMS42YzAtNC42LDYtNy40LDEzLjQtOS4yYzcuMi0xLjcsMjcuMy0xLjgsMjkuOS0xLjFjNi44LDEuNywxMi45LDIuMiwxMi43LDYuNGMtMC40LDEyLjctNywxOC45LTguMywyNC4zCglDMzIzLjQsNTEyLjMsMzIzLjQsNTE5LjIsMzIwLjksNTIxLjR6IE00MzEuMSwzMjAuM2MtOS4yLDcuNC0xMC42LDguMS0yNC45LDEzLjdjLTExLjMsNC40LTI4LjYsNS44LTQxLjYsMy42CgljLTEyLjItMi4xLTIyLjMtNC42LTI5LjUtMTAuMWMtOS43LTcuMy0xNi40LTE1LjEtMTYuNC0xOS44YzAtMy43LDYuNC00LjMsMTQuNS00LjljMy41LTAuMyw5LjMsNS45LDEzLjIsOS4yCgljOC4xLDYuOCwxNC44LDgsMjguOCw5LjljMi45LDAuNCw3LjgsMC40LDEwLjcsMC4xYzcuNS0wLjksMTItMC40LDI1LjgtOC4yYzIwLTExLjIsMTcuOC0xNC40LDI1LjEtMTIuNmMyLjIsMC42LDUuOCwxLjIsNS42LDUuNgoJQzQ0Mi40LDMwOSw0NDAuNSwzMTIuNyw0MzEuMSwzMjAuM3oiLz4KPC9zdmc+Cg==",kle={id:"engine-splash-screen",class:"flex justify-center items-center"},wle={id:"engine-splash-title"},_le=["src"],xle=b.defineComponent({__name:"engine-splash",emits:["finished"],setup(t,{emit:e}){const n=b.ref("hidden"),r=b.computed(()=>({transitionDuration:`${l.value}s`})),i=b.computed(()=>({invisible:n.value!=="appear"})),o=Gt(),a=b.computed(()=>{var d,h;return(h=(d=gt().splashScreens)==null?void 0:d.engineSplashScreen)!=null?h:{}}),s=b.computed(()=>typeof a.value.overrideText=="string"?a.value.overrideText:"Made with narrat engine"),u=b.computed(()=>{var d;return(d=a.value.overrideLogo)!=null?d:ble}),l=b.computed(()=>typeof a.value.fadeDuration=="number"?a.value.fadeDuration:2),f=b.computed(()=>typeof a.value.timeBeforeFadeout=="number"?a.value.timeBeforeFadeout:3);b.onMounted(async()=>{if(await _o(10),n.value="appear",a.value.skip||o.options.debug){c();return}await _o(l.value*1e3),await _o(f.value*1e3),n.value="disappear",await _o(l.value*1e3),c()});function c(){o.loading.loaded?e("finished"):o.listener.once("gameLoaded",()=>{e("finished")})}return(d,h)=>(b.openBlock(),b.createElementBlock("div",kle,[b.createElementVNode("div",{id:"engine-splash-header",class:b.normalizeClass(["flex justify-center flex-col items-center",b.unref(i)]),style:b.normalizeStyle(b.unref(r))},[b.createElementVNode("h1",wle,b.toDisplayString(b.unref(s)),1),b.createElementVNode("img",{src:b.unref(u),alt:"Narrat Logo",id:"engine-splash-logo"},null,8,_le),b.createVNode(yle,{percentage:b.unref(o).loading.percentage,step:b.unref(o).loading.step},null,8,["percentage","step"])],6)]))}}),Spe="",jle={id:"game-splash-screen",style:{height:"100%",padding:"20px"},class:"flex justify-center items-center"},Sle={id:"game-splash-screen-header flex justify-center flex-col items-center",class:"flex justify-center flex-col items-center"},Cle={class:"title",id:"game-splash-title"},$le=b.defineComponent({__name:"game-splash",setup(t){const e=Gt(),n=b.computed(()=>{var s,u;return(u=(s=gt().splashScreens)==null?void 0:s.gameSplashScreen)!=null?u:{}}),r=b.computed(()=>typeof n.value.startButtonText=="string"?n.value.startButtonText:"Press to start"),i=b.computed(()=>e.loading.loaded),o=b.computed(()=>gt().gameTitle||"Narrat Game");function a(){e.flowState="menu"}return b.onMounted(()=>{e.options.debug&&a()}),(s,u)=>(b.openBlock(),b.createElementBlock("div",jle,[b.createElementVNode("div",Sle,[b.createElementVNode("h1",Cle,b.toDisplayString(b.unref(o)),1),b.unref(i)?(b.openBlock(),b.createElementBlock("button",{key:0,class:"button menu-button main-menu-button large splash-start-button override",onClick:a},b.toDisplayString(b.unref(r)),1)):b.createCommentVNode("",!0)])]))}}),Cpe="",Ole={key:0,class:"floating-tooltip-title"},Ele=b.createElementVNode("hr",null,null,-1),Tle={class:"floating-tooltip-text"},Ale=b.defineComponent({__name:"floating-tooltip",props:{title:null,text:null,width:null,x:null,y:null},setup(t){const e=t,n=b.ref(150),r=b.ref(null),i=b.computed(()=>{const o={};let a=e.x-e.width/2;a=Math.min(a,window.innerWidth-e.width-5),a=Math.max(5,a),o.left=`${a}px`;let s=window.innerHeight-e.y;return s=Math.max(s,5),s=Math.min(s,window.innerHeight-n.value-5),o.bottom=`${s}px`,o.width=`${e.width}px`,o});return b.onMounted(()=>{r.value&&(n.value=r.value.clientHeight)}),(o,a)=>(b.openBlock(),b.createBlock(b.Transition,{name:"fade"},{default:b.withCtx(()=>[b.createElementVNode("div",{class:"floating-tooltip",style:b.normalizeStyle(b.unref(i)),ref_key:"element",ref:r},[t.title?(b.openBlock(),b.createElementBlock("div",Ole,[b.createTextVNode(b.toDisplayString(e.title)+" ",1),Ele])):b.createCommentVNode("",!0),b.createElementVNode("div",Tle,b.toDisplayString(e.text),1)],4)]),_:1}))}}),$pe="",Mle={class:"tooltips-ui"},Ple=b.defineComponent({__name:"tooltips-ui",setup(t){const e=b.computed(()=>lm().tooltip);return b.computed(()=>ed().options.width),(n,r)=>(b.openBlock(),b.createElementBlock("div",Mle,[b.unref(e)?(b.openBlock(),b.createBlock(Ale,b.normalizeProps(b.mergeProps({key:0},b.unref(e))),null,16)):b.createCommentVNode("",!0)]))}}),Nle=b.defineComponent({setup(){const t=zn(),e=wn(),n=Gt();return{dialog:b.computed(()=>t.dialog),stack:b.computed(()=>e.stack),flowState:b.computed(()=>n.flowState),alerts:b.computed(()=>n.alerts)}},$refs:{dialogContainer:HTMLInputElement},inject:["mq"],components:{DebugMenu:Ise,NotificationToast:Bse,StartMenu:vue,AlertModal:yue,InGame:hle,EngineSplash:xle,GameSplash:$le,TooltipsUi:Ple},data(){return{lineTitle:"title",lineText:"hello"}},props:{options:Object},async mounted(){Fn.callHook("onAppMounted"),await Gt().engineLoading(),window.addEventListener("resize",rR(()=>{this.updateScreenSize()},100,{maxWait:200})),$o.setup(this.options.debug),setTimeout(()=>{this.updateScreenSize()},50)},computed:{...Za(ao,["screenWidth","screenHeight","layoutMode","gameWidth","gameHeight","gameScaleRatio","actualGameHeight"]),...Za(wn,["currentLine"]),appStyle(){return{transform:`scale(${this.gameScaleRatio}, ${this.gameScaleRatio})`,width:`${this.gameWidth}px`,height:`${this.actualGameHeight}px`}},appClass(){return jo().activeMenu?"app-blurred-by-modal":{}}},methods:{closeAlert(t){Gt().closeAlert(t)},engineSplashDone(){Gt().flowState="game-splash"},updateScreenSize(){ao().updateScreenSize(window.innerWidth,window.innerHeight)}}}),Ope="";function Ile(t,e,n,r,i,o){const a=b.resolveComponent("EngineSplash"),s=b.resolveComponent("GameSplash"),u=b.resolveComponent("StartMenu"),l=b.resolveComponent("InGame"),f=b.resolveComponent("DebugMenu"),c=b.resolveComponent("NotificationToast"),d=b.resolveComponent("AlertModal"),h=b.resolveComponent("TooltipsUi");return b.openBlock(),b.createElementBlock(b.Fragment,null,[b.createElementVNode("div",{id:"app-container",style:b.normalizeStyle(t.appStyle)},[b.createElementVNode("div",{id:"app",class:b.normalizeClass(t.appClass)},[t.flowState==="engine-splash"?(b.openBlock(),b.createBlock(a,{key:0,onFinished:t.engineSplashDone},null,8,["onFinished"])):(b.openBlock(),b.createBlock(b.Transition,{key:1,name:"screens-fade"},{default:b.withCtx(()=>[t.flowState==="game-splash"?(b.openBlock(),b.createBlock(s,{key:"1"})):t.flowState==="menu"?(b.openBlock(),b.createBlock(u,{key:"2"})):t.flowState==="playing"?(b.openBlock(),b.createBlock(l,{key:"3"})):b.createCommentVNode("",!0)]),_:1})),t.options.debug?(b.openBlock(),b.createBlock(f,{key:2})):b.createCommentVNode("",!0),b.createVNode(c),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.alerts,p=>(b.openBlock(),b.createBlock(d,{key:p.id,title:p.title,text:p.text,onClose:()=>t.closeAlert(p.id)},null,8,["title","text","onClose"]))),128))],2)],4),b.createVNode(h)],64)}const Lle=Hi(Nle,[["render",Ile]]);function qt(t,e){console.error("Runtime error ========================="),console.error(`Command: ${t.commandType}`),console.error("Args: ",t.args),console.error("Options: ",t.options),Kt(`Runtime error at ${t.fileName}:${t.line} (${t.commandType}) ${t.code}. -
224
224
  <br />
225
- Error: ${e}`),console.error("============================")}function Lle(t,...e){console.log(`[${t.fileName}:${t.line}] log: `,...e)}class Ge{constructor(e,n,r,i){ei(this,"keyword");ei(this,"runner");ei(this,"argTypes");ei(this,"parser");ei(this,"onPlayerAnswered");ei(this,"returnAfterPlayerAnswer");this.keyword=e,this.runner=r,this.argTypes=n,i?this.parser=i:this.parser=nd(this.keyword,this.argTypes),this.returnAfterPlayerAnswer=!1}async run(e,n){let r=await this.runner(e,n);return this.returnAfterPlayerAnswer&&(r=await new Promise((i,o)=>{wn().waitForPlayerAnswer(e),e.finishCommand=i})),r}async processPlayerAnswer(e,n){let r=n;return this.onPlayerAnswered&&(r=await this.onPlayerAnswered(e,n)),this.returnAfterPlayerAnswer&&e.finishCommand&&e.finishCommand(r),r}static FromOptions(e){var r;const n=new Ge(e.keyword,e.argTypes,e.runner,e.parser);return n.onPlayerAnswered=e.onPlayerAnswered,n.returnAfterPlayerAnswer=(r=e.returnAfterPlayerAnswer)!=null?r:!1,n}}function nd(t,e){let n=[];if(e!=="any"){n=[];const r=e.reduce((i,o)=>(o.optional&&i++,o.type==="rest"&&(i=1/0),i),0);r>=1?n.push(e.length-r):n.push(e.length),n.push(e.length)}return(r,i)=>{const o={newLine:r.currentLine+1},a=i.command.args;return e!=="any"&&(a.length<n[0]||a.length>n[1])?(console.log("Error details"),console.log(i.command),console.log(a),r.parserContext.error(r.line.line,`Command ${t}: Expected ${n.join(" to ")} arguments but got ${a.length}`),o):(i.command.commandType=t,e!=="any"&&i.command.args.forEach((s,u)=>{const l=e[u];!a7(s)&&!s7(s)&&(l.type==="any"||l.type==="rest"||typeof s===l.type||r.parserContext.error(r.line.line,`Command ${t}: Argument #${u+1} (${l.name}) should be a ${l.type}, but got type ${typeof s}: ${JSON.stringify(s)}`))}),{newLine:r.currentLine+1})}}const Dle=new Ge("add_level",[{name:"skillKey",type:"string"},{name:"amount",type:"number"}],async t=>{let{skillKey:e,amount:n}=t.options;if((!e||!n)&&qt(t,"add_level command needs a skill id and a value as parameters"),!Number.isInteger(n)){const r=n;n=Math.round(n),console.warn(`add_level expects a level to be an integer. Auto Rounding ${r} to ${n}`)}Er().incrementSkill(e,n)}),Rle=Ge.FromOptions({keyword:"set_level",argTypes:[{name:"skill",type:"string"},{name:"level",type:"number"}],runner:async t=>{let{skill:e,level:n}=t.options;if((!e||!n)&&qt(t,"set_level command needs a skill id and a value as parameters"),!Number.isInteger(n)){const r=n;n=Math.round(n),console.warn(`set_level expects a level to be an integer. Auto Rounding ${r} to ${n}`)}Er().setSkillLevel(e,n)}}),Ble=new Ge("add_xp",[{name:"xpKey",type:"string"},{name:"xpToAdd",type:"number"}],async t=>{const{xpKey:e,xpToAdd:n}=t.options;(!e||!n)&&qt(t,"add_xp command needs a skill id and a value as parameters"),Er().addXp(e,n)}),zle=new Ge("get_level",[{name:"skillKey",type:"string"}],async t=>{const{skillKey:e}=t.options;e||qt(t,"get_level command needs a skill id as parameter");const n=Er().getSkill(e);return n||qt(t,`Skill ${e} not found`),n.level}),Fle=new Ge("get_xp",[{name:"xpKey",type:"string"}],async t=>{const{xpKey:e}=t.options;e||qt(t,"get_xp command needs a skill id as parameter");const n=Er().getSkillXp(e);return n||qt(t,`XP ${e} not found`),n}),Vle=new Ge("roll",[{name:"id",type:"string"},{name:"skill",type:"string"},{name:"value",type:"number"},{name:"mode",type:"string",optional:!0}],async t=>{const{id:e,skill:n,value:r,mode:i}=t.options;let o=!1,a=!1;return i==="hideAfterRoll"&&(o=!0),i==="repeatable"&&(a=!0),o7({id:e,skill:n,value:r,hideAfterRoll:o,repeatable:a}).succeeded}),qle=new Ge("reset_roll",[{name:"id",type:"string"}],async t=>Er().resetSkillCheck(t.options.id)),Hle=new Ge("add_stat",[{name:"statKey",type:"string"},{name:"amountToAdd",type:"number"}],async t=>{const{statKey:e,amountToAdd:n}=t.options;(!e||typeof n!="number")&&qt(t,"add_stat command needs a stat id and a value as parameters"),$a().addStat(e,n)}),Ule=new Ge("set_stat",[{name:"statKey",type:"string"},{name:"value",type:"number"}],async t=>{const{statKey:e,value:n}=t.options;(!e||typeof n!="number")&&qt(t,"set_stat command needs a stat id and a value as parameters"),$a().setStat(e,n)}),Wle=new Ge("get_stat_value",[{name:"statKey",type:"string"}],async t=>{const{statKey:e}=t.options;return e||qt(t,"get_stat_value command needs a stat id as parameter"),$a().getStatValue(e)}),Kle=Ge.FromOptions({keyword:"jump",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&qt(t,"requires a label argument");const e=t.args[0],n=wn(),r={branchData:n.script[e],label:e,args:t.args.splice(1),currentIndex:0};if(!n.script[e]){Kt(`Trying to jump but label ${e} not found`);return}return n.jumpTarget=r,am}}),Jle=Ge.FromOptions({keyword:"run",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&qt(t,"run command needs a label to argument run");const e=t.args[0];return await wn().runLabelFunction(e,...t.args.slice(1))}}),Gle=Ge.FromOptions({keyword:"var",argTypes:[{name:"name",type:"string"},{name:"value",type:"any"}],runner:async t=>{const{name:e,value:n}=t.options;wn().addScopedVariable(e,n)}}),Qle=Ge.FromOptions({keyword:"return",argTypes:[{name:"value",type:"any"}],runner:async t=>{const{value:e}=t.options;return wn().setReturnValue(e),ab}}),Yle=Ge.FromOptions({keyword:"log",argTypes:"any",runner:async t=>{Lle(t,...t.args)}}),Xle=Ge.FromOptions({keyword:"menu_return",argTypes:[],runner:async t=>(Gt().menuReturn(),sm)}),Zle=Ge.FromOptions({keyword:"save",argTypes:[{name:"name",type:"string",optional:!0}],runner:async t=>{await Gt().manualSave({saveName:t.options.name})}}),ece=Ge.FromOptions({keyword:"save_prompt",argTypes:[{name:"name",type:"string",optional:!0}],runner:async t=>{await Gt().manualSave({saveName:t.options.name,withPrompt:!0})}}),tce=Ge.FromOptions({keyword:"new",argTypes:[{name:"name",type:"string"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const e=t.options.name;if(e==="Array")return console.log(t.args),[...t.args.slice(1)];if(e==="Object")return{}}}),nce=[{name:"mode",type:"string"},{name:"audio",type:"string"},{name:"channel",type:"number",optional:!0}],rce=new Ge("play",nce,async t=>{const e=Gr(),{mode:n,audio:r,channel:i}=t.options,o=Ik(t,n);o&&e.playChannel(o,r,i!=null?i:0)}),ice=new Ge("pause",[{name:"mode",type:"string"},{name:"channel",type:"number",optional:!0}],async t=>{const e=Gr(),{mode:n,channel:r}=t.options,i=Ik(t,n);i&&e.pauseChannel(i,r!=null?r:0)}),oce=new Ge("stop",[{name:"mode",type:"string"},{name:"channel",type:"number",optional:!0}],async t=>{const e=Gr(),{mode:n,channel:r}=t.options,i=Ik(t,n);i&&e.stopChannel(i,r!=null?r:0)});function Ik(t,e){return ace(e)?e:(qt(t,`${e} is not a valid audio mode.`),!1)}function ace(t){return!!K8.includes(t)}const sce=new Ge("set",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=ic();eR(e,`$${t.options.key}`,t.options.value)}),uce=new Ge("add",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=ic();tR(e,`$${t.options.key}`,t.options.value)}),lce=new Ge("set_screen",[{name:"screen",type:"string"},{name:"layer",type:"number",optional:!0},{name:"transitionName",type:"string",optional:!0},{name:"transitionDuration",type:"number",optional:!0},{name:"transitionDelay",type:"number",optional:!0}],async t=>{var r;const e=Uo();if(!XD(t.options.screen)){qt(t,`Screen ${t.options.screen} doesn't exist in the config`);return}return t.options.transitionName?e.transitionScreen(t.options.screen,{transition:t.options.transitionName,duration:t.options.transitionDuration,delay:t.options.transitionDelay},t.options.layer):e.setScreen(t.options.screen,(r=t.options.layer)!=null?r:0)}),cce=new Ge("empty_layer",[{name:"layer",type:"number"},{name:"transitionName",type:"string",optional:!0},{name:"transitionDuration",type:"number",optional:!0},{name:"transitionDelay",type:"number",optional:!0}],async t=>{const e=Uo();return t.options.transitionName?e.emptyLayer(t.options.layer,{transition:t.options.transitionName,duration:t.options.transitionDuration,delay:t.options.transitionDelay}):e.emptyLayer(t.options.layer)}),fce=new Ge("set_button",[{name:"buttonId",type:"string"},{name:"state",type:"any"}],async t=>{const{buttonId:e,state:n}=t.options,r=Uo();if(!Hs(e)){qt(t,`Button ${e} doesn't exist in the config`);return}r.changeButton(e,n)}),dce=Ge.FromOptions({keyword:"talk",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await cb({speaker:t.options.speaker,pose:t.options.pose,cssClass:"talk-command",text:`"${t.options.text}"`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),hce=Ge.FromOptions({keyword:"think",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await cb({speaker:t.options.speaker,pose:t.options.pose,cssClass:"think-command",text:`${t.options.text}`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),pce=()=>{const t=nd("text",[]);return(e,n)=>{const r=t(e,n);return n.command.staticOptions={text:n.code.substring(1,n.code.length-1)},r}},mce=Ge.FromOptions({keyword:"text",argTypes:[],runner:async(t,e)=>{await cb({speaker:"game",cssClass:"text-command",text:t.staticOptions.text,choices:e,interactive:!0})},parser:pce(),returnAfterPlayerAnswer:!0}),vce=new Ge("add_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;Nr().add({id:e,amount:n})}),gce=new Ge("remove_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;Nr().remove({id:e,amount:n})}),yce=new Ge("has_item?",[{name:"id",type:"string"},{name:"amount",type:"number",optional:!0}],async t=>{const{id:e,amount:n}=t.options;return Nr().hasItem(e,n)}),bce=new Ge("item_amount?",[{name:"id",type:"string"}],async t=>{const{id:e}=t.options;return Nr().getItemAmount(e)}),kce=new Ge("enable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;Nr().enableInteraction(e)}),wce=new Ge("disable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;Nr().disableInteraction(e)}),_ce=new Ge("start_quest",[{name:"questId",type:"string"}],async t=>{const e=t.options.questId;di().startQuest(e)}),xce=new Ge("start_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;di().startObjective(e,n)}),jce=new Ge("complete_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;di().completeObjective(e,n)}),Sce=new Ge("complete_quest",[{name:"questId",type:"string"},{name:"ending",type:"string",optional:!0}],async t=>{const{questId:e,ending:n}=t.options;di().completeQuest(e,n)}),Cce=new Ge("quest_completed?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return di().isQuestCompleted(e)}),$ce=new Ge("objective_completed?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return di().isObjectiveCompleted(e,n)}),Oce=new Ge("quest_started?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return di().isQuestStarted(e)}),Ece=new Ge("objective_started?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return di().isObjectiveStarted(e,n)}),Tce=Ge.FromOptions({keyword:"wait",argTypes:[{name:"duration",type:"number"}],runner:async t=>{await _o(t.options.duration)}}),Ace=new Ge("notify",[{name:"text",type:"string"}],async t=>{const{text:e}=t.options;oo().addNotification(e)}),Mce=new Ge("disable_notifications",[],async t=>{oo().disableNotifications()}),Pce=new Ge("enable_notifications",[],async t=>{oo().enableNotifications()}),Nce=new Ge("clear_dialog",[],async t=>{zn().clearDialog()}),Ice=new Ge("if",[{name:"condition",type:"boolean"}],async t=>{const e=mee(t),n=wn();if(e){const r={branchData:{branch:e},currentIndex:0};return n.addAndRunBlock(r)}},(t,e)=>{let n=t.currentLine;nd("if",[{name:"condition",type:"string"}])(t,e);const{lines:i,currentLine:o,line:a}=t,s=e.command;let u;const l=vee(i,o+1);return l&&l.code==="else:"&&(u=t.processCommandsFunction(t.parserContext,l.branch,a),n++),s.staticOptions={success:t.processCommandsFunction(t.parserContext,a.branch,a),failure:u},n++,{newLine:n}}),Lce=new Ge("==","any",async t=>{t.args.length<2&&qt(t,"requires at least two arguments");let e=t.args[0],n=!0;for(const r of t.args)if(r!=e){n=!1;break}else e=r;return n}),Dce=new Ge(">",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>n}),Rce=new Ge("<",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<n}),Bce=new Ge(">=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>=n}),zce=new Ge("<=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<=n}),Fce=new Ge("!=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e!=n}),Vce=new Ge("!",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return!e}),qce=new Ge("&&","any",async t=>{const e=t.args;return t.args.length<2&&qt(t,"requires at least two arguments"),e.reduce((n,r)=>n&&r,!0)}),Hce=new Ge("||","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>e||n,!1))),Uce=new Ge("?",[{name:"a",type:"any"},{name:"b",type:"any"},{name:"c",type:"any"}],async t=>{const{a:e,b:n,c:r}=t.options;return e?n:r}),Wce=new Ge("+","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e+n:(qt(t,"requires all arguments to be numbers"),e),0))),Kce=new Ge("-","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.slice(1).reduce((e,n)=>typeof n=="number"?e-n:(qt(t,"requires all arguments to be numbers"),e),t.args[0]))),Jce=new Ge("neg",[{name:"a",type:"number"}],async t=>(t.args.length!==1&&qt(t,"requires one argument"),-t.options.a)),Gce=new Ge("abs",[{name:"a",type:"number"}],async t=>(t.args.length!==1&&qt(t,"requires one argument"),Math.abs(t.options.a))),Qce=new Ge("*","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e*n:(qt(t,"requires all arguments to be numbers"),e),1))),Yce=new Ge("/","any",async t=>{t.args.length<2&&qt(t,"requires at least two arguments");const e=t.args[0]/t.args[1];return t.args.slice(2).reduce((n,r)=>typeof r=="number"?n/r:(qt(t,"requires all arguments to be numbers"),n),e)}),Xce=async t=>{const{prompt:e,choices:n}=t.staticOptions,r=[];for(const[,a]of n.entries()){const s=await Ob(a.prompt);r.push(s)}t.options.choiceResults=r;const i=r.map((a,s)=>{var f,c;let u=!0;return a.skillCheck&&(u=(c=(f=a.skillCheck)==null?void 0:f.allowed)!=null?c:!1),{choice:a.text,originalIndex:s,allowed:u}}).filter(a=>a.choice),o=await kL(e,i);return await nfe(t,o)};function Zce(t,e){e.branch||t.parserContext.error(e.line,`Choice option doesn't have any branch to go to (${e.code} - ${e.line})`);let n,r;const i=e.branch;return e.expression[1]==="roll"?((!i[0].branch||!i[1].branch)&&t.parserContext.error(e.line,`Choice option with a skill roll needs success and failure branches (${e.code} - ${e.line})`),n={success:t.processCommandsFunction(t.parserContext,i[0].branch,e),failure:t.processCommandsFunction(t.parserContext,i[1].branch,e)}):r=t.processCommandsFunction(t.parserContext,i,e),{prompt:t.processCommandsFunction(t.parserContext,[e],e)[0],branch:r,skillBranches:n}}const efe=(t,e)=>{let n=t.currentLine;nd("choice",[]);const{line:r}=t,i=e.command;(!r.branch||r.branch.length<2)&&t.parserContext.error(r.line,"Choice menu needs to have at least one option");const o=r.branch[0];o||t.parserContext.error(t.line.line,"Choice prompt is missing ");const s=r.branch.slice(1).map((u,l)=>(u.branch||t.parserContext.error(u.line,`Choice option doesn't have any branch to go to (${u.code})`),u=rfe(t.parserContext,u),Zce(t,u)));return i.staticOptions={prompt:t.processCommandsFunction(t.parserContext,[o],r)[0],choices:s},n++,{newLine:n}},tfe=Ge.FromOptions({keyword:"choice",argTypes:[],runner:Xce,parser:efe}),nfe=async(t,e)=>{const n=e,r=wn(),{choices:i}=t.staticOptions,o=i[n],a=t.options.choiceResults[n];let s=a.text,u;if(a.skillCheck?(s=null,o7({skill:a.skillCheck.skillId,value:a.skillCheck.difficulty,id:a.skillCheck.skillCheckId,hideAfterRoll:a.skillCheck.hideAfterRoll,repeatable:a.skillCheck.repeatable}).succeeded?u=o.skillBranches.success:u=o.skillBranches.failure):u=o.branch,s){const l={speaker:"player",text:s,interactive:!1};zn().addDialog(l)}if(u){const l={currentIndex:0,branchData:{branch:u}};return await r.addAndRunBlock(l)}};function rfe(t,e){return{code:`choicePrompt ${e.code}`,indentation:e.indentation,line:e.line,branch:e.branch,expression:["choicePrompt",...e.expression]}}const ife=new Ge("choicePrompt","any",async t=>{const e=t.args;if(e[0]==="roll"){const n=e[1],r=e[2],i=e[3],o=e[4];let a=!1;e.length>5&&(a=e[5]);let s=!1,u=!1;a==="hideAfterRoll"&&(s=!0),a==="repeatable"&&(u=!0);const l=Er().getSkillCheck(n);if(l.hidden)return{text:null};const f=!l.happened||l.happened&&l.succeeded||u,{difficultyText:c}=fee({skill:r,skillCheckId:n,value:i});return{text:`${c} ${o}`,skillCheck:{allowed:f,skillId:r,skillCheckId:n,difficulty:i,hideAfterRoll:s,repeatable:u}}}else if(e.length>1&&e[1]==="if"){const n=e[0];let r=!0;return e.length>2&&(r=e[2]),r?{text:n}:{text:null}}else return{text:e[0]}}),sR=Ge.FromOptions({keyword:"text_field",argTypes:[{name:"prompt",type:"string"}],returnAfterPlayerAnswer:!0,runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};zn().addDialog(e)}});sR.onPlayerAnswered=async(t,e)=>(typeof e!="string"&&qt(t,"The player's answer should be a string"),e);const ofe=Ge.FromOptions({keyword:"text_field_prompt",argTypes:[{name:"prompt",type:"string"}],runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};zn().addDialog(e)}}),afe=new Ge("random",[{name:"a",type:"number"},{name:"b",type:"number"}],async t=>{const{a:e,b:n}=t.options;return typeof e!="number"||typeof n!="number"?(qt(t,"random command needs two numbers as parameters"),0):Math.floor(Math.random()*(n-e+1))+e}),sfe=new Ge("random_float",[{name:"a",type:"number"},{name:"b",type:"number"}],async t=>{const{a:e,b:n}=t.options;return typeof e!="number"||typeof n!="number"?(qt(t,"random_float command needs two numbers as parameters"),0):Math.random()*(n-e)+e}),ufe=new Ge("random_from_args",[],async t=>{const e=t.args;return!e||!e.length?(qt(t,"random_from_args command needs at least one argument"),0):e[Math.floor(Math.random()*e.length)]}),lfe=new Ge("random_from_array",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return Array.isArray(e)?e[Math.floor(Math.random()*e.length)]:(qt(t,"random_from_array command needs an array as parameter"),0)}),cfe=new Ge("concat","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="string"?`${e}${n}`:(qt(t,"requires all arguments to be strings"),e),""))),ffe=new Ge("join","any",async t=>{const e=t.args[0];return t.args.length<3&&qt(t,"requires at least 3 arguments"),t.args.slice(1).reduce((n,r)=>typeof r=="string"?`${n}${e}${r}`:(qt(t,"requires all arguments to be strings"),n),"")}),dfe=Ge.FromOptions({keyword:"min",argTypes:[{name:"min",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{min:e,value:n}=t.options;return n<e?n:e}}),hfe=Ge.FromOptions({keyword:"max",argTypes:[{name:"max",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{max:e,value:n}=t.options;return n>e?n:e}}),pfe=Ge.FromOptions({keyword:"clamp",argTypes:[{name:"min",type:"number"},{name:"max",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{min:e,max:n,value:r}=t.options;return r<e?e:r>n?n:r}}),mfe=Ge.FromOptions({keyword:"floor",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.floor(e)}}),vfe=Ge.FromOptions({keyword:"ceil",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.ceil(e)}}),gfe=Ge.FromOptions({keyword:"round",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.round(e)}}),yfe=Ge.FromOptions({keyword:"sqrt",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.sqrt(e)}}),bfe=Ge.FromOptions({keyword:"^",argTypes:[{name:"base",type:"number"},{name:"exponent",type:"number"}],runner:async t=>{const{base:e,exponent:n}=t.options;return Math.pow(e,n)}}),kfe=new Ge("create_sprite",[{name:"image",type:"string"},{name:"x",type:"number"},{name:"y",type:"number"},{name:"parent",type:"any",optional:!0}],async t=>{const e=io(),{x:n,y:r,image:i,parent:o}=t.options,a={x:n,y:r,image:i};return typeof o=="object"&&(a.parent=o),typeof o=="string"&&(a.parent=io().getObject(o)),e.createSprite(a)}),wfe=new Ge("create_object",[{name:"x",type:"number"},{name:"y",type:"number"},{name:"parent",type:"any",optional:!0}],async t=>{const e=io(),{x:n,y:r,parent:i}=t.options,o={x:n,y:r};return typeof i=="object"&&(o.parent=i),typeof i=="string"&&(o.parent=io().getObject(i)),e.createObject(o)}),_fe=new Ge("delete_sprite",[{name:"sprite",type:"any"}],async t=>io().destroyObject(t.options.sprite)),xfe=Ge.FromOptions({keyword:"shuffle",argTypes:[{name:"array",type:"any"}],runner:async t=>{const e=t.options.array;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return Nfe(e),e}}),jfe=Ge.FromOptions({keyword:"push",argTypes:[{name:"array",type:"any"},{name:"value",type:"any"}],runner:async t=>{const{array:e,value:n}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.push(n),e}}),Sfe=Ge.FromOptions({keyword:"pop",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.pop()}}),Cfe=Ge.FromOptions({keyword:"shift",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.shift()}}),$fe=Ge.FromOptions({keyword:"array_join",argTypes:[{name:"array",type:"any"},{name:"separator",type:"string",optional:!0}],runner:async t=>{const{array:e,separator:n}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}if(typeof n<"u"&&typeof n!="string"){qt(t,"array join string separator must be a string");return}return e.join(n),e}}),Ofe=Ge.FromOptions({keyword:"array_concat",argTypes:[{name:"array",type:"any"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const{array:e}=t.options,n=t.args;if(!Array.isArray(e)){qt(t,"requires an array argument");return}for(const r of n)if(!Array.isArray(r)){qt(t,"All concat arguments should be arrays");return}return e.concat(...n.slice(1))}}),Efe=Ge.FromOptions({keyword:"includes",argTypes:[{name:"array",type:"any"},{name:"searchElement",type:"string"}],runner:async t=>{const{array:e,searchElement:n}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n>"u"&&qt(t,"requires a search element argument"),e.includes(n)}}),Tfe=Ge.FromOptions({keyword:"reverse",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),e.reverse(),e}}),Afe=Ge.FromOptions({keyword:"slice",argTypes:[{name:"array",type:"any"},{name:"start",type:"number"},{name:"end",type:"number",optional:!0}],runner:async t=>{const{array:e,start:n,end:r}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n!="number"&&qt(t,"requires a start index argument"),typeof r<"u"&&typeof r!="number"&&qt(t,"end index argument must be a number if present"),e.slice(n,r)}}),Mfe=Ge.FromOptions({keyword:"splice",argTypes:[{name:"array",type:"any"},{name:"start",type:"number"},{name:"end",type:"number",optional:!0}],runner:async t=>{const{array:e,start:n,end:r}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n!="number"&&qt(t,"requires a start index argument"),typeof r<"u"&&typeof r!="number"&&qt(t,"end index argument must be a number if present"),e.splice(n,r)}}),Pfe=Ge.FromOptions({keyword:"array_find_index",argTypes:[{name:"array",type:"any"},{name:"predicateLabel",type:"string"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const{array:e,predicateLabel:n}=t.options;Array.isArray(e)||qt(t,"requires an array argument");for(const[r,i]of e.entries())if(await wn().runLabelFunction(n,i,...t.args.slice(2))===!0)return r;return-1}});function Nfe(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}}const Ife=Ge.FromOptions({keyword:"load_data",argTypes:[{name:"url",type:"string"}],runner:async t=>{const{url:e}=t.options;return await vm(Tk(e))}}),Lfe=Ge.FromOptions({keyword:"time_now",argTypes:[],runner:async t=>Date.now()}),Dfe=Ge.FromOptions({keyword:"total_playtime",argTypes:[],runner:async t=>Gt().totalPlayTime}),Rfe=Ge.FromOptions({keyword:"session_playtime",argTypes:[],runner:async t=>Gt().sessionPlayTime}),Bfe=Ge.FromOptions({keyword:"to_days",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/864e5)}),zfe=Ge.FromOptions({keyword:"to_hours",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/36e5)}),Ffe=Ge.FromOptions({keyword:"to_minutes",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/6e4)}),Vfe=Ge.FromOptions({keyword:"to_seconds",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/1e3)});function qfe(t){t.addCommand(tfe),t.addCommand(ife),t.addCommand(Ice),t.addCommand(Hle),t.addCommand(Ule),t.addCommand(Wle),t.addCommand(Nce),t.addCommand(Ace),t.addCommand(Mce),t.addCommand(Pce),t.addCommand(ice),t.addCommand(rce),t.addCommand(oce),t.addCommand(fce),t.addCommand(lce),t.addCommand(cce),t.addCommand(kfe),t.addCommand(wfe),t.addCommand(_fe),t.addCommand(Tce),t.addCommand(Lce),t.addCommand(Dce),t.addCommand(Rce),t.addCommand(Bce),t.addCommand(zce),t.addCommand(Fce),t.addCommand(Vce),t.addCommand(qce),t.addCommand(Hce),t.addCommand(Uce),t.addCommand(Wce),t.addCommand(Kce),t.addCommand(Qce),t.addCommand(Yce),t.addCommand(Jce),t.addCommand(Gce),t.addCommand(uce),t.addCommand(sce),t.addCommand(mce),t.addCommand(dce),t.addCommand(hce),t.addCommand(Kle),t.addCommand(Jle),t.addCommand(Gle),t.addCommand(Qle),t.addCommand(Yle),t.addCommand(Xle),t.addCommand(Zle),t.addCommand(ece),t.addCommand(tce),t.addCommand(_ce),t.addCommand(xce),t.addCommand(jce),t.addCommand(Sce),t.addCommand(Oce),t.addCommand(Ece),t.addCommand(Cce),t.addCommand($ce),t.addCommand(vce),t.addCommand(gce),t.addCommand(kce),t.addCommand(wce),t.addCommand(yce),t.addCommand(bce),t.addCommand(Dle),t.addCommand(Rle),t.addCommand(Ble),t.addCommand(Vle),t.addCommand(qle),t.addCommand(zle),t.addCommand(Fle),t.addCommand(sR),t.addCommand(ofe),t.addCommand(afe),t.addCommand(sfe),t.addCommand(ufe),t.addCommand(lfe),t.addCommand(cfe),t.addCommand(ffe),t.addCommand(dfe),t.addCommand(hfe),t.addCommand(pfe),t.addCommand(mfe),t.addCommand(gfe),t.addCommand(vfe),t.addCommand(yfe),t.addCommand(bfe),t.addCommand(xfe),t.addCommand(jfe),t.addCommand(Sfe),t.addCommand(Cfe),t.addCommand($fe),t.addCommand(Ofe),t.addCommand(Efe),t.addCommand(Tfe),t.addCommand(Afe),t.addCommand(Mfe),t.addCommand(Pfe),t.addCommand(Ife),t.addCommand(Lfe),t.addCommand(Dfe),t.addCommand(Rfe),t.addCommand(Bfe),t.addCommand(zfe),t.addCommand(Ffe),t.addCommand(Vfe)}const Hfe=b.defineComponent({data(){return{muted:!1,volumes:[],modeNames:{master:"Master volume:",music:"Music:",ambiant:"Ambiant:",sound:"Sound effects:"}}},mounted(){const t=Gr(),e=Ya.Howler.volume();this.volumes.push({mode:"master",volume:e}),t.modes.forEach((n,r)=>{this.volumes.push({mode:r,volume:t.modes.get(r).options.volume})})},methods:{changeVolume(t,e){const n=e.target;t==="master"?Gr().setMasterVolume(n.value):Gr().setModeVolume(t,n.value)},toggleMute(){this.muted?(Ya.Howler.mute(!1),this.muted=!1):(Ya.Howler.mute(!0),this.muted=!0)}}}),Ope="",Ufe={class:"volume-controls"},Wfe=b.createElementVNode("h3",{class:"subtitle"},"Volume",-1),Kfe={for:"volume",class:"volume-label"},Jfe=["onUpdate:modelValue","onChange"];function Gfe(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",Ufe,[Wfe,(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.volumes,(a,s)=>(b.openBlock(),b.createElementBlock("div",{class:"volume-control",key:a.mode},[b.createElementVNode("label",Kfe,b.toDisplayString(t.modeNames[a.mode]),1),b.withDirectives(b.createElementVNode("input",{ref_for:!0,ref:"slider",class:"volume-slider",type:"range",id:"volume",name:"volume",min:"0",max:"1",step:"0.1","onUpdate:modelValue":u=>t.volumes[s].volume=u,onChange:u=>t.changeVolume(a.mode,u)},null,40,Jfe),[[b.vModelText,t.volumes[s].volume]])]))),128))])}const Qfe=Hi(Hfe,[["render",Gfe]]),Yfe=b.defineComponent({components:{VolumeControls:Qfe},data(){return{}},mounted(){},methods:{quit(){window.close()},mainMenu(){Gt().menuReturn(),this.closeMenu()},closeMenu(){this.$emit("close")},getPlayTimeString(){const t=Fu(Gt().playTime.start,Gt().playTime.previousPlaytime);return Ym(t/1e3)}}}),Epe="",Xfe={class:"menu-content"};function Zfe(t,e,n,r,i,o){const a=b.resolveComponent("VolumeControls");return b.openBlock(),b.createElementBlock("div",Xfe,[b.createElementVNode("h3",null,"Play time: "+b.toDisplayString(t.getPlayTimeString()),1),b.createVNode(a),b.createElementVNode("button",{class:"button title quit-button",onClick:e[0]||(e[0]=(...s)=>t.mainMenu&&t.mainMenu(...s))}," Main Menu "),b.createElementVNode("button",{class:"button title quit-button",onClick:e[1]||(e[1]=(...s)=>t.quit&&t.quit(...s))},"Exit")])}const ede=Hi(Yfe,[["render",Zfe]]),tde={class:"inventory-section-items"},nde=["onClick"],rde={class:"item-title"},ide={class:"item-amount"},ode=b.defineComponent({__name:"inventory-section",props:{items:null,title:null,id:null},setup(t){const e=t;function n(i){return{backgroundImage:`url(${Ma(is(i).icon)})`}}function r(i){return is(i).name}return(i,o)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["inventory-section",`section-${e.id}`])},[b.createElementVNode("h3",null,b.toDisplayString(t.title),1),b.createElementVNode("div",tde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.items,a=>(b.openBlock(),b.createElementBlock("button",{onClick:()=>i.$emit("chosen",a.id),class:b.normalizeClass(["item-display",`item-${a.id}`]),style:b.normalizeStyle(n(a.id)),key:a.id},[b.createElementVNode("h3",rde,b.toDisplayString(r(a.id)),1),b.createElementVNode("h3",ide,b.toDisplayString(a.amount),1)],14,nde))),128))])],2))}}),Tpe="",ade={class:"flex flex-row item-description-container"},sde={class:"flex item-left"},ude={class:"flex item-right"},lde=b.createElementVNode("hr",{class:"hr-solid"},null,-1),cde=b.defineComponent({__name:"item-details",props:{item:null},emits:["close","use"],setup(t,{emit:e}){const n=t,r=b.computed(()=>is(n.item.id)),i=b.computed(()=>({backgroundImage:`url(${Ma(r.value.icon)})`})),o=b.computed(()=>Nr().canUseItem(n.item));return(a,s)=>(b.openBlock(),b.createElementBlock("div",null,[b.createElementVNode("div",ade,[b.createElementVNode("div",sde,[b.createElementVNode("div",{class:"item-display",style:b.normalizeStyle(b.unref(i))},null,4)]),b.createElementVNode("div",ude,[b.createElementVNode("h2",null,b.toDisplayString(b.unref(r).name),1),lde,b.createElementVNode("h3",null,"Amount: "+b.toDisplayString(t.item.amount),1),b.createElementVNode("p",null,b.toDisplayString(b.unref(r).description),1),b.createElementVNode("button",{onClick:s[0]||(s[0]=u=>a.$emit("use")),class:b.normalizeClass(["button",b.unref(o)?"":"disabled"])}," Use ",2)])]),b.createElementVNode("button",{class:"button",onClick:s[1]||(s[1]=u=>a.$emit("close"))},b.toDisplayString("<--"))]))}}),Ape="",fde=b.defineComponent({setup(){const t=Nr(),e=zn(),n=b.computed(()=>t.items),r=b.computed(()=>e.currentDialog.choices);return{items:n,currentlyChoosing:r}},emits:["close"],data(){return{chosenId:!1}},mounted(){},methods:{close(){this.$emit("close")},clickItem(t){this.chosenId=t},closeItem(){this.chosenId=!1},useItem(){if(this.chosenItem&&this.canUseChosenItem&&this.chosenItemConf){const t=this.chosenItemConf.onUse;this.close(),Eu("onItemUsed"),t.action==="jump"?wn().jumpToLabel(t.label):t.action==="run"?wn().runThenGoBackToPreviousDialog(t.label,!0):Kt(`Unknown action ${t.action}`)}}},computed:{itemsToDisplay(){return Object.values(this.items).filter(t=>t.amount>0?!0:!!is(t.id).showIfEmpty)},chosenItem(){return this.chosenId?this.items[this.chosenId]:null},canUseChosenItem(){return Nr().canUseItem(this.chosenItem)},chosenItemConf(){return this.chosenId?this.itemConf[this.chosenId]:null},itemConf(){return gt().items.items},sections(){const t=gt().items.categories,e=[];return this.itemsToDisplay.reduce((r,i)=>{var u;const o=(u=is(i.id).category)!=null?u:"default",a=t.find(l=>l.id===o);if(!a)return Kt(`Unknown category ${o}`),r;let s=r.find(l=>l.id===o);return s||(s={id:o,title:a.title,items:[]},r.push(s)),s.items.push(i),r},e)}},components:{InventorySection:ode,ItemDetails:cde}}),Mpe="",dde={key:0},hde={key:2},pde=[b.createElementVNode("h2",null,"The inventory is empty!",-1)];function mde(t,e,n,r,i,o){const a=b.resolveComponent("InventorySection"),s=b.resolveComponent("ItemDetails");return!t.chosenItem&&Object.keys(t.itemsToDisplay).length>0?(b.openBlock(),b.createElementBlock("div",dde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.sections,u=>(b.openBlock(),b.createBlock(a,{key:u.id,items:u.items,title:u.title,id:u.id,onChosen:t.clickItem},null,8,["items","title","id","onChosen"]))),128))])):typeof t.chosenId=="string"?(b.openBlock(),b.createBlock(s,{key:1,item:t.items[t.chosenId],onUse:t.useItem,onClose:t.closeItem},null,8,["item","onUse","onClose"])):(b.openBlock(),b.createElementBlock("div",hde,pde))}const vde=Hi(fde,[["render",mde]]),gde={class:"quest-display"},yde={class:"quest-title"},bde={class:"quest-description"},kde={key:0,class:"quest-objectives-container list-disc"},wde=b.defineComponent({__name:"QuestDetails",props:{quest:null},setup(t){const e=t,n=b.computed(()=>Bu(e.quest.id));function r(s){return Fm(e.quest.id,s)}const i=b.computed(()=>{switch(e.quest.state){case"hidden":return" Hidden";case"unlocked":return"";case"completed":return" (Completed)";default:return" Unknown"}}),o=b.computed(()=>e.quest.ending?e.quest.ending:n.value.description),a=b.computed(()=>Object.values(e.quest.objectives).filter(s=>s.state!=="hidden"));return(s,u)=>(b.openBlock(),b.createElementBlock("div",gde,[b.createElementVNode("div",{class:b.normalizeClass(["quest-header",t.quest.state==="completed"?"quest-completed":"quest-in-progress"])},[b.createElementVNode("h3",yde,b.toDisplayString(b.unref(n).title)+" "+b.toDisplayString(b.unref(i)),1)],2),b.createElementVNode("p",bde,b.toDisplayString(b.unref(o)),1),t.quest.state!=="completed"?(b.openBlock(),b.createElementBlock("ul",kde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(a),l=>(b.openBlock(),b.createElementBlock("li",{class:"quest-objective-display",key:l.id},[b.createElementVNode("p",{class:b.normalizeClass(["quest-objective-description",l.state==="completed"?"quest-objective-completed":"quest-objctive-in-progress"])},b.toDisplayString(r(l.id).description),3)]))),128))])):b.createCommentVNode("",!0)]))}}),Npe="",_de={class:"quest-list-title"},xde=b.defineComponent({__name:"QuestDisplay",props:{quest:null},setup(t){const e=t,n=b.computed(()=>Bu(e.quest.id));return(r,i)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["quest-list-display",t.quest.state==="completed"?"quest-list-completed":"quest-list-in-progress"])},[b.createElementVNode("p",_de,b.toDisplayString(b.unref(n).title),1)],2))}}),Ipe="",jde={key:0},Sde={key:0},Cde={key:1},$de=b.defineComponent({__name:"quests-list-section",props:{quests:null,sectionId:null,title:null,fallbackText:null},emits:["quest-selected"],setup(t,{emit:e}){const n=t,r=b.computed(()=>Zf().categories),i=b.computed(()=>{const o=[];return n.quests.reduce((s,u)=>{var d;const l=(d=Bu(u.id).category)!=null?d:"default",f=r.value.find(h=>h.id===l);if(!f)return Kt(`Quest category ${l} not found in config`),s;let c=s.find(h=>h.category.id===l);return c||(c={category:f,quests:[]},s.push(c)),c.quests.push(u),s},o)});return(o,a)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass([`${t.sectionId}-quests-container`,"quests-section"])},[b.createElementVNode("h3",null,b.toDisplayString(t.title),1),t.quests.length>0?(b.openBlock(),b.createElementBlock("div",jde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),s=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass([`${t.sectionId}-${s.category.id}-category`,"quests-category"]),key:s.category.id},[b.unref(r).length>1?(b.openBlock(),b.createElementBlock("h4",Sde,b.toDisplayString(s.category.title),1)):b.createCommentVNode("",!0),b.createElementVNode("div",{class:b.normalizeClass(`${t.sectionId}-${s.category.id}-quests`)},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(s.quests,u=>(b.openBlock(),b.createBlock(xde,{key:u.id,quest:u,onClick:l=>o.$emit("quest-selected",u)},null,8,["quest","onClick"]))),128))],2)],2))),128))])):(b.openBlock(),b.createElementBlock("div",Cde,[b.createElementVNode("p",null,b.toDisplayString(t.fallbackText),1)]))],2))}}),Lpe="",Ode=b.defineComponent({setup(){const t=di(),e=b.computed(()=>t.quests),n=b.ref(null);return{quests:e,selectedQuest:n}},computed:{questsToDisplay(){return Object.values(this.quests).filter(t=>t.state!=="hidden")},activeQuests(){return this.questsToDisplay.filter(t=>t.state==="unlocked")},completedQuests(){return this.questsToDisplay.filter(t=>t.state==="completed")},questsUiClass(){return ao().layoutMode==="horizontal"?"quests-ui-horizontal":"quests-ui-vertical"}},mounted(){this.activeQuests.length>0?this.selectedQuest=this.activeQuests[0]:this.completedQuests.length>0&&(this.selectedQuest=this.completedQuests[0])},methods:{clickOnQuest(t){this.selectedQuest=t}},components:{QuestDetails:wde,QuestsListSection:$de}}),Dpe="",Ede={class:"quests-list-container"},Tde={class:"quest-details"};function Ade(t,e,n,r,i,o){const a=b.resolveComponent("QuestsListSection"),s=b.resolveComponent("QuestDetails");return b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["quests-ui",t.questsUiClass])},[b.createElementVNode("div",Ede,[b.createVNode(a,{quests:t.activeQuests,sectionId:"active",title:"Active Quests",fallbackText:"No active quests",onQuestSelected:t.clickOnQuest},null,8,["quests","onQuestSelected"]),b.createVNode(a,{quests:t.completedQuests,sectionId:"completed",title:"Completed Quests",fallbackText:"No completed quests",onQuestSelected:t.clickOnQuest},null,8,["quests","onQuestSelected"])]),b.createElementVNode("div",Tde,[t.selectedQuest?(b.openBlock(),b.createBlock(s,{key:0,quest:t.selectedQuest},null,8,["quest"])):b.createCommentVNode("",!0)])],2)}const Mde=Hi(Ode,[["render",Ade]]),Pde=b.defineComponent({setup(){const t=Er();return{skills:b.computed(()=>t.skills)}},data(){return{chosenSkill:!1}},mounted(){},methods:{getSkillStyle(t){return{backgroundImage:`url(${Ma(this.skillConf[t].icon)})`}},getSkillName(t){return this.skillConf[t].name},clickSkill(t){this.chosenSkill=t},closeSkill(){this.chosenSkill=!1},xpBarWidth(t){return{width:`${Math.floor(t/this.xpPerLevel*100)}%`}}},computed:{skillsToDisplay(){const t={};for(const e in this.skills)this.skillConf[e].hidden&&this.skills[e].level<1||(t[e]=this.skills[e]);return t},skillConf(){return Co().skills},xpPerLevel(){return Co().skillOptions.xpPerLevel}}}),Rpe="",Nde={key:0,class:"skills-container"},Ide=["onClick"],Lde={class:"skill-title"},Dde={class:"skill-xp-container"},Rde={class:"skill-xp-text"},Bde={class:"skill-level"},zde={key:1},Fde={class:"flex flex-row skill-description-container"},Vde={class:"flex skill-left"},qde={class:"flex skill-right"},Hde=b.createElementVNode("hr",{class:"hr-solid"},null,-1);function Ude(t,e,n,r,i,o){return t.chosenSkill?typeof t.chosenSkill=="string"?(b.openBlock(),b.createElementBlock("div",zde,[b.createElementVNode("div",Fde,[b.createElementVNode("div",Vde,[b.createElementVNode("div",{class:"skill-display",style:b.normalizeStyle(t.getSkillStyle(t.chosenSkill))},null,4)]),b.createElementVNode("div",qde,[b.createElementVNode("h2",null,b.toDisplayString(t.getSkillName(t.chosenSkill)),1),Hde,b.createElementVNode("h3",null,"Level: "+b.toDisplayString(t.skills[t.chosenSkill].level),1),b.createElementVNode("p",null,b.toDisplayString(t.skillConf[t.chosenSkill].description),1)])]),b.createElementVNode("button",{class:"button",onClick:e[0]||(e[0]=(...a)=>t.closeSkill&&t.closeSkill(...a))},b.toDisplayString("<--"))])):b.createCommentVNode("",!0):(b.openBlock(),b.createElementBlock("div",Nde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.skillsToDisplay,a=>(b.openBlock(),b.createElementBlock("button",{onClick:()=>t.clickSkill(a.id),class:"skill-display",style:b.normalizeStyle(t.getSkillStyle(a.id)),key:a.id},[b.createElementVNode("h3",Lde,b.toDisplayString(t.getSkillName(a.id)),1),b.createElementVNode("div",Dde,[b.createElementVNode("div",{class:"skill-xp-bar",style:b.normalizeStyle(t.xpBarWidth(a.xp))},null,4),b.createElementVNode("h3",Rde,b.toDisplayString(a.xp)+" / "+b.toDisplayString(t.xpPerLevel)+" XP",1)]),b.createElementVNode("h3",Bde,b.toDisplayString(a.level),1)],12,Ide))),128))]))}const Wde=Hi(Pde,[["render",Ude]]);function Kde(t){t.component("MainMenu",ede),t.component("InventoryUi",vde),t.component("QuestsUi",Mde),t.component("SkillsWindow",Wde),jo().menus={system:{label:"System",cssClass:"system-menu",id:"system",tabs:[{id:"system-tab",cssId:"system-tab",text:"System",component:"MainMenu"}],activeTab:0},menu:{label:"Menu",id:"menu",cssClass:"menu-menu",tabs:[{id:"skills",cssId:"skills-menu-button",text:"Skills",condition:()=>jo().showSkills,component:"SkillsWindow"},{id:"inventory",cssId:"inventory-menu-button",text:"Items",condition:()=>jo().showInventory,component:"InventoryUi"},{id:"quests",cssId:"quests-menu-button",text:"Quests",condition:()=>jo().showQuests,component:"QuestsUi"}],activeTab:0}}}function uR(t,e,n){const r=window.narrat.app;for(const i in e.tabs){const o=e.tabs[i].component;r.component(o,n[o])}jo().addMenu(t,e)}function Jde(t,e,n){window.narrat.app.component(e.component,n),jo().addMenuOption(t,e)}function Gde(){for(const t of Fn.plugins){if(t.customMenuButtons)for(const e of t.customMenuButtons)uR(e.config.id,e.config,e.components);if(t.customMenuTabs)for(const e of t.customMenuTabs)Jde(e.config.id,e.config,e.component)}}function Qde(t){t.directive("visible",{mounted(e,n){n.value?e.style.visibility="visible":e.style.visibility="hidden"},updated(e,n){n.value?e.style.visibility="visible":e.style.visibility="hidden"}})}class Yde extends Eb{setup(){const e=()=>{this.emit("preUpdate"),this.emit("update"),this.emit("postUpdate"),requestAnimationFrame(e)};e()}}const Lk=new Yde;Ze.Vec2=void 0,(t=>{function e(p,m){return{x:p!=null?p:0,y:m!=null?m:0}}t.create=e;function n(p){return Math.sqrt(p.x*p.x+p.y*p.y)}t.magnitude=n;function r(p){const m=n(p);return m===0?e(0,0):{x:p.x/m,y:p.y/m}}t.normalize=r;function i(p,m){return{x:p.x+m.x,y:p.y+m.y}}t.add=i;function o(p,m){return{x:p.x-m.x,y:p.y-m.y}}t.subtract=o;function a(p,m){return{x:p.x*m.x,y:p.y*m.y}}t.multiply=a;function s(p,m){return{x:p.x*m,y:p.y*m}}t.scale=s;function u(p,m){return{x:p.x/m.x,y:p.y/m.y}}t.divide=u;function l(p,m){return n(o(p,m))}t.distance=l;function f(p,m,g){return{x:p.x+(m.x-p.x)*g,y:p.y+(m.y-p.y)*g}}t.lerp=f;function c(p,m){const g=Math.cos(m),v=Math.sin(m);return{x:p.x*g-p.y*v,y:p.x*v+p.y*g}}t.rotate=c;function d(p,m){const g=o(m,p);return t.normalize({x:-g.y,y:g.x})}t.normal=d;function h(p,m){return p.x*m.x+p.y*m.y}t.dot=h})(Ze.Vec2||(Ze.Vec2={}));class Xde{constructor(){ei(this,"gameActions",{});ei(this,"keyboardState",{});ei(this,"actions",{})}startListening(){window.addEventListener("keydown",e=>{const n=this.getKeyState(e.key);this.keyboardState[e.key]={previous:n.current,current:!0}}),window.addEventListener("keyup",e=>{const n=this.getKeyState(e.key);this.keyboardState[e.key]={previous:n.current,current:!1}}),Lk.on("preUpdate",()=>{this.update()})}addAction(e){this.gameActions[e.id]=e,e.type==="button"?this.actions[e.id]={active:!1,previous:!1}:this.actions[e.id]={value:Ze.Vec2.create(0,0),previous:Ze.Vec2.create(0,0),fullState:{left:0,right:0,up:0,down:0},previousFullState:{left:0,right:0,up:0,down:0}}}getAnalog(e){return this.actions[e]||Kt(`Action ${e} does not exist`),this.actions[e]}getButton(e){return this.actions[e]||Kt(`Action ${e} does not exist`),this.actions[e]}getKeyState(e){return this.keyboardState[e]?this.keyboardState[e]:(this.keyboardState[e]={current:!1,previous:!1},this.keyboardState[e])}update(){Object.values(this.gameActions).forEach(e=>{if(e.type==="button")e.action==="press"&&(this.actions[e.id].previous=this.actions[e.id].active,e.keybinds.some(r=>{const i=this.getKeyState(r.keyboardKey);return i.current===!0&&i.previous===!1})?this.actions[e.id].active=!0:this.actions[e.id].active=!1);else if(e.type==="analog"){const n=this.actions[e.id];n.previous=n.value,n.previousFullState=n.fullState;let r=Ze.Vec2.create(0,0);e.keybinds.forEach(i=>{this.getKeyState(i.left).current&&(n.fullState.left=1,r.x-=1),this.getKeyState(i.right).current&&(n.fullState.right=1,r.x+=1),this.getKeyState(i.up).current&&(n.fullState.up=1,r.y-=1),this.getKeyState(i.down).current&&(n.fullState.down=1,r.y+=1)}),r=Ze.Vec2.normalize(r),n.value=r}})}}const lR=Jr("inputs",{state:()=>({inputs:new Xde}),actions:{setupInputs(){this.inputs.startListening()}}});let os;Fn.callHook("onPageLoaded");async function Zde(t){Lk.setup(),console.log("Starting narrat...");const e=Object.assign(hre(),t),n=RZ();os=b.createApp(Ile,{options:e}),Qde(os),os.use(n);const r=await ose(e);Tb().setConfig(r),lR().setupInputs(),Fn.pinia=n,Gt();const i={app:os,vm:Fn,jump:o=>{wn().jumpToLabel(o)}};return window.narrat=i,Kde(os),Gde(),aR().addButtonsFromPlugins(),Gt().setOptions(e),os.use(TR,{breakpoints:{s:0,m:800,l:1200}}),qfe(Fn),Qm.setupDebugger(e.debug),console.log(`%c Narrat game engine v${GZ} - Built at ${QZ.toLocaleString()}`,"background: #222; color: #bada55"),Fn.callHook("onNarratSetup"),os.mount("#game-holder"),os}function ehe(t,e){os.component(t,e)}class the{constructor(){ei(this,"pluginId","narrat-plugin")}onPageLoaded(){}onNarratSetup(){}onAppMounted(){}onAssetsLoaded(){}onGameSetup(){}onGameStart(){}onGameMounted(){}onGameDismounted(){}}function nhe(t){Fn.addPlugin(t)}function rhe(t){Fn.addCommand(t)}Ze.CommandPlugin=Ge,Ze.InputsListener=oR,Ze.LogManager=Gm,Ze.ModalWindow=Ws,Ze.NarratPlugin=the,Ze.addCommand=rhe,Ze.aspectRatioFit=xL,Ze.audioConfig=Aa,Ze.buttonsConfig=$k,Ze.charactersConfig=Ok,Ze.error=Kt,Ze.findVariable=n7,Ze.gameloop=Lk,Ze.generateParser=nd,Ze.getAssetUrl=Ma,Ze.getButtonConfig=Hs,Ze.getConfig=gt,Ze.getDataUrl=Tk,Ze.getFile=Sb,Ze.getImageUrl=td,Ze.getItemConfig=is,Ze.getObjectiveConfig=Fm,Ze.getQuestConfig=Bu,Ze.getScreenConfig=XD,Ze.getSkillConfig=Ek,Ze.getSplitConfigUrl=YD,Ze.getWindow=lb,Ze.inputEvents=$o,Ze.itemsConfig=Bm,Ze.loadDataFile=vm,Ze.logManager=Qm,Ze.logger=Zo,Ze.processText=es,Ze.questsConfig=Zf,Ze.randomId=ql,Ze.registerComponent=ehe,Ze.registerMenuButton=uR,Ze.registerPlugin=nhe,Ze.screensConfig=zm,Ze.skillsConfig=Co,Ze.startApp=Zde,Ze.timeout=_o,Ze.tooltipsConfig=ed,Ze.useAudio=Gr,Ze.useConfig=Tb,Ze.useDialogStore=zn,Ze.useHud=$a,Ze.useInputs=lR,Ze.useInventory=Nr,Ze.useMain=Gt,Ze.useMenu=jo,Ze.useNotifications=oo,Ze.useQuests=di,Ze.useRenderingStore=ao,Ze.useScreenObjects=io,Ze.useScreens=Uo,Ze.useSkills=Er,Ze.useTooltips=lm,Ze.useVM=wn,Ze.warning=Au,Object.defineProperties(Ze,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
225
+ Error: ${e}`),console.error("============================")}function Dle(t,...e){console.log(`[${t.fileName}:${t.line}] log: `,...e)}class Ge{constructor(e,n,r,i){ei(this,"keyword");ei(this,"runner");ei(this,"argTypes");ei(this,"parser");ei(this,"onPlayerAnswered");ei(this,"returnAfterPlayerAnswer");this.keyword=e,this.runner=r,this.argTypes=n,i?this.parser=i:this.parser=nd(this.keyword,this.argTypes),this.returnAfterPlayerAnswer=!1}async run(e,n){let r=await this.runner(e,n);return this.returnAfterPlayerAnswer&&(r=await new Promise((i,o)=>{wn().waitForPlayerAnswer(e),e.finishCommand=i})),r}async processPlayerAnswer(e,n){let r=n;return this.onPlayerAnswered&&(r=await this.onPlayerAnswered(e,n)),this.returnAfterPlayerAnswer&&e.finishCommand&&e.finishCommand(r),r}static FromOptions(e){var r;const n=new Ge(e.keyword,e.argTypes,e.runner,e.parser);return n.onPlayerAnswered=e.onPlayerAnswered,n.returnAfterPlayerAnswer=(r=e.returnAfterPlayerAnswer)!=null?r:!1,n}}function nd(t,e){let n=[];if(e!=="any"){n=[];const r=e.reduce((i,o)=>(o.optional&&i++,o.type==="rest"&&(i=1/0),i),0);r>=1?n.push(e.length-r):n.push(e.length),n.push(e.length)}return(r,i)=>{const o={newLine:r.currentLine+1},a=i.command.args;return e!=="any"&&(a.length<n[0]||a.length>n[1])?(console.log("Error details"),console.log(i.command),console.log(a),r.parserContext.error(r.line.line,`Command ${t}: Expected ${n.join(" to ")} arguments but got ${a.length}`),o):(i.command.commandType=t,e!=="any"&&i.command.args.forEach((s,u)=>{const l=e[u];!a7(s)&&!s7(s)&&(l.type==="any"||l.type==="rest"||typeof s===l.type||r.parserContext.error(r.line.line,`Command ${t}: Argument #${u+1} (${l.name}) should be a ${l.type}, but got type ${typeof s}: ${JSON.stringify(s)}`))}),{newLine:r.currentLine+1})}}const Rle=new Ge("add_level",[{name:"skillKey",type:"string"},{name:"amount",type:"number"}],async t=>{let{skillKey:e,amount:n}=t.options;if((!e||!n)&&qt(t,"add_level command needs a skill id and a value as parameters"),!Number.isInteger(n)){const r=n;n=Math.round(n),console.warn(`add_level expects a level to be an integer. Auto Rounding ${r} to ${n}`)}Er().incrementSkill(e,n)}),Ble=Ge.FromOptions({keyword:"set_level",argTypes:[{name:"skill",type:"string"},{name:"level",type:"number"}],runner:async t=>{let{skill:e,level:n}=t.options;if((!e||!n)&&qt(t,"set_level command needs a skill id and a value as parameters"),!Number.isInteger(n)){const r=n;n=Math.round(n),console.warn(`set_level expects a level to be an integer. Auto Rounding ${r} to ${n}`)}Er().setSkillLevel(e,n)}}),zle=new Ge("add_xp",[{name:"xpKey",type:"string"},{name:"xpToAdd",type:"number"}],async t=>{const{xpKey:e,xpToAdd:n}=t.options;(!e||!n)&&qt(t,"add_xp command needs a skill id and a value as parameters"),Er().addXp(e,n)}),Fle=new Ge("get_level",[{name:"skillKey",type:"string"}],async t=>{const{skillKey:e}=t.options;e||qt(t,"get_level command needs a skill id as parameter");const n=Er().getSkill(e);return n||qt(t,`Skill ${e} not found`),n.level}),Vle=new Ge("get_xp",[{name:"xpKey",type:"string"}],async t=>{const{xpKey:e}=t.options;e||qt(t,"get_xp command needs a skill id as parameter");const n=Er().getSkillXp(e);return n||qt(t,`XP ${e} not found`),n}),qle=new Ge("roll",[{name:"id",type:"string"},{name:"skill",type:"string"},{name:"value",type:"number"},{name:"mode",type:"string",optional:!0}],async t=>{const{id:e,skill:n,value:r,mode:i}=t.options;let o=!1,a=!1;return i==="hideAfterRoll"&&(o=!0),i==="repeatable"&&(a=!0),o7({id:e,skill:n,value:r,hideAfterRoll:o,repeatable:a}).succeeded}),Hle=new Ge("reset_roll",[{name:"id",type:"string"}],async t=>Er().resetSkillCheck(t.options.id)),Ule=new Ge("add_stat",[{name:"statKey",type:"string"},{name:"amountToAdd",type:"number"}],async t=>{const{statKey:e,amountToAdd:n}=t.options;(!e||typeof n!="number")&&qt(t,"add_stat command needs a stat id and a value as parameters"),$a().addStat(e,n)}),Wle=new Ge("set_stat",[{name:"statKey",type:"string"},{name:"value",type:"number"}],async t=>{const{statKey:e,value:n}=t.options;(!e||typeof n!="number")&&qt(t,"set_stat command needs a stat id and a value as parameters"),$a().setStat(e,n)}),Kle=new Ge("get_stat_value",[{name:"statKey",type:"string"}],async t=>{const{statKey:e}=t.options;return e||qt(t,"get_stat_value command needs a stat id as parameter"),$a().getStatValue(e)}),Jle=Ge.FromOptions({keyword:"jump",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&qt(t,"requires a label argument");const e=t.args[0],n=wn(),r={branchData:n.script[e],label:e,args:t.args.splice(1),currentIndex:0};if(!n.script[e]){Kt(`Trying to jump but label ${e} not found`);return}return n.jumpTarget=r,am}}),Gle=Ge.FromOptions({keyword:"run",argTypes:"any",runner:async t=>{(t.args.length<1||typeof t.args[0]!="string")&&qt(t,"run command needs a label to argument run");const e=t.args[0];return await wn().runLabelFunction(e,...t.args.slice(1))}}),Qle=Ge.FromOptions({keyword:"var",argTypes:[{name:"name",type:"string"},{name:"value",type:"any"}],runner:async t=>{const{name:e,value:n}=t.options;wn().addScopedVariable(e,n)}}),Yle=Ge.FromOptions({keyword:"return",argTypes:[{name:"value",type:"any"}],runner:async t=>{const{value:e}=t.options;return wn().setReturnValue(e),ab}}),Xle=Ge.FromOptions({keyword:"log",argTypes:"any",runner:async t=>{Dle(t,...t.args)}}),Zle=Ge.FromOptions({keyword:"menu_return",argTypes:[],runner:async t=>(Gt().menuReturn(),sm)}),ece=Ge.FromOptions({keyword:"save",argTypes:[{name:"name",type:"string",optional:!0}],runner:async t=>{await Gt().manualSave({saveName:t.options.name})}}),tce=Ge.FromOptions({keyword:"save_prompt",argTypes:[{name:"name",type:"string",optional:!0}],runner:async t=>{await Gt().manualSave({saveName:t.options.name,withPrompt:!0})}}),nce=Ge.FromOptions({keyword:"new",argTypes:[{name:"name",type:"string"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const e=t.options.name;if(e==="Array")return console.log(t.args),[...t.args.slice(1)];if(e==="Object")return{}}}),rce=[{name:"mode",type:"string"},{name:"audio",type:"string"},{name:"channel",type:"number",optional:!0}],ice=new Ge("play",rce,async t=>{const e=Gr(),{mode:n,audio:r,channel:i}=t.options,o=Ik(t,n);o&&e.playChannel(o,r,i!=null?i:0)}),oce=new Ge("pause",[{name:"mode",type:"string"},{name:"channel",type:"number",optional:!0}],async t=>{const e=Gr(),{mode:n,channel:r}=t.options,i=Ik(t,n);i&&e.pauseChannel(i,r!=null?r:0)}),ace=new Ge("stop",[{name:"mode",type:"string"},{name:"channel",type:"number",optional:!0}],async t=>{const e=Gr(),{mode:n,channel:r}=t.options,i=Ik(t,n);i&&e.stopChannel(i,r!=null?r:0)});function Ik(t,e){return sce(e)?e:(qt(t,`${e} is not a valid audio mode.`),!1)}function sce(t){return!!K8.includes(t)}const uce=new Ge("set",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=ic();eR(e,`$${t.options.key}`,t.options.value)}),lce=new Ge("add",[{name:"key",type:"string"},{name:"value",type:"any"}],async t=>{const e=ic();tR(e,`$${t.options.key}`,t.options.value)}),cce=new Ge("set_screen",[{name:"screen",type:"string"},{name:"layer",type:"number",optional:!0},{name:"transitionName",type:"string",optional:!0},{name:"transitionDuration",type:"number",optional:!0},{name:"transitionDelay",type:"number",optional:!0}],async t=>{var r;const e=Uo();if(!XD(t.options.screen)){qt(t,`Screen ${t.options.screen} doesn't exist in the config`);return}return t.options.transitionName?e.transitionScreen(t.options.screen,{transition:t.options.transitionName,duration:t.options.transitionDuration,delay:t.options.transitionDelay},t.options.layer):e.setScreen(t.options.screen,(r=t.options.layer)!=null?r:0)}),fce=new Ge("empty_layer",[{name:"layer",type:"number"},{name:"transitionName",type:"string",optional:!0},{name:"transitionDuration",type:"number",optional:!0},{name:"transitionDelay",type:"number",optional:!0}],async t=>{const e=Uo();return t.options.transitionName?e.emptyLayer(t.options.layer,{transition:t.options.transitionName,duration:t.options.transitionDuration,delay:t.options.transitionDelay}):e.emptyLayer(t.options.layer)}),dce=new Ge("set_button",[{name:"buttonId",type:"string"},{name:"state",type:"any"}],async t=>{const{buttonId:e,state:n}=t.options,r=Uo();if(!Hs(e)){qt(t,`Button ${e} doesn't exist in the config`);return}r.changeButton(e,n)}),hce=Ge.FromOptions({keyword:"talk",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await cb({speaker:t.options.speaker,pose:t.options.pose,cssClass:"talk-command",text:`"${t.options.text}"`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),pce=Ge.FromOptions({keyword:"think",argTypes:[{name:"speaker",type:"string"},{name:"pose",type:"string"},{name:"text",type:"string"}],runner:async(t,e)=>{await cb({speaker:t.options.speaker,pose:t.options.pose,cssClass:"think-command",text:`${t.options.text}`,choices:e,interactive:!0})},returnAfterPlayerAnswer:!0}),mce=()=>{const t=nd("text",[]);return(e,n)=>{const r=t(e,n);return n.command.staticOptions={text:n.code.substring(1,n.code.length-1)},r}},vce=Ge.FromOptions({keyword:"text",argTypes:[],runner:async(t,e)=>{await cb({speaker:"game",cssClass:"text-command",text:t.staticOptions.text,choices:e,interactive:!0})},parser:mce(),returnAfterPlayerAnswer:!0}),gce=new Ge("add_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;Nr().add({id:e,amount:n})}),yce=new Ge("remove_item",[{name:"id",type:"string"},{name:"amount",type:"number"}],async t=>{const{id:e,amount:n}=t.options;Nr().remove({id:e,amount:n})}),bce=new Ge("has_item?",[{name:"id",type:"string"},{name:"amount",type:"number",optional:!0}],async t=>{const{id:e,amount:n}=t.options;return Nr().hasItem(e,n)}),kce=new Ge("item_amount?",[{name:"id",type:"string"}],async t=>{const{id:e}=t.options;return Nr().getItemAmount(e)}),wce=new Ge("enable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;Nr().enableInteraction(e)}),_ce=new Ge("disable_interaction",[{name:"tag",type:"string"}],async t=>{const e=t.options.tag;Nr().disableInteraction(e)}),xce=new Ge("start_quest",[{name:"questId",type:"string"}],async t=>{const e=t.options.questId;di().startQuest(e)}),jce=new Ge("start_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;di().startObjective(e,n)}),Sce=new Ge("complete_objective",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;di().completeObjective(e,n)}),Cce=new Ge("complete_quest",[{name:"questId",type:"string"},{name:"ending",type:"string",optional:!0}],async t=>{const{questId:e,ending:n}=t.options;di().completeQuest(e,n)}),$ce=new Ge("quest_completed?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return di().isQuestCompleted(e)}),Oce=new Ge("objective_completed?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return di().isObjectiveCompleted(e,n)}),Ece=new Ge("quest_started?",[{name:"questId",type:"string"}],async t=>{const{questId:e}=t.options;return di().isQuestStarted(e)}),Tce=new Ge("objective_started?",[{name:"questId",type:"string"},{name:"objectiveId",type:"string"}],async t=>{const{questId:e,objectiveId:n}=t.options;return di().isObjectiveStarted(e,n)}),Ace=Ge.FromOptions({keyword:"wait",argTypes:[{name:"duration",type:"number"}],runner:async t=>{await _o(t.options.duration)}}),Mce=new Ge("notify",[{name:"text",type:"string"}],async t=>{const{text:e}=t.options;oo().addNotification(e)}),Pce=new Ge("disable_notifications",[],async t=>{oo().disableNotifications()}),Nce=new Ge("enable_notifications",[],async t=>{oo().enableNotifications()}),Ice=new Ge("clear_dialog",[],async t=>{zn().clearDialog()}),Lce=new Ge("if",[{name:"condition",type:"boolean"}],async t=>{const e=mee(t),n=wn();if(e){const r={branchData:{branch:e},currentIndex:0};return n.addAndRunBlock(r)}},(t,e)=>{let n=t.currentLine;nd("if",[{name:"condition",type:"string"}])(t,e);const{lines:i,currentLine:o,line:a}=t,s=e.command;let u;const l=vee(i,o+1);return l&&l.code==="else:"&&(u=t.processCommandsFunction(t.parserContext,l.branch,a),n++),s.staticOptions={success:t.processCommandsFunction(t.parserContext,a.branch,a),failure:u},n++,{newLine:n}}),Dce=new Ge("==","any",async t=>{t.args.length<2&&qt(t,"requires at least two arguments");let e=t.args[0],n=!0;for(const r of t.args)if(r!=e){n=!1;break}else e=r;return n}),Rce=new Ge(">",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>n}),Bce=new Ge("<",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<n}),zce=new Ge(">=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e>=n}),Fce=new Ge("<=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e<=n}),Vce=new Ge("!=",[{name:"a",type:"any"},{name:"b",type:"any"}],async t=>{const{a:e,b:n}=t.options;return e!=n}),qce=new Ge("!",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return!e}),Hce=new Ge("&&","any",async t=>{const e=t.args;return t.args.length<2&&qt(t,"requires at least two arguments"),e.reduce((n,r)=>n&&r,!0)}),Uce=new Ge("||","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>e||n,!1))),Wce=new Ge("?",[{name:"a",type:"any"},{name:"b",type:"any"},{name:"c",type:"any"}],async t=>{const{a:e,b:n,c:r}=t.options;return e?n:r}),Kce=new Ge("+","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e+n:(qt(t,"requires all arguments to be numbers"),e),0))),Jce=new Ge("-","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.slice(1).reduce((e,n)=>typeof n=="number"?e-n:(qt(t,"requires all arguments to be numbers"),e),t.args[0]))),Gce=new Ge("neg",[{name:"a",type:"number"}],async t=>(t.args.length!==1&&qt(t,"requires one argument"),-t.options.a)),Qce=new Ge("abs",[{name:"a",type:"number"}],async t=>(t.args.length!==1&&qt(t,"requires one argument"),Math.abs(t.options.a))),Yce=new Ge("*","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="number"?e*n:(qt(t,"requires all arguments to be numbers"),e),1))),Xce=new Ge("/","any",async t=>{t.args.length<2&&qt(t,"requires at least two arguments");const e=t.args[0]/t.args[1];return t.args.slice(2).reduce((n,r)=>typeof r=="number"?n/r:(qt(t,"requires all arguments to be numbers"),n),e)}),Zce=async t=>{const{prompt:e,choices:n}=t.staticOptions,r=[];for(const[,a]of n.entries()){const s=await Ob(a.prompt);r.push(s)}t.options.choiceResults=r;const i=r.map((a,s)=>{var f,c;let u=!0;return a.skillCheck&&(u=(c=(f=a.skillCheck)==null?void 0:f.allowed)!=null?c:!1),{choice:a.text,originalIndex:s,allowed:u}}).filter(a=>a.choice),o=await kL(e,i);return await rfe(t,o)};function efe(t,e){e.branch||t.parserContext.error(e.line,`Choice option doesn't have any branch to go to (${e.code} - ${e.line})`);let n,r;const i=e.branch;return e.expression[1]==="roll"?((!i[0].branch||!i[1].branch)&&t.parserContext.error(e.line,`Choice option with a skill roll needs success and failure branches (${e.code} - ${e.line})`),n={success:t.processCommandsFunction(t.parserContext,i[0].branch,e),failure:t.processCommandsFunction(t.parserContext,i[1].branch,e)}):r=t.processCommandsFunction(t.parserContext,i,e),{prompt:t.processCommandsFunction(t.parserContext,[e],e)[0],branch:r,skillBranches:n}}const tfe=(t,e)=>{let n=t.currentLine;nd("choice",[]);const{line:r}=t,i=e.command;(!r.branch||r.branch.length<2)&&t.parserContext.error(r.line,"Choice menu needs to have at least one option");const o=r.branch[0];o||t.parserContext.error(t.line.line,"Choice prompt is missing ");const s=r.branch.slice(1).map((u,l)=>(u.branch||t.parserContext.error(u.line,`Choice option doesn't have any branch to go to (${u.code})`),u=ife(t.parserContext,u),efe(t,u)));return i.staticOptions={prompt:t.processCommandsFunction(t.parserContext,[o],r)[0],choices:s},n++,{newLine:n}},nfe=Ge.FromOptions({keyword:"choice",argTypes:[],runner:Zce,parser:tfe}),rfe=async(t,e)=>{const n=e,r=wn(),{choices:i}=t.staticOptions,o=i[n],a=t.options.choiceResults[n];let s=a.text,u;if(a.skillCheck?(s=null,o7({skill:a.skillCheck.skillId,value:a.skillCheck.difficulty,id:a.skillCheck.skillCheckId,hideAfterRoll:a.skillCheck.hideAfterRoll,repeatable:a.skillCheck.repeatable}).succeeded?u=o.skillBranches.success:u=o.skillBranches.failure):u=o.branch,s){const l={speaker:"player",text:s,interactive:!1};zn().addDialog(l)}if(u){const l={currentIndex:0,branchData:{branch:u}};return await r.addAndRunBlock(l)}};function ife(t,e){return{code:`choicePrompt ${e.code}`,indentation:e.indentation,line:e.line,branch:e.branch,expression:["choicePrompt",...e.expression]}}const ofe=new Ge("choicePrompt","any",async t=>{const e=t.args;if(e[0]==="roll"){const n=e[1],r=e[2],i=e[3],o=e[4];let a=!1;e.length>5&&(a=e[5]);let s=!1,u=!1;a==="hideAfterRoll"&&(s=!0),a==="repeatable"&&(u=!0);const l=Er().getSkillCheck(n);if(l.hidden)return{text:null};const f=!l.happened||l.happened&&l.succeeded||u,{difficultyText:c}=fee({skill:r,skillCheckId:n,value:i});return{text:`${c} ${o}`,skillCheck:{allowed:f,skillId:r,skillCheckId:n,difficulty:i,hideAfterRoll:s,repeatable:u}}}else if(e.length>1&&e[1]==="if"){const n=e[0];let r=!0;return e.length>2&&(r=e[2]),r?{text:n}:{text:null}}else return{text:e[0]}}),sR=Ge.FromOptions({keyword:"text_field",argTypes:[{name:"prompt",type:"string"}],returnAfterPlayerAnswer:!0,runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};zn().addDialog(e)}});sR.onPlayerAnswered=async(t,e)=>(typeof e!="string"&&qt(t,"The player's answer should be a string"),e);const afe=Ge.FromOptions({keyword:"text_field_prompt",argTypes:[{name:"prompt",type:"string"}],runner:async t=>{const e={speaker:"game",text:t.options.prompt,textField:!0,interactive:!0};zn().addDialog(e)}}),sfe=new Ge("random",[{name:"a",type:"number"},{name:"b",type:"number"}],async t=>{const{a:e,b:n}=t.options;return typeof e!="number"||typeof n!="number"?(qt(t,"random command needs two numbers as parameters"),0):Math.floor(Math.random()*(n-e+1))+e}),ufe=new Ge("random_float",[{name:"a",type:"number"},{name:"b",type:"number"}],async t=>{const{a:e,b:n}=t.options;return typeof e!="number"||typeof n!="number"?(qt(t,"random_float command needs two numbers as parameters"),0):Math.random()*(n-e)+e}),lfe=new Ge("random_from_args",[],async t=>{const e=t.args;return!e||!e.length?(qt(t,"random_from_args command needs at least one argument"),0):e[Math.floor(Math.random()*e.length)]}),cfe=new Ge("random_from_array",[{name:"a",type:"any"}],async t=>{const{a:e}=t.options;return Array.isArray(e)?e[Math.floor(Math.random()*e.length)]:(qt(t,"random_from_array command needs an array as parameter"),0)}),ffe=new Ge("concat","any",async t=>(t.args.length<2&&qt(t,"requires at least two arguments"),t.args.reduce((e,n)=>typeof n=="string"?`${e}${n}`:(qt(t,"requires all arguments to be strings"),e),""))),dfe=new Ge("join","any",async t=>{const e=t.args[0];return t.args.length<3&&qt(t,"requires at least 3 arguments"),t.args.slice(1).reduce((n,r)=>typeof r=="string"?`${n}${e}${r}`:(qt(t,"requires all arguments to be strings"),n),"")}),hfe=Ge.FromOptions({keyword:"min",argTypes:[{name:"min",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{min:e,value:n}=t.options;return n<e?n:e}}),pfe=Ge.FromOptions({keyword:"max",argTypes:[{name:"max",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{max:e,value:n}=t.options;return n>e?n:e}}),mfe=Ge.FromOptions({keyword:"clamp",argTypes:[{name:"min",type:"number"},{name:"max",type:"number"},{name:"value",type:"number"}],runner:async t=>{const{min:e,max:n,value:r}=t.options;return r<e?e:r>n?n:r}}),vfe=Ge.FromOptions({keyword:"floor",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.floor(e)}}),gfe=Ge.FromOptions({keyword:"ceil",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.ceil(e)}}),yfe=Ge.FromOptions({keyword:"round",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.round(e)}}),bfe=Ge.FromOptions({keyword:"sqrt",argTypes:[{name:"value",type:"number"}],runner:async t=>{const{value:e}=t.options;return Math.sqrt(e)}}),kfe=Ge.FromOptions({keyword:"^",argTypes:[{name:"base",type:"number"},{name:"exponent",type:"number"}],runner:async t=>{const{base:e,exponent:n}=t.options;return Math.pow(e,n)}}),wfe=new Ge("create_sprite",[{name:"image",type:"string"},{name:"x",type:"number"},{name:"y",type:"number"},{name:"parent",type:"any",optional:!0}],async t=>{const e=io(),{x:n,y:r,image:i,parent:o}=t.options,a={x:n,y:r,image:i};return typeof o=="object"&&(a.parent=o),typeof o=="string"&&(a.parent=io().getObject(o)),e.createSprite(a)}),_fe=new Ge("create_object",[{name:"x",type:"number"},{name:"y",type:"number"},{name:"parent",type:"any",optional:!0}],async t=>{const e=io(),{x:n,y:r,parent:i}=t.options,o={x:n,y:r};return typeof i=="object"&&(o.parent=i),typeof i=="string"&&(o.parent=io().getObject(i)),e.createObject(o)}),xfe=new Ge("delete_sprite",[{name:"sprite",type:"any"}],async t=>io().destroyObject(t.options.sprite)),jfe=Ge.FromOptions({keyword:"shuffle",argTypes:[{name:"array",type:"any"}],runner:async t=>{const e=t.options.array;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return Ife(e),e}}),Sfe=Ge.FromOptions({keyword:"push",argTypes:[{name:"array",type:"any"},{name:"value",type:"any"}],runner:async t=>{const{array:e,value:n}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.push(n),e}}),Cfe=Ge.FromOptions({keyword:"pop",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.pop()}}),$fe=Ge.FromOptions({keyword:"shift",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}return e.shift()}}),Ofe=Ge.FromOptions({keyword:"array_join",argTypes:[{name:"array",type:"any"},{name:"separator",type:"string",optional:!0}],runner:async t=>{const{array:e,separator:n}=t.options;if(!Array.isArray(e)){qt(t,"requires an array argument");return}if(typeof n<"u"&&typeof n!="string"){qt(t,"array join string separator must be a string");return}return e.join(n),e}}),Efe=Ge.FromOptions({keyword:"array_concat",argTypes:[{name:"array",type:"any"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const{array:e}=t.options,n=t.args;if(!Array.isArray(e)){qt(t,"requires an array argument");return}for(const r of n)if(!Array.isArray(r)){qt(t,"All concat arguments should be arrays");return}return e.concat(...n.slice(1))}}),Tfe=Ge.FromOptions({keyword:"includes",argTypes:[{name:"array",type:"any"},{name:"searchElement",type:"string"}],runner:async t=>{const{array:e,searchElement:n}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n>"u"&&qt(t,"requires a search element argument"),e.includes(n)}}),Afe=Ge.FromOptions({keyword:"reverse",argTypes:[{name:"array",type:"any"}],runner:async t=>{const{array:e}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),e.reverse(),e}}),Mfe=Ge.FromOptions({keyword:"slice",argTypes:[{name:"array",type:"any"},{name:"start",type:"number"},{name:"end",type:"number",optional:!0}],runner:async t=>{const{array:e,start:n,end:r}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n!="number"&&qt(t,"requires a start index argument"),typeof r<"u"&&typeof r!="number"&&qt(t,"end index argument must be a number if present"),e.slice(n,r)}}),Pfe=Ge.FromOptions({keyword:"splice",argTypes:[{name:"array",type:"any"},{name:"start",type:"number"},{name:"end",type:"number",optional:!0}],runner:async t=>{const{array:e,start:n,end:r}=t.options;return Array.isArray(e)||qt(t,"requires an array argument"),typeof n!="number"&&qt(t,"requires a start index argument"),typeof r<"u"&&typeof r!="number"&&qt(t,"end index argument must be a number if present"),e.splice(n,r)}}),Nfe=Ge.FromOptions({keyword:"array_find_index",argTypes:[{name:"array",type:"any"},{name:"predicateLabel",type:"string"},{name:"rest",type:"rest",optional:!0}],runner:async t=>{const{array:e,predicateLabel:n}=t.options;Array.isArray(e)||qt(t,"requires an array argument");for(const[r,i]of e.entries())if(await wn().runLabelFunction(n,i,...t.args.slice(2))===!0)return r;return-1}});function Ife(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}}const Lfe=Ge.FromOptions({keyword:"load_data",argTypes:[{name:"url",type:"string"}],runner:async t=>{const{url:e}=t.options;return await vm(Tk(e))}}),Dfe=Ge.FromOptions({keyword:"time_now",argTypes:[],runner:async t=>Date.now()}),Rfe=Ge.FromOptions({keyword:"total_playtime",argTypes:[],runner:async t=>Gt().totalPlayTime}),Bfe=Ge.FromOptions({keyword:"session_playtime",argTypes:[],runner:async t=>Gt().sessionPlayTime}),zfe=Ge.FromOptions({keyword:"to_days",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/864e5)}),Ffe=Ge.FromOptions({keyword:"to_hours",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/36e5)}),Vfe=Ge.FromOptions({keyword:"to_minutes",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/6e4)}),qfe=Ge.FromOptions({keyword:"to_seconds",argTypes:[{name:"time",type:"number"}],runner:async t=>Math.floor(t.options.time/1e3)});function Hfe(t){t.addCommand(nfe),t.addCommand(ofe),t.addCommand(Lce),t.addCommand(Ule),t.addCommand(Wle),t.addCommand(Kle),t.addCommand(Ice),t.addCommand(Mce),t.addCommand(Pce),t.addCommand(Nce),t.addCommand(oce),t.addCommand(ice),t.addCommand(ace),t.addCommand(dce),t.addCommand(cce),t.addCommand(fce),t.addCommand(wfe),t.addCommand(_fe),t.addCommand(xfe),t.addCommand(Ace),t.addCommand(Dce),t.addCommand(Rce),t.addCommand(Bce),t.addCommand(zce),t.addCommand(Fce),t.addCommand(Vce),t.addCommand(qce),t.addCommand(Hce),t.addCommand(Uce),t.addCommand(Wce),t.addCommand(Kce),t.addCommand(Jce),t.addCommand(Yce),t.addCommand(Xce),t.addCommand(Gce),t.addCommand(Qce),t.addCommand(lce),t.addCommand(uce),t.addCommand(vce),t.addCommand(hce),t.addCommand(pce),t.addCommand(Jle),t.addCommand(Gle),t.addCommand(Qle),t.addCommand(Yle),t.addCommand(Xle),t.addCommand(Zle),t.addCommand(ece),t.addCommand(tce),t.addCommand(nce),t.addCommand(xce),t.addCommand(jce),t.addCommand(Sce),t.addCommand(Cce),t.addCommand(Ece),t.addCommand(Tce),t.addCommand($ce),t.addCommand(Oce),t.addCommand(gce),t.addCommand(yce),t.addCommand(wce),t.addCommand(_ce),t.addCommand(bce),t.addCommand(kce),t.addCommand(Rle),t.addCommand(Ble),t.addCommand(zle),t.addCommand(qle),t.addCommand(Hle),t.addCommand(Fle),t.addCommand(Vle),t.addCommand(sR),t.addCommand(afe),t.addCommand(sfe),t.addCommand(ufe),t.addCommand(lfe),t.addCommand(cfe),t.addCommand(ffe),t.addCommand(dfe),t.addCommand(hfe),t.addCommand(pfe),t.addCommand(mfe),t.addCommand(vfe),t.addCommand(yfe),t.addCommand(gfe),t.addCommand(bfe),t.addCommand(kfe),t.addCommand(jfe),t.addCommand(Sfe),t.addCommand(Cfe),t.addCommand($fe),t.addCommand(Ofe),t.addCommand(Efe),t.addCommand(Tfe),t.addCommand(Afe),t.addCommand(Mfe),t.addCommand(Pfe),t.addCommand(Nfe),t.addCommand(Lfe),t.addCommand(Dfe),t.addCommand(Rfe),t.addCommand(Bfe),t.addCommand(zfe),t.addCommand(Ffe),t.addCommand(Vfe),t.addCommand(qfe)}const Ufe=b.defineComponent({data(){return{muted:!1,volumes:[],modeNames:{master:"Master volume:",music:"Music:",ambiant:"Ambiant:",sound:"Sound effects:"}}},mounted(){const t=Gr(),e=Ya.Howler.volume();this.volumes.push({mode:"master",volume:e}),t.modes.forEach((n,r)=>{this.volumes.push({mode:r,volume:t.modes.get(r).options.volume})})},methods:{changeVolume(t,e){const n=e.target;t==="master"?Gr().setMasterVolume(n.value):Gr().setModeVolume(t,n.value)},toggleMute(){this.muted?(Ya.Howler.mute(!1),this.muted=!1):(Ya.Howler.mute(!0),this.muted=!0)}}}),Epe="",Wfe={class:"volume-controls"},Kfe=b.createElementVNode("h3",{class:"subtitle"},"Volume",-1),Jfe={for:"volume",class:"volume-label"},Gfe=["onUpdate:modelValue","onChange"];function Qfe(t,e,n,r,i,o){return b.openBlock(),b.createElementBlock("div",Wfe,[Kfe,(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.volumes,(a,s)=>(b.openBlock(),b.createElementBlock("div",{class:"volume-control",key:a.mode},[b.createElementVNode("label",Jfe,b.toDisplayString(t.modeNames[a.mode]),1),b.withDirectives(b.createElementVNode("input",{ref_for:!0,ref:"slider",class:"volume-slider",type:"range",id:"volume",name:"volume",min:"0",max:"1",step:"0.1","onUpdate:modelValue":u=>t.volumes[s].volume=u,onChange:u=>t.changeVolume(a.mode,u)},null,40,Gfe),[[b.vModelText,t.volumes[s].volume]])]))),128))])}const Yfe=Hi(Ufe,[["render",Qfe]]),Xfe=b.defineComponent({components:{VolumeControls:Yfe},data(){return{}},mounted(){},methods:{quit(){window.close()},mainMenu(){Gt().menuReturn(),this.closeMenu()},closeMenu(){this.$emit("close")},getPlayTimeString(){const t=Fu(Gt().playTime.start,Gt().playTime.previousPlaytime);return Ym(t/1e3)}}}),Tpe="",Zfe={class:"menu-content"};function ede(t,e,n,r,i,o){const a=b.resolveComponent("VolumeControls");return b.openBlock(),b.createElementBlock("div",Zfe,[b.createElementVNode("h3",null,"Play time: "+b.toDisplayString(t.getPlayTimeString()),1),b.createVNode(a),b.createElementVNode("button",{class:"button title quit-button",onClick:e[0]||(e[0]=(...s)=>t.mainMenu&&t.mainMenu(...s))}," Main Menu "),b.createElementVNode("button",{class:"button title quit-button",onClick:e[1]||(e[1]=(...s)=>t.quit&&t.quit(...s))},"Exit")])}const tde=Hi(Xfe,[["render",ede]]),nde={class:"inventory-section-items"},rde=["onClick"],ide={class:"item-title"},ode={class:"item-amount"},ade=b.defineComponent({__name:"inventory-section",props:{items:null,title:null,id:null},setup(t){const e=t;function n(i){return{backgroundImage:`url(${Ma(is(i).icon)})`}}function r(i){return is(i).name}return(i,o)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["inventory-section",`section-${e.id}`])},[b.createElementVNode("h3",null,b.toDisplayString(t.title),1),b.createElementVNode("div",nde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.items,a=>(b.openBlock(),b.createElementBlock("button",{onClick:()=>i.$emit("chosen",a.id),class:b.normalizeClass(["item-display",`item-${a.id}`]),style:b.normalizeStyle(n(a.id)),key:a.id},[b.createElementVNode("h3",ide,b.toDisplayString(r(a.id)),1),b.createElementVNode("h3",ode,b.toDisplayString(a.amount),1)],14,rde))),128))])],2))}}),Ape="",sde={class:"flex flex-row item-description-container"},ude={class:"flex item-left"},lde={class:"flex item-right"},cde=b.createElementVNode("hr",{class:"hr-solid"},null,-1),fde=b.defineComponent({__name:"item-details",props:{item:null},emits:["close","use"],setup(t,{emit:e}){const n=t,r=b.computed(()=>is(n.item.id)),i=b.computed(()=>({backgroundImage:`url(${Ma(r.value.icon)})`})),o=b.computed(()=>Nr().canUseItem(n.item));return(a,s)=>(b.openBlock(),b.createElementBlock("div",null,[b.createElementVNode("div",sde,[b.createElementVNode("div",ude,[b.createElementVNode("div",{class:"item-display",style:b.normalizeStyle(b.unref(i))},null,4)]),b.createElementVNode("div",lde,[b.createElementVNode("h2",null,b.toDisplayString(b.unref(r).name),1),cde,b.createElementVNode("h3",null,"Amount: "+b.toDisplayString(t.item.amount),1),b.createElementVNode("p",null,b.toDisplayString(b.unref(r).description),1),b.createElementVNode("button",{onClick:s[0]||(s[0]=u=>a.$emit("use")),class:b.normalizeClass(["button",b.unref(o)?"":"disabled"])}," Use ",2)])]),b.createElementVNode("button",{class:"button",onClick:s[1]||(s[1]=u=>a.$emit("close"))},b.toDisplayString("<--"))]))}}),Mpe="",dde=b.defineComponent({setup(){const t=Nr(),e=zn(),n=b.computed(()=>t.items),r=b.computed(()=>e.currentDialog.choices);return{items:n,currentlyChoosing:r}},emits:["close"],data(){return{chosenId:!1}},mounted(){},methods:{close(){this.$emit("close")},clickItem(t){this.chosenId=t},closeItem(){this.chosenId=!1},useItem(){if(this.chosenItem&&this.canUseChosenItem&&this.chosenItemConf){const t=this.chosenItemConf.onUse;this.close(),Eu("onItemUsed"),t.action==="jump"?wn().jumpToLabel(t.label):t.action==="run"?wn().runThenGoBackToPreviousDialog(t.label,!0):Kt(`Unknown action ${t.action}`)}}},computed:{itemsToDisplay(){return Object.values(this.items).filter(t=>t.amount>0?!0:!!is(t.id).showIfEmpty)},chosenItem(){return this.chosenId?this.items[this.chosenId]:null},canUseChosenItem(){return Nr().canUseItem(this.chosenItem)},chosenItemConf(){return this.chosenId?this.itemConf[this.chosenId]:null},itemConf(){return gt().items.items},sections(){const t=gt().items.categories,e=[];return this.itemsToDisplay.reduce((r,i)=>{var u;const o=(u=is(i.id).category)!=null?u:"default",a=t.find(l=>l.id===o);if(!a)return Kt(`Unknown category ${o}`),r;let s=r.find(l=>l.id===o);return s||(s={id:o,title:a.title,items:[]},r.push(s)),s.items.push(i),r},e)}},components:{InventorySection:ade,ItemDetails:fde}}),Ppe="",hde={key:0},pde={key:2},mde=[b.createElementVNode("h2",null,"The inventory is empty!",-1)];function vde(t,e,n,r,i,o){const a=b.resolveComponent("InventorySection"),s=b.resolveComponent("ItemDetails");return!t.chosenItem&&Object.keys(t.itemsToDisplay).length>0?(b.openBlock(),b.createElementBlock("div",hde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.sections,u=>(b.openBlock(),b.createBlock(a,{key:u.id,items:u.items,title:u.title,id:u.id,onChosen:t.clickItem},null,8,["items","title","id","onChosen"]))),128))])):typeof t.chosenId=="string"?(b.openBlock(),b.createBlock(s,{key:1,item:t.items[t.chosenId],onUse:t.useItem,onClose:t.closeItem},null,8,["item","onUse","onClose"])):(b.openBlock(),b.createElementBlock("div",pde,mde))}const gde=Hi(dde,[["render",vde]]),yde={class:"quest-display"},bde={class:"quest-title"},kde={class:"quest-description"},wde={key:0,class:"quest-objectives-container list-disc"},_de=b.defineComponent({__name:"QuestDetails",props:{quest:null},setup(t){const e=t,n=b.computed(()=>Bu(e.quest.id));function r(s){return Fm(e.quest.id,s)}const i=b.computed(()=>{switch(e.quest.state){case"hidden":return" Hidden";case"unlocked":return"";case"completed":return" (Completed)";default:return" Unknown"}}),o=b.computed(()=>e.quest.ending?e.quest.ending:n.value.description),a=b.computed(()=>Object.values(e.quest.objectives).filter(s=>s.state!=="hidden"));return(s,u)=>(b.openBlock(),b.createElementBlock("div",yde,[b.createElementVNode("div",{class:b.normalizeClass(["quest-header",t.quest.state==="completed"?"quest-completed":"quest-in-progress"])},[b.createElementVNode("h3",bde,b.toDisplayString(b.unref(n).title)+" "+b.toDisplayString(b.unref(i)),1)],2),b.createElementVNode("p",kde,b.toDisplayString(b.unref(o)),1),t.quest.state!=="completed"?(b.openBlock(),b.createElementBlock("ul",wde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(a),l=>(b.openBlock(),b.createElementBlock("li",{class:"quest-objective-display",key:l.id},[b.createElementVNode("p",{class:b.normalizeClass(["quest-objective-description",l.state==="completed"?"quest-objective-completed":"quest-objctive-in-progress"])},b.toDisplayString(r(l.id).description),3)]))),128))])):b.createCommentVNode("",!0)]))}}),Ipe="",xde={class:"quest-list-title"},jde=b.defineComponent({__name:"QuestDisplay",props:{quest:null},setup(t){const e=t,n=b.computed(()=>Bu(e.quest.id));return(r,i)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["quest-list-display",t.quest.state==="completed"?"quest-list-completed":"quest-list-in-progress"])},[b.createElementVNode("p",xde,b.toDisplayString(b.unref(n).title),1)],2))}}),Lpe="",Sde={key:0},Cde={key:0},$de={key:1},Ode=b.defineComponent({__name:"quests-list-section",props:{quests:null,sectionId:null,title:null,fallbackText:null},emits:["quest-selected"],setup(t,{emit:e}){const n=t,r=b.computed(()=>Zf().categories),i=b.computed(()=>{const o=[];return n.quests.reduce((s,u)=>{var d;const l=(d=Bu(u.id).category)!=null?d:"default",f=r.value.find(h=>h.id===l);if(!f)return Kt(`Quest category ${l} not found in config`),s;let c=s.find(h=>h.category.id===l);return c||(c={category:f,quests:[]},s.push(c)),c.quests.push(u),s},o)});return(o,a)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass([`${t.sectionId}-quests-container`,"quests-section"])},[b.createElementVNode("h3",null,b.toDisplayString(t.title),1),t.quests.length>0?(b.openBlock(),b.createElementBlock("div",Sde,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(i),s=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass([`${t.sectionId}-${s.category.id}-category`,"quests-category"]),key:s.category.id},[b.unref(r).length>1?(b.openBlock(),b.createElementBlock("h4",Cde,b.toDisplayString(s.category.title),1)):b.createCommentVNode("",!0),b.createElementVNode("div",{class:b.normalizeClass(`${t.sectionId}-${s.category.id}-quests`)},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(s.quests,u=>(b.openBlock(),b.createBlock(jde,{key:u.id,quest:u,onClick:l=>o.$emit("quest-selected",u)},null,8,["quest","onClick"]))),128))],2)],2))),128))])):(b.openBlock(),b.createElementBlock("div",$de,[b.createElementVNode("p",null,b.toDisplayString(t.fallbackText),1)]))],2))}}),Dpe="",Ede=b.defineComponent({setup(){const t=di(),e=b.computed(()=>t.quests),n=b.ref(null);return{quests:e,selectedQuest:n}},computed:{questsToDisplay(){return Object.values(this.quests).filter(t=>t.state!=="hidden")},activeQuests(){return this.questsToDisplay.filter(t=>t.state==="unlocked")},completedQuests(){return this.questsToDisplay.filter(t=>t.state==="completed")},questsUiClass(){return ao().layoutMode==="horizontal"?"quests-ui-horizontal":"quests-ui-vertical"}},mounted(){this.activeQuests.length>0?this.selectedQuest=this.activeQuests[0]:this.completedQuests.length>0&&(this.selectedQuest=this.completedQuests[0])},methods:{clickOnQuest(t){this.selectedQuest=t}},components:{QuestDetails:_de,QuestsListSection:Ode}}),Rpe="",Tde={class:"quests-list-container"},Ade={class:"quest-details"};function Mde(t,e,n,r,i,o){const a=b.resolveComponent("QuestsListSection"),s=b.resolveComponent("QuestDetails");return b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["quests-ui",t.questsUiClass])},[b.createElementVNode("div",Tde,[b.createVNode(a,{quests:t.activeQuests,sectionId:"active",title:"Active Quests",fallbackText:"No active quests",onQuestSelected:t.clickOnQuest},null,8,["quests","onQuestSelected"]),b.createVNode(a,{quests:t.completedQuests,sectionId:"completed",title:"Completed Quests",fallbackText:"No completed quests",onQuestSelected:t.clickOnQuest},null,8,["quests","onQuestSelected"])]),b.createElementVNode("div",Ade,[t.selectedQuest?(b.openBlock(),b.createBlock(s,{key:0,quest:t.selectedQuest},null,8,["quest"])):b.createCommentVNode("",!0)])],2)}const Pde=Hi(Ede,[["render",Mde]]),Nde=b.defineComponent({setup(){const t=Er();return{skills:b.computed(()=>t.skills)}},data(){return{chosenSkill:!1}},mounted(){},methods:{getSkillStyle(t){return{backgroundImage:`url(${Ma(this.skillConf[t].icon)})`}},getSkillName(t){return this.skillConf[t].name},clickSkill(t){this.chosenSkill=t},closeSkill(){this.chosenSkill=!1},xpBarWidth(t){return{width:`${Math.floor(t/this.xpPerLevel*100)}%`}}},computed:{skillsToDisplay(){const t={};for(const e in this.skills)this.skillConf[e].hidden&&this.skills[e].level<1||(t[e]=this.skills[e]);return t},skillConf(){return Co().skills},xpPerLevel(){return Co().skillOptions.xpPerLevel}}}),Bpe="",Ide={key:0,class:"skills-container"},Lde=["onClick"],Dde={class:"skill-title"},Rde={class:"skill-xp-container"},Bde={class:"skill-xp-text"},zde={class:"skill-level"},Fde={key:1},Vde={class:"flex flex-row skill-description-container"},qde={class:"flex skill-left"},Hde={class:"flex skill-right"},Ude=b.createElementVNode("hr",{class:"hr-solid"},null,-1);function Wde(t,e,n,r,i,o){return t.chosenSkill?typeof t.chosenSkill=="string"?(b.openBlock(),b.createElementBlock("div",Fde,[b.createElementVNode("div",Vde,[b.createElementVNode("div",qde,[b.createElementVNode("div",{class:"skill-display",style:b.normalizeStyle(t.getSkillStyle(t.chosenSkill))},null,4)]),b.createElementVNode("div",Hde,[b.createElementVNode("h2",null,b.toDisplayString(t.getSkillName(t.chosenSkill)),1),Ude,b.createElementVNode("h3",null,"Level: "+b.toDisplayString(t.skills[t.chosenSkill].level),1),b.createElementVNode("p",null,b.toDisplayString(t.skillConf[t.chosenSkill].description),1)])]),b.createElementVNode("button",{class:"button",onClick:e[0]||(e[0]=(...a)=>t.closeSkill&&t.closeSkill(...a))},b.toDisplayString("<--"))])):b.createCommentVNode("",!0):(b.openBlock(),b.createElementBlock("div",Ide,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.skillsToDisplay,a=>(b.openBlock(),b.createElementBlock("button",{onClick:()=>t.clickSkill(a.id),class:"skill-display",style:b.normalizeStyle(t.getSkillStyle(a.id)),key:a.id},[b.createElementVNode("h3",Dde,b.toDisplayString(t.getSkillName(a.id)),1),b.createElementVNode("div",Rde,[b.createElementVNode("div",{class:"skill-xp-bar",style:b.normalizeStyle(t.xpBarWidth(a.xp))},null,4),b.createElementVNode("h3",Bde,b.toDisplayString(a.xp)+" / "+b.toDisplayString(t.xpPerLevel)+" XP",1)]),b.createElementVNode("h3",zde,b.toDisplayString(a.level),1)],12,Lde))),128))]))}const Kde=Hi(Nde,[["render",Wde]]);function Jde(t){t.component("MainMenu",tde),t.component("InventoryUi",gde),t.component("QuestsUi",Pde),t.component("SkillsWindow",Kde),jo().menus={system:{label:"System",cssClass:"system-menu",id:"system",tabs:[{id:"system-tab",cssId:"system-tab",text:"System",component:"MainMenu"}],activeTab:0},menu:{label:"Menu",id:"menu",cssClass:"menu-menu",tabs:[{id:"skills",cssId:"skills-menu-button",text:"Skills",condition:()=>jo().showSkills,component:"SkillsWindow"},{id:"inventory",cssId:"inventory-menu-button",text:"Items",condition:()=>jo().showInventory,component:"InventoryUi"},{id:"quests",cssId:"quests-menu-button",text:"Quests",condition:()=>jo().showQuests,component:"QuestsUi"}],activeTab:0}}}function uR(t,e,n){const r=window.narrat.app;for(const i in e.tabs){const o=e.tabs[i].component;r.component(o,n[o])}jo().addMenu(t,e)}function Gde(t,e,n){window.narrat.app.component(e.component,n),jo().addMenuOption(t,e)}function Qde(){for(const t of Fn.plugins){if(t.customMenuButtons)for(const e of t.customMenuButtons)uR(e.config.id,e.config,e.components);if(t.customMenuTabs)for(const e of t.customMenuTabs)Gde(e.config.id,e.config,e.component)}}function Yde(t){t.directive("visible",{mounted(e,n){n.value?e.style.visibility="visible":e.style.visibility="hidden"},updated(e,n){n.value?e.style.visibility="visible":e.style.visibility="hidden"}})}class Xde extends Eb{setup(){const e=()=>{this.emit("preUpdate"),this.emit("update"),this.emit("postUpdate"),requestAnimationFrame(e)};e()}}const Lk=new Xde;Ze.Vec2=void 0,(t=>{function e(p,m){return{x:p!=null?p:0,y:m!=null?m:0}}t.create=e;function n(p){return Math.sqrt(p.x*p.x+p.y*p.y)}t.magnitude=n;function r(p){const m=n(p);return m===0?e(0,0):{x:p.x/m,y:p.y/m}}t.normalize=r;function i(p,m){return{x:p.x+m.x,y:p.y+m.y}}t.add=i;function o(p,m){return{x:p.x-m.x,y:p.y-m.y}}t.subtract=o;function a(p,m){return{x:p.x*m.x,y:p.y*m.y}}t.multiply=a;function s(p,m){return{x:p.x*m,y:p.y*m}}t.scale=s;function u(p,m){return{x:p.x/m.x,y:p.y/m.y}}t.divide=u;function l(p,m){return n(o(p,m))}t.distance=l;function f(p,m,g){return{x:p.x+(m.x-p.x)*g,y:p.y+(m.y-p.y)*g}}t.lerp=f;function c(p,m){const g=Math.cos(m),v=Math.sin(m);return{x:p.x*g-p.y*v,y:p.x*v+p.y*g}}t.rotate=c;function d(p,m){const g=o(m,p);return t.normalize({x:-g.y,y:g.x})}t.normal=d;function h(p,m){return p.x*m.x+p.y*m.y}t.dot=h})(Ze.Vec2||(Ze.Vec2={}));class Zde{constructor(){ei(this,"gameActions",{});ei(this,"keyboardState",{});ei(this,"actions",{})}startListening(){window.addEventListener("keydown",e=>{const n=this.getKeyState(e.key);this.keyboardState[e.key]={previous:n.current,current:!0}}),window.addEventListener("keyup",e=>{const n=this.getKeyState(e.key);this.keyboardState[e.key]={previous:n.current,current:!1}}),Lk.on("preUpdate",()=>{this.update()})}addAction(e){this.gameActions[e.id]=e,e.type==="button"?this.actions[e.id]={active:!1,previous:!1}:this.actions[e.id]={value:Ze.Vec2.create(0,0),previous:Ze.Vec2.create(0,0),fullState:{left:0,right:0,up:0,down:0},previousFullState:{left:0,right:0,up:0,down:0}}}getAnalog(e){return this.actions[e]||Kt(`Action ${e} does not exist`),this.actions[e]}getButton(e){return this.actions[e]||Kt(`Action ${e} does not exist`),this.actions[e]}getKeyState(e){return this.keyboardState[e]?this.keyboardState[e]:(this.keyboardState[e]={current:!1,previous:!1},this.keyboardState[e])}update(){Object.values(this.gameActions).forEach(e=>{if(e.type==="button")e.action==="press"&&(this.actions[e.id].previous=this.actions[e.id].active,e.keybinds.some(r=>{const i=this.getKeyState(r.keyboardKey);return i.current===!0&&i.previous===!1})?this.actions[e.id].active=!0:this.actions[e.id].active=!1);else if(e.type==="analog"){const n=this.actions[e.id];n.previous=n.value,n.previousFullState=n.fullState;let r=Ze.Vec2.create(0,0);e.keybinds.forEach(i=>{this.getKeyState(i.left).current&&(n.fullState.left=1,r.x-=1),this.getKeyState(i.right).current&&(n.fullState.right=1,r.x+=1),this.getKeyState(i.up).current&&(n.fullState.up=1,r.y-=1),this.getKeyState(i.down).current&&(n.fullState.down=1,r.y+=1)}),r=Ze.Vec2.normalize(r),n.value=r}})}}const lR=Jr("inputs",{state:()=>({inputs:new Zde}),actions:{setupInputs(){this.inputs.startListening()}}});let os;Fn.callHook("onPageLoaded");async function ehe(t){Lk.setup(),console.log("Starting narrat...");const e=Object.assign(hre(),t),n=RZ();os=b.createApp(Lle,{options:e}),Yde(os),os.use(n);const r=await ose(e);Tb().setConfig(r),lR().setupInputs(),Fn.pinia=n,Gt();const i={app:os,vm:Fn,jump:o=>{wn().jumpToLabel(o)}};return window.narrat=i,Jde(os),Qde(),aR().addButtonsFromPlugins(),Gt().setOptions(e),os.use(TR,{breakpoints:{s:0,m:800,l:1200}}),Hfe(Fn),Qm.setupDebugger(e.debug),console.log(`%c Narrat game engine v${GZ} - Built at ${QZ.toLocaleString()}`,"background: #222; color: #bada55"),Fn.callHook("onNarratSetup"),os.mount("#game-holder"),os}function the(t,e){os.component(t,e)}class nhe{constructor(){ei(this,"pluginId","narrat-plugin")}onPageLoaded(){}onNarratSetup(){}onAppMounted(){}onAssetsLoaded(){}onGameSetup(){}onGameStart(){}onGameMounted(){}onGameDismounted(){}}function rhe(t){Fn.addPlugin(t)}function ihe(t){Fn.addCommand(t)}Ze.CommandPlugin=Ge,Ze.InputsListener=oR,Ze.LogManager=Gm,Ze.ModalWindow=Ws,Ze.NarratPlugin=nhe,Ze.addCommand=ihe,Ze.aspectRatioFit=xL,Ze.audioConfig=Aa,Ze.buttonsConfig=$k,Ze.charactersConfig=Ok,Ze.error=Kt,Ze.findVariable=n7,Ze.gameloop=Lk,Ze.generateParser=nd,Ze.getAssetUrl=Ma,Ze.getButtonConfig=Hs,Ze.getConfig=gt,Ze.getDataUrl=Tk,Ze.getFile=Sb,Ze.getImageUrl=td,Ze.getItemConfig=is,Ze.getObjectiveConfig=Fm,Ze.getQuestConfig=Bu,Ze.getScreenConfig=XD,Ze.getSkillConfig=Ek,Ze.getSplitConfigUrl=YD,Ze.getWindow=lb,Ze.inputEvents=$o,Ze.itemsConfig=Bm,Ze.loadDataFile=vm,Ze.logManager=Qm,Ze.logger=Zo,Ze.processText=es,Ze.questsConfig=Zf,Ze.randomId=ql,Ze.registerComponent=the,Ze.registerMenuButton=uR,Ze.registerPlugin=rhe,Ze.screensConfig=zm,Ze.skillsConfig=Co,Ze.startApp=ehe,Ze.timeout=_o,Ze.tooltipsConfig=ed,Ze.useAudio=Gr,Ze.useConfig=Tb,Ze.useDialogStore=zn,Ze.useHud=$a,Ze.useInputs=lR,Ze.useInventory=Nr,Ze.useMain=Gt,Ze.useMenu=jo,Ze.useNotifications=oo,Ze.useQuests=di,Ze.useRenderingStore=ao,Ze.useScreenObjects=io,Ze.useScreens=Uo,Ze.useSkills=Er,Ze.useTooltips=lm,Ze.useVM=wn,Ze.warning=Au,Object.defineProperties(Ze,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
226
226
  //# sourceMappingURL=narrat.umd.js.map