@drincs/pixi-vn-ink 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LJ7DXYK6.mjs → chunk-54QJQIS3.mjs} +2 -2
- package/dist/{chunk-34RMBLNJ.mjs → chunk-HE25JM4E.mjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mapper.cjs +1 -1
- package/dist/mapper.mjs +1 -1
- package/dist/vite-listener.cjs +2 -2
- package/dist/vite-listener.mjs +1 -1
- package/dist/vite.cjs +55 -55
- package/dist/vite.mjs +5 -5
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ Error:${h}`);}return l!=null&&(u=new r(l,s,this._externalErrorHandler,this._root
|
|
|
43
43
|
\r`),this.ParseNewline(),ct.ParseSuccess),this.Line=s=>()=>{let o=this.ParseObject(s);return o===null?null:(this.Expect(this.EndOfLine,"end of line",this.SkipToNextLine),o)},this.StartTag=()=>{if(this.Whitespace(),this.ParseString("#")===null)return null;this.parsingStringExpression&&this.Error("Tags aren't allowed inside of strings. Please use \\# if you want a hash symbol.");let s=null;if(this.tagActive){let o=new Fe.ContentList;o.AddContent(new yn.Tag(false)),o.AddContent(new yn.Tag(true)),s=o;}else s=new yn.Tag(true);return this.tagActive=true,this.Whitespace(),s},this._inlineWhitespaceChars=new de.CharacterSet(" "),this.EndOfLine=()=>this.OneOf([this.Newline,this.EndOfFile]),this.Newline=()=>(this.Whitespace(),this.ParseNewline()!==null?ct.ParseSuccess:null),this.EndOfFile=()=>(this.Whitespace(),this.endOfInput?ct.ParseSuccess:null),this.MultilineWhitespace=()=>{let s=this.OneOrMore(this.Newline);return s===null?null:s.length>=1?ct.ParseSuccess:null},this.Whitespace=()=>this.ParseCharactersFromCharSet(this._inlineWhitespaceChars)!==null?ct.ParseSuccess:null,this.Spaced=s=>()=>{this.Whitespace();let o=this.ParseObject(s);return o===null?null:(this.Whitespace(),o)},this.AnyWhitespace=()=>{let s=false;for(;this.OneOf([this.Whitespace,this.MultilineWhitespace])!==null;)s=true;return s?ct.ParseSuccess:null},this.MultiSpaced=s=>()=>{this.AnyWhitespace();let o=this.ParseObject(s);return o===null?null:(this.AnyWhitespace(),o)},this._filename=null,this._externalErrorHandler=null,this._fileHandler=null,this._filename=t,this.RegisterExpressionOperators(),this.GenerateStatementLevelRules(),this.errorHandler=this.OnStringParserError,this._externalErrorHandler=n,a===null?this._fileHandler=new EC.DefaultFileHandler:this._fileHandler=a,i===null){if(this._rootParser=this,this._openFilenames=[],this._filename!==null){let s=this.fileHandler.ResolveInkFilename(this._filename);this._openFilenames.push(s);}}else this._rootParser=i;}PreProcessInputString(e){return new rC.CommentEliminator(e).Process()}get parsingStringExpression(){return this.GetFlag(Number(Ws.CustomFlags.ParsingString))}set parsingStringExpression(e){this.SetFlag(Number(Ws.CustomFlags.ParsingString),e);}get tagActive(){return this.GetFlag(Number(Ws.CustomFlags.TagActive))}set tagActive(e){this.SetFlag(Number(Ws.CustomFlags.TagActive),e);}get identifierCharSet(){return this._identifierCharSet===null&&((this._identifierCharSet=new de.CharacterSet).AddRange("A","Z").AddRange("a","z").AddRange("0","9").Add("_"),this.ExtendIdentifierCharacterRanges(this._identifierCharSet)),this._identifierCharSet}EndTagIfNecessary(e){this.tagActive&&(e!=null&&(e instanceof Fe.ContentList?e.AddContent(new yn.Tag(false)):e.push(new yn.Tag(false))),this.tagActive=false);}};Ms.InkParser=U;U.LatinBasic=He.CharacterRange.Define("A","z",new de.CharacterSet().AddRange("[","`"));U.LatinExtendedA=He.CharacterRange.Define("\u0100","\u017F");U.LatinExtendedB=He.CharacterRange.Define("\u0180","\u024F");U.Greek=He.CharacterRange.Define("\u0370","\u03FF",new de.CharacterSet().AddRange("\u0378","\u0385").AddCharacters("\u0374\u0375\u0378\u0387\u038B\u038D\u03A2"));U.Cyrillic=He.CharacterRange.Define("\u0400","\u04FF",new de.CharacterSet().AddRange("\u0482","\u0489"));U.Armenian=He.CharacterRange.Define("\u0530","\u058F",new de.CharacterSet().AddCharacters("\u0530").AddRange("\u0557","\u0560").AddRange("\u0588","\u058E"));U.Hebrew=He.CharacterRange.Define("\u0590","\u05FF",new de.CharacterSet);U.Arabic=He.CharacterRange.Define("\u0600","\u06FF",new de.CharacterSet);U.Korean=He.CharacterRange.Define("\uAC00","\uD7AF",new de.CharacterSet);U.Latin1Supplement=He.CharacterRange.Define("\x80","\xFF",new de.CharacterSet);U.Chinese=He.CharacterRange.Define("\u4E00","\u9FFF",new de.CharacterSet);U.ListAllCharacterRanges=()=>[U.LatinBasic,U.LatinExtendedA,U.LatinExtendedB,U.Arabic,U.Armenian,U.Cyrillic,U.Greek,U.Hebrew,U.Korean,U.Latin1Supplement,U.Chinese];});var vc=x(Gs=>{Object.defineProperty(Gs,"__esModule",{value:true});Gs.GenerateStoryStats=void 0;var DC=sn(),bC=un(),AC=Mn(),xC=zo(),wC=Zo(),_C=St();function TC(r){let e=r.FindAll(_C.Text)(),t=0;for(let u of e){let l=0,h=true;for(let c of u.text)c==" "||c==" "||c==`
|
|
44
44
|
`||c=="\r"?h=true:h&&(l++,h=false);t+=l;}let n=r.FindAll(xC.Knot)(),i=r.FindAll(wC.Stitch)(),a=r.FindAll(DC.Choice)(),s=r.FindAll(AC.Gather)(u=>u.debugMetadata!=null),o=r.FindAll(bC.Divert)();return {words:t,knots:n.length,functions:n.filter(u=>u.isFunction).length,stitches:i.length,gathers:s.length,diverts:o.length-1,choices:a.length}}Gs.GenerateStoryStats=TC;});var Sc=x($s=>{Object.defineProperty($s,"__esModule",{value:true});$s.JsonFileHandler=void 0;var Fl=class{constructor(e){this.fileHierarchy=e,this.ResolveInkFilename=t=>{if(Object.keys(this.fileHierarchy).includes(t))return t;throw new Error(`Cannot locate ${t}. Are you trying a relative import ? This is not yet implemented.`)},this.LoadInkFileContents=t=>{if(Object.keys(this.fileHierarchy).includes(t))return this.fileHierarchy[t];throw new Error(`Cannot open ${t}.`)};}};$s.JsonFileHandler=Fl;});var Dc=x(ye=>{Object.defineProperty(ye,"__esModule",{value:true});ye.Compiler=ye.Story=ye.InkList=ye.JsonFileHandler=ye.StatementLevel=ye.InkParser=ye.CompilerOptions=void 0;var OC=fa(),PC=Pu(),Nl=Ut(),FC=Pl(),NC=ee(),IC=H(),VC=vc(),kC=fa();Object.defineProperty(ye,"CompilerOptions",{enumerable:true,get:function(){return kC.CompilerOptions}});var RC=Pl();Object.defineProperty(ye,"InkParser",{enumerable:true,get:function(){return RC.InkParser}});var LC=Yo();Object.defineProperty(ye,"StatementLevel",{enumerable:true,get:function(){return LC.StatementLevel}});var BC=Sc();Object.defineProperty(ye,"JsonFileHandler",{enumerable:true,get:function(){return BC.JsonFileHandler}});var Ec=Qn();Object.defineProperty(ye,"InkList",{enumerable:true,get:function(){return Ec.InkList}});Object.defineProperty(ye,"Story",{enumerable:true,get:function(){return Ec.Story}});var Il=class{get errors(){return this._errors}get warnings(){return this._warnings}get authorMessages(){return this._authorMessages}get inputString(){return this._inputString}get options(){return this._options}get parsedStory(){if(!this._parsedStory)throw new Error;return this._parsedStory}get runtimeStory(){if(!this._runtimeStory)throw new Error("Compilation failed.");return this._runtimeStory}get parser(){if(!this._parser)throw new Error;return this._parser}get debugSourceRanges(){return this._debugSourceRanges}constructor(e,t=null){this._errors=[],this._warnings=[],this._authorMessages=[],this._parsedStory=null,this._runtimeStory=null,this._parser=null,this._debugSourceRanges=[],this.Compile=()=>(this._parser=new FC.InkParser(this.inputString,this.options.sourceFilename||null,this.OnError,null,this.options.fileHandler),this._parsedStory=this.parser.ParseStory(),this.errors.length===0?(this.parsedStory.countAllVisits=this.options.countAllVisits,this._runtimeStory=this.parsedStory.ExportRuntime(this.OnError)):this._runtimeStory=null,this.runtimeStory),this.RetrieveDebugSourceForLatestContent=()=>{var n;for(let i of this.runtimeStory.state.outputStream){let a=(0, IC.asOrNull)(i,NC.StringValue);if(a!==null){let s=new PC.DebugSourceRange(((n=a.value)===null||n===void 0?void 0:n.length)||0,a.debugMetadata,a.value||"unknown");this.debugSourceRanges.push(s);}}},this.GenerateStats=()=>this._parsedStory===null?null:(0, VC.GenerateStoryStats)(this._parsedStory),this.DebugMetadataForContentAtOffset=n=>{let i=0,a=null;for(let s of this.debugSourceRanges){if(s.debugMetadata!==null&&(a=s.debugMetadata),n>=i&&n<i+s.length)return a;i+=s.length;}return null},this.OnError=(n,i)=>{switch(i){case Nl.ErrorType.Author:this._authorMessages.push(n);break;case Nl.ErrorType.Warning:this._warnings.push(n);break;case Nl.ErrorType.Error:this._errors.push(n);break}this.options.errorHandler!==null&&this.options.errorHandler(n,i);},this._inputString=e,this._options=t||new OC.CompilerOptions;}};ye.Compiler=Il;});var Ae;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(Ae||={});var _=class M{static init(e){e.loadAssets&&(M._loadAssets=e.loadAssets),e.soundOperation&&(M._soundOperation=e.soundOperation),e.imageOperation&&(M._imageOperation=e.imageOperation),e.videoOperation&&(M._videoOperation=e.videoOperation),e.imageContainerOperation&&(M._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(M._textOperation=e.textOperation),e.canvasElementOperation&&(M._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(M._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(M._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(M._narrationOperation=e.narrationOperation),e.effectOperation&&(M._effectOperation=e.effectOperation),e.animateOperation&&(M._animateOperation=e.animateOperation),e.getLogichValue&&(M._getLogichValue=e.getLogichValue),e.getConditionalStep&&(M._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return M._loadAssets}static _soundOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return M._soundOperation}static _imageOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return M._imageOperation}static _videoOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return M._videoOperation}static _imageContainerOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return M._imageContainerOperation}static _textOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return M._textOperation}static _canvasElementOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return M._canvasElementOperation}static _setStorageValue=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return M._setStorageValue}static _setInitialStorageValue=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return M._setInitialStorageValue}static _narrationOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return M._narrationOperation}static _effectOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return M._effectOperation}static _animateOperation=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return M._animateOperation}static _getLogichValue=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return M._getLogichValue}static _getConditionalStep=()=>{throw Ae.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return M._getConditionalStep}};exports.TextReplaces=void 0;(r=>{r.options={replaceRegex:/\[([^\]]+)\]/};let e=[];function t(l,h){e.unshift({fn:l,opts:h});}r.add=t;function n(l){let h=e.findIndex(c=>c.fn===l);h!==-1&&e.splice(h,1);}r.remove=n;function i(){return e.map(l=>l.opts)}r.info=i;function a(l,h){let c=e.filter(d=>(d.opts.type??"after-translation")===h.type);for(let d of c)l=u(l,d.fn,d.opts.validation);return l}r.replace=a;function s(l){let h=e.filter(c=>c.opts.i18nInterpolation);for(let c of h)l=o(l,c.fn,c.opts);return l}r.runI18nPreStep=s;function o(l,h,c){let{validation:d}=c,f=new RegExp(r.options.replaceRegex.source,"g"),m=[...l.matchAll(f)],g=new Set,b=[];for(let S of m)g.has(S[1])||(g.add(S[1]),b.push(S[1]));for(let S of b){if(d==="characterId"){if(!characters.RegisteredCharacters.has(S))continue}else if(d!=="all"){if(d instanceof RegExp){if(!d.test(S))continue}else if(d instanceof v.ZodType&&!d.safeParse(S).success)continue}h(S)!==void 0&&(l.includes(`{{[${S}]}}`)||(l=l.replaceAll(`[${S}]`,`{{[${S}]}}`)));}return l}function u(l,h,c){let d=new RegExp(r.options.replaceRegex.source,"g"),f=[...l.matchAll(d)],m=new Set,g=[];for(let b of f)m.has(b[1])||(m.add(b[1]),g.push(b[1]));for(let b of g){if(c==="characterId"){if(!characters.RegisteredCharacters.has(b))continue}else if(c!=="all"){if(c instanceof RegExp){if(!c.test(b))continue}else if(c instanceof v.ZodType&&!c.safeParse(b).success)continue}let S=h(b);S!==void 0&&(l=l.replaceAll(`[${b}]`,S));}return l}})(exports.TextReplaces||={});function Ic(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}var ql;(r=>{let e=u=>u;function t(u){return Array.isArray(u)?u.map(l=>n(`${l}`)):n(`${u}`)}r.t=t;function n(u){let l=u;return r.beforeToTranslate&&(l=(0, r.beforeToTranslate)(l)),l=exports.TextReplaces.replace(l,{type:"before-translation"}),l=e(l),r.afterToTranslate&&(l=(0, r.afterToTranslate)(l)),l=exports.TextReplaces.replace(l,{type:"after-translation"}),l}r.translate=n;function i(u){e=u;}r.setTranslate=i;function a(u,l,h){let{defaultValue:c="empty_string"}=h;typeof l=="string"&&(l=[l]),Array.isArray(l)&&l.forEach(d=>{let f=d;if(r.beforeToTranslate&&(f=(0, r.beforeToTranslate)(f)),c==="empty_string")u[f]===void 0&&(u[f]="");else if(c==="copy_key"){let m=d;r.beforeToTranslate&&(m=(0, r.beforeToTranslate)(m));let g=exports.TextReplaces.runI18nPreStep(m);g=exports.TextReplaces.replace(g,{type:"before-translation"}),u[f]=g;}});}function s(u,l=[]){if(typeof u=="object"&&u&&"type"in u)if(u.type==="ifelse")u.then&&s(u.then,l),u.else&&s(u.else,l);else if(u.type==="stepswitch"){if(u.elements)if(Array.isArray(u.elements))u.elements.forEach(h=>{s(h,l);});else if(u.elements.type==="ifelse"){let h=[];s(u.elements,h),h.forEach(c=>{l.push(...c);});}else if(u.elements.type==="stepswitch"){let h=[];s(u.elements,h),h.forEach(c=>{l.push(...c);});}else s(u.elements,l);}else u.type==="resulttocombine"?(u.firstItem&&s(u.firstItem,l),u.secondConditionalItem&&u.secondConditionalItem.forEach(h=>{s(h,l);})):l.push(u);else u&&l.push(u);return l}async function o(u,l={},h={}){let{defaultValue:c="copy_key",operationStringConvert:d}=h,f=u.map(async m=>{if(m.choices){let g=[];Array.isArray(m.choices)?g=[m.choices]:g=s(m.choices),g.forEach(b=>{b.forEach(S=>{if("type"in S){let y=[];S.type==="ifelse"||S.type==="stepswitch"?s(S,y):y=[S],y.map(p=>s(p.text)).forEach(p=>{Array.isArray(p)&&p.forEach(D=>{Array.isArray(D)?D.forEach(C=>{typeof C=="string"?a(l,C,{defaultValue:c}):s(C).forEach(E=>{Array.isArray(E)?E.forEach(w=>{typeof w=="string"&&a(l,w,{defaultValue:c});}):typeof E=="string"&&a(l,E,{defaultValue:c});});}):typeof D=="string"&&a(l,D,{defaultValue:c});});});}});});}if(m.dialogue){let g=[];Array.isArray(m.dialogue)?g=[m.dialogue]:g=s(m.dialogue),g.forEach(b=>{if(typeof b=="string")a(l,b,{defaultValue:c});else if("text"in b){let S=s(b.text);typeof S=="string"&&(S=[S]),S.forEach(y=>{typeof y=="string"?a(l,y,{defaultValue:c}):s(y).forEach(p=>{typeof p=="string"?a(l,p,{defaultValue:c}):Array.isArray(p)&&p.forEach(D=>{typeof D=="string"?a(l,D,{defaultValue:c}):s(D).forEach(C=>{typeof C=="string"&&a(l,C,{defaultValue:c});});});});});}});}if(m.operations)for(let g of m.operations){if(g.type==="operationtoconvert"&&d){let b=Ic(g),S=await d(b,m,{});if(!S)return;g=S;}g.type==="text"&&g.operationType==="show"&&a(l,g.text,{defaultValue:c});}m.conditionalStep&&s(m.conditionalStep).forEach(g=>{Array.isArray(g)?o(g,l,h):o([g],l,h);});});return await Promise.all(f),l}r.generateJsonTranslation=o;})(ql||={});var oe=ql;async function Ml(r){let e=_.getLogichValue(r,{});if(e)switch(e.type){case "assets":switch(e.operationType){case "load":await canvas.Assets.load(e.aliases);break;case "lazyload":canvas.Assets.backgroundLoad(e.aliases);break}break;case "bundle":switch(e.operationType){case "load":await canvas.Assets.loadBundle(e.aliases);break;case "lazyload":canvas.Assets.backgroundLoadBundle(e.aliases);break}break}}var q;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(q||={});async function fi(r,e,t){switch(t.type){case "fade":await canvas.showWithFade(e.alias,r,t.props,t.priority);break;case "dissolve":await canvas.showWithDissolve(e.alias,r,t.props,t.priority);break;case "movein":case "moveout":await canvas.moveIn(e.alias,r,t.props,t.priority);break;case "zoomin":case "zoomout":await canvas.zoomIn(e.alias,r,t.props,t.priority);break;case "pushin":case "pushout":await canvas.pushIn(e.alias,r,t.props,t.priority);break}}function Sn(r){if(r.transition)switch(r.transition.type){case "fade":canvas.removeWithFade(r.alias,r.transition.props,r.transition.priority);break;case "dissolve":canvas.removeWithDissolve(r.alias,r.transition.props,r.transition.priority);break;case "movein":case "moveout":canvas.moveOut(r.alias,r.transition.props,r.transition.priority);break;case "zoomin":case "zoomout":canvas.zoomOut(r.alias,r.transition.props,r.transition.priority);break;case "pushin":case "pushout":canvas.pushOut(r.alias,r.transition.props,r.transition.priority);break}else canvas.canvas.remove(r.alias);}async function Gl(r){switch(r.operationType){case "show":if(r.transition){let e=new canvas.ImageSprite(r.props,r.url||r.alias);await fi(e,r,r.transition);}else await canvas.showImage(r.alias,r.url,r.props);break;case "edit":{let e=canvas.canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Image with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function $l(r){switch(r.operationType){case "show":if(r.transition){let e=new canvas.VideoSprite(r.props,r.url||r.alias);await fi(e,r,r.transition);}else await canvas.showVideo(r.alias,r.url,r.props);break;case "edit":{let e=canvas.canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Video with alias ${r.alias} not found.`);break}case "remove":Sn(r);break;case "pause":case "resume":{let e=canvas.canvas.find(r.alias);e?e.paused=r.operationType==="pause":q.error(`Video with alias ${r.alias} not found.`);break}}}async function Jl(r){switch(r.operationType){case "show":if(r.transition){let e=new canvas.ImageContainer(r.props,r.urls);await fi(e,r,r.transition);}else await canvas.showImageContainer(r.alias,r.urls,r.props);break;case "edit":{let e=canvas.canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`ImageContainer with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function Hl(r){switch(r.operationType){case "show":if(r.props=r.props||{},r.props.text=oe.t(r.text),r.transition){let e=new canvas.Text(r.props);await fi(e,r,r.transition);}else canvas.showText(r.alias,r.text,r.props);break;case "edit":{let e=canvas.canvas.find(r.alias);e?r.props&&await e.setMemory({...e.memory,...r.props}):q.error(`Text with alias ${r.alias} not found.`);break}case "remove":Sn(r);break}}async function zl(r){switch(r.operationType){case "edit":try{let e=canvas.canvas.find(r.alias);e?r.props&&e.setMemory({...e.memory,...r.props}):q.error(`Canvas Element with alias ${r.alias} not found.`);}catch(e){q.error(`There was an error while trying to edit the canvas element with alias ${r.alias}.`,e);}break;case "remove":Sn(r);break}}async function Ul(r){r.type==="shake"&&await canvas.shakeEffect(r.alias,r.props,r.priority);}function Kl(r){switch(r.type){case "animate":canvas.canvas.animate(r.alias,r.keyframes,r.options,r.priority);break;case "animate-sequence":canvas.canvas.animate(r.alias,r.sequence,r.options,r.priority);break}}function Xl(r){switch(r.type){case "input":narration.narration.requestInput({type:r.valueType},r.defaultValue);break;case "dialogue":narration.narration.dialogue=void 0;break}}function Yl(r){switch(r.operationType){case "play":r.url?sound.sound.play(r.alias,r.url,r.props):sound.sound.play(r.alias,r.props);break;case "stop":switch(r.type){case "sound":sound.sound.stop(r.alias);break;case "all":sound.sound.stopAll();break}break;case "pause":switch(r.type){case "sound":sound.sound.pause(r.alias);break;case "channel":sound.sound.findChannel(r.alias).pauseAll();break;case "all":sound.sound.pauseAll();break}break;case "resume":switch(r.type){case "sound":sound.sound.resume(r.alias);break;case "channel":sound.sound.findChannel(r.alias).resumeAll();break;case "all":sound.sound.resumeAll();break}break;case "edit":Object.entries(r.props).forEach(([e,t])=>{let n=sound.sound.find(r.alias);n&&(e==="volume"?n.volume.value=t:n.paused=t);});break}}var Us="___param___",ed=class G{static init(e){e.loadAssets&&(G._loadAssets=e.loadAssets),e.soundOperation&&(G._soundOperation=e.soundOperation),e.imageOperation&&(G._imageOperation=e.imageOperation),e.videoOperation&&(G._videoOperation=e.videoOperation),e.imageContainerOperation&&(G._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(G._textOperation=e.textOperation),e.canvasElementOperation&&(G._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(G._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(G._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(G._narrationOperation=e.narrationOperation),e.effectOperation&&(G._effectOperation=e.effectOperation),e.animateOperation&&(G._animateOperation=e.animateOperation),e.getLogichValue&&(G._getLogichValue=e.getLogichValue),e.getConditionalStep&&(G._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return G._loadAssets}static _soundOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return G._soundOperation}static _imageOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return G._imageOperation}static _videoOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return G._videoOperation}static _imageContainerOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return G._imageContainerOperation}static _textOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return G._textOperation}static _canvasElementOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return G._canvasElementOperation}static _setStorageValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return G._setStorageValue}static _setInitialStorageValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return G._setInitialStorageValue}static _narrationOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return G._narrationOperation}static _effectOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return G._effectOperation}static _animateOperation=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return G._animateOperation}static _getLogichValue=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return G._getLogichValue}static _getConditionalStep=()=>{throw q.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return G._getConditionalStep}};function td(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>ed.getLogichValue(i,e));return t(...n)}else q.warn(`getLogichValue function ${r.functionName} not found in props`);}}function Ql(r,e){let t=_.getLogichValue(r,e);return t&&typeof t=="object"&&"type"in t?_.getLogichValue(t,e):t}function Zl(r,e={}){let t=Ql(r.value,e);switch(r.storageType){case "flagStorage":storage.storage.setFlag(r.key,r.value);break;case "storage":storage.storage.set(r.key,t);break;case "tempstorage":storage.storage.setTempVariable(r.key,t);break;case "params":{let n=storage.storage.get(`${Us}${narration.narration.openedLabels.length-1}`)||[];n.length>r.key&&(n[r.key]=t),storage.storage.setTempVariable(`${Us}${narration.narration.openedLabels.length-1}`,n);break}}}function eu(r,e={}){let t=Ql(r.value,e);switch(r.storageType){case "storage":case "tempstorage":storage.storage.default={[r.key]:t};break}}function tu(r,e={}){let t=nu(r,e);if(t&&typeof t=="object"&&"type"in t)switch(t.type){case "value":return id(t,e);case "arithmetic":case "arithmeticsingle":return nd(t,e);case "compare":case "union":return rd(t,e);case "function":return td(t,e)}return t}function nd(r,e){let t=_.getLogichValue(r.leftValue,e);switch(r.type){case "arithmetic":{let n=_.getLogichValue(r.rightValue,e);switch(r.operator){case "*":return t*n;case "/":return t/n;case "+":return typeof t=="string"||typeof n=="string"?`${t}${n}`:Array.isArray(t)&&Array.isArray(n)?[...t,...n]:Array.isArray(t)?[...t,n]:Array.isArray(n)?[t,...n]:t+n;case "-":if(Array.isArray(t)&&Array.isArray(n))return t.filter(i=>!n.includes(i));if(Array.isArray(t))return t.filter(i=>i!==n);if(Array.isArray(n)){q.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return t-n;case "%":return t%n;case "POW":return t**n;case "RANDOM":return narration.narration.getRandomNumber(t,n);case "INTERSECTION":if(Array.isArray(t)&&Array.isArray(n))return t.filter(i=>n.includes(i));q.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:q.warn("getValueFromArithmeticOperations unknown operator",r);return}}case "arithmeticsingle":switch(r.operator){case "INT":return Number(t);case "FLOOR":return Math.floor(t)}break}}function id(r,e){if(r&&typeof r=="object"&&"type"in r&&r.type==="value"&&r.storageOperationType==="get")switch(r.storageType){case "storage":case "tempstorage":return r.key==="_input_value_"?narration.narration.inputValue:storage.storage.get(r.key);case "flagStorage":return storage.storage.getFlag(r.key);case "label":return narration.narration.getTimesLabelOpened(r.label);case "choice":return narration.narration.getTimesChoiceMade(r.index);case "logic":return _.getLogichValue(r.operation,e);case "params":{let t=storage.storage.get(`${Us}${narration.narration.openedLabels.length-1}`)||[];if(t&&t.length>r.key)return t[r.key];q.warn("getValue params not found");return}}return r}function rd(r,e){if(!r)return false;if(typeof r!="object"||!("type"in r))return !!r;switch(r.type){case "compare":{let t=_.getLogichValue(r.leftValue,e),n=_.getLogichValue(r.rightValue,e);switch(r.operator){case "==":return Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every(i=>n.includes(i)):t===n;case "!=":return Array.isArray(t)&&Array.isArray(n)?t.length!==n.length||!t.every(i=>n.includes(i)):t!==n;case "<":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)<0:Array.isArray(t)&&Array.isArray(n)?t.length<n.length:t<n;case "<=":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)<=0:Array.isArray(t)&&Array.isArray(n)?t.length<=n.length:t<=n;case ">":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)>0:Array.isArray(t)&&Array.isArray(n)?t.length>n.length:t>n;case ">=":return typeof t=="string"&&typeof n=="string"?t.localeCompare(n)>=0:Array.isArray(t)&&Array.isArray(n)?t.length>=n.length:t>=n;case "CONTAINS":return Array.isArray(t)&&Array.isArray(n)?n.every(i=>t.includes(i)):Array.isArray(t)?t.includes(n):t.toString().includes(n.toString())}break}case "value":{let t=_.getLogichValue(r,e);return Array.isArray(t)?t.length>0:t&&typeof t=="object"?Object.keys(t).length>0:!!t}case "union":return sd(r,e)}return !!r}function sd(r,e){if(r.unionType==="not"){let n=tu(r.condition,e);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let t=n=>_.getLogichValue(n,e)||false;return r.unionType==="and"?r.conditions.every(t):r.conditions.some(t)}function ad(r,e){return Math.floor(Math.random()*(e-r+1)+r)}function nu(r,e={}){if(Array.isArray(r)||!r)return r;if(r&&typeof r=="object"&&"type"in r)switch(r.type){case "resulttocombine":return od(r,e);case "ifelse":return _.getLogichValue(r.condition,e)?_.getLogichValue(r.then,e):_.getLogichValue(r.else,e);case "stepswitch":{let t=_.getLogichValue(r.elements,e)||[];if(t.length===0){q.error("getValueFromConditionalStatements elements.length === 0");return}switch(r.choiceType){case "random":{let n=ad(0,t.length-1);return _.getLogichValue(t[n],e)}case "loop":{let n=narration.NarrationManagerStatic.getCurrentStepTimesCounter(r.nestedId)-1;return n>t.length-1?(n=n%t.length,_.getLogichValue(t[n],e)):_.getLogichValue(t[n],e)}case "sequential":{let n,i=narration.NarrationManagerStatic.getCurrentStepTimesCounter(r.nestedId)-1;return r.end==="lastItem"&&(n=_.getLogichValue(t[t.length-1],e)),i>t.length-1?n:_.getLogichValue(t[i],e)}case "sequentialrandom":{let n=narration.NarrationManagerStatic.getRandomNumber(0,t.length-1,{nestedId:r.nestedId,onceOnly:true});if(n===void 0&&r.end==="lastItem"){let i=narration.NarrationManagerStatic.getCurrentStepTimesCounterData(r.nestedId);if(!i?.usedRandomNumbers){q.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let a=i.usedRandomNumbers[`0-${t.length-1}`];return _.getLogichValue(t[a[a.length-1]],e)}if(n===void 0){q.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return _.getLogichValue(t[n],e)}}}}return r}function mi(r,e={}){if(r.conditionalStep){let t=pixiVn.createExportableElement(_.getLogichValue(r.conditionalStep,e));if(t?.glueEnabled===void 0&&delete t?.glueEnabled,t?.goNextStep===void 0&&delete t?.goNextStep,t?.end===void 0&&delete t?.end,t?.choices===void 0&&delete t?.choices,t?.dialogue===void 0&&delete t?.dialogue,t?.labelToOpen===void 0&&delete t?.labelToOpen,t?.operations===void 0&&delete t?.operations,t){let n={...r,conditionalStep:void 0,...t};return mi(n,e)}else narration.narration.dialogGlue&&(narration.narration.dialogGlue=false);}return r}function od(r,e){let t=r.firstItem,n=(r.secondConditionalItem??[]).flatMap(a=>Array.isArray(a)?a.map(s=>_.getLogichValue(s,e)):[_.getLogichValue(a,e)]),i=t?[t,...n]:n;if(i.length===0){q.warn("combinateResult toCheck.length === 0");return}if(typeof i[0]=="string")return oe.t(i);if(typeof i[0]=="object"){let a=i,s,o=false,u=a.map((y,p)=>{y=mi(y,e);let D=_.getLogichValue(y.dialogue,e)||"";return p===0?(s=_.getLogichValue(y.glueEnabled,e)||false,D):(typeof D=="object"&&"text"in D&&(D=`${D.character}: ${D.text}`),s===false&&o&&(D=`
|
|
45
45
|
|
|
46
|
-
${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogichValue(u[0],e),h=typeof l=="object"&&"character"in l?l.character:void 0,c=u.flatMap(y=>{let p;y&&typeof y=="object"&&"text"in y?p=y.text:p=y;let D;return Array.isArray(p)?D=p.map(C=>{let E=_.getLogichValue(C,e);return oe.t(`${E}`)}):D=_.getLogichValue(p,e)||"",oe.t(D)}),d=a.find(y=>y.end),f=a.find(y=>y.choices),m=false,g=false;a.length>0&&(a[0].glueEnabled&&a[0].goNextStep&&a[0].dialogue===void 0&&(narration.narration.dialogGlue=true),m=a[a.length-1].glueEnabled,g=a.reverse().find(y=>!(y.operations&&(!y.dialogue||!y.choices)))?.goNextStep);let b=a.find(y=>y.labelToOpen),S=[];return a.forEach(y=>{y.operations&&(S=[...S,...y.operations]);}),{dialogue:h?{character:h,text:c}:c,end:d?.end,choices:f?.choices,glueEnabled:m,goNextStep:g,labelToOpen:b?.labelToOpen,operations:S}}}exports.VariableGetter=void 0;(r=>{let e=new Set;function t(a){e.add(a);}r.add=t;function n(){e.clear();}r.clear=n;function i(a,s={}){let o=h=>tu(h,s)??void 0,u=nu(a,s);if(e.size===0)return o(u);let l=o;for(let h of e){let c=l;l=d=>h(d,c)??void 0;}return l(u)}r.getLogichValue=i;})(exports.VariableGetter||={});var cd=Object.create,ou=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,pd=Object.getOwnPropertyNames,fd=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty,ru=(r=>typeof wt<"u"?wt:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof wt<"u"?wt:e)[t]}):r)(function(r){if(typeof wt<"u")return wt.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),lu=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),gd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pd(e))!md.call(r,i)&&i!==t&&ou(r,i,{get:()=>e[i],enumerable:!(n=dd(e,i))||n.enumerable});return r},Cd=(r,e,t)=>(t=r!=null?cd(fd(r)):{},gd(ou(t,"default",{value:r,enumerable:true}),r)),yd=lu((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n():typeof define=="function"&&define.amd?define([],n):t.CryptoJS=n();})(r,function(){var t=t||(function(n,i){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof ru=="function")try{a=ru("crypto");}catch{}var s=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||(function(){function y(){}return function(p){var D;return y.prototype=p,D=new y,y.prototype=null,D}})(),u={},l=u.lib={},h=l.Base=(function(){return {extend:function(y){var p=o(this);return y&&p.mixIn(y),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments);}),p.init.prototype=p,p.$super=this,p},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var p in y)y.hasOwnProperty(p)&&(this[p]=y[p]);y.hasOwnProperty("toString")&&(this.toString=y.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=l.WordArray=h.extend({init:function(y,p){y=this.words=y||[],p!=i?this.sigBytes=p:this.sigBytes=y.length*4;},toString:function(y){return (y||f).stringify(this)},concat:function(y){var p=this.words,D=y.words,C=this.sigBytes,E=y.sigBytes;if(this.clamp(),C%4)for(var w=0;w<E;w++){var P=D[w>>>2]>>>24-w%4*8&255;p[C+w>>>2]|=P<<24-(C+w)%4*8;}else for(var N=0;N<E;N+=4)p[C+N>>>2]=D[N>>>2];return this.sigBytes+=E,this},clamp:function(){var y=this.words,p=this.sigBytes;y[p>>>2]&=4294967295<<32-p%4*8,y.length=n.ceil(p/4);},clone:function(){var y=h.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var p=[],D=0;D<y;D+=4)p.push(s());return new c.init(p,y)}}),d=u.enc={},f=d.Hex={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var w=p[E>>>2]>>>24-E%4*8&255;C.push((w>>>4).toString(16)),C.push((w&15).toString(16));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C+=2)D[C>>>3]|=parseInt(y.substr(C,2),16)<<24-C%8*4;return new c.init(D,p/2)}},m=d.Latin1={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var w=p[E>>>2]>>>24-E%4*8&255;C.push(String.fromCharCode(w));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C++)D[C>>>2]|=(y.charCodeAt(C)&255)<<24-C%4*8;return new c.init(D,p)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(m.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return m.parse(unescape(encodeURIComponent(y)))}},b=l.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes;},_process:function(y){var p,D=this._data,C=D.words,E=D.sigBytes,w=this.blockSize,P=w*4,N=E/P;y?N=n.ceil(N):N=n.max((N|0)-this._minBufferSize,0);var Z=N*w,ve=n.min(Z*4,E);if(Z){for(var Gt=0;Gt<Z;Gt+=w)this._doProcessBlock(C,Gt);p=C.splice(0,Z),D.sigBytes-=ve;}return new c.init(p,ve)},clone:function(){var y=h.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});l.Hasher=b.extend({cfg:h.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset();},reset:function(){b.reset.call(this),this._doReset();},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var p=this._doFinalize();return p},blockSize:16,_createHelper:function(y){return function(p,D){return new y.init(D).finalize(p)}},_createHmacHelper:function(y){return function(p,D){return new S.HMAC.init(y,D).finalize(p)}}});var S=u.algo={};return u})(Math);return t});}),vd=lu((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n(yd()):typeof define=="function"&&define.amd?define(["./core"],n):n(t.CryptoJS);})(r,function(t){return (function(){var n=t,i=n.lib,a=i.WordArray,s=i.Hasher,o=n.algo,u=[],l=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var d=this._hash.words,f=d[0],m=d[1],g=d[2],b=d[3],S=d[4],y=0;y<80;y++){if(y<16)u[y]=h[c+y]|0;else {var p=u[y-3]^u[y-8]^u[y-14]^u[y-16];u[y]=p<<1|p>>>31;}var D=(f<<5|f>>>27)+S+u[y];y<20?D+=(m&g|~m&b)+1518500249:y<40?D+=(m^g^b)+1859775393:y<60?D+=(m&g|m&b|g&b)-1894007588:D+=(m^g^b)-899497514,S=b,b=g,g=m<<30|m>>>2,m=f,f=D;}d[0]=d[0]+f|0,d[1]=d[1]+m|0,d[2]=d[2]+g|0,d[3]=d[3]+b|0,d[4]=d[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,d=this._nDataBytes*8,f=h.sigBytes*8;return c[f>>>5]|=128<<24-f%32,c[(f+64>>>9<<4)+14]=Math.floor(d/4294967296),c[(f+64>>>9<<4)+15]=d,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l);})(),t.SHA1});}),su="___param___",se;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(se||={});var Sd=class ${static init(e){e.loadAssets&&($._loadAssets=e.loadAssets),e.soundOperation&&($._soundOperation=e.soundOperation),e.imageOperation&&($._imageOperation=e.imageOperation),e.videoOperation&&($._videoOperation=e.videoOperation),e.imageContainerOperation&&($._imageContainerOperation=e.imageContainerOperation),e.textOperation&&($._textOperation=e.textOperation),e.canvasElementOperation&&($._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&($._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&($._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&($._narrationOperation=e.narrationOperation),e.effectOperation&&($._effectOperation=e.effectOperation),e.animateOperation&&($._animateOperation=e.animateOperation),e.getLogichValue&&($._getLogichValue=e.getLogichValue),e.getConditionalStep&&($._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return $._loadAssets}static _soundOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return $._soundOperation}static _imageOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return $._imageOperation}static _videoOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return $._videoOperation}static _imageContainerOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return $._imageContainerOperation}static _textOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return $._textOperation}static _canvasElementOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return $._canvasElementOperation}static _setStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return $._setStorageValue}static _setInitialStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return $._setInitialStorageValue}static _narrationOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return $._narrationOperation}static _effectOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return $._effectOperation}static _animateOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return $._animateOperation}static _getLogichValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return $._getLogichValue}static _getConditionalStep=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return $._getConditionalStep}};function Ed(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>Sd.getLogichValue(i,e));return t(...n)}else se.warn(`getLogichValue function ${r.functionName} not found in props`);}}function Dd(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}async function uu(r,e,t){let n=_.getLogichValue(r,e);if(n)switch(n.type){case "sound":_.soundOperation(n);break;case "assets":case "bundle":await _.loadAssets(n);break;case "image":await _.imageOperation(n);break;case "video":await _.videoOperation(n);break;case "imagecontainer":await _.imageContainerOperation(n);break;case "text":await _.textOperation(n);break;case "canvaselement":await _.canvasElementOperation(n);break;case "value":_.setStorageValue(n,e);break;case "operationtoconvert":if(t){let i=Dd(n,e),a=await t(i);a&&await uu(a,e,t);}break;case "input":case "dialogue":_.narrationOperation(n);break;case "shake":await _.effectOperation(n);break;case "animate":case "animate-sequence":_.animateOperation(n);break;case "function":await Ed(n,e);break}}function au(r){let e=_.getLogichValue(r,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&_.setInitialStorageValue(e);}var bd=Cd(vd()),Ad=class extends narration.LabelAbstract{constructor(r,e,t,n={}){t||(t={}),t.onLoadingLabel=async()=>{for(let i of e){let a;if(typeof i=="function"?a=i():a=i,a=_.getConditionalStep(a),a.operations)try{let s=a.operations.map(o=>_.loadAssets(o));await Promise.all(s);}catch(s){se.error("The operation in the onLoadingLabel function of the label has an error:",s);}}},super(r,t),this._steps=e,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(r=>this.stepConverter(r))}get stepCount(){return this._steps.length}getStepById(r){if(r<0||r>=this._steps.length)return;let e=this._steps[r];return this.stepConverter(e)}operationStringConvert;skipEmptyDialogs=false;getStepSha(r){if(r<0||r>=this.steps.length)return;let e=this._steps[r];return (0, bd.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(r,e){let t="";if(Array.isArray(r)){let n=[];r.forEach(i=>{if(typeof i=="string")n.push(i);else if(i&&typeof i=="object"){let a=_.getLogichValue(i,e);a?(a&&!Array.isArray(a)&&typeof a=="object"&&(a=_.getLogichValue(a,e)||""),Array.isArray(a)?n=n.map(s=>`${s}`).concat(a):n.push(`${a}`)):n.push(`${i}`);}else n.push(`${i}`);}),t=n;}else {let n=_.getLogichValue(r,e);n&&!Array.isArray(n)&&typeof n=="object"&&(n=_.getLogichValue(n,e)),n&&Array.isArray(n)?t=n.map(i=>`${i}`):t=`${n}`;}return t}getDialogue(r,e){if(r==null)return;let t=_.getLogichValue(r,e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:oe.t(this.getDialogueText(t.text,e))}:oe.t(this.getDialogueText(t,e))}getChoices(r,e){return _.getLogichValue(r,e)?.map(t=>_.getLogichValue(t,e)).filter(t=>t!==void 0)}stepConverter(r){return async e=>{let t=typeof r=="function"?r():r;t=pixiVn.createExportableElement(t),t=_.getConditionalStep(t,e);let n=this.operationStringConvert?d=>this.operationStringConvert(d,t,e):void 0,{operations:i=[]}=t;for(let d of i)await uu(d,e,n);let{labelToOpen:a=[]}=t,s=this.getChoices(t.choices,e),o=_.getLogichValue(t.glueEnabled,e),u=this.getDialogue(t.dialogue,e),l=[];Array.isArray(a)||(a=[a]),a.forEach(d=>{let f=_.getLogichValue(d,e);f&&l.push(f);});let h=_.getLogichValue(t.goNextStep,e),c=_.getLogichValue(t.end,e);if(s){let d=s.map(f=>{let m="";if(Array.isArray(f.text)){let g=[];f.text.forEach(b=>{if(typeof b=="string")g.push(oe.t(b));else if(b&&typeof b=="object"){let S=_.getLogichValue(b,e);S&&!Array.isArray(S)&&typeof S=="object"&&(S=_.getLogichValue(S,e)||""),S&&(Array.isArray(S)?g=g.concat(oe.t(S)):g.push(oe.t(S)));}}),m=g;}else typeof f.text=="string"&&(m=oe.t(f.text));return {label:f.label,text:m,props:f.props,type:f.type,oneTime:f.oneTime,onlyHaveNoChoice:f.onlyHaveNoChoice,autoSelect:f.autoSelect}});narration.narration.choices=d;}else narration.narration.choices=void 0;u!==void 0&&(narration.narration.dialogue=u,this.skipEmptyDialogs&&typeof u=="string"&&(u===""||RegExp(/^\s+$/).test(u))&&(h=true)),o?narration.narration.dialogGlue=true:o===false&&(narration.narration.dialogGlue=false);for(let d of l){let f=d.label;typeof f=="object"&&(f=_.getLogichValue(f,e)||"");let m=d.params?.map(g=>_.getLogichValue(g,e));e={...e,...d.props},d.type==="jump"?(narration.narration.openedLabels.length>0&&narration.narration.closeCurrentLabel(),storage.storage.setTempVariable(`${su}${narration.narration.openedLabels.length}`,m),await narration.narration.call(f,e)):(storage.storage.setTempVariable(`${su}${narration.narration.openedLabels.length}`,m),await narration.narration.call(f,e));}c==="game_end"?(narration.narration.closeAllLabels(),await narration.narration.continue(e,{runNow:true})):c==="label_end"&&narration.narration.closeCurrentLabel(),h&&await narration.narration.continue(e,{runNow:true});}}};async function Ks(r,e={}){if(!Array.isArray(r))if(typeof r=="object"||typeof r=="string")r=[r];else {se.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let t=r.map(a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(s){return se.error("Error parsing imported Pixi'VN JSON",s),{}}return a}),n=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)s.type==="value"&&(typeof s.value!="object"||!s.value||!("type"in s.value))&&au(s);return Promise.resolve()});await Promise.all(n);let i=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)(s.type!=="value"||s.type==="value"&&typeof s.value=="object"&&s.value&&"type"in s.value)&&au(s);if(a.labels){let s=a.labels;for(let o in s)try{let u=s[o],l=new Ad(o,u,void 0,e);narration.RegisteredLabels.add(l);}catch(u){se.error(`Error creating JSON label ${o}`,u);}}return Promise.resolve()});await Promise.all(i);}var xd={version:"1.13.10"};var hu=`https://pixi-vn.com/schemas/${xd.version}/schema.json`,cu=["==","!=","<","<=",">",">=","CONTAINS"];function Xs(){_.init({animateOperation:Kl,canvasElementOperation:zl,effectOperation:Ul,imageContainerOperation:Jl,imageOperation:Gl,textOperation:Hl,narrationOperation:Xl,loadAssets:Ml,soundOperation:Yl,videoOperation:$l,setStorageValue:Zl,setInitialStorageValue:eu,getLogichValue:exports.VariableGetter.getLogichValue,getConditionalStep:mi});}var gi="global decl",_t="___external_value___",Ci=/\[([^\]]+)\]/;function wd(r){oe.afterToTranslate=e=>du(e,r);}function _d(r){oe.beforeToTranslate=e=>du(e,r);}function du(r,e){let t=new RegExp(Ci.source,"g"),n=new Set,i=true;for(;i;){i=false;let a=[...r.matchAll(t)],s=new Set;for(let o of a){let u=o[1];if(s.has(u)||n.has(u))continue;s.add(u);let l=e(u);l!==void 0?(r=r.replaceAll(o[0],l),i=true):n.add(u);}}return r}var W;(i=>(i.log=(a,...s)=>console.log(`[Pixi\u2019VN Ink] ${a}`,...s),i.warn=(a,...s)=>console.warn(`[Pixi\u2019VN Ink] ${a}`,...s),i.error=(a,...s)=>console.error(`[Pixi\u2019VN Ink] ${a}`,...s),i.info=(a,...s)=>console.info(`[Pixi\u2019VN Ink] ${a}`,...s)))(W||={});var Td=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Od=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Pd=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Ys={Space_Separator:Td,ID_Start:Od,ID_Continue:Pd},ne={isSpaceSeparator(r){return typeof r=="string"&&Ys.Space_Separator.test(r)},isIdStartChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="$"||r==="_"||Ys.ID_Start.test(r))},isIdContinueChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"||r==="$"||r==="_"||r==="\u200C"||r==="\u200D"||Ys.ID_Continue.test(r))},isDigit(r){return typeof r=="string"&&/[0-9]/.test(r)},isHexDigit(r){return typeof r=="string"&&/[0-9A-Fa-f]/.test(r)}},Zs,Ee,ot,vi,pt,$e,le,na,bn,Fd=function(e,t){Zs=String(e),Ee="start",ot=[],vi=0,pt=1,$e=0,le=void 0,na=void 0,bn=void 0;do le=Nd(),kd[Ee]();while(le.type!=="eof");return typeof t=="function"?ea({"":bn},"",t):bn};function ea(r,e,t){let n=r[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let a=String(i),s=ea(n,a,t);s===void 0?delete n[a]:Object.defineProperty(n,a,{value:s,writable:true,enumerable:true,configurable:true});}else for(let i in n){let a=ea(n,i,t);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:true,enumerable:true,configurable:true});}return t.call(r,e,n)}var V,I,Dn,at,L;function Nd(){for(V="default",I="",Dn=false,at=1;;){L=lt();let r=fu[V]();if(r)return r}}function lt(){if(Zs[vi])return String.fromCodePoint(Zs.codePointAt(vi))}function A(){let r=lt();return r===`
|
|
46
|
+
${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogichValue(u[0],e),h=typeof l=="object"&&"character"in l?l.character:void 0,c=u.flatMap(y=>{let p;y&&typeof y=="object"&&"text"in y?p=y.text:p=y;let D;return Array.isArray(p)?D=p.map(C=>{let E=_.getLogichValue(C,e);return oe.t(`${E}`)}):D=_.getLogichValue(p,e)||"",oe.t(D)}),d=a.find(y=>y.end),f=a.find(y=>y.choices),m=false,g=false;a.length>0&&(a[0].glueEnabled&&a[0].goNextStep&&a[0].dialogue===void 0&&(narration.narration.dialogGlue=true),m=a[a.length-1].glueEnabled,g=a.reverse().find(y=>!(y.operations&&(!y.dialogue||!y.choices)))?.goNextStep);let b=a.find(y=>y.labelToOpen),S=[];return a.forEach(y=>{y.operations&&(S=[...S,...y.operations]);}),{dialogue:h?{character:h,text:c}:c,end:d?.end,choices:f?.choices,glueEnabled:m,goNextStep:g,labelToOpen:b?.labelToOpen,operations:S}}}exports.VariableGetter=void 0;(r=>{let e=new Set;function t(a){e.add(a);}r.add=t;function n(){e.clear();}r.clear=n;function i(a,s={}){let o=h=>tu(h,s)??void 0,u=nu(a,s);if(e.size===0)return o(u);let l=o;for(let h of e){let c=l;l=d=>h(d,c)??void 0;}return l(u)}r.getLogichValue=i;})(exports.VariableGetter||={});var cd=Object.create,ou=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,pd=Object.getOwnPropertyNames,fd=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty,ru=(r=>typeof wt<"u"?wt:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof wt<"u"?wt:e)[t]}):r)(function(r){if(typeof wt<"u")return wt.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),lu=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),gd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pd(e))!md.call(r,i)&&i!==t&&ou(r,i,{get:()=>e[i],enumerable:!(n=dd(e,i))||n.enumerable});return r},Cd=(r,e,t)=>(t=r!=null?cd(fd(r)):{},gd(ou(t,"default",{value:r,enumerable:true}),r)),yd=lu((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n():typeof define=="function"&&define.amd?define([],n):t.CryptoJS=n();})(r,function(){var t=t||(function(n,i){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof global<"u"&&global.crypto&&(a=global.crypto),!a&&typeof ru=="function")try{a=ru("crypto");}catch{}var s=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||(function(){function y(){}return function(p){var D;return y.prototype=p,D=new y,y.prototype=null,D}})(),u={},l=u.lib={},h=l.Base=(function(){return {extend:function(y){var p=o(this);return y&&p.mixIn(y),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments);}),p.init.prototype=p,p.$super=this,p},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var p in y)y.hasOwnProperty(p)&&(this[p]=y[p]);y.hasOwnProperty("toString")&&(this.toString=y.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=l.WordArray=h.extend({init:function(y,p){y=this.words=y||[],p!=i?this.sigBytes=p:this.sigBytes=y.length*4;},toString:function(y){return (y||f).stringify(this)},concat:function(y){var p=this.words,D=y.words,C=this.sigBytes,E=y.sigBytes;if(this.clamp(),C%4)for(var w=0;w<E;w++){var P=D[w>>>2]>>>24-w%4*8&255;p[C+w>>>2]|=P<<24-(C+w)%4*8;}else for(var N=0;N<E;N+=4)p[C+N>>>2]=D[N>>>2];return this.sigBytes+=E,this},clamp:function(){var y=this.words,p=this.sigBytes;y[p>>>2]&=4294967295<<32-p%4*8,y.length=n.ceil(p/4);},clone:function(){var y=h.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var p=[],D=0;D<y;D+=4)p.push(s());return new c.init(p,y)}}),d=u.enc={},f=d.Hex={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var w=p[E>>>2]>>>24-E%4*8&255;C.push((w>>>4).toString(16)),C.push((w&15).toString(16));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C+=2)D[C>>>3]|=parseInt(y.substr(C,2),16)<<24-C%8*4;return new c.init(D,p/2)}},m=d.Latin1={stringify:function(y){for(var p=y.words,D=y.sigBytes,C=[],E=0;E<D;E++){var w=p[E>>>2]>>>24-E%4*8&255;C.push(String.fromCharCode(w));}return C.join("")},parse:function(y){for(var p=y.length,D=[],C=0;C<p;C++)D[C>>>2]|=(y.charCodeAt(C)&255)<<24-C%4*8;return new c.init(D,p)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(m.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return m.parse(unescape(encodeURIComponent(y)))}},b=l.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes;},_process:function(y){var p,D=this._data,C=D.words,E=D.sigBytes,w=this.blockSize,P=w*4,N=E/P;y?N=n.ceil(N):N=n.max((N|0)-this._minBufferSize,0);var Z=N*w,ve=n.min(Z*4,E);if(Z){for(var Gt=0;Gt<Z;Gt+=w)this._doProcessBlock(C,Gt);p=C.splice(0,Z),D.sigBytes-=ve;}return new c.init(p,ve)},clone:function(){var y=h.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});l.Hasher=b.extend({cfg:h.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset();},reset:function(){b.reset.call(this),this._doReset();},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var p=this._doFinalize();return p},blockSize:16,_createHelper:function(y){return function(p,D){return new y.init(D).finalize(p)}},_createHmacHelper:function(y){return function(p,D){return new S.HMAC.init(y,D).finalize(p)}}});var S=u.algo={};return u})(Math);return t});}),vd=lu((r,e)=>{(function(t,n){typeof r=="object"?e.exports=r=n(yd()):typeof define=="function"&&define.amd?define(["./core"],n):n(t.CryptoJS);})(r,function(t){return (function(){var n=t,i=n.lib,a=i.WordArray,s=i.Hasher,o=n.algo,u=[],l=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var d=this._hash.words,f=d[0],m=d[1],g=d[2],b=d[3],S=d[4],y=0;y<80;y++){if(y<16)u[y]=h[c+y]|0;else {var p=u[y-3]^u[y-8]^u[y-14]^u[y-16];u[y]=p<<1|p>>>31;}var D=(f<<5|f>>>27)+S+u[y];y<20?D+=(m&g|~m&b)+1518500249:y<40?D+=(m^g^b)+1859775393:y<60?D+=(m&g|m&b|g&b)-1894007588:D+=(m^g^b)-899497514,S=b,b=g,g=m<<30|m>>>2,m=f,f=D;}d[0]=d[0]+f|0,d[1]=d[1]+m|0,d[2]=d[2]+g|0,d[3]=d[3]+b|0,d[4]=d[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,d=this._nDataBytes*8,f=h.sigBytes*8;return c[f>>>5]|=128<<24-f%32,c[(f+64>>>9<<4)+14]=Math.floor(d/4294967296),c[(f+64>>>9<<4)+15]=d,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l);})(),t.SHA1});}),su="___param___",se;(r=>(r.log=(e,...t)=>console.log(`[Pixi\u2019VN Json] ${e}`,...t),r.warn=(e,...t)=>console.warn(`[Pixi\u2019VN Json] ${e}`,...t),r.error=(e,...t)=>console.error(`[Pixi\u2019VN Json] ${e}`,...t),r.info=(e,...t)=>console.info(`[Pixi\u2019VN Json] ${e}`,...t)))(se||={});var Sd=class ${static init(e){e.loadAssets&&($._loadAssets=e.loadAssets),e.soundOperation&&($._soundOperation=e.soundOperation),e.imageOperation&&($._imageOperation=e.imageOperation),e.videoOperation&&($._videoOperation=e.videoOperation),e.imageContainerOperation&&($._imageContainerOperation=e.imageContainerOperation),e.textOperation&&($._textOperation=e.textOperation),e.canvasElementOperation&&($._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&($._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&($._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&($._narrationOperation=e.narrationOperation),e.effectOperation&&($._effectOperation=e.effectOperation),e.animateOperation&&($._animateOperation=e.animateOperation),e.getLogichValue&&($._getLogichValue=e.getLogichValue),e.getConditionalStep&&($._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return $._loadAssets}static _soundOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return $._soundOperation}static _imageOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return $._imageOperation}static _videoOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return $._videoOperation}static _imageContainerOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return $._imageContainerOperation}static _textOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return $._textOperation}static _canvasElementOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return $._canvasElementOperation}static _setStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return $._setStorageValue}static _setInitialStorageValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return $._setInitialStorageValue}static _narrationOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return $._narrationOperation}static _effectOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return $._effectOperation}static _animateOperation=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return $._animateOperation}static _getLogichValue=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return $._getLogichValue}static _getConditionalStep=()=>{throw se.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return $._getConditionalStep}};function Ed(r,e){if(e&&typeof e=="object"&&typeof r.functionName=="string"&&r.functionName in e){let t=e[r.functionName];if(typeof t=="function"){let n=r.args.map(i=>Sd.getLogichValue(i,e));return t(...n)}else se.warn(`getLogichValue function ${r.functionName} not found in props`);}}function Dd(r,e={}){let t="";return r.values.forEach(n=>{if(typeof n=="string")t+=n;else {let i=_.getLogichValue(n,e);t+=`${i}`;}}),t}async function uu(r,e,t){let n=_.getLogichValue(r,e);if(n)switch(n.type){case "sound":_.soundOperation(n);break;case "assets":case "bundle":await _.loadAssets(n);break;case "image":await _.imageOperation(n);break;case "video":await _.videoOperation(n);break;case "imagecontainer":await _.imageContainerOperation(n);break;case "text":await _.textOperation(n);break;case "canvaselement":await _.canvasElementOperation(n);break;case "value":_.setStorageValue(n,e);break;case "operationtoconvert":if(t){let i=Dd(n,e),a=await t(i);a&&await uu(a,e,t);}break;case "input":case "dialogue":_.narrationOperation(n);break;case "shake":await _.effectOperation(n);break;case "animate":case "animate-sequence":_.animateOperation(n);break;case "function":await Ed(n,e);break}}function au(r){let e=_.getLogichValue(r,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&_.setInitialStorageValue(e);}var bd=Cd(vd()),Ad=class extends narration.LabelAbstract{constructor(r,e,t,n={}){t||(t={}),t.onLoadingLabel=async()=>{for(let i of e){let a;if(typeof i=="function"?a=i():a=i,a=_.getConditionalStep(a),a.operations)try{let s=a.operations.map(o=>_.loadAssets(o));await Promise.all(s);}catch(s){se.error("The operation in the onLoadingLabel function of the label has an error:",s);}}},super(r,t),this._steps=e,this.operationStringConvert=n.operationStringConvert,this.skipEmptyDialogs=n.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(r=>this.stepConverter(r))}get stepCount(){return this._steps.length}getStepById(r){if(r<0||r>=this._steps.length)return;let e=this._steps[r];return this.stepConverter(e)}operationStringConvert;skipEmptyDialogs=false;getStepSha(r){if(r<0||r>=this.steps.length)return;let e=this._steps[r];return (0, bd.default)(e.toString().toLocaleLowerCase()).toString()}getDialogueText(r,e){let t="";if(Array.isArray(r)){let n=[];r.forEach(i=>{if(typeof i=="string")n.push(i);else if(i&&typeof i=="object"){let a=_.getLogichValue(i,e);a?(a&&!Array.isArray(a)&&typeof a=="object"&&(a=_.getLogichValue(a,e)||""),Array.isArray(a)?n=n.map(s=>`${s}`).concat(a):n.push(`${a}`)):n.push(`${i}`);}else n.push(`${i}`);}),t=n;}else {let n=_.getLogichValue(r,e);n&&!Array.isArray(n)&&typeof n=="object"&&(n=_.getLogichValue(n,e)),n&&Array.isArray(n)?t=n.map(i=>`${i}`):t=`${n}`;}return t}getDialogue(r,e){if(r==null)return;let t=_.getLogichValue(r,e);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:oe.t(this.getDialogueText(t.text,e))}:oe.t(this.getDialogueText(t,e))}getChoices(r,e){return _.getLogichValue(r,e)?.map(t=>_.getLogichValue(t,e)).filter(t=>t!==void 0)}stepConverter(r){return async e=>{let t=typeof r=="function"?r():r;t=pixiVn.createExportableElement(t),t=_.getConditionalStep(t,e);let n=this.operationStringConvert?d=>this.operationStringConvert(d,t,e):void 0,{operations:i=[]}=t;for(let d of i)await uu(d,e,n);let{labelToOpen:a=[]}=t,s=this.getChoices(t.choices,e),o=_.getLogichValue(t.glueEnabled,e),u=this.getDialogue(t.dialogue,e),l=[];Array.isArray(a)||(a=[a]),a.forEach(d=>{let f=_.getLogichValue(d,e);f&&l.push(f);});let h=_.getLogichValue(t.goNextStep,e),c=_.getLogichValue(t.end,e);if(s){let d=s.map(f=>{let m="";if(Array.isArray(f.text)){let g=[];f.text.forEach(b=>{if(typeof b=="string")g.push(oe.t(b));else if(b&&typeof b=="object"){let S=_.getLogichValue(b,e);S&&!Array.isArray(S)&&typeof S=="object"&&(S=_.getLogichValue(S,e)||""),S&&(Array.isArray(S)?g=g.concat(oe.t(S)):g.push(oe.t(S)));}}),m=g;}else typeof f.text=="string"&&(m=oe.t(f.text));return {label:f.label,text:m,props:f.props,type:f.type,oneTime:f.oneTime,onlyHaveNoChoice:f.onlyHaveNoChoice,autoSelect:f.autoSelect}});narration.narration.choices=d;}else narration.narration.choices=void 0;u!==void 0&&(narration.narration.dialogue=u,this.skipEmptyDialogs&&typeof u=="string"&&(u===""||RegExp(/^\s+$/).test(u))&&(h=true)),o?narration.narration.dialogGlue=true:o===false&&(narration.narration.dialogGlue=false);for(let d of l){let f=d.label;typeof f=="object"&&(f=_.getLogichValue(f,e)||"");let m=d.params?.map(g=>_.getLogichValue(g,e));e={...e,...d.props},d.type==="jump"?(narration.narration.openedLabels.length>0&&narration.narration.closeCurrentLabel(),storage.storage.setTempVariable(`${su}${narration.narration.openedLabels.length}`,m),await narration.narration.call(f,e)):(storage.storage.setTempVariable(`${su}${narration.narration.openedLabels.length}`,m),await narration.narration.call(f,e));}c==="game_end"?(narration.narration.closeAllLabels(),await narration.narration.continue(e,{runNow:true})):c==="label_end"&&narration.narration.closeCurrentLabel(),h&&await narration.narration.continue(e,{runNow:true});}}};async function Ks(r,e={}){if(!Array.isArray(r))if(typeof r=="object"||typeof r=="string")r=[r];else {se.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let t=r.map(a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(s){return se.error("Error parsing imported Pixi'VN JSON",s),{}}return a}),n=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)s.type==="value"&&(typeof s.value!="object"||!s.value||!("type"in s.value))&&au(s);return Promise.resolve()});await Promise.all(n);let i=t.map(async a=>{if(a.initialOperations)for(let s of a.initialOperations)(s.type!=="value"||s.type==="value"&&typeof s.value=="object"&&s.value&&"type"in s.value)&&au(s);if(a.labels){let s=a.labels;for(let o in s)try{let u=s[o],l=new Ad(o,u,void 0,e);narration.RegisteredLabels.add(l);}catch(u){se.error(`Error creating JSON label ${o}`,u);}}return Promise.resolve()});await Promise.all(i);}var xd={version:"1.13.12"};var hu=`https://pixi-vn.com/schemas/${xd.version}/schema.json`,cu=["==","!=","<","<=",">",">=","CONTAINS"];function Xs(){_.init({animateOperation:Kl,canvasElementOperation:zl,effectOperation:Ul,imageContainerOperation:Jl,imageOperation:Gl,textOperation:Hl,narrationOperation:Xl,loadAssets:Ml,soundOperation:Yl,videoOperation:$l,setStorageValue:Zl,setInitialStorageValue:eu,getLogichValue:exports.VariableGetter.getLogichValue,getConditionalStep:mi});}var gi="global decl",_t="___external_value___",Ci=/\[([^\]]+)\]/;function wd(r){oe.afterToTranslate=e=>du(e,r);}function _d(r){oe.beforeToTranslate=e=>du(e,r);}function du(r,e){let t=new RegExp(Ci.source,"g"),n=new Set,i=true;for(;i;){i=false;let a=[...r.matchAll(t)],s=new Set;for(let o of a){let u=o[1];if(s.has(u)||n.has(u))continue;s.add(u);let l=e(u);l!==void 0?(r=r.replaceAll(o[0],l),i=true):n.add(u);}}return r}var W;(i=>(i.log=(a,...s)=>console.log(`[Pixi\u2019VN Ink] ${a}`,...s),i.warn=(a,...s)=>console.warn(`[Pixi\u2019VN Ink] ${a}`,...s),i.error=(a,...s)=>console.error(`[Pixi\u2019VN Ink] ${a}`,...s),i.info=(a,...s)=>console.info(`[Pixi\u2019VN Ink] ${a}`,...s)))(W||={});var Td=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Od=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Pd=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Ys={Space_Separator:Td,ID_Start:Od,ID_Continue:Pd},ne={isSpaceSeparator(r){return typeof r=="string"&&Ys.Space_Separator.test(r)},isIdStartChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="$"||r==="_"||Ys.ID_Start.test(r))},isIdContinueChar(r){return typeof r=="string"&&(r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"||r==="$"||r==="_"||r==="\u200C"||r==="\u200D"||Ys.ID_Continue.test(r))},isDigit(r){return typeof r=="string"&&/[0-9]/.test(r)},isHexDigit(r){return typeof r=="string"&&/[0-9A-Fa-f]/.test(r)}},Zs,Ee,ot,vi,pt,$e,le,na,bn,Fd=function(e,t){Zs=String(e),Ee="start",ot=[],vi=0,pt=1,$e=0,le=void 0,na=void 0,bn=void 0;do le=Nd(),kd[Ee]();while(le.type!=="eof");return typeof t=="function"?ea({"":bn},"",t):bn};function ea(r,e,t){let n=r[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let a=String(i),s=ea(n,a,t);s===void 0?delete n[a]:Object.defineProperty(n,a,{value:s,writable:true,enumerable:true,configurable:true});}else for(let i in n){let a=ea(n,i,t);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:true,enumerable:true,configurable:true});}return t.call(r,e,n)}var V,I,Dn,at,L;function Nd(){for(V="default",I="",Dn=false,at=1;;){L=lt();let r=fu[V]();if(r)return r}}function lt(){if(Zs[vi])return String.fromCodePoint(Zs.codePointAt(vi))}function A(){let r=lt();return r===`
|
|
47
47
|
`?(pt++,$e=0):r?$e+=r.length:$e++,r&&(vi+=r.length),r}var fu={default(){switch(L){case " ":case "\v":case "\f":case " ":case "\xA0":case "\uFEFF":case `
|
|
48
48
|
`:case "\r":case "\u2028":case "\u2029":A();return;case "/":A(),V="comment";return;case void 0:return A(),K("eof")}if(ne.isSpaceSeparator(L)){A();return}return fu[Ee]()},comment(){switch(L){case "*":A(),V="multiLineComment";return;case "/":A(),V="singleLineComment";return}throw X(A())},multiLineComment(){switch(L){case "*":A(),V="multiLineCommentAsterisk";return;case void 0:throw X(A())}A();},multiLineCommentAsterisk(){switch(L){case "*":A();return;case "/":A(),V="default";return;case void 0:throw X(A())}A(),V="multiLineComment";},singleLineComment(){switch(L){case `
|
|
49
49
|
`:case "\r":case "\u2028":case "\u2029":A(),V="default";return;case void 0:return A(),K("eof")}A();},value(){switch(L){case "{":case "[":return K("punctuator",A());case "n":return A(),Tt("ull"),K("null",null);case "t":return A(),Tt("rue"),K("boolean",true);case "f":return A(),Tt("alse"),K("boolean",false);case "-":case "+":A()==="-"&&(at=-1),V="sign";return;case ".":I=A(),V="decimalPointLeading";return;case "0":I=A(),V="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":I=A(),V="decimalInteger";return;case "I":return A(),Tt("nfinity"),K("numeric",1/0);case "N":return A(),Tt("aN"),K("numeric",NaN);case '"':case "'":Dn=A()==='"',I="",V="string";return}throw X(A())},identifierNameStartEscape(){if(L!=="u")throw X(A());A();let r=ta();switch(r){case "$":case "_":break;default:if(!ne.isIdStartChar(r))throw pu();break}I+=r,V="identifierName";},identifierName(){switch(L){case "$":case "_":case "\u200C":case "\u200D":I+=A();return;case "\\":A(),V="identifierNameEscape";return}if(ne.isIdContinueChar(L)){I+=A();return}return K("identifier",I)},identifierNameEscape(){if(L!=="u")throw X(A());A();let r=ta();switch(r){case "$":case "_":case "\u200C":case "\u200D":break;default:if(!ne.isIdContinueChar(r))throw pu();break}I+=r,V="identifierName";},sign(){switch(L){case ".":I=A(),V="decimalPointLeading";return;case "0":I=A(),V="zero";return;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":I=A(),V="decimalInteger";return;case "I":return A(),Tt("nfinity"),K("numeric",at*(1/0));case "N":return A(),Tt("aN"),K("numeric",NaN)}throw X(A())},zero(){switch(L){case ".":I+=A(),V="decimalPoint";return;case "e":case "E":I+=A(),V="decimalExponent";return;case "x":case "X":I+=A(),V="hexadecimal";return}return K("numeric",at*0)},decimalInteger(){switch(L){case ".":I+=A(),V="decimalPoint";return;case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},decimalPointLeading(){if(ne.isDigit(L)){I+=A(),V="decimalFraction";return}throw X(A())},decimalPoint(){switch(L){case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A(),V="decimalFraction";return}return K("numeric",at*Number(I))},decimalFraction(){switch(L){case "e":case "E":I+=A(),V="decimalExponent";return}if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},decimalExponent(){switch(L){case "+":case "-":I+=A(),V="decimalExponentSign";return}if(ne.isDigit(L)){I+=A(),V="decimalExponentInteger";return}throw X(A())},decimalExponentSign(){if(ne.isDigit(L)){I+=A(),V="decimalExponentInteger";return}throw X(A())},decimalExponentInteger(){if(ne.isDigit(L)){I+=A();return}return K("numeric",at*Number(I))},hexadecimal(){if(ne.isHexDigit(L)){I+=A(),V="hexadecimalInteger";return}throw X(A())},hexadecimalInteger(){if(ne.isHexDigit(L)){I+=A();return}return K("numeric",at*Number(I))},string(){switch(L){case "\\":A(),I+=Id();return;case '"':if(Dn)return A(),K("string",I);I+=A();return;case "'":if(!Dn)return A(),K("string",I);I+=A();return;case `
|
|
@@ -65,7 +65,7 @@ ${D}`),D&&(o=true),s=_.getLogichValue(y.glueEnabled,e)||false,D)}),l=_.getLogich
|
|
|
65
65
|
# lazyload bundle <alias...>
|
|
66
66
|
\`\`\``,validation:v__default.default.union([v__default.default.tuple([v__default.default.enum(["load","lazyload"]),v__default.default.literal("assets")]).rest(e(r.assetAliasIds)),v__default.default.tuple([v__default.default.enum(["load","lazyload"]),v__default.default.literal("bundle")]).rest(e(r.bundleIds))])}),exports.HashtagCommands.addMapper(l=>({type:"all",operationType:l[0]}),{name:"Pause/Resume/Stop all sounds",description:"Pauses, resumes, or stops all active sounds at once.\n\n```ink\n# pause all sounds\n# resume all sounds\n# stop all sounds\n```",validation:v__default.default.tuple([v__default.default.enum(["pause","resume","stop"]),v__default.default.literal("all"),v__default.default.enum(["sounds","sound"])])}),exports.HashtagCommands.addMapper(l=>({type:"sound",operationType:"pause",alias:l[2]}),{name:"Pause sound",description:"Pauses the sound identified by its alias.\n\n```ink\n# pause sound <alias>\n```",validation:v__default.default.tuple([v__default.default.literal("pause"),v__default.default.literal("sound"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"channel",operationType:"pause",alias:l[2]}),{name:"Pause channel",description:"Pauses the audio channel identified by its alias.\n\n```ink\n# pause channel <alias>\n```",validation:v__default.default.tuple([v__default.default.literal("pause"),v__default.default.literal("channel"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"sound",operationType:"resume",alias:l[2]}),{name:"Resume sound",description:"Resumes the sound identified by its alias.\n\n```ink\n# resume sound <alias>\n```",validation:v__default.default.tuple([v__default.default.literal("resume"),v__default.default.literal("sound"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"channel",operationType:"resume",alias:l[2]}),{name:"Resume channel",description:"Resumes the audio channel identified by its alias.\n\n```ink\n# resume channel <alias>\n```",validation:v__default.default.tuple([v__default.default.literal("resume"),v__default.default.literal("channel"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"sound",operationType:"stop",alias:l[2]}),{name:"Stop sound",description:"Stops the sound identified by its alias.\n\n```ink\n# stop sound <alias>\n```",validation:v__default.default.tuple([v__default.default.literal("stop"),v__default.default.literal("sound"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"sound",operationType:"stop",alias:l[2]}),{name:"Remove sound",description:"Removes (stops) the sound identified by its alias.\n\n```ink\n# remove sound <alias>\n```",deprecated:true,validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("sound"),v__default.default.string()])}),exports.HashtagCommands.addMapper(l=>({type:"sound",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit sound",description:"Edits the properties of a sound identified by its alias.\n\n```ink\n# edit sound <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("sound"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>(l.length-3)%2===0)}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c={type:"sound",operationType:"play",alias:h,url:h};return l.length>3&&(c.props=exports.HashtagCommands.convertListStringToObj(l.slice(3))),c},{name:"Play sound",description:"Plays a sound using its alias as the URL, with optional key/value properties.\n\n```ink\n# play sound <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("play"),v__default.default.literal("sound"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>(l.length-3)%2===0)}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=l[3],d={type:"sound",operationType:"play",alias:h,url:c};return l.length>4&&(d.props=exports.HashtagCommands.convertListStringToObj(l.slice(4))),d},{name:"Play sound with source",description:"Plays a sound with an explicit source URL and optional key/value properties.\n \n```ink\n# play sound <alias> <source> [<key> <value> \u2026]\n```\n",validation:v__default.default.tuple([v__default.default.literal("play"),v__default.default.literal("sound"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>l.length>3&&(l.length-3)%2!==0)});function t(l){let h=[],c=0,d="";for(let f of l)f.startsWith("{")?(c++,d+=f):f.endsWith("}")&&c>0?(c--,d+=f,c===0&&(h.push(d),d="")):c>0?d+=f:h.push(f);return h}function n(l,h){switch(l){case "dissolve":case "fade":case "movein":case "moveout":case "zoomin":case "zoomout":case "pushin":case "pushout":break;default:return}let c={type:l};if(h.length>0)try{c.props=exports.HashtagCommands.convertListStringToObj(h);}catch{}return c}function i(l,h,c){let d,f;c.length%2===0?(d=h,f=c):(d=c[0],f=c.slice(1));let m={type:l,operationType:"show",alias:h,url:d};if(f.length>0){if(f.includes("with")&&f.length>f.indexOf("with")+1){let g=f[f.indexOf("with")+1],b=f.slice(f.indexOf("with")+2);f=f.slice(0,f.indexOf("with"));let S=n(g,b);S!==void 0&&(m.transition=S);}f.length>0&&(m.props=exports.HashtagCommands.convertListStringToObj(f));}return m}function a(l,h){let c,d;h.length%2===0?(c=l,d=h):(c=h[0],d=h.slice(1));let f={type:"text",operationType:"show",alias:l,text:c};if(d.length>0){if(d.includes("with")&&d.length>d.indexOf("with")+1){let m=d[d.indexOf("with")+1],g=d.slice(d.indexOf("with")+2);d=d.slice(0,d.indexOf("with"));let b=n(m,g);b!==void 0&&(f.transition=b);}d.length>0&&(f.props=exports.HashtagCommands.convertListStringToObj(d));}return f}function s(l,h,c){let d={type:l,operationType:"remove",alias:h};if(c.includes("with")&&c.length>c.indexOf("with")+1){let f=c[c.indexOf("with")+1],m=c.slice(c.indexOf("with")+2),g=n(f,m);g!==void 0&&(d.transition=g);}return d}function o(l,h){let c=S=>S.startsWith('"')&&S.endsWith('"')||S.startsWith("'")&&S.endsWith("'")||S.startsWith("`")&&S.endsWith("`")?S.substring(1,S.length-1):S,d=[],f=h.findIndex(S=>S.startsWith("[")),m=h.findIndex(S=>S.endsWith("]"));if(f===-1||m===-1){W.error("Show imagecontainer must have a list of image ulrs",h);return}if(d=h.slice(f,m+1),d.length<2){W.error("Show imagecontainer must have a list of image ulrs",h);return}d[0]==="["?d.shift():d[0]=d[0].substring(1),d[d.length-1]==="]"?d.pop():d[d.length-1]=d[d.length-1].substring(0,d[d.length-1].length-1);let g={type:"imagecontainer",operationType:"show",alias:l,urls:d.map(S=>c(S))},b=h.slice(m+1);if(b.length>0){if(b.includes("with")&&b.length>b.indexOf("with")+1){let S=b[b.indexOf("with")+1],y=b.slice(b.indexOf("with")+2);b=b.slice(0,b.indexOf("with"));let p=n(S,y);p!==void 0&&(g.transition=p);}b.length>0&&(g.props=exports.HashtagCommands.convertListStringToObj(b));}return g}function u(l){let h=l.slice(3),c=h.findIndex(g=>g.startsWith("[")),d=h.findIndex(g=>g.endsWith("]"));if(c===-1||d===-1||d<c)return;let f=h.slice(d+1),m=f.indexOf("with");return m===-1?{beforeWith:f,afterWith:[]}:{beforeWith:f.slice(0,m),afterWith:f.slice(m+1)}}exports.HashtagCommands.addMapper(l=>({alias:l[1],type:"shake",props:exports.HashtagCommands.convertListStringToObj(l.slice(2))}),{name:"Shake",description:"Applies shake effect to a canvas alias with optional key/value parameters.\n\n```ink\n# shake <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("shake"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>(l.length-2)%2===0)}),exports.HashtagCommands.addMapper(l=>{let h=l.slice(2),c=h,d=[];if(h.includes("options")){let m=h.indexOf("options");c=h.slice(0,m),d=h.slice(m+1);}return {alias:l[1],type:"animate",keyframes:exports.HashtagCommands.convertListStringToObj(c),options:exports.HashtagCommands.convertListStringToObj(d)}},{name:"Animate",description:"Animates a canvas alias with keyframes and optional options section, both in key/value pairs.\n\n```ink\n# animate <alias> [<key> <value> \u2026] [options <key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("animate"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>{let h=l.slice(2),c=h.indexOf("options");if(c===-1)return h.length%2===0;if(h.lastIndexOf("options")!==c)return false;let d=h.slice(0,c),f=h.slice(c+1);return d.length%2===0&&f.length%2===0})}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return i("image",h,c)},{name:"Show image",description:"Shows an image canvas element with optional source URL, key/value properties, and transition effect.\n\n```ink\n# show image <alias> [<source>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("image"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer",description:"Shows an image-container canvas element with a list of image URLs and optional key/value properties.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("imagecontainer"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length===0&&h.beforeWith.length%2===0})}),exports.HashtagCommands.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer with transition",description:"Shows an image-container canvas element with a list of image URLs, optional properties, and a transition effect.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026] with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("imagecontainer"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length===1&&h.beforeWith.length%2===0})}),exports.HashtagCommands.addMapper(l=>o(l[2],t(l.slice(3))),{name:"Show imagecontainer with transition and props",description:"Shows an image-container canvas element with a list of image URLs, optional properties, a transition effect, and transition key/value properties.\n\n```ink\n# show imagecontainer <alias> [ <url1> <url2> \u2026 ] [<key> <value> \u2026] with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout <key> <value> \u2026\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("imagecontainer"),v__default.default.string()]).rest(v__default.default.string()).refine(l=>{let h=u(l);return h===void 0?false:h.afterWith.length>1&&(h.afterWith.length-1)%2===0&&h.beforeWith.length%2===0})}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return i("video",h,c)},{name:"Show video",description:"Shows a video canvas element with optional source URL, key/value properties, and transition effect.\n\n```ink\n# show video <alias> [<source>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("video"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2];return a(h,l.slice(3))},{name:"Show text",description:"Shows a text canvas element with optional text content, key/value properties, and transition effect.\n\n```ink\n# show text <alias> [<text>] [<key> <value> \u2026] [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("show"),v__default.default.literal("text"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("image",h,c)},{name:"Remove image",description:"Removes an image canvas element with an optional transition effect.\n\n```ink\n# remove image <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("image"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("video",h,c)},{name:"Remove video",description:"Removes a video canvas element with an optional transition effect.\n\n```ink\n# remove video <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("video"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("canvaselement",h,c)},{name:"Remove canvas element",description:"Removes a canvas element with an optional transition effect.\n\n```ink\n# remove canvaselement <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("canvaselement"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("text",h,c)},{name:"Remove text",description:"Removes a text canvas element with an optional transition effect.\n\n```ink\n# remove text <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("text"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>{let h=l[2],c=t(l.slice(3));return s("imagecontainer",h,c)},{name:"Remove imagecontainer",description:"Removes an image-container canvas element with an optional transition effect.\n\n```ink\n# remove imagecontainer <alias> [with dissolve|fade|movein|moveout|zoomin|zoomout|pushin|pushout [<key> <value> \u2026]]\n```",validation:v__default.default.tuple([v__default.default.literal("remove"),v__default.default.literal("imagecontainer"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"image",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit image",description:"Edits the properties of an image canvas element identified by its alias.\n\n```ink\n# edit image <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("image"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"imagecontainer",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit imagecontainer",description:"Edits the properties of an image-container canvas element identified by its alias.\n\n```ink\n# edit imagecontainer <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("imagecontainer"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"canvaselement",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit canvas element",description:"Edits the properties of a canvas element identified by its alias.\n\n```ink\n# edit canvaselement <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("canvaselement"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"video",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit video",description:"Edits the properties of a video canvas element identified by its alias.\n\n```ink\n# edit video <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("video"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"text",operationType:"edit",alias:l[2],props:exports.HashtagCommands.convertListStringToObj(l.slice(3))}),{name:"Edit text",description:"Edits the properties of a text canvas element identified by its alias.\n\n```ink\n# edit text <alias> [<key> <value> \u2026]\n```",validation:v__default.default.tuple([v__default.default.literal("edit"),v__default.default.literal("text"),v__default.default.string()]).rest(v__default.default.string())}),exports.HashtagCommands.addMapper(l=>({type:"input",operationType:"request"}),{name:"Request input",description:"Requests player input without any additional constraints.\n\n```ink\n# request input\n```",validation:v__default.default.tuple([v__default.default.literal("request"),v__default.default.literal("input")])}),exports.HashtagCommands.addMapper(l=>{let h={type:"input",operationType:"request"};try{let c=exports.HashtagCommands.convertListStringToObj(l.slice(2));"type"in c&&typeof c.type=="string"&&(h.valueType=c.type),"default"in c&&(h.defaultValue=c.default);}catch{}return h},{name:"Request input with params",description:"Requests player input with optional key/value parameters (e.g. type, default).\n\n```ink\n# request input <key> <value> [<key> <value> \u2026]\n# request input type number default 18\n```",validation:v__default.default.tuple([v__default.default.literal("request"),v__default.default.literal("input")]).rest(v__default.default.string()).refine(l=>l.length>2&&(l.length-2)%2===0)});}function Gd(r){oe.translate=r;}async function $d(r,e={},t={}){let n=[];return r.labels&&Object.values(r.labels).forEach(i=>{n=n.concat(i);}),await oe.generateJsonTranslation(n,e,{...t,operationStringConvert:exports.HashtagCommands.run})}var bu=["+","-","/","*","%","_","==",">","<",">=","<=","!=","!","&&","||","MIN","MAX"],Au=["+","-","/","*","%","POW","RANDOM","L^"],xu=["INT","FLOOR","FLOAT"];function Jt(r,e){if(r.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(r)&&(r=r.split(".").filter(i=>!i.match(/^[0-9]+$/)).join("."),!r.startsWith(".")))return r.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(r)&&r.includes("g-")){let n=r.split("g-");return ia(e)+"_|_"+"g-"+n[n.length-1]}let t=0;for(;new RegExp(/^\.\^.*$/).test(r);)t++,r=r.substring(2);if(t=t-1,new RegExp(/^\..*$/).test(r)&&e){let n=r.substring(1);return ia(e,t)+"_|_"+n.replaceAll(".","_|_")}return r.replaceAll(".","_|_")||ia(e,t).replaceAll(".","_|_")}function ia(r,e=0){let t=r.split("_|_");for(;t.length>1&&e>0;)t.pop()?.includes("g-")&&e--,e--;return t.join("_|_")}var wu="\xA7DOUBLE_SLASH_CONVERTOR\xA7";function ze(r){return r.startsWith("^")&&(r=r.substring(1)),r=r.replaceAll("\\\\",wu),r=r.replaceAll("\\n",`
|
|
67
67
|
`),r=r.replaceAll("\\t"," "),r=r.replaceAll(" "," "),r=r.replaceAll(wu,"\\\\"),r}function ft(r,e,t,n){let{functions:i}=n;r=r.map(s=>{if(typeof s=="string")switch(s){case "rnd":return "RANDOM";case "?":return "CONTAINS"}return s});let a=[];return r.forEach(s=>{if(typeof s=="string")switch(s){case "&&":case "||":if(a.length>=2){let o={type:"union",unionType:s==="&&"?"and":"or",conditions:[a[a.length-2],a[a.length-1]]};a.pop(),a.pop(),a.push(o);}break;case "!":if(a.length===0)W.error("Error parsing ink file: Conditional statement is not valid",r);else {let o={type:"union",unionType:"not",condition:a[a.length-1]};a[a.length-1]=o;}break;case "!?":if(a.length>1){let o={type:"union",unionType:"not",condition:{type:"compare",operator:"CONTAINS",leftValue:a[a.length-2],rightValue:a[a.length-1]}};a.pop(),a.pop(),a.push(o);}else W.error("Error parsing ink file: Conditional statement is not valid",r);break;default:if(cu.includes(s))if(a.length<2)W.error("Error parsing ink file: Conditional statement is not valid",r);else {let o={type:"compare",operator:s,rightValue:a[a.length-1],leftValue:a[a.length-2]};a.pop(),a.pop(),a.push(o);}else if(Au.includes(s))if(a.length<2)W.error("Error parsing ink file: Conditional statement is not valid",r);else {s==="L^"&&(s="INTERSECTION");let o={type:"arithmetic",operator:s,rightValue:a[a.length-1],leftValue:a[a.length-2]};a.pop(),a.pop(),a.push(o);}else if(xu.includes(s)){let o={type:"arithmeticsingle",operator:s,leftValue:a[a.length-1]};a.pop(),a.push(o);}else s.startsWith("^")&&a.push(ze(s));}else if(typeof s=="object"&&"CNT?"in s)if(new RegExp(/.*\.[0-9]\..*/).test(s["CNT?"])){let o=s["CNT?"].split("."),u=o.pop(),l=o.pop();if(l===void 0||u===void 0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let h=Number(l),c=o.join(".");if(c.includes("^.")){let f=c.split("."),m=f[f.length-1].replaceAll(".","_|_");f.pop(),c=`${f.join(".")}.${m}`,u.includes("c-")&&(c=c+"_|_"+u);}else c=c.replaceAll(".","_|_");let d=Jt(c,e);if(!d)return;a.push({type:"compare",leftValue:ra(d),operator:">=",rightValue:{type:"value",value:h}});}else {let o=Jt(s["CNT?"],e);if(!o)return;a.push(ra(o));}else if(typeof s=="object"&&"VAR?"in s)a.push(Pt({key:s["VAR?"],defaultType:"storage"},t));else if(typeof s=="object"&&"f()"in s){let o=s["f()"],u=i.find(h=>h.name===o);if(!u){W.error(`Error parsing ink file: Function ${o} is not defined`,r);return}let l=[];for(let h=0;h<u.args;h++)a.length!==0&&l.push(a.pop());a.push({type:"function",functionName:o,args:l.reverse()});}else if(typeof s=="object"&&"^->"in s)s["^->"].includes("$r")||a.push(s["^->"]);else if(typeof s=="object"&&"list"in s){let o=Object.values(s.list).map(u=>u);a.push(o);}else a.push(s);}),a}function sa(r,e,t,n){return ft(r,e,t,n)}function Pt(r,e,t){let{key:n,defaultType:i}=r,a=e.indexOf(n);return a>=0?{type:"value",storageType:"params",storageOperationType:"get",key:a}:{type:"value",storageOperationType:"get",storageType:i,key:n}}function xn(r,e,t){let{key:n,value:i,defaultType:a,artmeticValue:s}=r,o=e.indexOf(n);if(o>=0)return [{type:"value",storageType:"params",storageOperationType:"set",key:o,value:i}];if(s){if(typeof i=="object"&&"list"in i){let u=Object.values(i.list).map(l=>l);return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:u}]}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:i}]}else if(typeof i=="object"){if("list"in i&&typeof i.list=="object"){if("origins"in i&&Array.isArray(i.origins)&&i.origins.length>0)return i.origins.reduce(u=>(u.push({type:"value",storageOperationType:"set",storageType:a,key:n,value:Object.values(t.enums[n])}),Object.entries(t.enums[n]).forEach(([l,h])=>{u.push({type:"value",storageOperationType:"set",storageType:a,key:`${n}.${l}`,value:h});}),u),[]);{let u=new Set,l=Object.entries(i.list).reduce((h,[c,d])=>{let[f,m]=c.split(".");return h.push({type:"value",storageOperationType:"set",storageType:a,key:m,value:d}),u.add(f),h},[]);return u.forEach(h=>{l.push({type:"value",storageOperationType:"set",storageType:a,key:h,value:Object.values(t.enums[h])});}),n in t.enums?Object.entries(t.enums[n]).forEach(([h,c])=>{l.push({type:"value",storageOperationType:"set",storageType:a,key:`${n}.${h}`,value:c});}):l.push({type:"value",storageOperationType:"set",storageType:a,key:n,value:Object.values(i.list)}),l}}else if(typeof i=="object"&&"VAR?"in i){if(typeof i["VAR?"]=="string"&&i["VAR?"].includes(".")){let[u,l]=i["VAR?"].split(".");if(u in t.enums&&l in t.enums[u])return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:t.enums[u][l]}]}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:Pt({key:i["VAR?"],defaultType:"storage"},e)}]}}return [{type:"value",storageOperationType:"set",storageType:a,key:n,value:i}]}function ra(r){return {type:"value",storageType:"label",storageOperationType:"get",label:r}}function aa(r,e){return e||new RegExp(`${"_|_".replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c-\\d+$`).test(r)?"call":"jump"}function Ei(r,e){if(e){if(typeof e=="string")e.startsWith("^")&&r.push(ze(e));else if(typeof e=="object"&&"type"in e)switch(e.type){case "value":case "function":console.warn("Warning: trying to add a value or function operation as text. This is likely a mistake, so it will be ignored.");break;default:r.push(e);}}}function oa(r,e,t,n,i,a={}){let{isNewLine:s=true,isHashtagScript:o=false,isThreads:u=false}=a;return Hd(r,e,t,n,i,{isNewLine:s,isHashtagScript:o,isThreads:u})}function Hd(r,e,t,n,i,a){if(!e)return;let{isNewLine:s,isHashtagScript:o=false,isThreads:u}=a;if(o){if(Array.isArray(e)&&e.length>0){let l={goNextStep:true},h=[];try{if(e.length===1&&typeof e[0]=="string"&&!e[0].match(Ci)){let c=e[0],d=exports.HashtagCommands.convertTagTolist(c),f=exports.HashtagCommands.convertOperation(d,l,{silent:!0});f&&(f.$origin=c,h.push(f));}}catch{}h.length===0&&h.push({type:"operationtoconvert",values:e}),r.push({...l,operations:h});}}else if(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get"){if(!s&&r.length>0){let l=r[r.length-1];!l.glueEnabled&&!l.operations&&!l.labelToOpen&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),r[r.length-1]=l;}typeof e=="string"?r.push(zd(ze(e),n.characterIds)):r.push({dialogue:e});}else if(typeof e=="string"){if(e==="end")r.push({end:"game_end"});else if(e==="done")r.push({end:"label_end",goNextStep:true});else if(e==="<>")if(r.length>0){let l=r[r.length-1];l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true),r[r.length-1]=l;}else r.push({glueEnabled:true,goNextStep:false});}else if(typeof e=="object"){if("type"in e)switch(e.type){case "value":e.storageOperationType==="set"?(typeof e.value=="string"&&e.value.startsWith("^")&&(e.value=ze(e.value)),r.push({goNextStep:true,operations:[e]})):console.warn("Warning: trying to add a value get operation as step. This is likely a mistake, so it will be ignored.");break;case "function":r.push({goNextStep:true,operations:[e]});break;default:if(!s&&r.length>0){let l=r[r.length-1];!l.glueEnabled&&!l.operations&&(l.glueEnabled=true,l.labelToOpen||(l.goNextStep=true)),r[r.length-1]=l;}r.push({conditionalStep:e});}else if("->"in e){let l=s?void 0:true;if(l&&t.includes("c-")&&r.length>0&&r[r.length-1]?.dialogue===void 0&&(l=void 0),!s&&r.length>0){let h=r[r.length-1];h.labelToOpen||(h.goNextStep=true),r[r.length-1]=h;}if(e.params&&e.params.length===0&&delete e.params,e.var)r.push({labelToOpen:{label:Pt({key:e["->"],defaultType:"storage"},i),type:u?"call":"jump",params:e.params},glueEnabled:l});else {let h=Jt(e["->"],t);if(!h)return;r.push({labelToOpen:{label:h,type:aa(h,u),params:e.params},glueEnabled:l});}}else if("->t->"in e){let l=s?void 0:true;if(l&&t.includes("c-")&&r.length>0&&r[r.length-1]?.dialogue===void 0&&(l=void 0),!s&&r.length>0){let c=r[r.length-1];c.labelToOpen||(c.goNextStep=true),r[r.length-1]=c;}e.params&&e.params.length===0&&delete e.params;let h=Jt(e["->t->"],t);if(!h)return;r.push({labelToOpen:{label:h,type:"call",params:e.params},glueEnabled:l});}}}function zd(r,e){let t;if(r.includes(": ")){let n=r.split(": "),i=n[0],a=n.slice(1).join(": ");(e?.has(i)||characters.RegisteredCharacters.has(i))&&(t=i,r=a);}return t?{dialogue:{character:t,text:r}}:{dialogue:r}}function la(r,e,t,n=true,i=false){return Ud(r,e,t,n,i)}function Ud(r,e,t,n,i=false){e&&(typeof e=="string"&&e.startsWith("^")||e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get"?typeof e=="string"?r.push(ze(e)):r.push(e):typeof e=="object"&&"type"in e&&r.push(e));}function Di(r,e,t,n){if(r.length===0){W.error("Error parsing ink file: Arithmetic statement is not valid",r);return}let i=ft(r,e,t,n);if(i.length===1){let a=i[0];return a&&typeof a=="object"&&"type"in a?{type:"value",storageType:"logic",storageOperationType:"get",operation:a}:a}}function Ht(r,e,t,n="",i,a,s=void 0){let o=[],u="sequential",l=false,h=true;r.forEach(f=>{f==="%"&&(u="loop"),f==="seq"&&(u="random"),f==="MIN"&&(l=true);});let c=r[r.length-1];return Object.keys(c).forEach(f=>{let m=c[f];if(Array.isArray(m)&&m.length>3){m=m.slice(1,m.length-2);let g=[];mt(m,n,i,g,e,e,t,zt,s,true,a),g.length===1?o.push(g[0]):o.push({type:"resulttocombine",combine:"cross",secondConditionalItem:g});}else Array.isArray(m)&&m.length===3&&(h=false);}),u==="sequential"?{type:"stepswitch",elements:o,choiceType:u,end:h?"lastItem":void 0,nestedId:s}:l&&u==="random"?{type:"stepswitch",elements:o,choiceType:"sequentialrandom",end:h?"lastItem":void 0,nestedId:s}:{type:"stepswitch",elements:o,choiceType:u}}function mt(r,e,t,n=[],i,a,s,o,u=void 0,l=true,h=[]){let c=false,d=[],f=false,m=false,g=false,b=[],S=[];if(t.preDialog[e]&&(l=false,i(n,`^${t.preDialog[e].text}`,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),t.preDialog[e].glue&&i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),delete t.preDialog[e]),r.includes("visit")){let p=Ht(r,a,s,e,t,h,u);p&&(!l&&n.length>0&&i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}));return}let y=r[0];if(y&&typeof y=="object"&&"temp="in y){for(;r[0]&&typeof r[0]=="object"&&"temp="in r[0];)h.push(r[0]["temp="]),r.shift();h=h.reverse();}if(r.forEach((p,D)=>{if(m){if(typeof p=="string"&&p==="/#"){let C=[];mt(S,e,t,C,la,la,s,o,u,l),i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),m=false,S=[];}else S.push(p);return}else if(c)if(Array.isArray(p))d.push(p);else if(p&&typeof p=="object")"CNT?"in p?D>0&&r[D-1]==="ev"?(f=true,b.push(p)):f?b.push(p):(d.push(p),l=false):"VAR="in p||"temp="in p?xn({key:"VAR="in p?p["VAR="]:p["temp="],value:r[D-1],defaultType:"VAR="in p?"storage":"tempstorage"},h,t).forEach(E=>{if(E.value&&typeof E.value=="string"&&E.value==="/str"&&(E.value=r[D-2]),E.value&&typeof E.value=="object"&&"^->"in E.value&&(E.value=E.value["^->"]),d.length>1){let w=Di(d,e,h,t);d=[],w&&typeof w=="object"&&"type"in w&&w.type==="value"&&"storageType"in w&&w.storageType==="logic"&&(E.value=w.operation);}(typeof E.key!="string"||!E.key.includes("$r"))&&(i(n,E,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=true);}):"VAR?"in p?d.push(p):"^->"in p?p["^->"].includes("$r")||d.push(p):("f()"in p||"list"in p&&typeof p.list=="object")&&d.push(p);else switch(p){case "/ev":f&&b.push(p),c=false,d.push(p);break;case "out":if(d.length>0){let C=d[d.length-1];if(C&&typeof C=="object"&&"VAR?"in C){d.pop();let E=Pt({key:C["VAR?"],defaultType:"storage"},h);i(n,E,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}else {let E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse();let w=Di(E,e,h,t);d=[],w&&typeof w=="object"&&"type"in w&&w.type==="value"&&"storageType"in w&&w.storageType==="logic"?i(n,{storageOperationType:"get",storageType:"logic",operation:w.operation,type:"value"},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}):(i(n,"<>",e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),w=`^${w}`,i(n,w,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}));}l=false;}break;case "pop":{let C=d[d.length-1];if(C&&typeof C=="object"&&"f()"in C){let E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse();let w=ft(E,e,h,t);d=[],w.forEach(P=>{P&&typeof P=="object"&&"type"in P&&P.type==="function"?i(n,P,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}):W.warn("Unhandled case: value is not a function",P);}),l=false;}else d.push(p);return}default:d.push(p);}else if(typeof p=="string")if(p.startsWith("^"))i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="ev")c=true;else if(p===`
|
|
68
|
-
`)l=true;else if(p==="done"||p==="end")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="<>")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="nop"&&f){let C=_u(b,a,s,e,t,h,u);C&&i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),f=false,b=[];}else p==="#"?m=true:p==="thread"&&(g=true);else if(Array.isArray(p))if(f)b.push(p);else if(p.length>1&&typeof p[p.length-2]=="object"&&p[p.length-2]&&"c"in p[p.length-2]&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"b"in p[p.length-1]){d.pop();let C=[],E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)C.push(d.pop());b=[...b,...C.reverse()],f=true,E.push(p.pop()),E.push(p.pop()),b=[...b,...p],b.push(E);}else if(p.length>1&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"#n"in p[p.length-1]){let C=p.pop();if(!C){W.error("Error parsing ink file: el is undefined");return}let E=C["#n"];delete C["#n"],p.push(C),i(n,{"->":e?e+"_|_"+E:E},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),s({[E]:p},e,t);}else mt(p,e,t,n,i,a,s,o,u,l,h);else if(p&&typeof p=="object")if("->"in p&&typeof p["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->"])){let C=[];d.length>0&&(C=sa(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("->t->"in p&&typeof p["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->t->"])){let C=[];d.length>0&&(C=sa(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("*"in p&&typeof p["*"]=="string")p["*"].includes("c")&&(d.push(p),l=false);else if("s"in p&&Array.isArray(p.s))d.push(p),l=false;else if("CNT?"in p)d.push(p),l=false;else if("VAR="in p||"temp="in p){let C="VAR="in p?p["VAR="]:p["temp="],E,w=[];if(C!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)w.push(d.pop());w=w.reverse(),E=Di(w,e,h,t),d=[],xn({key:C,value:E,defaultType:"VAR="in p?"storage":"tempstorage",artmeticValue:true},h,t).forEach(N=>{(N.value!==void 0||N.value!==null)&&i(n,N,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}),l=false;}}else s(p,e,t);}),o(d,n,e,t,h),e.includes("_|_")&&n.length===2){let p=n[0],D=n[1];p&&D&&typeof p=="object"&&"dialogue"in p&&typeof D=="object"&&"labelToOpen"in D&&p.dialogue===" "&&D.labelToOpen&&(n.shift(),delete D.glueEnabled,n[0]=D);}}function ha(r,e,t,n,i,a){if(e.length===0)return;let s=ft(e,n,t,i);if(s.length===1){let o={type:"ifelse",condition:s[0],then:r,else:a};return o.else||delete o.else,o}else if(s.length>1){let o={type:"ifelse",condition:{type:"union",unionType:"and",conditions:s},then:r,else:a};return o.else||delete o.else,o}}function _u(r,e,t,n,i,a,s=void 0){if(r.length===0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let o=[],u=[];if(r.forEach(c=>{Array.isArray(c)?u.push(c):typeof c=="string"&&c==="du"?i.du?o.push(i.du):i.du=o[o.length-1]:(typeof c!="string"||c!=="/ev")&&o.push(c);}),u.length===0){W.error("Error parsing ink file: Conditional statement is not valid",u);return}let l=ua(u[0],e,t,`${n}${"_|_"}then`,i,a,`${s||""}then`),h;return u.length===2?h=ua(u[1],e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`):u.length>2?(u.shift(),u.push("nop"),u=[{b:u}],h=ua(u,e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`)):h=void 0,i.du=void 0,ha(l,o,a,n,i,h)}function ua(r,e,t,n,i,a,s=void 0){let o=[];for(let l of r)typeof l=="object"&&"b"in l&&(l.b=l.b.filter(h=>h!==null&&!(typeof h=="object"&&"->"in h&&new RegExp(/.*\.[0-9]/).test(h["->"]))),mt(l.b,n,i,o,e,e,t,zt,s,true,a));return o.length===1?o[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:o}}function ca(r="",e=""){let t=Array.isArray(r)?r:[r],n=Array.isArray(e)?e:[e];return [...new Set([...t,...n])]}function zt(r,e,t,n,i){if(r.length>0){let a={};Tu(r,a,i,n);for(let[s,o]of Object.entries(a)){let u=t+"_|_"+s,l={text:o.text.length===1?o.text[0]:o.text,label:u,props:{},type:aa(u,false),oneTime:o.onetime};o.text.length===0&&(l.onlyHaveNoChoice=true,l.autoSelect=true),l.oneTime===false&&delete l.oneTime;let h=ha(l,o.conditions,i,t,n)||l,c=e[e.length-1];if(typeof c=="object"&&c&&"type"in c&&(c={conditionalStep:c}),e.length>0&&typeof c=="object"&&c&&"choices"in c&&c.choices){let d=c.choices;d&&Array.isArray(d)?d.push(h):W.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",o,d),c.choices=d.sort((f,m)=>{try{let g=f.label.split("."),b=g[g.length-1].replaceAll(".","_|_"),S=m.label.split("."),y=S[S.length-1].replaceAll(".","_|_");if(b.includes("c-")&&y.includes("c-")){let p=b.split("c-")[1],D=Number(p),C=y.split("c-")[1],E=Number(C);return D-E}}catch{}return 0});}else e.push({choices:[h]});o.preDialog&&(n.preDialog[u]={...o.preDialog});}}}function Tu(r,e,t,n,i){let a=[],s="",o="",u=false,l=[];for(let h=0;h<r.length;h++){let c=r[h];if(typeof c=="string")c.startsWith("^")?a.push(ze(c)):bu.includes(c)&&l.push(c);else if(Array.isArray(c)&&c.includes("visit")){let d=Ht(c,Ei,(f,m,g)=>{},i,n,t);a.push(d);}else if(c&&typeof c=="object")if("*"in c&&typeof c["*"]&&typeof c["*"]=="string")c["*"].includes("c")&&(s=`c${c["*"].split("c")[1]}`,c.flg&16&&(u=true));else if("s"in c&&Array.isArray(c.s)){let d=Ou(c.s),f=c.s.includes("<>");d&&(i&&e[i]?(e[i].preDialog={text:d,glue:f},e[i].text=ca(d,e[i].text)):(a.push(d),o=d));}else ("CNT?"in c||"VAR?"in c)&&l.push(c);else l.push(c);if(s){e[s]?e[s].text=ca(a,e[s].text):e[s]={text:a,onetime:u,conditions:l},o&&(e[s].preDialog={text:o,glue:false});let d=r.slice(h+1);Tu(d,e,t,n,s);return}}}function Ou(r){for(let e of r)if(typeof e=="string"){if(e.startsWith("^"))return ze(e)}else if(Array.isArray(e)){let t=Ou(e);if(t)return t}}var da;(i=>{function r(a,s={}){let{labelToRemove:o=[],initialVarsToRemove:u=[],enums:l={},functions:h=[],preDialog:c={},characterIds:d}=s,f={$schema:hu};if(f.labels=e(a.root,{labelToRemove:o,initialVarsToRemove:u,enums:l,functions:h,preDialog:c,characterIds:d}),f.labels&&gi in f.labels){let m=f.labels[gi];delete f.labels[gi],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}if(f.labels&&_t in f.labels){let m=f.labels[_t];delete f.labels[_t],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}return o.forEach(m=>{f.labels&&m in f.labels&&delete f.labels[m];}),u.forEach(m=>{f.initialOperations&&(f.initialOperations=f.initialOperations.filter(g=>!(g.type==="value"&&g.key===m)));}),f}i.inkToJson=r;function e(a,s){try{let o={};return t(a,o,s),o}catch(o){W.error("Error parsing ink file",o);}}function t(a,s,o){for(let u of a)if(u)if(Array.isArray(u))if(u.includes("visit")){let l=Ht(u,Ei,(h,c,d)=>{},"",o,[]);l&&(o.externalSwitch=l);}else t(u,s,o);else typeof u=="object"&&(u&&"VAR="in u&&o.externalSwitch&&(s[_t]||(s[_t]=[]),s[_t].push({operations:xn({defaultType:"storage",key:u["VAR="],value:o.externalSwitch},[],o)})),n(u,s,"",o));}function n(a,s,o="",u){if(a!==null){for(let[l,h]of Object.entries(a))if(Array.isArray(h)){let c=[],d={},f=(o?o+"_|_":"")+l;mt(h,f,u,c,oa,oa,(m,g,b)=>{n(m,d,g,b);},zt);for(let[m,g]of Object.entries(d))s[m]=g;c.length>0&&(s[f]=c);}}}})(da||={});var Ac=zs(Dc()),xc=zs(Ut()),WC=/(?:^|<>)\s*#\s*([^\r\n]+)/g,jC=/^=+[ \t]+(?:function[ \t]+)?(\w+)/gm,qC=new Set(["DONE","END"]),MC="_|_",bc=new Map;function wc(r,e){let t=JSON.stringify([e,r]),n=bc.get(t);if(n)return n;let i=new RegExp(r,e);return bc.set(t,i),i}function hi(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(s=>hi(r,s));let i=t.oneOf;if(Array.isArray(i))return i.some(s=>hi(r,s));let a=t.allOf;if(Array.isArray(a))return a.every(s=>hi(r,s));if(typeof t.const=="string")return r===t.const;if(Array.isArray(t.enum))return t.enum.some(s=>typeof s=="string"&&s===r);if(t.type!=="string"||typeof t.minLength=="number"&&r.length<t.minLength||typeof t.maxLength=="number"&&r.length>t.maxLength)return false;if(typeof t.pattern=="string")try{if(!wc(t.pattern,"").test(r))return !1}catch{return false}return true}function Js(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(o=>Js(r,o));let i=t.oneOf;if(Array.isArray(i))return i.some(o=>Js(r,o));let a=t.allOf;if(Array.isArray(a))return a.every(o=>Js(r,o));if(t.type!=="array"||typeof t.minItems=="number"&&r.length<t.minItems||typeof t.maxItems=="number"&&r.length>t.maxItems)return false;let s=Array.isArray(t.prefixItems)?t.prefixItems:[];if(r.length<s.length)return false;for(let o=0;o<s.length;o++)if(!hi(r[o],s[o]))return false;return r.length===s.length?true:t.items===false||typeof t.items>"u"?false:t.items===true?true:r.slice(s.length).every(o=>hi(o,t.items))}function GC(r,e){if(e.type==="regexp")try{let t=wc(e.source,e.flags);return t.lastIndex=0,t.test(r.join(" "))}catch{return false}return e.type==="literal"?r.join(" ")===e.value:Js(r,e.schema)}function $C(r){let e=r.split(/\r?\n/),t=[];for(let n=0;n<e.length;n++){let i=e[n];for(let a of i.matchAll(WC)){let s=(a[1]??"").trim();if(!s)continue;let o=exports.HashtagCommands.convertTagTolist(s,{mergeInkVariables:true});o.length!==0&&t.push({line:n+1,command:s,tokens:o});}}return t}var Vl;(i=>{function r(a,s={labelToRemove:[],initialVarsToRemove:[],functions:[],enums:{}}){let o=[];try{return {json:new Ac.Compiler(a,{errorHandler:(c,d)=>{let f=c.replace(/^[A-Z]+: line \d+: ?/,""),m=c.match(/line (\d+)/);o.push({message:f,type:d,line:m?Number(m[1]):-1});},countAllVisits:!0,fileHandler:{ResolveInkFilename:c=>c,LoadInkFileContents:()=>""},pluginNames:[],sourceFilename:null}).Compile().ToJson()||"",issues:o}}catch{let l=false,h={...s,textSource:a};return e(o,()=>{l=true;},h),l?r(h.textSource,s):{issues:o}}}i.compile=r;function e(a,s,o){let{functions:u,initialVarsToRemove:l,labelToRemove:h}=o,c=a.find(d=>d.type===xc.ErrorType.Error);if(c){if(c.message.includes("Divert target not found")){let d=c.message.match(/Divert target not found: '-> (\w+)'/);if(d?.[1]){let f=d[1],m=`
|
|
68
|
+
`)l=true;else if(p==="done"||p==="end")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="<>")i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;else if(p==="nop"&&f){let C=_u(b,a,s,e,t,h,u);C&&i(n,C,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),f=false,b=[];}else p==="#"?m=true:p==="thread"&&(g=true);else if(Array.isArray(p))if(f)b.push(p);else if(p.length>1&&typeof p[p.length-2]=="object"&&p[p.length-2]&&"c"in p[p.length-2]&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"b"in p[p.length-1]){d.pop();let C=[],E=[];for(;d.length>0&&d[d.length-1]!=="/ev";)C.push(d.pop());b=[...b,...C.reverse()],f=true,E.push(p.pop()),E.push(p.pop()),b=[...b,...p],b.push(E);}else if(p.length>1&&typeof p[p.length-1]=="object"&&p[p.length-1]&&"#n"in p[p.length-1]){let C=p.pop();if(!C){W.error("Error parsing ink file: el is undefined");return}let E=C["#n"];delete C["#n"],p.push(C),i(n,{"->":e?e+"_|_"+E:E},e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),s({[E]:p},e,t);}else mt(p,e,t,n,i,a,s,o,u,l,h);else if(p&&typeof p=="object")if("->"in p&&typeof p["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->"])){let C=[];d.length>0&&(C=sa(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("->t->"in p&&typeof p["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(p["->t->"])){let C=[];d.length>0&&(C=sa(["ev",...d],e,h,t)),p.params=C,i(n,p,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g}),l=false;}else if("*"in p&&typeof p["*"]=="string")p["*"].includes("c")&&(d.push(p),l=false);else if("s"in p&&Array.isArray(p.s))d.push(p),l=false;else if("CNT?"in p)d.push(p),l=false;else if("VAR="in p||"temp="in p){let C="VAR="in p?p["VAR="]:p["temp="],E,w=[];if(C!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)w.push(d.pop());w=w.reverse(),E=Di(w,e,h,t),d=[],xn({key:C,value:E,defaultType:"VAR="in p?"storage":"tempstorage",artmeticValue:true},h,t).forEach(N=>{(N.value!==void 0||N.value!==null)&&i(n,N,e,t,h,{isNewLine:l,isHashtagScript:m,isThreads:g});}),l=false;}}else s(p,e,t);}),o(d,n,e,t,h),e.includes("_|_")&&n.length===2){let p=n[0],D=n[1];p&&D&&typeof p=="object"&&"dialogue"in p&&typeof D=="object"&&"labelToOpen"in D&&p.dialogue===" "&&D.labelToOpen&&(n.shift(),delete D.glueEnabled,n[0]=D);}}function ha(r,e,t,n,i,a){if(e.length===0)return;let s=ft(e,n,t,i);if(s.length===1){let o={type:"ifelse",condition:s[0],then:r,else:a};return o.else||delete o.else,o}else if(s.length>1){let o={type:"ifelse",condition:{type:"union",unionType:"and",conditions:s},then:r,else:a};return o.else||delete o.else,o}}function _u(r,e,t,n,i,a,s=void 0){if(r.length===0){W.error("Error parsing ink file: Conditional statement is not valid",r);return}let o=[],u=[];if(r.forEach(c=>{Array.isArray(c)?u.push(c):typeof c=="string"&&c==="du"?i.du?o.push(i.du):i.du=o[o.length-1]:(typeof c!="string"||c!=="/ev")&&o.push(c);}),u.length===0){W.error("Error parsing ink file: Conditional statement is not valid",u);return}let l=ua(u[0],e,t,`${n}${"_|_"}then`,i,a,`${s||""}then`),h;return u.length===2?h=ua(u[1],e,t,`${n}${"_|_"}else`,i,a,`${s||""}else`):u.length>2?(u.shift(),u.push("nop"),u=[{b:u}],h=ua(u,e,t,n,i,a,`${s||""}else`)):h=void 0,i.du=void 0,ha(l,o,a,n,i,h)}function ua(r,e,t,n,i,a,s=void 0){let o=[];for(let l of r)typeof l=="object"&&"b"in l&&(l.b=l.b.filter(h=>h!==null&&!(typeof h=="object"&&"->"in h&&new RegExp(/.*\.[0-9]/).test(h["->"]))),mt(l.b,n,i,o,e,e,t,zt,s,true,a));return o.length===1?o[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:o}}function ca(r="",e=""){let t=Array.isArray(r)?r:[r],n=Array.isArray(e)?e:[e];return [...new Set([...t,...n])]}function zt(r,e,t,n,i){if(r.length>0){let a={};Tu(r,a,i,n);for(let[s,o]of Object.entries(a)){let u=t+"_|_"+s,l={text:o.text.length===1?o.text[0]:o.text,label:u,props:{},type:aa(u,false),oneTime:o.onetime};o.text.length===0&&(l.onlyHaveNoChoice=true,l.autoSelect=true),l.oneTime===false&&delete l.oneTime;let h=ha(l,o.conditions,i,t,n)||l,c=e[e.length-1];if(typeof c=="object"&&c&&"type"in c&&(c={conditionalStep:c}),e.length>0&&typeof c=="object"&&c&&"choices"in c&&c.choices){let d=c.choices;d&&Array.isArray(d)?d.push(h):W.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",o,d),c.choices=d.sort((f,m)=>{try{let g=f.label.split("."),b=g[g.length-1].replaceAll(".","_|_"),S=m.label.split("."),y=S[S.length-1].replaceAll(".","_|_");if(b.includes("c-")&&y.includes("c-")){let p=b.split("c-")[1],D=Number(p),C=y.split("c-")[1],E=Number(C);return D-E}}catch{}return 0});}else e.push({choices:[h]});o.preDialog&&(n.preDialog[u]={...o.preDialog});}}}function Tu(r,e,t,n,i){let a=[],s="",o="",u=false,l=[];for(let h=0;h<r.length;h++){let c=r[h];if(typeof c=="string")c.startsWith("^")?a.push(ze(c)):bu.includes(c)&&l.push(c);else if(Array.isArray(c)&&c.includes("visit")){let d=Ht(c,Ei,(f,m,g)=>{},i,n,t);a.push(d);}else if(c&&typeof c=="object")if("*"in c&&typeof c["*"]&&typeof c["*"]=="string")c["*"].includes("c")&&(s=`c${c["*"].split("c")[1]}`,c.flg&16&&(u=true));else if("s"in c&&Array.isArray(c.s)){let d=Ou(c.s),f=c.s.includes("<>");d&&(i&&e[i]?(e[i].preDialog={text:d,glue:f},e[i].text=ca(d,e[i].text)):(a.push(d),o=d));}else ("CNT?"in c||"VAR?"in c)&&l.push(c);else l.push(c);if(s){e[s]?e[s].text=ca(a,e[s].text):e[s]={text:a,onetime:u,conditions:l},o&&(e[s].preDialog={text:o,glue:false});let d=r.slice(h+1);Tu(d,e,t,n,s);return}}}function Ou(r){for(let e of r)if(typeof e=="string"){if(e.startsWith("^"))return ze(e)}else if(Array.isArray(e)){let t=Ou(e);if(t)return t}}var da;(i=>{function r(a,s={}){let{labelToRemove:o=[],initialVarsToRemove:u=[],enums:l={},functions:h=[],preDialog:c={},characterIds:d}=s,f={$schema:hu};if(f.labels=e(a.root,{labelToRemove:o,initialVarsToRemove:u,enums:l,functions:h,preDialog:c,characterIds:d}),f.labels&&gi in f.labels){let m=f.labels[gi];delete f.labels[gi],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}if(f.labels&&_t in f.labels){let m=f.labels[_t];delete f.labels[_t],m.forEach(g=>{g.operations&&(f.initialOperations=f.initialOperations?[...f.initialOperations,...g.operations]:[...g.operations]);});}return o.forEach(m=>{f.labels&&m in f.labels&&delete f.labels[m];}),u.forEach(m=>{f.initialOperations&&(f.initialOperations=f.initialOperations.filter(g=>!(g.type==="value"&&g.key===m)));}),f}i.inkToJson=r;function e(a,s){try{let o={};return t(a,o,s),o}catch(o){W.error("Error parsing ink file",o);}}function t(a,s,o){for(let u of a)if(u)if(Array.isArray(u))if(u.includes("visit")){let l=Ht(u,Ei,(h,c,d)=>{},"",o,[]);l&&(o.externalSwitch=l);}else t(u,s,o);else typeof u=="object"&&(u&&"VAR="in u&&o.externalSwitch&&(s[_t]||(s[_t]=[]),s[_t].push({operations:xn({defaultType:"storage",key:u["VAR="],value:o.externalSwitch},[],o)})),n(u,s,"",o));}function n(a,s,o="",u){if(a!==null){for(let[l,h]of Object.entries(a))if(Array.isArray(h)){let c=[],d={},f=(o?o+"_|_":"")+l;mt(h,f,u,c,oa,oa,(m,g,b)=>{n(m,d,g,b);},zt);for(let[m,g]of Object.entries(d))s[m]=g;c.length>0&&(s[f]=c);}}}})(da||={});var Ac=zs(Dc()),xc=zs(Ut()),WC=/(?:^|<>)\s*#\s*([^\r\n]+)/g,jC=/^=+[ \t]+(?:function[ \t]+)?(\w+)/gm,qC=new Set(["DONE","END"]),MC="_|_",bc=new Map;function wc(r,e){let t=JSON.stringify([e,r]),n=bc.get(t);if(n)return n;let i=new RegExp(r,e);return bc.set(t,i),i}function hi(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(s=>hi(r,s));let i=t.oneOf;if(Array.isArray(i))return i.some(s=>hi(r,s));let a=t.allOf;if(Array.isArray(a))return a.every(s=>hi(r,s));if(typeof t.const=="string")return r===t.const;if(Array.isArray(t.enum))return t.enum.some(s=>typeof s=="string"&&s===r);if(t.type!=="string"||typeof t.minLength=="number"&&r.length<t.minLength||typeof t.maxLength=="number"&&r.length>t.maxLength)return false;if(typeof t.pattern=="string")try{if(!wc(t.pattern,"").test(r))return !1}catch{return false}return true}function Js(r,e){if(!e||typeof e!="object")return false;let t=e,n=t.anyOf;if(Array.isArray(n))return n.some(o=>Js(r,o));let i=t.oneOf;if(Array.isArray(i))return i.some(o=>Js(r,o));let a=t.allOf;if(Array.isArray(a))return a.every(o=>Js(r,o));if(t.type!=="array"||typeof t.minItems=="number"&&r.length<t.minItems||typeof t.maxItems=="number"&&r.length>t.maxItems)return false;let s=Array.isArray(t.prefixItems)?t.prefixItems:[];if(r.length<s.length)return false;for(let o=0;o<s.length;o++)if(!hi(r[o],s[o]))return false;return r.length===s.length?true:t.items===false||typeof t.items>"u"?false:t.items===true?true:r.slice(s.length).every(o=>hi(o,t.items))}function GC(r,e){if(e.type==="regexp")try{let t=wc(e.source,e.flags);return t.lastIndex=0,t.test(r.join(" "))}catch{return false}return e.type==="literal"?r.join(" ")===e.value:Js(r,e.schema)}function $C(r){let e=r.split(/\r?\n/),t=[];for(let n=0;n<e.length;n++){let i=e[n];for(let a of i.matchAll(WC)){let s=(a[1]??"").trim();if(!s)continue;let o=exports.HashtagCommands.convertTagTolist(s,{mergeInkVariables:true});o.length!==0&&t.push({line:n+1,command:s,tokens:o});}}return t}var Vl;(i=>{function r(a,s={labelToRemove:[],initialVarsToRemove:[],functions:[],enums:{}}){let o=[];try{return {json:new Ac.Compiler(a,{errorHandler:(c,d)=>{let f=c.replace(/^[A-Z]+: line \d+: ?/,""),m=c.match(/line (\d+)/);o.push({message:f,type:d,line:m?Number(m[1]):-1});},countAllVisits:!0,fileHandler:{ResolveInkFilename:c=>c,LoadInkFileContents:()=>""},pluginNames:[],sourceFilename:null}).Compile().ToJson()||"",issues:o}}catch{let l=false,h={...s,textSource:a};return e(o,()=>{l=true;},h),l?r(h.textSource,s):{issues:o}}}i.compile=r;function e(a,s,o){let{functions:u,initialVarsToRemove:l,labelToRemove:h}=o,c=a.find(d=>d.type===xc.ErrorType.Error);if(c){if(c.message.includes("Divert target not found")){let d=c.message.match(/Divert target not found: '-> (\w+)'/);if(d?.[1]){let f=d[1],m=`
|
|
69
69
|
|
|
70
70
|
=== ${f} ===
|
|
71
71
|
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as importInkText,b as importJson}from'./chunk-
|
|
1
|
+
export{a as importInkText,b as importJson}from'./chunk-HE25JM4E.mjs';import {d,h as h$1,i}from'./chunk-54QJQIS3.mjs';export{i as HashtagCommands,c as TextReplaces,e as VariableGetter,k as addBaseHashtagCommands,n as convertInkText,n as convertInkToJson,j as onInkHashtagScript}from'./chunk-54QJQIS3.mjs';function k(e){d.afterToTranslate=n=>T(n,e);}function y(e){d.beforeToTranslate=n=>T(n,e);}function T(e,n){let s=new RegExp(h$1.source,"g"),t=new Set,o=true;for(;o;){o=false;let x=[...e.matchAll(s)],i=new Set;for(let l of x){let a=l[1];if(i.has(a)||t.has(a))continue;i.add(a);let p=n(a);p!==void 0?(e=e.replaceAll(l[0],p),o=true):t.add(a);}}return e}function b(e){d.translate=e;}async function h(e,n={},s={}){let t=[];return e.labels&&Object.values(e.labels).forEach(o=>{t=t.concat(o);}),await d.generateJsonTranslation(t,n,{...s,operationStringConvert:i.run})}export{h as generateJsonInkTranslation,b as onInkTranslate,k as onReplaceTextAfterTranslation,y as onReplaceTextBeforeTranslation};
|
package/dist/mapper.cjs
CHANGED
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
`+n+F+`,
|
|
14
14
|
`+T+"]";}return a.pop(),n=T,b}},eu={parse:qe,stringify:Ke},uu=eu,de=uu;var Oe="\xA7SPACE\xA7",Ne="\xA7DOUBLE_QUOTES\xA7",we="\xA7QUOTES\xA7",Re="SPECIAL_\xA7QUOTES\xA7",ke="\xA7CURLY_BRACKETS1\xA7",tu="\xA7INK_VAR\xA7",Je="\xA7CURLY_BRACKETS2\xA7",ee;(b=>{let e=[],u=[];async function i(t,F){for(let l=0;l<e.length;l++)try{let{validation:g}=e[l].opts;if(g instanceof RegExp){if(!g.test(t.join(" ")))continue}else if(g instanceof zod.ZodType&&!g.safeParse(t).success)continue;let E=await e[l].fn(t,F,f);if(E===!0||typeof E=="string")return E}catch{}return false}function r(t,F={name:"custom-command",validation:/^/}){e.unshift({fn:t,opts:F});}b.add=r;function a(){return [...u.map(t=>t.opts),...e.map(t=>t.opts)]}b.info=a;function n(t,F){u.unshift({fn:t,opts:F});}b.addMapper=n;function o(){e.length=0;}b.clear=o;function c(){u.length=0;}b.clearMappers=c;async function C(t,F,l){try{let g=s(t),E=await i(g,l);return E===!0?void 0:typeof E=="string"?(E.startsWith("#")&&(E=E.substring(1)),await b.run(E,F,l)):D(g,F)}catch(g){throw P.error("Error parsing ink hashtag-command",t),g}}b.run=C;function s(t,F){if(t=t.replaceAll('\\"',Ne),t=t.replaceAll("\\'",we),t=t.replaceAll("\\`",Re),t=t.replaceAll("\\{",ke),t=t.replaceAll("\\}",Je),F?.mergeInkVariables){let x;do x=t,t=t.replace(/\{[^{}:]*\}/g,tu);while(t!==x)}t=t.replaceAll("{"," { "),t=t.replaceAll("}"," } "),t=t.replaceAll(ke,"{"),t=t.replaceAll(Je,"}");let l=[],g,E="";for(let x=0;x<t.length;x++){let R=t[x];R==='"'||R==="'"||R==="`"?g===void 0?(l.push(E),E="",g=R,E+=R):g===R?(g=void 0,E+=R,l.push(E),E=""):E+=R:E+=R;}return E!==""&&l.push(E),l.forEach((x,R)=>{R%2===1&&(l[R]=x.replaceAll(" ",Oe));}),t=l.join(""),l=t.split(" ").filter(x=>x!==""),l=l.map(x=>x.replaceAll(Oe," ").replaceAll(Ne,'"').replaceAll(we,"'").replaceAll(Re,"`")),l=A(l),l=l.map(x=>x.startsWith('"')&&x.endsWith('"')||x.startsWith("'")&&x.endsWith("'")||x.startsWith("`")&&x.endsWith("`")?x.slice(1,-1):x),l}b.convertTagTolist=s;function D(t,F,l){for(let g of u){let{validation:E}=g.opts,x=false;if(E instanceof RegExp?x=E.test(t.join(" ")):E instanceof zod.ZodType&&(x=E.safeParse(t).success),x)return g.fn(t,F)}l?.silent||P.error("The operation is not valid",t);}b.convertOperation=D;function f(t){return d(t)}b.convertListStringToObj=f;function d(t){if(t.length===0)return {};if(t.length%2!==0)throw P.error("The props list must have a pair number of elements",t),new Error("The props list must have a pair number of elements");let F="{";t.forEach((l,g)=>{if(g%2===0)F+=`"${l}": `;else {switch(l){case "null":case "undefined":case "true":case "false":F+=`${l}`;break;default:y(l)?(l=h(l),F+=`"${l}"`):l.startsWith("{")&&l.endsWith("}")?F+=`${l}`:l.startsWith('"')&&l.endsWith('"')?F+=`${l}`:Number.isNaN(parseFloat(l))?F+=`"${l}"`:F+=`${l}`;}g<t.length-1&&(F+=", ");}}),F+="}";try{return de.parse(F)}catch(l){throw P.error("Error parsing ink json",F),l}}function h(t){return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")||t.startsWith("`")&&t.endsWith("`")?t.substring(1,t.length-1):t}function y(t){return !!(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")||t.startsWith("`")&&t.endsWith("`"))}function A(t){return T(t).tokens}b.mergeJsonBlocks=A;function T(t){let F=[],l=false;for(let g=0;g<t.length;g++){let E=t[g];if(E!=="{"){F.push(E);continue}let x=m(t,g);if(x===-1){F.push(E);continue}let R=T(t.slice(g+1,x)),Te=["{",...R.tokens,"}"],ve=Te.join(" ");if(!R.hasInvalidMatchedBlock)try{de.parse(ve),F.push(ve),g=x;continue}catch{}l=true,F.push(...Te),g=x;}return {tokens:F,hasInvalidMatchedBlock:l}}function m(t,F){let l=0;for(let g=F;g<t.length;g++)if(t[g]==="{")l++;else if(t[g]==="}"&&(l--,l===0))return g;return -1}})(ee||={});var Me=["+","-","/","*","%","_","==",">","<",">=","<=","!=","!","&&","||","MIN","MAX"],Le=["+","-","/","*","%","POW","RANDOM","L^"],_e=["INT","FLOOR","FLOAT"];function Y(e,u){if(e.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(e)&&(e=e.split(".").filter(a=>!a.match(/^[0-9]+$/)).join("."),!e.startsWith(".")))return e.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(e)&&e.includes("g-")){let r=e.split("g-");return Ce(u)+"_|_"+"g-"+r[r.length-1]}let i=0;for(;new RegExp(/^\.\^.*$/).test(e);)i++,e=e.substring(2);if(i=i-1,new RegExp(/^\..*$/).test(e)&&u){let r=e.substring(1);return Ce(u,i)+"_|_"+r.replaceAll(".","_|_")}return e.replaceAll(".","_|_")||Ce(u,i).replaceAll(".","_|_")}function Ce(e,u=0){let i=e.split("_|_");for(;i.length>1&&u>0;)i.pop()?.includes("g-")&&u--,u--;return i.join("_|_")}var je="\xA7DOUBLE_SLASH_CONVERTOR\xA7";function L(e){return e.startsWith("^")&&(e=e.substring(1)),e=e.replaceAll("\\\\",je),e=e.replaceAll("\\n",`
|
|
15
15
|
`),e=e.replaceAll("\\t"," "),e=e.replaceAll(" "," "),e=e.replaceAll(je,"\\\\"),e}function W(e,u,i,r){let{functions:a}=r;e=e.map(o=>{if(typeof o=="string")switch(o){case "rnd":return "RANDOM";case "?":return "CONTAINS"}return o});let n=[];return e.forEach(o=>{if(typeof o=="string")switch(o){case "&&":case "||":if(n.length>=2){let c={type:"union",unionType:o==="&&"?"and":"or",conditions:[n[n.length-2],n[n.length-1]]};n.pop(),n.pop(),n.push(c);}break;case "!":if(n.length===0)P.error("Error parsing ink file: Conditional statement is not valid",e);else {let c={type:"union",unionType:"not",condition:n[n.length-1]};n[n.length-1]=c;}break;case "!?":if(n.length>1){let c={type:"union",unionType:"not",condition:{type:"compare",operator:"CONTAINS",leftValue:n[n.length-2],rightValue:n[n.length-1]}};n.pop(),n.pop(),n.push(c);}else P.error("Error parsing ink file: Conditional statement is not valid",e);break;default:if(pixiVnJson.PixiVNJsonComparationOperators.includes(o))if(n.length<2)P.error("Error parsing ink file: Conditional statement is not valid",e);else {let c={type:"compare",operator:o,rightValue:n[n.length-1],leftValue:n[n.length-2]};n.pop(),n.pop(),n.push(c);}else if(Le.includes(o))if(n.length<2)P.error("Error parsing ink file: Conditional statement is not valid",e);else {o==="L^"&&(o="INTERSECTION");let c={type:"arithmetic",operator:o,rightValue:n[n.length-1],leftValue:n[n.length-2]};n.pop(),n.pop(),n.push(c);}else if(_e.includes(o)){let c={type:"arithmeticsingle",operator:o,leftValue:n[n.length-1]};n.pop(),n.push(c);}else o.startsWith("^")&&n.push(L(o));}else if(typeof o=="object"&&"CNT?"in o)if(new RegExp(/.*\.[0-9]\..*/).test(o["CNT?"])){let c=o["CNT?"].split("."),C=c.pop(),s=c.pop();if(s===void 0||C===void 0){P.error("Error parsing ink file: Conditional statement is not valid",e);return}let D=Number(s),f=c.join(".");if(f.includes("^.")){let h=f.split("."),y=h[h.length-1].replaceAll(".","_|_");h.pop(),f=`${h.join(".")}.${y}`,C.includes("c-")&&(f=f+"_|_"+C);}else f=f.replaceAll(".","_|_");let d=Y(f,u);if(!d)return;n.push({type:"compare",leftValue:Ae(d),operator:">=",rightValue:{type:"value",value:D}});}else {let c=Y(o["CNT?"],u);if(!c)return;n.push(Ae(c));}else if(typeof o=="object"&&"VAR?"in o)n.push(G({key:o["VAR?"],defaultType:"storage"},i));else if(typeof o=="object"&&"f()"in o){let c=o["f()"],C=a.find(D=>D.name===c);if(!C){P.error(`Error parsing ink file: Function ${c} is not defined`,e);return}let s=[];for(let D=0;D<C.args;D++)n.length!==0&&s.push(n.pop());n.push({type:"function",functionName:c,args:s.reverse()});}else if(typeof o=="object"&&"^->"in o)o["^->"].includes("$r")||n.push(o["^->"]);else if(typeof o=="object"&&"list"in o){let c=Object.values(o.list).map(C=>C);n.push(c);}else n.push(o);}),n}function ge(e,u,i,r){return W(e,u,i,r)}function G(e,u,i){let{key:r,defaultType:a}=e,n=u.indexOf(r);return n>=0?{type:"value",storageType:"params",storageOperationType:"get",key:n}:{type:"value",storageOperationType:"get",storageType:a,key:r}}function ue(e,u,i){let{key:r,value:a,defaultType:n,artmeticValue:o}=e,c=u.indexOf(r);if(c>=0)return [{type:"value",storageType:"params",storageOperationType:"set",key:c,value:a}];if(o){if(typeof a=="object"&&"list"in a){let C=Object.values(a.list).map(s=>s);return [{type:"value",storageOperationType:"set",storageType:n,key:r,value:C}]}return [{type:"value",storageOperationType:"set",storageType:n,key:r,value:a}]}else if(typeof a=="object"){if("list"in a&&typeof a.list=="object"){if("origins"in a&&Array.isArray(a.origins)&&a.origins.length>0)return a.origins.reduce(C=>(C.push({type:"value",storageOperationType:"set",storageType:n,key:r,value:Object.values(i.enums[r])}),Object.entries(i.enums[r]).forEach(([s,D])=>{C.push({type:"value",storageOperationType:"set",storageType:n,key:`${r}.${s}`,value:D});}),C),[]);{let C=new Set,s=Object.entries(a.list).reduce((D,[f,d])=>{let[h,y]=f.split(".");return D.push({type:"value",storageOperationType:"set",storageType:n,key:y,value:d}),C.add(h),D},[]);return C.forEach(D=>{s.push({type:"value",storageOperationType:"set",storageType:n,key:D,value:Object.values(i.enums[D])});}),r in i.enums?Object.entries(i.enums[r]).forEach(([D,f])=>{s.push({type:"value",storageOperationType:"set",storageType:n,key:`${r}.${D}`,value:f});}):s.push({type:"value",storageOperationType:"set",storageType:n,key:r,value:Object.values(a.list)}),s}}else if(typeof a=="object"&&"VAR?"in a){if(typeof a["VAR?"]=="string"&&a["VAR?"].includes(".")){let[C,s]=a["VAR?"].split(".");if(C in i.enums&&s in i.enums[C])return [{type:"value",storageOperationType:"set",storageType:n,key:r,value:i.enums[C][s]}]}return [{type:"value",storageOperationType:"set",storageType:n,key:r,value:G({key:a["VAR?"],defaultType:"storage"},u)}]}}return [{type:"value",storageOperationType:"set",storageType:n,key:r,value:a}]}function Ae(e){return {type:"value",storageType:"label",storageOperationType:"get",label:e}}function Fe(e,u){return u||new RegExp(`${"_|_".replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c-\\d+$`).test(e)?"call":"jump"}function se(e,u){if(u){if(typeof u=="string")u.startsWith("^")&&e.push(L(u));else if(typeof u=="object"&&"type"in u)switch(u.type){case "value":case "function":console.warn("Warning: trying to add a value or function operation as text. This is likely a mistake, so it will be ignored.");break;default:e.push(u);}}}function he(e,u,i,r,a,n={}){let{isNewLine:o=true,isHashtagScript:c=false,isThreads:C=false}=n;return ru(e,u,i,r,a,{isNewLine:o,isHashtagScript:c,isThreads:C})}function ru(e,u,i,r,a,n){if(!u)return;let{isNewLine:o,isHashtagScript:c=false,isThreads:C}=n;if(c){if(Array.isArray(u)&&u.length>0){let s={goNextStep:true},D=[];try{if(u.length===1&&typeof u[0]=="string"&&!u[0].match(xe)){let f=u[0],d=ee.convertTagTolist(f),h=ee.convertOperation(d,s,{silent:!0});h&&(h.$origin=f,D.push(h));}}catch{}D.length===0&&D.push({type:"operationtoconvert",values:u}),e.push({...s,operations:D});}}else if(typeof u=="string"&&u.startsWith("^")||u&&typeof u=="object"&&"type"in u&&u.type==="value"&&u.storageOperationType==="get"){if(!o&&e.length>0){let s=e[e.length-1];!s.glueEnabled&&!s.operations&&!s.labelToOpen&&(s.glueEnabled=true,s.labelToOpen||(s.goNextStep=true)),e[e.length-1]=s;}typeof u=="string"?e.push(su(L(u),r.characterIds)):e.push({dialogue:u});}else if(typeof u=="string"){if(u==="end")e.push({end:"game_end"});else if(u==="done")e.push({end:"label_end",goNextStep:true});else if(u==="<>")if(e.length>0){let s=e[e.length-1];s.glueEnabled=true,s.labelToOpen||(s.goNextStep=true),e[e.length-1]=s;}else e.push({glueEnabled:true,goNextStep:false});}else if(typeof u=="object"){if("type"in u)switch(u.type){case "value":u.storageOperationType==="set"?(typeof u.value=="string"&&u.value.startsWith("^")&&(u.value=L(u.value)),e.push({goNextStep:true,operations:[u]})):console.warn("Warning: trying to add a value get operation as step. This is likely a mistake, so it will be ignored.");break;case "function":e.push({goNextStep:true,operations:[u]});break;default:if(!o&&e.length>0){let s=e[e.length-1];!s.glueEnabled&&!s.operations&&(s.glueEnabled=true,s.labelToOpen||(s.goNextStep=true)),e[e.length-1]=s;}e.push({conditionalStep:u});}else if("->"in u){let s=o?void 0:true;if(s&&i.includes("c-")&&e.length>0&&e[e.length-1]?.dialogue===void 0&&(s=void 0),!o&&e.length>0){let D=e[e.length-1];D.labelToOpen||(D.goNextStep=true),e[e.length-1]=D;}if(u.params&&u.params.length===0&&delete u.params,u.var)e.push({labelToOpen:{label:G({key:u["->"],defaultType:"storage"},a),type:C?"call":"jump",params:u.params},glueEnabled:s});else {let D=Y(u["->"],i);if(!D)return;e.push({labelToOpen:{label:D,type:Fe(D,C),params:u.params},glueEnabled:s});}}else if("->t->"in u){let s=o?void 0:true;if(s&&i.includes("c-")&&e.length>0&&e[e.length-1]?.dialogue===void 0&&(s=void 0),!o&&e.length>0){let f=e[e.length-1];f.labelToOpen||(f.goNextStep=true),e[e.length-1]=f;}u.params&&u.params.length===0&&delete u.params;let D=Y(u["->t->"],i);if(!D)return;e.push({labelToOpen:{label:D,type:"call",params:u.params},glueEnabled:s});}}}function su(e,u){let i;if(e.includes(": ")){let r=e.split(": "),a=r[0],n=r.slice(1).join(": ");(u?.has(a)||characters.RegisteredCharacters.has(a))&&(i=a,e=n);}return i?{dialogue:{character:i,text:e}}:{dialogue:e}}function Ee(e,u,i,r=true,a=false){return ou(e,u,i,r,a)}function ou(e,u,i,r,a=false){u&&(typeof u=="string"&&u.startsWith("^")||u&&typeof u=="object"&&"type"in u&&u.type==="value"&&u.storageOperationType==="get"?typeof u=="string"?e.push(L(u)):e.push(u):typeof u=="object"&&"type"in u&&e.push(u));}function oe(e,u,i,r){if(e.length===0){P.error("Error parsing ink file: Arithmetic statement is not valid",e);return}let a=W(e,u,i,r);if(a.length===1){let n=a[0];return n&&typeof n=="object"&&"type"in n?{type:"value",storageType:"logic",storageOperationType:"get",operation:n}:n}}function Q(e,u,i,r="",a,n,o=void 0){let c=[],C="sequential",s=false,D=true;e.forEach(h=>{h==="%"&&(C="loop"),h==="seq"&&(C="random"),h==="MIN"&&(s=true);});let f=e[e.length-1];return Object.keys(f).forEach(h=>{let y=f[h];if(Array.isArray(y)&&y.length>3){y=y.slice(1,y.length-2);let A=[];$(y,r,a,A,u,u,i,X,o,true,n),A.length===1?c.push(A[0]):c.push({type:"resulttocombine",combine:"cross",secondConditionalItem:A});}else Array.isArray(y)&&y.length===3&&(D=false);}),C==="sequential"?{type:"stepswitch",elements:c,choiceType:C,end:D?"lastItem":void 0,nestedId:o}:s&&C==="random"?{type:"stepswitch",elements:c,choiceType:"sequentialrandom",end:D?"lastItem":void 0,nestedId:o}:{type:"stepswitch",elements:c,choiceType:C}}function $(e,u,i,r=[],a,n,o,c,C=void 0,s=true,D=[]){let f=false,d=[],h=false,y=false,A=false,T=[],m=[];if(i.preDialog[u]&&(s=false,a(r,`^${i.preDialog[u].text}`,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),i.preDialog[u].glue&&a(r,"<>",u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),delete i.preDialog[u]),e.includes("visit")){let t=Q(e,n,o,u,i,D,C);t&&(!s&&r.length>0&&a(r,"<>",u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}));return}let b=e[0];if(b&&typeof b=="object"&&"temp="in b){for(;e[0]&&typeof e[0]=="object"&&"temp="in e[0];)D.push(e[0]["temp="]),e.shift();D=D.reverse();}if(e.forEach((t,F)=>{if(y){if(typeof t=="string"&&t==="/#"){let l=[];$(m,u,i,l,Ee,Ee,o,c,C,s),a(r,l,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),y=false,m=[];}else m.push(t);return}else if(f)if(Array.isArray(t))d.push(t);else if(t&&typeof t=="object")"CNT?"in t?F>0&&e[F-1]==="ev"?(h=true,T.push(t)):h?T.push(t):(d.push(t),s=false):"VAR="in t||"temp="in t?ue({key:"VAR="in t?t["VAR="]:t["temp="],value:e[F-1],defaultType:"VAR="in t?"storage":"tempstorage"},D,i).forEach(g=>{if(g.value&&typeof g.value=="string"&&g.value==="/str"&&(g.value=e[F-2]),g.value&&typeof g.value=="object"&&"^->"in g.value&&(g.value=g.value["^->"]),d.length>1){let E=oe(d,u,D,i);d=[],E&&typeof E=="object"&&"type"in E&&E.type==="value"&&"storageType"in E&&E.storageType==="logic"&&(g.value=E.operation);}(typeof g.key!="string"||!g.key.includes("$r"))&&(a(r,g,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=true);}):"VAR?"in t?d.push(t):"^->"in t?t["^->"].includes("$r")||d.push(t):("f()"in t||"list"in t&&typeof t.list=="object")&&d.push(t);else switch(t){case "/ev":h&&T.push(t),f=false,d.push(t);break;case "out":if(d.length>0){let l=d[d.length-1];if(l&&typeof l=="object"&&"VAR?"in l){d.pop();let g=G({key:l["VAR?"],defaultType:"storage"},D);a(r,g,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A});}else {let g=[];for(;d.length>0&&d[d.length-1]!=="/ev";)g.push(d.pop());g=g.reverse();let E=oe(g,u,D,i);d=[],E&&typeof E=="object"&&"type"in E&&E.type==="value"&&"storageType"in E&&E.storageType==="logic"?a(r,{storageOperationType:"get",storageType:"logic",operation:E.operation,type:"value"},u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}):(a(r,"<>",u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),E=`^${E}`,a(r,E,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}));}s=false;}break;case "pop":{let l=d[d.length-1];if(l&&typeof l=="object"&&"f()"in l){let g=[];for(;d.length>0&&d[d.length-1]!=="/ev";)g.push(d.pop());g=g.reverse();let E=W(g,u,D,i);d=[],E.forEach(x=>{x&&typeof x=="object"&&"type"in x&&x.type==="function"?a(r,x,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}):P.warn("Unhandled case: value is not a function",x);}),s=false;}else d.push(t);return}default:d.push(t);}else if(typeof t=="string")if(t.startsWith("^"))a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;else if(t==="ev")f=true;else if(t===`
|
|
16
|
-
`)s=true;else if(t==="done"||t==="end")a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;else if(t==="<>")a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;else if(t==="nop"&&h){let l=Ie(T,n,o,u,i,D,C);l&&a(r,l,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),h=false,T=[];}else t==="#"?y=true:t==="thread"&&(A=true);else if(Array.isArray(t))if(h)T.push(t);else if(t.length>1&&typeof t[t.length-2]=="object"&&t[t.length-2]&&"c"in t[t.length-2]&&typeof t[t.length-1]=="object"&&t[t.length-1]&&"b"in t[t.length-1]){d.pop();let l=[],g=[];for(;d.length>0&&d[d.length-1]!=="/ev";)l.push(d.pop());T=[...T,...l.reverse()],h=true,g.push(t.pop()),g.push(t.pop()),T=[...T,...t],T.push(g);}else if(t.length>1&&typeof t[t.length-1]=="object"&&t[t.length-1]&&"#n"in t[t.length-1]){let l=t.pop();if(!l){P.error("Error parsing ink file: el is undefined");return}let g=l["#n"];delete l["#n"],t.push(l),a(r,{"->":u?u+"_|_"+g:g},u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),o({[g]:t},u,i);}else $(t,u,i,r,a,n,o,c,C,s,D);else if(t&&typeof t=="object")if("->"in t&&typeof t["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(t["->"])){let l=[];d.length>0&&(l=ge(["ev",...d],u,D,i)),t.params=l,a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;}else if("->t->"in t&&typeof t["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(t["->t->"])){let l=[];d.length>0&&(l=ge(["ev",...d],u,D,i)),t.params=l,a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;}else if("*"in t&&typeof t["*"]=="string")t["*"].includes("c")&&(d.push(t),s=false);else if("s"in t&&Array.isArray(t.s))d.push(t),s=false;else if("CNT?"in t)d.push(t),s=false;else if("VAR="in t||"temp="in t){let l="VAR="in t?t["VAR="]:t["temp="],g,E=[];if(l!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse(),g=oe(E,u,D,i),d=[],ue({key:l,value:g,defaultType:"VAR="in t?"storage":"tempstorage",artmeticValue:true},D,i).forEach(R=>{(R.value!==void 0||R.value!==null)&&a(r,R,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A});}),s=false;}}else o(t,u,i);}),c(d,r,u,i,D),u.includes("_|_")&&r.length===2){let t=r[0],F=r[1];t&&F&&typeof t=="object"&&"dialogue"in t&&typeof F=="object"&&"labelToOpen"in F&&t.dialogue===" "&&F.labelToOpen&&(r.shift(),delete F.glueEnabled,r[0]=F);}}function me(e,u,i,r,a,n){if(u.length===0)return;let o=W(u,r,i,a);if(o.length===1){let c={type:"ifelse",condition:o[0],then:e,else:n};return c.else||delete c.else,c}else if(o.length>1){let c={type:"ifelse",condition:{type:"union",unionType:"and",conditions:o},then:e,else:n};return c.else||delete c.else,c}}function Ie(e,u,i,r,a,n,o=void 0){if(e.length===0){P.error("Error parsing ink file: Conditional statement is not valid",e);return}let c=[],C=[];if(e.forEach(f=>{Array.isArray(f)?C.push(f):typeof f=="string"&&f==="du"?a.du?c.push(a.du):a.du=c[c.length-1]:(typeof f!="string"||f!=="/ev")&&c.push(f);}),C.length===0){P.error("Error parsing ink file: Conditional statement is not valid",C);return}let s=ye(C[0],u,i,`${r}${"_|_"}then`,a,n,`${o||""}then`),D;return C.length===2?D=ye(C[1],u,i,`${r}${"_|_"}else`,a,n,`${o||""}else`):C.length>2?(C.shift(),C.push("nop"),C=[{b:C}],D=ye(C,u,i
|
|
16
|
+
`)s=true;else if(t==="done"||t==="end")a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;else if(t==="<>")a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;else if(t==="nop"&&h){let l=Ie(T,n,o,u,i,D,C);l&&a(r,l,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),h=false,T=[];}else t==="#"?y=true:t==="thread"&&(A=true);else if(Array.isArray(t))if(h)T.push(t);else if(t.length>1&&typeof t[t.length-2]=="object"&&t[t.length-2]&&"c"in t[t.length-2]&&typeof t[t.length-1]=="object"&&t[t.length-1]&&"b"in t[t.length-1]){d.pop();let l=[],g=[];for(;d.length>0&&d[d.length-1]!=="/ev";)l.push(d.pop());T=[...T,...l.reverse()],h=true,g.push(t.pop()),g.push(t.pop()),T=[...T,...t],T.push(g);}else if(t.length>1&&typeof t[t.length-1]=="object"&&t[t.length-1]&&"#n"in t[t.length-1]){let l=t.pop();if(!l){P.error("Error parsing ink file: el is undefined");return}let g=l["#n"];delete l["#n"],t.push(l),a(r,{"->":u?u+"_|_"+g:g},u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),o({[g]:t},u,i);}else $(t,u,i,r,a,n,o,c,C,s,D);else if(t&&typeof t=="object")if("->"in t&&typeof t["->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(t["->"])){let l=[];d.length>0&&(l=ge(["ev",...d],u,D,i)),t.params=l,a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;}else if("->t->"in t&&typeof t["->t->"]=="string"&&!new RegExp(/^\.\^\.\^\.\d\.s$/).test(t["->t->"])){let l=[];d.length>0&&(l=ge(["ev",...d],u,D,i)),t.params=l,a(r,t,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A}),s=false;}else if("*"in t&&typeof t["*"]=="string")t["*"].includes("c")&&(d.push(t),s=false);else if("s"in t&&Array.isArray(t.s))d.push(t),s=false;else if("CNT?"in t)d.push(t),s=false;else if("VAR="in t||"temp="in t){let l="VAR="in t?t["VAR="]:t["temp="],g,E=[];if(l!=="$r"){for(d.pop(),d[d.length-1]==="/ev"&&d.pop();d.length>0&&d[d.length-1]!=="/ev";)E.push(d.pop());E=E.reverse(),g=oe(E,u,D,i),d=[],ue({key:l,value:g,defaultType:"VAR="in t?"storage":"tempstorage",artmeticValue:true},D,i).forEach(R=>{(R.value!==void 0||R.value!==null)&&a(r,R,u,i,D,{isNewLine:s,isHashtagScript:y,isThreads:A});}),s=false;}}else o(t,u,i);}),c(d,r,u,i,D),u.includes("_|_")&&r.length===2){let t=r[0],F=r[1];t&&F&&typeof t=="object"&&"dialogue"in t&&typeof F=="object"&&"labelToOpen"in F&&t.dialogue===" "&&F.labelToOpen&&(r.shift(),delete F.glueEnabled,r[0]=F);}}function me(e,u,i,r,a,n){if(u.length===0)return;let o=W(u,r,i,a);if(o.length===1){let c={type:"ifelse",condition:o[0],then:e,else:n};return c.else||delete c.else,c}else if(o.length>1){let c={type:"ifelse",condition:{type:"union",unionType:"and",conditions:o},then:e,else:n};return c.else||delete c.else,c}}function Ie(e,u,i,r,a,n,o=void 0){if(e.length===0){P.error("Error parsing ink file: Conditional statement is not valid",e);return}let c=[],C=[];if(e.forEach(f=>{Array.isArray(f)?C.push(f):typeof f=="string"&&f==="du"?a.du?c.push(a.du):a.du=c[c.length-1]:(typeof f!="string"||f!=="/ev")&&c.push(f);}),C.length===0){P.error("Error parsing ink file: Conditional statement is not valid",C);return}let s=ye(C[0],u,i,`${r}${"_|_"}then`,a,n,`${o||""}then`),D;return C.length===2?D=ye(C[1],u,i,`${r}${"_|_"}else`,a,n,`${o||""}else`):C.length>2?(C.shift(),C.push("nop"),C=[{b:C}],D=ye(C,u,i,r,a,n,`${o||""}else`)):D=void 0,a.du=void 0,me(s,c,n,r,a,D)}function ye(e,u,i,r,a,n,o=void 0){let c=[];for(let s of e)typeof s=="object"&&"b"in s&&(s.b=s.b.filter(D=>D!==null&&!(typeof D=="object"&&"->"in D&&new RegExp(/.*\.[0-9]/).test(D["->"]))),$(s.b,r,a,c,u,u,i,X,o,true,n));return c.length===1?c[0]:{type:"resulttocombine",combine:"cross",secondConditionalItem:c}}function Be(e="",u=""){let i=Array.isArray(e)?e:[e],r=Array.isArray(u)?u:[u];return [...new Set([...i,...r])]}function X(e,u,i,r,a){if(e.length>0){let n={};He(e,n,a,r);for(let[o,c]of Object.entries(n)){let C=i+"_|_"+o,s={text:c.text.length===1?c.text[0]:c.text,label:C,props:{},type:Fe(C,false),oneTime:c.onetime};c.text.length===0&&(s.onlyHaveNoChoice=true,s.autoSelect=true),s.oneTime===false&&delete s.oneTime;let D=me(s,c.conditions,a,i,r)||s,f=u[u.length-1];if(typeof f=="object"&&f&&"type"in f&&(f={conditionalStep:f}),u.length>0&&typeof f=="object"&&f&&"choices"in f&&f.choices){let d=f.choices;d&&Array.isArray(d)?d.push(D):P.error("Unhandled case: choices is PixiVNJsonConditionalStatements<PixiVNJsonChoices> | undefined",c,d),f.choices=d.sort((h,y)=>{try{let A=h.label.split("."),T=A[A.length-1].replaceAll(".","_|_"),m=y.label.split("."),b=m[m.length-1].replaceAll(".","_|_");if(T.includes("c-")&&b.includes("c-")){let t=T.split("c-")[1],F=Number(t),l=b.split("c-")[1],g=Number(l);return F-g}}catch{}return 0});}else u.push({choices:[D]});c.preDialog&&(r.preDialog[C]={...c.preDialog});}}}function He(e,u,i,r,a){let n=[],o="",c="",C=false,s=[];for(let D=0;D<e.length;D++){let f=e[D];if(typeof f=="string")f.startsWith("^")?n.push(L(f)):Me.includes(f)&&s.push(f);else if(Array.isArray(f)&&f.includes("visit")){let d=Q(f,se,(h,y,A)=>{},a,r,i);n.push(d);}else if(f&&typeof f=="object")if("*"in f&&typeof f["*"]&&typeof f["*"]=="string")f["*"].includes("c")&&(o=`c${f["*"].split("c")[1]}`,f.flg&16&&(C=true));else if("s"in f&&Array.isArray(f.s)){let d=We(f.s),h=f.s.includes("<>");d&&(a&&u[a]?(u[a].preDialog={text:d,glue:h},u[a].text=Be(d,u[a].text)):(n.push(d),c=d));}else ("CNT?"in f||"VAR?"in f)&&s.push(f);else s.push(f);if(o){u[o]?u[o].text=Be(n,u[o].text):u[o]={text:n,onetime:C,conditions:s},c&&(u[o].preDialog={text:c,glue:false});let d=e.slice(D+1);He(d,u,i,r,o);return}}}function We(e){for(let u of e)if(typeof u=="string"){if(u.startsWith("^"))return L(u)}else if(Array.isArray(u)){let i=We(u);if(i)return i}}exports.InkMapper=void 0;(a=>{function e(n,o={}){let{labelToRemove:c=[],initialVarsToRemove:C=[],enums:s={},functions:D=[],preDialog:f={},characterIds:d}=o,h={$schema:pixiVnJson.PIXIVNJSON_SCHEMA_URL};if(h.labels=u(n.root,{labelToRemove:c,initialVarsToRemove:C,enums:s,functions:D,preDialog:f,characterIds:d}),h.labels&&te in h.labels){let y=h.labels[te];delete h.labels[te],y.forEach(A=>{A.operations&&(h.initialOperations=h.initialOperations?[...h.initialOperations,...A.operations]:[...A.operations]);});}if(h.labels&&z in h.labels){let y=h.labels[z];delete h.labels[z],y.forEach(A=>{A.operations&&(h.initialOperations=h.initialOperations?[...h.initialOperations,...A.operations]:[...A.operations]);});}return c.forEach(y=>{h.labels&&y in h.labels&&delete h.labels[y];}),C.forEach(y=>{h.initialOperations&&(h.initialOperations=h.initialOperations.filter(A=>!(A.type==="value"&&A.key===y)));}),h}a.inkToJson=e;function u(n,o){try{let c={};return i(n,c,o),c}catch(c){P.error("Error parsing ink file",c);}}function i(n,o,c){for(let C of n)if(C)if(Array.isArray(C))if(C.includes("visit")){let s=Q(C,se,(D,f,d)=>{},"",c,[]);s&&(c.externalSwitch=s);}else i(C,o,c);else typeof C=="object"&&(C&&"VAR="in C&&c.externalSwitch&&(o[z]||(o[z]=[]),o[z].push({operations:ue({defaultType:"storage",key:C["VAR="],value:c.externalSwitch},[],c)})),r(C,o,"",c));}function r(n,o,c="",C){if(n!==null){for(let[s,D]of Object.entries(n))if(Array.isArray(D)){let f=[],d={},h=(c?c+"_|_":"")+s;$(D,h,C,f,he,he,(y,A,T)=>{r(y,d,A,T);},X);for(let[y,A]of Object.entries(d))o[y]=A;f.length>0&&(o[h]=f);}}}})(exports.InkMapper||={});
|