function e(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}var r,t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},E={},b={},k=y.parcelRequire847f;null==k&&((k=function(e){if(e in E)return E[e].exports;if(e in b){var r=b[e];delete b[e];var t={id:e,exports:{}};return E[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){b[e]=r},y.parcelRequire847f=k);var S,D,F,M,P,A,x,R,C,T={},N=[],z=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function O(e,r){for(var t in r)e[t]=r[t];return e}function j(e){var r=e.parentNode;r&&r.removeChild(e)}function I(e,r,t){var n,o,a,i={};for(a in r)"key"==a?n=r[a]:"ref"==a?o=r[a]:i[a]=r[a];if(arguments.length>2&&(i.children=arguments.length>3?S.call(arguments,2):t),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===i[a]&&(i[a]=e.defaultProps[a]);return L(e,i,n,o,null)}function L(e,r,t,n,o){var a={type:e,props:r,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++F:o};return null==o&&null!=D.vnode&&D.vnode(a),a}function U(e){return e.children}function H(e,r){this.props=e,this.context=r}function W(e,r){if(null==r)return e.__?W(e.__,e.__.__k.indexOf(e)+1):null;for(var t;rr&&P.sort(R));Y.__r=0}function G(e,r,t,n,o,a,i,s,u,l){var c,d,f,m,h,p,v,w=n&&n.__k||N,g=w.length;for(t.__k=[],c=0;c0?L(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=t,m.__b=t.__b+1,null===(f=w[c])||f&&m.key==f.key&&m.type===f.type)w[c]=void 0;else for(d=0;d=0;t--)if((n=r.__k[t])&&(o=e(n)))return o}return null}(n).nextSibling),function e(r,t,n){var o,a;if(D.unmount&&D.unmount(r),(o=r.ref)&&(o.current&&o.current!==r.__e||ee(o,null,t)),null!=(o=r.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){D.__e(e,t)}o.base=o.__P=null,r.__c=void 0}if(o=r.__k)for(a=0;a2&&(s.children=arguments.length>3?S.call(arguments,2):t),L(e.type,s,n||e.key,o||e.ref,null)}S=N.slice,D={__e:function(e,r,t,n){for(var o,a,i;r=r.__;)if((o=r.__c)&&!o.__)try{if((a=o.constructor)&&null!=a.getDerivedStateFromError&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),i=o.__d),i)return o.__E=o}catch(r){e=r}throw e}},F=0,M=function(e){return null!=e&&void 0===e.constructor},H.prototype.setState=function(e,r){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=O({},this.state),"function"==typeof e&&(e=e(O({},t),this.props)),e&&O(t,e),null!=e&&this.__v&&(r&&this._sb.push(r),q(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),q(this))},H.prototype.render=U,P=[],x="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,R=function(e,r){return e.__v.__b-r.__v.__b},Y.__r=0,C=0;var en=0;function eo(e,r,t,n,o,a){var i,s,u={};for(s in r)"ref"==s?i=r[s]:u[s]=r[s];var l={type:e,props:u,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--en,__source:o,__self:a};if("function"==typeof e&&(i=e.defaultProps))for(s in i)void 0===u[s]&&(u[s]=i[s]);return D.vnode&&D.vnode(l),l}var ea,ei,es,eu,el=0,ec=[],ed=[],ef=D.__b,em=D.__r,eh=D.diffed,ep=D.__c,ev=D.unmount;function ew(e,r){D.__h&&D.__h(ei,e,el||r),el=0;var t=ei.__H||(ei.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({__V:ed}),t.__[e]}function eg(e){return el=1,function(e,r,t){var n=ew(ea++,2);if(n.t=e,!n.__c&&(n.__=[t?t(r):eA(void 0,r),function(e){var r=n.__N?n.__N[0]:n.__[0],t=n.t(r,e);r!==t&&(n.__N=[t,n.__[1]],n.__c.setState({}))}],n.__c=ei,!ei.u)){var o=function(e,r,t){if(!n.__c.__H)return!0;var o=n.__c.__H.__.filter(function(e){return e.__c});if(o.every(function(e){return!e.__N}))return!a||a.call(this,e,r,t);var i=!1;return o.forEach(function(e){if(e.__N){var r=e.__[0];e.__=e.__N,e.__N=void 0,r!==e.__[0]&&(i=!0)}}),!(!i&&n.__c.props===e)&&(!a||a.call(this,e,r,t))};ei.u=!0;var a=ei.shouldComponentUpdate,i=ei.componentWillUpdate;ei.componentWillUpdate=function(e,r,t){if(this.__e){var n=a;a=void 0,o(e,r,t),a=n}i&&i.call(this,e,r,t)},ei.shouldComponentUpdate=o}return n.__N||n.__}(eA,e)}function e_(e,r){var t=ew(ea++,3);!D.__s&&eP(t.__H,r)&&(t.__=e,t.i=r,ei.__H.__h.push(t))}function ey(e,r){var t=ew(ea++,4);!D.__s&&eP(t.__H,r)&&(t.__=e,t.i=r,ei.__h.push(t))}function eE(e){return el=5,eb(function(){return{current:e}},[])}function eb(e,r){var t=ew(ea++,7);return eP(t.__H,r)?(t.__V=e(),t.i=r,t.__h=e,t.__V):t.__}function ek(){for(var e;e=ec.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(eF),e.__H.__h.forEach(eM),e.__H.__h=[]}catch(r){e.__H.__h=[],D.__e(r,e.__v)}}D.__b=function(e){ei=null,ef&&ef(e)},D.__r=function(e){em&&em(e),ea=0;var r=(ei=e.__c).__H;r&&(es===ei?(r.__h=[],ei.__h=[],r.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=ed,e.__N=e.i=void 0})):(r.__h.forEach(eF),r.__h.forEach(eM),r.__h=[],ea=0)),es=ei},D.diffed=function(e){eh&&eh(e);var r=e.__c;r&&r.__H&&(r.__H.__h.length&&(1!==ec.push(r)&&eu===D.requestAnimationFrame||((eu=D.requestAnimationFrame)||eD)(ek)),r.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==ed&&(e.__=e.__V),e.i=void 0,e.__V=ed})),es=ei=null},D.__c=function(e,r){r.some(function(e){try{e.__h.forEach(eF),e.__h=e.__h.filter(function(e){return!e.__||eM(e)})}catch(t){r.some(function(e){e.__h&&(e.__h=[])}),r=[],D.__e(t,e.__v)}}),ep&&ep(e,r)},D.unmount=function(e){ev&&ev(e);var r,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(e){try{eF(e)}catch(e){r=e}}),t.__H=void 0,r&&D.__e(r,t.__v))};var eS="function"==typeof requestAnimationFrame;function eD(e){var r,t=function(){clearTimeout(n),eS&&cancelAnimationFrame(r),setTimeout(e)},n=setTimeout(t,100);eS&&(r=requestAnimationFrame(t))}function eF(e){var r=ei,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),ei=r}function eM(e){var r=ei;e.__c=e.__(),ei=r}function eP(e,r){return!e||e.length!==r.length||r.some(function(r,t){return r!==e[t]})}function eA(e,r){return"function"==typeof r?r(e):r}const ex=!!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement);function eR(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r}const eC=e=>{let r=eE([e,(...e)=>r[0](...e)]).current;return ey(()=>{r[0]=e}),r[1]},eT=(e="",r=location.pathname)=>r.toLowerCase().indexOf(e.toLowerCase())?"~"+r:r.slice(e.length)||"/",eN=(e,r="")=>"~"===e[0]?e.slice(1):r+e,ez="pushState",eB="replaceState",eO=["popstate",ez,eB,"hashchange"],ej=e=>{for(let r of eO)addEventListener(r,e);return()=>{for(let r of eO)removeEventListener(r,e)}},eI=(e,r)=>(function(e,r,t){t&&!ex&&(r=t);let n=r(),[{_instance:o},a]=eg({_instance:{_value:n,_getSnapshot:r}});return ey(()=>{o._value=n,o._getSnapshot=r,eR(o._value,r())||a({_instance:o})},[e,n,r]),e_(()=>(eR(o._value,o._getSnapshot())||a({_instance:o}),e(()=>{eR(o._value,o._getSnapshot())||a({_instance:o})})),[e]),n})(ej,e,r),eL=()=>location.pathname,eU=({ssrPath:e}={})=>eI(eL,e?()=>e:eL),eH=(e,{replace:r=!1}={})=>history[r?eB:ez](null,"",e);if("undefined"!=typeof history)for(const e of[ez,eB]){let r=history[e];history[e]=function(){let t=r.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),t}}const eW=e=>e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),eq=(e,r,t)=>{let n=e?"((?:[^\\/]+?)(?:\\/(?:[^\\/]+?))*)":"([^\\/]+?)";return r&&t&&(n="(?:\\/"+n+")"),n+(r?"?":"")},eY=e=>{let r=/:([A-Za-z0-9_]+)([?+*]?)/g,t=null,n=0,o=[],a="";for(;null!==(t=r.exec(e));){let[i,s,u]=t,l="+"===u||"*"===u,c="?"===u||"*"===u,d=c&&"/"===e[t.index-1]?1:0,f=e.substring(n,t.index-d);o.push({name:s}),n=r.lastIndex,a+=eW(f)+eq(l,c,d)}return{keys:o,regexp:RegExp("^"+(a+=eW(e.substring(n)))+"(?:\\/)?$","i")}},eG={hook:(e={})=>[eT(e.base,eU(e)),eC((r,t)=>eH(eN(r,e.base),t))],matcher:function(e=eY){let r={},t=t=>r[t]||(r[t]=e(t));return(e,r)=>{let{regexp:n,keys:o}=t(e||""),a=n.exec(r);if(!a)return[!1,null];let i=o.reduce((e,r,t)=>(e[r.name]=a[t+1],e),{});return[!0,i]}}(),base:""},eV=function(e,r){var t={__c:r="__cC"+C++,__:e,Consumer:function(e,r){return e.children(r)},Provider:function(e){var t,n;return this.getChildContext||(t=[],(n={})[r]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(function(e){e.__e=!0,q(e)})},this.sub=function(e){t.push(e);var r=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),r&&r.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t}(eG),eX=()=>(function(e){var r=ei.context[e.__c],t=ew(ea++,9);return t.c=e,r?(null==t.__&&(t.__=!0,r.sub(ei)),r.props.value):e.__})(eV),eK=e=>e.hook(e),e$=e=>{let r=eX(),[t]=eK(r);return r.matcher(e,t)},eJ=({hook:e,matcher:r,ssrPath:t,base:n="",parent:o,children:a})=>{let i=(a,i=o||eG)=>(a.hook=e||i.hook,a.matcher=r||i.matcher,a.ssrPath=t||i.ssrPath,a.ownBase=n,a.parent=o,a),[s]=eg(()=>i({get base(){return(s.parent||eG).base+s.ownBase}}));return ey(()=>{i(s)}),I(eV.Provider,{value:s,children:a})},eZ=({path:e,match:r,component:t,children:n})=>{let o=e$(e),[a,i]=r||o;return a?t?I(t,{params:i}):"function"==typeof n?n(i):n:null},eQ=(e,r)=>{let t=eX(),[,n]=eK(t),{to:o,href:a=o,children:i,onClick:s}=e,u=eC(r=>{r.ctrlKey||r.metaKey||r.altKey||r.shiftKey||0!==r.button||(s&&s(r),r.defaultPrevented||(r.preventDefault(),n(o||a,e)))}),l={href:"~"===a[0]?a.slice(1):t.base+a,onClick:u,to:null,ref:r},c=M(i)?i:I("a",e);return et(c,l)},e0=e=>Array.isArray(e)?[].concat(...e.map(e=>e&&e.type===U?e0(e.props.children):e0(e))):[e],e1=({children:e,location:r})=>{let t=eX(),n=t.matcher,[o]=eK(t);for(let t of e0(e)){let e=0;if(M(t)&&(e=t.props.path?n(t.props.path,r||o):[!0,{}])[0])return et(t,{match:e})}return null},e2=()=>window.location.hash.replace("#","")||"/",e4=({url:e})=>`/#/play/${encodeURIComponent(e)}`,e6=e=>{if("/"===e)return"home";let r=e.split("/").filter(Boolean)[0];return r||""},e3=()=>{var e;let[r,t]=eg(e2());e_(()=>{let e=()=>{let e=e2();e!==r&&(t(e),window.scrollTo(0,0))};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[r,t]);let n=(e=e=>{window.location.hash=e.replace("#/","")},el=8,eb(function(){return e},[]));return[r,n]},e9=["light","dim","dark","solarized-light","solarized-dark","emo","redrum","toxin","valve","wasp","a8008","a80s_after_dark","a9009","aether","alduin","alpine","arch","aurora","beach","bento","bingsu","bliss","blue_dolphin","blueberry_dark","blueberry_light","botanical","bouquet","breeze","bushido","cafe","camping","carbon","catppuccin","chaos_theory","cheesecake","cherry_blossom","comfy","copper","creamsicle","cyberspace","dark_magic_girl","dark_note","darling","deku","desert_oasis","dev","diner","dino","dmg","dollar","dots","dracula","drowning","dualshot","earthsong","everblush","evil_eye","ez_mode","fire","fledgling","fleuriste","froyo","frozen_llama","fruit_chew","fundamentals","future_funk","godspeed","graen","grand_prix","gruvbox_dark","gruvbox_light","hammerhead","hanok","hedge","honey","horizon","husqy","iceberg_dark","iceberg_light","ishtar","iv_clover","iv_spade","joker","laser","lavender","leather","lil_dragon","lime","luna","magic_girl","mashu","matcha_moccha","material","matrix","menthol","metaverse","metropolis","mexican","miami","miami_nights","midnight","milkshake","mint","mizu","modern_dolch","modern_dolch_light","modern_ink","monokai","moonlight","mountain","mr_sleeves","ms_cupcakes","muted","nautilus","nebula","night_runner","nord","nord_light","norse","oblivion","olive","olivia","onedark","our_theme","paper","passion_fruit","pastel","peach_blossom","peaches","pink_lemonade","pulse","purpurite","red_dragon","red_samurai","repose_dark","repose_light","retro","retrocast","rose_pine","rose_pine_dawn","rose_pine_moon","rudy","ryujinscales","serika","serika_dark","sewing_tin","sewing_tin_light","shadow","shoko","slambook","snes","soaring_skies","sonokai","stealth","strawberry","striker","superuser","sweden","taro","terminal","terra","terror_below","tiramisu","trackday","trance","tron_orange","vaporwave","viridescent","voc","vscode","watermelon","wavez","witch_girl"],e8="elseifplayer/theme",e5=e9[0],e7=()=>{let e=localStorage.getItem(e8);return e||e5},re=e=>e9.includes(e)?e:e7(),rr=(e=e7())=>{let[r,t]=eg(e),n=e=>{let r=re(e);t(r),localStorage.setItem(e8,r)};return{currentTheme:r,setTheme:n,setRandomTheme:()=>{let e=e9[Math.floor(Math.random()*e9.length)];n(e)},themes:e9}};function rt({theme:e,setLocation:r,buildLink:t}){return eo("input",{type:"file",onChange:({target:n})=>{let o=n.files[0],a=`${URL.createObjectURL(o)}#${o.name}`;r(t({url:a,theme:e}))}})}function rn({theme:e,setLocation:r,buildLink:t}){let n=/^(http|https):\/\/[^ "]+$/;return eo("input",{type:"text",placeholder:"https://...",onKeyPress:({keyCode:o,target:a})=>{if(13!==o)return;let i=encodeURI(a.value);n.test(i)&&r(t({url:i,theme:e}))}})}function ro({themeEngine:e}){let r=e.themes.map(e=>eo("option",{value:e,children:e},e));return eo("select",{value:e.currentTheme,onChange:({target:r})=>e.setTheme(r.value),children:r})}function ra({themeEngine:e}){let r=e3()[1];return eo("main",{children:[eo("h1",{children:"ElseIFPlayer"}),eo("section",{children:eo("p",{children:["Interactive Fiction interpreter that runs right in your browser.",eo("br",{}),"Source code can be found in this ",eo("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/He4eT/elseifplayer",children:"repository"}),"."]})}),eo("hr",{}),eo("section",{children:[eo("h2",{children:"Interface Theme"}),eo(ro,{themeEngine:e}),eo("p",{children:["Preview and choose from available themes on the ",eo(eQ,{href:"/#/themes/",children:"themes page"}),"."]}),eo("p",{children:eo("small",{children:"Double-click the input field during the game to enter full-screen mode."})})]}),eo("hr",{}),eo("section",{children:[eo("h2",{children:"Play a Game from the List"}),eo("p",{children:eo(eQ,{href:"/#/games/",children:"IFDB games"})})]}),eo("hr",{}),eo("section",{children:[eo("h2",{children:"Play the Game from a File"}),eo("p",{children:eo("details",{children:[eo("summary",{children:"Supported formats"}),eo("p",{children:"Text-only games are supported:"}),eo("ul",{children:[eo("li",{children:"ADRIFT 4 (.taf)"}),eo("li",{children:"Glulx (.gblorb, .ulx)"}),eo("li",{children:"Hugo (.hex)"}),eo("li",{children:"TADS 2/3 (.gam, .t3)"}),eo("li",{children:"Z-code (.z3, .z4, .z5, .z8, .blorb)"})]})]})}),eo("p",{children:eo("label",{children:["Local file: ",eo("br",{}),eo(rt,{setLocation:r,buildLink:e4,theme:e.currentTheme})]})}),eo("p",{children:eo("label",{children:["Direct link: ",eo("br",{}),eo(rn,{setLocation:r,buildLink:e4,theme:e.currentTheme})]})})]})]})}function ri({name:e,ifdb:r,url:t}){return eo("div",{children:[eo("h4",{children:e}),eo("a",{target:"_blank",rel:"noopener noreferrer",href:r,children:"IFDB page"}),eo("span",{children:" | "}),eo(eQ,{href:e4({url:t}),children:"Play"})]})}var rs=[["Lost Pig","https://ifdb.org/viewgame?id=mohwfk47yjzii14w","https://mirror.ifarchive.org/if-archive/games/zcode/LostPig.z8"],["Counterfeit Monkey","https://ifdb.org/viewgame?id=aearuuxv83plclpl","https://mirror.ifarchive.org/if-archive/games/glulx/CounterfeitMonkey.gblorb"],["Anchorhead","https://ifdb.org/viewgame?id=op0uw1gn1tjqmjt7","https://ifarchive.org/if-archive/games/zcode/anchor.z8"],["Galatea","https://ifdb.org/viewgame?id=urxrv27t7qtu52lb","https://mirror.ifarchive.org/if-archive/games/zcode/Galatea.zblorb"],["Photopia","https://ifdb.org/viewgame?id=ju778uv5xaswnlpl","https://mirror.ifarchive.org/if-archive/games/zcode/photopia.z5"],["Spider and Web","https://ifdb.org/viewgame?id=2xyccw3pe0uovfad","https://mirror.ifarchive.org/if-archive/games/zcode/Tangle.z5"],["Slouching Towards Bedlam","https://ifdb.org/viewgame?id=032krqe6bjn5au78","https://mirror.ifarchive.org/if-archive/games/competition2003/zcode/slouch/slouch.z5"],["Curses!","https://ifdb.org/viewgame?id=plvzam05bmz3enh8","https://mirror.ifarchive.org/if-archive/games/zcode/curses.z5"],["Violet","https://ifdb.org/viewgame?id=4glrrfh7wrp9zz7b","https://mirror.ifarchive.org/if-archive/games/zcode/Violet.zblorb"],["The Wizard Sniffer","https://ifdb.org/viewgame?id=uq18rw9gt8j58da","https://ifarchive.org/if-archive/games/competition2017/The%20Wizard%20Sniffer/The_Wizard_Sniffer.gblorb"],["Shade","https://ifdb.org/viewgame?id=hsfc7fnl40k4a30q","https://mirror.ifarchive.org/if-archive/games/zcode/shade.z5"],["Vespers","https://ifdb.org/viewgame?id=6dj2vguyiagrhvc2","https://mirror.ifarchive.org/if-archive/games/zcode/vespers.z8"],["Savoir-Faire","https://ifdb.org/viewgame?id=p0cizeb3kiwzlm2p","https://mirror.ifarchive.org/if-archive/games/zcode/Savoir-Faire.zblorb"],["Aisle","https://ifdb.org/viewgame?id=j49crlvd62mhwuzu","https://mirror.ifarchive.org/if-archive/games/zcode/Aisle.z5"],["Gun Mute","https://ifdb.org/viewgame?id=xwedbibfksczn7eq","https://mirror.ifarchive.org/if-archive/games/tads/GunMute.t3"],["A Beauty Cold and Austere","https://ifdb.org/viewgame?id=y9y7jozi0l76bb82","https://ifarchive.org/if-archive/games/competition2017/A%20Beauty%20Cold%20and%20Austere/A_Beauty_Cold_and_Austere.gblorb"],["Coloratura","https://ifdb.org/viewgame?id=g0fl99ovcrq2sqzk","https://mirror.ifarchive.org/if-archive/games/competition2013/glulx/coloratura/Coloratura.gblorb"],["Lime Ergot","https://ifdb.org/viewgame?id=b8mb4fcwmf1hrxl","https://mirror.ifarchive.org/if-archive/games/glulx/Lime_Ergot.gblorb"],["Rameses","https://ifdb.org/viewgame?id=0stz0hr7a98bp9mp","https://mirror.ifarchive.org/if-archive/games/zcode/rameses.zblorb"],["The Wand","https://ifdb.org/viewgame?id=2jil5vbxmbv8riv1","https://ifarchive.org/if-archive/games/glulx/Wand.ulx"],["1893: A World's Fair Mystery","https://ifdb.org/viewgame?id=00e0t7swrris5pg6","https://mirror.ifarchive.org/if-archive/games/tads/1893.gam"],["Adventure","https://ifdb.org/viewgame?id=fft6pu91j85y4acv","https://mirror.ifarchive.org/if-archive/games/zcode/Advent.z5"],["Alias 'The Magpie'","https://ifdb.org/viewgame?id=yspn49v69hzc8rtb","https://ifarchive.org/if-archive/games/competition2018/Alias%20The%20Magpie/Alias%20%27The%20Magpie%27.gblorb"],["Cragne Manor","https://ifdb.org/viewgame?id=4x7nltu8p851tn4x","https://mirror.ifarchive.org/if-archive/games/glulx/cragne.gblorb"],["The Edifice","https://ifdb.org/viewgame?id=4tb9soabrb4apqzd","https://mirror.ifarchive.org/if-archive/games/zcode/edifice.z5"],["Endless, Nameless","https://ifdb.org/viewgame?id=7vtm1rq16hh3xch","https://ifarchive.org/if-archive/games/zcode/nameless.z8"],["Everybody Dies","https://ifdb.org/viewgame?id=lyblvftb8xtlo0a1","https://mirror.ifarchive.org/if-archive/games/competition2008/glulx/everybodydies/EverybodyDies.gblorb"],["Foo Foo","https://ifdb.org/viewgame?id=ec6x9y8qcmsrxob9","https://ifarchive.org/if-archive/games/springthing/2016/FooFoo.gblorb"],["The Gostak","https://ifdb.org/viewgame?id=w5s3sv43s3p98v45","https://mirror.ifarchive.org/if-archive/games/zcode/gostak.z5"],["Inside the Facility","https://ifdb.org/viewgame?id=stsdri5zh7a4i5my","https://ifarchive.org/if-archive/games/competition2016/Inside%20the%20Facility/Facility.z8"],["Make It Good","https://ifdb.org/viewgame?id=jdrbw1htq4ah8q57","https://mirror.ifarchive.org/if-archive/games/zcode/MakeItGood.z8"],["Sub Rosa","https://ifdb.org/viewgame?id=73nvz9yui87ub3sd","https://mirror.ifarchive.org/if-archive/games/glulx/Sub_Rosa.gblorb"],["Suveh Nux","https://ifdb.org/viewgame?id=xkai23ry99qdxce3","https://mirror.ifarchive.org/if-archive/games/zcode/suvehnux.z5"],["Varicella","https://ifdb.org/viewgame?id=ywwlr3tpxnktjasd","https://mirror.ifarchive.org/if-archive/games/zcode/vgame.z8"]].map(([e,r,t])=>({name:e,ifdb:r,url:t}));const ru={name:"The Dreamhold",ifdb:"https://ifdb.org/viewgame?id=3myqnrs64nbtwdaz",url:"https://mirror.ifarchive.org/if-archive/games/zcode/dreamhold.z8"};function rl(){return eo("main",{className:"-soi4G_games",children:[eo("h1",{children:[eo("a",{target:"_blank",rel:"noopener noreferrer",href:"https://ifdb.org/",title:"The Interactive Fiction Database",children:"IFDB"})," Games"]}),eo("p",{children:["Choose one or ",eo(eQ,{href:"/",children:"go back"}),"."]}),eo("section",{className:"-soi4G_tutorial",children:[eo("h2",{children:"Tutorial"}),eo("p",{children:"If you are not familiar with Interactive Fiction, you should start with this tutorial game by\xa0Andrew\xa0Plotkin:"}),eo("ul",{children:eo("li",{children:eo(ri,{...ru})})})]}),eo("h2",{children:"Interactive Fiction Top 50 of All Time"}),eo("p",{children:[eo("a",{target:"_blank",rel:"noopener noreferrer",href:"https://ifdb.org/search?comp&sortby=awn&searchfor=series%3AInteractive+Fiction+Top+50+of+All+Time",children:"Every four years "}),", Victor Gijsbers puts together a list of the top 50 IF games of all time. Here is an almost complete and slightly rearranged version of the ",eo("a",{target:"_blank",rel:"noopener noreferrer",href:"https://ifdb.org/viewcomp?id=1lv599reviaxvwo7",children:"list from 2019"}),":"]}),eo("ol",{children:rs.map(e=>eo("li",{children:eo(ri,{...e})},e.name))})]})}r="qdlvgW_input",t="qdlvgW_message",n="qdlvgW_output",o="qdlvgW_subheader",a="qdlvgW_themePreview";const rc=(e,i)=>eo("section",{className:[a,i].join(" "),children:[eo("div",{className:n,children:[eo("div",{className:[t,r].join(" "),children:"> look"}),eo("div",{children:eo("br",{})}),eo("div",{className:[t,o].join(" "),children:i}),eo("div",{children:"Observe a vibrant demonstration of colors at work, showcasing their versatile usage right before your eyes."}),eo("div",{children:eo("br",{})})]}),eo("button",{onClick:()=>e.setTheme(i),children:"Apply this colors"})]},i);function rd({themeEngine:e}){let i=e.themes.map(r=>rc(e,r));return eo("main",{className:"qdlvgW_themes",children:[eo("h1",{children:"Themes Page"}),eo("p",{children:["Choose one or ",eo(eQ,{href:"/",children:"go back"}),"."]}),eo("section",{className:[a,"qdlvgW_current"].join(" "),children:[eo("h2",{children:"Current Theme"}),eo("div",{className:n,children:[eo("div",{className:[t,r].join(" "),children:"> look"}),eo("div",{children:eo("br",{})}),eo("div",{className:[t,o].join(" "),children:["Selected: ",e.currentTheme]}),eo("div",{children:"You can set random one with the button below or choose any theme from the list."}),eo("div",{children:eo("br",{})})]}),eo("button",{onClick:()=>e.setRandomTheme(),children:"Set a random theme"})]}),eo("h2",{children:"Theme List"}),eo("section",{children:i})]})}class rf{constructor(e){this.dialog=e.options.Dialog,this.streaming=this.dialog.streaming,this.FS=e.Module.FS,this.VM=e,this.filename_map={},this.filename_counter=0}close(e){"storyfile"===e.name||(this.streaming?e.fstream.fclose():2!==e.fmode&&this.dialog.file_write(e.fref,e.data))}createNode(e,r,t){let n=this.FS;if(!n.isDir(t)&&!n.isFile(t))throw new n.ErrnoError(28);let o=n.createNode(e,r,t);return o.node_ops=this,o.stream_ops=this,o.timestamp=Date.now(),o}getattr(e){let r="storyfile"===e.name?this.VM.data.length:0;return{atime:new Date(e.timestamp),ctime:new Date(e.timestamp),dev:1,gid:0,ino:e.id,mode:e.mode,mtime:new Date(e.timestamp),nlink:1,rdev:e.rdev,size:r,uid:0}}get_dialog_ref(e){let[r,t]=e.split(".");t=t.replace("glk","");let n="";return"save"===t&&(n=this.VM.Module.AsciiToString(this.VM.Module._gidispatch_get_game_id())),this.dialog.file_construct_ref(r,t,n)}llseek(e,r,t){let n=r;if(1===t)n+=e.position;else if(2===t){if("storyfile"===e.name)n+=e.data.length;else if(this.streaming){let r=e.fstream.ftell();e.fstream.fseek(0,2),n+=e.fstream.ftell(),e.fstream.fseek(r,0)}else n+=e.data.length}if(n<0)throw new this.FS.ErrnoError(28);return n}lookup(e,r){if("storyfile"!==r){let e=this.filename_map[r]||r;if(!this.dialog.file_ref_exists(this.streaming?{filename:e}:this.get_dialog_ref(e)))throw new this.FS.ErrnoError(44)}return this.createNode(e,r,33206)}mknod(e,r,t){return this.createNode(e,r,t)}mmap(){throw Error("EmglkenFS.mmap")}mount(){return this.createNode(null,"/",16895,0)}msync(){throw Error("EmglkenFS.msync")}open(e){if(e.name=e.node.name,"storyfile"===e.name)e.data=this.VM.data;else{var r;let t=1024&(r=e.flags)?5:1&r?1:2&r?3:2,n=this.filename_map[e.name]||e.name;this.streaming?e.fstream=this.dialog.file_fopen(t,{filename:n}):(e.fref=this.get_dialog_ref(n),e.fmode=t,e.data=null,1!==t&&(e.data=this.dialog.file_read(e.fref)),null==e.data&&(e.data=new Uint8Array(0),2!==t&&this.dialog.file_write(e.fref,"",!0)))}}read(e,r,t,n,o){if(0===n)return 0;if("storyfile"===e.name){let a=Math.min(e.data.length-o,n);return r.set(e.data.subarray(o,o+a),t),a}if(this.streaming){e.fstream.fseek(o,0);let a=e.fstream.BufferClass.from(r.buffer,t,n);return e.fstream.fread(a,n)}{let a=Math.min(e.data.length-o,n);return r.set(e.data.subarray(o,o+a),t),a}}readdir(){throw Error("EmglkenFS.readdir")}readlink(){throw new this.FS.ErrnoError(28)}register_filename(e,r){let t="save"===r?".glksave":"data"===r?".glkdata":".txt";if(/\.(glkdata|glksave|txt)$/.test(e)||(e+=t),this.filename_map[e])return this.filename_map[e];let n="emglken_fake_file_"+this.filename_counter++;return this.filename_map[e]=n,this.filename_map[n+t]=e,n}rename(){throw Error("EmglkenFS.rename")}rmdir(){throw Error("EmglkenFS.rmdir")}setattr(){}symlink(){throw Error("EmglkenFS.symlink")}unlink(e,r){let t=this.filename_map[r]||r;this.dialog.file_remove_ref(this.get_dialog_ref(t))}write(e,r,t,n,o){if("storyfile"===e.name)throw Error("EmglkenFS.write: cannot write to storyfile");if(this.streaming){e.fstream.fseek(o,0);let a=e.fstream.BufferClass.from(r).subarray(t,t+n);return e.fstream.fwrite(a,n)}{o=o||e.position;let a=n+o;if(a>e.data.length){let r=e.data;e.data=new Uint8Array(a),e.data.set(r)}return e.data.set(r.subarray(t,t+n),o),n}}}const rm={arguments:["storyfile"]};class rh{init(e,r){this.data=e,this.options=Object.assign({},rm,this.default_options(),r)}async start(){let e=new TextEncoder,r="",t={arguments:this.options.show_help?["-help"]:this.options.arguments,emglken_stdin_buffers:[],emglken_stdin_ready(){},locateFile(){},print:e=>{if(""!==r||""===e||e.startsWith("{")){if(r+=e,e.endsWith("}")){let e;try{e=JSON.parse(r)}catch(e){}e&&(r="",e.specialinput&&"fileref_prompt"===e.specialinput.type&&(this.last_fr_usage=e.specialinput.filetype),this.options.GlkOte.update(e))}}else console.log(e)},preRun:()=>{let e=t.FS;this.EFS=new rf(this),e.mkdir("/emglken"),e.mount(this.EFS,{},"/emglken"),e.chdir("/emglken")},wasmBinary:this.options.wasmBinary};this.Module=t,this.options.accept=r=>{"specialresponse"===r.type&&"fileref_prompt"===r.response&&r.value&&(this.EFS.streaming?r.value=this.EFS.register_filename(r.value.filename,this.last_fr_usage):r.value=r.value.filename);let n=JSON.stringify(r),o=e.encode(n);t.emglken_stdin_buffers.push(o),t.emglken_stdin_ready()},await this.options.vmcore(t),this.options.GlkOte.init(this.options)}}var rp={};rp=new URL(k("6MsPj").resolve("4QCNJ"),import.meta.url).toString();var rv=(()=>{var e="file:///node_modules/emglken/build/bocfel-core.js";return function(r={}){var t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,r=void 0!==r?r:{};r.ready=new Promise(function(e,r){n=e,o=r});var y=Object.assign({},r),E=[],b="./this.program",k=(e,r)=>{throw r},S="";"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),e&&(S=e),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(200==n.status||0==n.status&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null)};var D=r.print||console.log.bind(console),F=r.printErr||console.warn.bind(console);Object.assign(r,y),y=null,r.arguments&&(E=r.arguments),r.thisProgram&&(b=r.thisProgram),r.quit&&(k=r.quit),r.wasmBinary&&(u=r.wasmBinary);var M=r.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var P=!1,A=new TextDecoder("utf8");function x(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;return A.decode(e.buffer?e.subarray(r,o):new Uint8Array(e.slice(r,o)))}function R(e,r){if(!e)return"";for(var t=e+r,n=e;!(n>=t)&&f[n];)++n;return A.decode(f.subarray(e,n))}function C(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function T(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function N(){var e=l.buffer;r.HEAP8=d=new Int8Array(e),r.HEAP16=m=new Int16Array(e),r.HEAP32=h=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var z=[],B=[],O=[],j=[],I=[],L=!1,U=0,H=0,W=null,q=null;function Y(e){H++,r.monitorRunDependencies&&r.monitorRunDependencies(H)}function G(e){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),0==H&&(null!==W&&(clearInterval(W),W=null),q)){var t=q;q=null,t()}}function V(e){r.onAbort&&r.onAbort(e),F(e="Aborted("+e+")"),P=!0,c=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function X(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e){try{if(e==v&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function $(e,r,t){return(u||"function"!=typeof fetch?Promise.resolve().then(function(){return K(e)}):fetch(e,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(function(){return K(e)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(t,function(e){F("failed to asynchronously prepare wasm: "+e),V(e)})}function J(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Z(e){for(;e.length>0;)e.shift()(r)}r.locateFile?X(v="bocfel-core.wasm")||(t=v,v=r.locateFile?r.locateFile(t,S):S+t):v=new URL(rp).href;var Q=[],ee=0,er=0;function et(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_refcount=function(e){h[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,d[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=d[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,d[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=d[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=h[this.ptr>>2];h[this.ptr>>2]=e+1},this.release_ref=function(){var e=h[this.ptr>>2];return h[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(eI(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function en(){var e=er;if(!e)return eN(0),0;var r=new et(e);r.set_adjusted_ptr(e);var t=r.get_type();if(!t)return eN(0),e;for(var n=0;n"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=eo.isAbs(e),t="/"===e.substr(-1);return(e=eo.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=eo.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=eo.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return eo.normalize(e.join("/"))},join2:(e,r)=>eo.normalize(e+"/"+r)},ea={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:el.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=eo.isAbs(n)}return e=eo.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ea.resolve(e).substr(1),r=ea.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:T(e)+1),o=C(e,n,0,n.length);return r&&(n.length=o),n}var es={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){es.ttys[e]={input:[],output:[],ops:r},el.registerDevice(e,es.stream_ops)},stream_ops:{open:function(e){var r=es.ttys[e.node.rdev];if(!r)throw new el.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new el.ErrnoError(60);for(var a,i=0,s=0;s0&&(D(x(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(F(x(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(F(x(e.output,0)),e.output=[])}}},eu={ops_table:null,mount:function(e){return eu.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(el.isBlkdev(t)||el.isFIFO(t))throw new el.ErrnoError(63);eu.ops_table||(eu.ops_table={dir:{node:{getattr:eu.node_ops.getattr,setattr:eu.node_ops.setattr,lookup:eu.node_ops.lookup,mknod:eu.node_ops.mknod,rename:eu.node_ops.rename,unlink:eu.node_ops.unlink,rmdir:eu.node_ops.rmdir,readdir:eu.node_ops.readdir,symlink:eu.node_ops.symlink},stream:{llseek:eu.stream_ops.llseek}},file:{node:{getattr:eu.node_ops.getattr,setattr:eu.node_ops.setattr},stream:{llseek:eu.stream_ops.llseek,read:eu.stream_ops.read,write:eu.stream_ops.write,allocate:eu.stream_ops.allocate,mmap:eu.stream_ops.mmap,msync:eu.stream_ops.msync}},link:{node:{getattr:eu.node_ops.getattr,setattr:eu.node_ops.setattr,readlink:eu.node_ops.readlink},stream:{}},chrdev:{node:{getattr:eu.node_ops.getattr,setattr:eu.node_ops.setattr},stream:el.chrdev_stream_ops}});var o=el.createNode(e,r,t,n);return el.isDir(o.mode)?(o.node_ops=eu.ops_table.dir.node,o.stream_ops=eu.ops_table.dir.stream,o.contents={}):el.isFile(o.mode)?(o.node_ops=eu.ops_table.file.node,o.stream_ops=eu.ops_table.file.stream,o.usedBytes=0,o.contents=null):el.isLink(o.mode)?(o.node_ops=eu.ops_table.link.node,o.stream_ops=eu.ops_table.link.stream):el.isChrdev(o.mode)&&(o.node_ops=eu.ops_table.chrdev.node,o.stream_ops=eu.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}}},node_ops:{getattr:function(e){var r={};return r.dev=el.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,el.isDir(e.mode)?r.size=4096:el.isFile(e.mode)?r.size=e.usedBytes:el.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&eu.resizeFileStorage(e,r.size)},lookup:function(e,r){throw el.genericErrors[44]},mknod:function(e,r,t,n){return eu.createNode(e,r,t,n)},rename:function(e,r,t){if(el.isDir(e.mode)){var n;try{n=el.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new el.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=el.lookupNode(e,r);for(var n in t.contents)throw new el.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=eu.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!el.isLink(e.mode))throw new el.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=ea.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new el.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=el.root,o="/",a=0;a40)throw new el.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(el.isRoot(e)){var t=e.mount.mountpoint;if(!r)return t;return"/"!==t[t.length-1]?t+"/"+r:t+r}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%el.nameTable.length},hashAddNode:e=>{var r=el.hashName(e.parent.id,e.name);e.name_next=el.nameTable[r],el.nameTable[r]=e},hashRemoveNode:e=>{var r=el.hashName(e.parent.id,e.name);if(el.nameTable[r]===e)el.nameTable[r]=e.name_next;else for(var t=el.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=el.mayLookup(e);if(t)throw new el.ErrnoError(t,e);for(var n=el.hashName(e.id,r),o=el.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return el.lookup(e,r)},createNode:(e,r,t,n)=>{var o=new el.FSNode(e,r,t,n);return el.hashAddNode(o),o},destroyNode:e=>{el.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>(49152&e)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=el.flagModes[e];if(void 0===r)throw Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>el.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>el.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,r)=>{try{return el.lookupNode(e,r),20}catch(e){}return el.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{try{n=el.lookupNode(e,r)}catch(e){return e.errno}var n,o=el.nodePermissions(e,"wx");if(o)return o;if(t){if(!el.isDir(n.mode))return 54;if(el.isRoot(n)||el.getPath(n)===el.cwd())return 10}else if(el.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?el.isLink(e.mode)?32:el.isDir(e.mode)&&("r"!==el.flagsToPermissionString(r)||512&r)?31:el.nodePermissions(e,el.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=el.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!el.streams[t])return t;throw new el.ErrnoError(33)},getStream:e=>el.streams[e],createStream:(e,r,t)=>{el.FSStream||(el.FSStream=function(){this.shared={}},el.FSStream.prototype={},Object.defineProperties(el.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new el.FSStream,e);var n=el.nextfd(r,t);return e.fd=n,el.streams[n]=e,e},closeStream:e=>{el.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=el.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new el.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{el.devices[e]={stream_ops:r}},getDevice:e=>el.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),el.syncFSRequests++,el.syncFSRequests>1&&F("warning: "+el.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=el.getMounts(el.root.mount),n=0;function o(e){return el.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount:(e,r,t)=>{var n,o="/"===t,a=!t;if(o&&el.root)throw new el.ErrnoError(10);if(!o&&!a){var i=el.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,el.isMountpoint(n))throw new el.ErrnoError(10);if(!el.isDir(n.mode))throw new el.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?el.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=el.lookupPath(e,{follow_mount:!1});if(!el.isMountpoint(r.node))throw new el.ErrnoError(28);var t=r.node,n=t.mounted,o=el.getMounts(n);Object.keys(el.nameTable).forEach(e=>{for(var r=el.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&el.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=el.lookupPath(e,{parent:!0}).node,o=eo.basename(e);if(!o||"."===o||".."===o)throw new el.ErrnoError(28);var a=el.mayCreate(n,o);if(a)throw new el.ErrnoError(a);if(!n.node_ops.mknod)throw new el.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=(void 0!==r?r:438)&4095|32768,el.mknod(e,r,0)),mkdir:(e,r)=>(r=(void 0!==r?r:511)&1023|16384,el.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,el.mknod(e,r,t)),symlink:(e,r)=>{if(!ea.resolve(e))throw new el.ErrnoError(44);var t=el.lookupPath(r,{parent:!0}).node;if(!t)throw new el.ErrnoError(44);var n=eo.basename(r),o=el.mayCreate(t,n);if(o)throw new el.ErrnoError(o);if(!t.node_ops.symlink)throw new el.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o,a=eo.dirname(e),i=eo.dirname(r),s=eo.basename(e),u=eo.basename(r);if(t=el.lookupPath(e,{parent:!0}).node,n=el.lookupPath(r,{parent:!0}).node,!t||!n)throw new el.ErrnoError(44);if(t.mount!==n.mount)throw new el.ErrnoError(75);var l=el.lookupNode(t,s),c=ea.relative(e,i);if("."!==c.charAt(0))throw new el.ErrnoError(28);if("."!==(c=ea.relative(r,a)).charAt(0))throw new el.ErrnoError(55);try{o=el.lookupNode(n,u)}catch(e){}if(l!==o){var d=el.isDir(l.mode),f=el.mayDelete(t,s,d);if(f||(f=o?el.mayDelete(n,u,d):el.mayCreate(n,u)))throw new el.ErrnoError(f);if(!t.node_ops.rename)throw new el.ErrnoError(63);if(el.isMountpoint(l)||o&&el.isMountpoint(o))throw new el.ErrnoError(10);if(n!==t&&(f=el.nodePermissions(t,"w")))throw new el.ErrnoError(f);el.hashRemoveNode(l);try{t.node_ops.rename(l,n,u)}catch(e){throw e}finally{el.hashAddNode(l)}}},rmdir:e=>{var r=el.lookupPath(e,{parent:!0}).node,t=eo.basename(e),n=el.lookupNode(r,t),o=el.mayDelete(r,t,!0);if(o)throw new el.ErrnoError(o);if(!r.node_ops.rmdir)throw new el.ErrnoError(63);if(el.isMountpoint(n))throw new el.ErrnoError(10);r.node_ops.rmdir(r,t),el.destroyNode(n)},readdir:e=>{var r=el.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new el.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=el.lookupPath(e,{parent:!0}).node;if(!r)throw new el.ErrnoError(44);var t=eo.basename(e),n=el.lookupNode(r,t),o=el.mayDelete(r,t,!1);if(o)throw new el.ErrnoError(o);if(!r.node_ops.unlink)throw new el.ErrnoError(63);if(el.isMountpoint(n))throw new el.ErrnoError(10);r.node_ops.unlink(r,t),el.destroyNode(n)},readlink:e=>{var r=el.lookupPath(e).node;if(!r)throw new el.ErrnoError(44);if(!r.node_ops.readlink)throw new el.ErrnoError(28);return ea.resolve(el.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=el.lookupPath(e,{follow:!r}).node;if(!t)throw new el.ErrnoError(44);if(!t.node_ops.getattr)throw new el.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>el.stat(e,!0),chmod:(e,r,t)=>{var n;if(!(n="string"==typeof e?el.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new el.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{el.chmod(e,r,!0)},fchmod:(e,r)=>{var t=el.getStream(e);if(!t)throw new el.ErrnoError(8);el.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;if(!(o="string"==typeof e?el.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new el.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{el.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=el.getStream(e);if(!n)throw new el.ErrnoError(8);el.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new el.ErrnoError(28);if("string"==typeof e){var t;t=el.lookupPath(e,{follow:!0}).node}else t=e;if(!t.node_ops.setattr)throw new el.ErrnoError(63);if(el.isDir(t.mode))throw new el.ErrnoError(31);if(!el.isFile(t.mode))throw new el.ErrnoError(28);var n=el.nodePermissions(t,"w");if(n)throw new el.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=el.getStream(e);if(!t)throw new el.ErrnoError(8);if((2097155&t.flags)==0)throw new el.ErrnoError(28);el.truncate(t.node,r)},utime:(e,r,t)=>{var n=el.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,t,n)=>{if(""===e)throw new el.ErrnoError(44);if(t="string"==typeof t?el.modeStringToFlags(t):t,n=void 0===n?438:n,n=64&t?4095&n|32768:0,"object"==typeof e)o=e;else{e=eo.normalize(e);try{var o;o=el.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t){if(o){if(128&t)throw new el.ErrnoError(20)}else o=el.mknod(e,n,0),a=!0}if(!o)throw new el.ErrnoError(44);if(el.isChrdev(o.mode)&&(t&=-513),65536&t&&!el.isDir(o.mode))throw new el.ErrnoError(54);if(!a){var i=el.mayOpen(o,t);if(i)throw new el.ErrnoError(i)}512&t&&!a&&el.truncate(o,0),t&=-131713;var s=el.createStream({node:o,path:el.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!r.logReadFiles||1&t||(el.readFiles||(el.readFiles={}),e in el.readFiles||(el.readFiles[e]=1)),s},close:e=>{if(el.isClosed(e))throw new el.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{el.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(el.isClosed(e))throw new el.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new el.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new el.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new el.ErrnoError(28);if(el.isClosed(e)||(2097155&e.flags)==1)throw new el.ErrnoError(8);if(el.isDir(e.node.mode))throw new el.ErrnoError(31);if(!e.stream_ops.read)throw new el.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new el.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new el.ErrnoError(28);if(el.isClosed(e)||(2097155&e.flags)==0)throw new el.ErrnoError(8);if(el.isDir(e.node.mode))throw new el.ErrnoError(31);if(!e.stream_ops.write)throw new el.ErrnoError(28);e.seekable&&1024&e.flags&&el.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new el.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(el.isClosed(e))throw new el.ErrnoError(8);if(r<0||t<=0)throw new el.ErrnoError(28);if((2097155&e.flags)==0)throw new el.ErrnoError(8);if(!el.isFile(e.node.mode)&&!el.isDir(e.node.mode))throw new el.ErrnoError(43);if(!e.stream_ops.allocate)throw new el.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if((2&n)!=0&&(2&o)==0&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new el.ErrnoError(2);if(!e.stream_ops.mmap)throw new el.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new el.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw Error('Invalid encoding type "'+r.encoding+'"');var t,n=el.open(e,r.flags),o=el.stat(e).size,a=new Uint8Array(o);return el.read(n,a,0,o,0),"utf8"===r.encoding?t=x(a,0):"binary"===r.encoding&&(t=a),el.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=el.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(T(r)+1),a=C(r,o,0,o.length);el.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))el.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw Error("Unsupported data type");el.close(n)},cwd:()=>el.currentPath,chdir:e=>{var r=el.lookupPath(e,{follow:!0});if(null===r.node)throw new el.ErrnoError(44);if(!el.isDir(r.node.mode))throw new el.ErrnoError(54);var t=el.nodePermissions(r.node,"x");if(t)throw new el.ErrnoError(t);el.currentPath=r.path},createDefaultDirectories:()=>{el.mkdir("/tmp"),el.mkdir("/home"),el.mkdir("/home/web_user")},createDefaultDevices:()=>{el.mkdir("/dev"),el.registerDevice(el.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),el.mkdev("/dev/null",el.makedev(1,3)),es.register(el.makedev(5,0),es.default_tty_ops),es.register(el.makedev(6,0),es.default_tty1_ops),el.mkdev("/dev/tty",el.makedev(5,0)),el.mkdev("/dev/tty1",el.makedev(6,0));var e=function(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return()=>V("randomDevice");var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}();el.createDevice("/dev","random",e),el.createDevice("/dev","urandom",e),el.mkdir("/dev/shm"),el.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{el.mkdir("/proc");var e=el.mkdir("/proc/self");el.mkdir("/proc/self/fd"),el.mount({mount:()=>{var r=el.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=el.getStream(+r);if(!t)throw new el.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>t.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{r.stdin?el.createDevice("/dev","stdin",r.stdin):el.symlink("/dev/tty","/dev/stdin"),r.stdout?el.createDevice("/dev","stdout",null,r.stdout):el.symlink("/dev/tty","/dev/stdout"),r.stderr?el.createDevice("/dev","stderr",null,r.stderr):el.symlink("/dev/tty1","/dev/stderr"),el.open("/dev/stdin",0),el.open("/dev/stdout",1),el.open("/dev/stderr",1)},ensureErrnoError:()=>{el.ErrnoError||(el.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},el.ErrnoError.prototype=Error(),el.ErrnoError.prototype.constructor=el.ErrnoError,[44].forEach(e=>{el.genericErrors[e]=new el.ErrnoError(e),el.genericErrors[e].stack=""}))},staticInit:()=>{el.ensureErrnoError(),el.nameTable=Array(4096),el.mount(eu,{},"/"),el.createDefaultDirectories(),el.createDefaultDevices(),el.createSpecialDirectories(),el.filesystems={MEMFS:eu}},init:(e,t,n)=>{el.init.initialized=!0,el.ensureErrnoError(),r.stdin=e||r.stdin,r.stdout=t||r.stdout,r.stderr=n||r.stderr,el.createStandardStreams()},quit:()=>{el.init.initialized=!1,eM(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=el.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{var t=el.lookupPath(e,{follow:!r});e=t.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=el.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=eo.basename(e),t=el.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(e){n.error=e.errno}return n},createPath:(e,r,t,n)=>{e="string"==typeof e?e:el.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=eo.join2(e,a);try{el.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=eo.join2("string"==typeof e?e:el.getPath(e),r),i=el.getMode(n,o);return el.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:el.getPath(e),i=r?eo.join2(e,r):e);var s=el.getMode(n,o),u=el.create(i,s);if(t){if("string"==typeof t){for(var l=Array(t.length),c=0,d=t.length;c{var o=eo.join2("string"==typeof e?e:el.getPath(e),r),a=el.getMode(!!t,!!n);el.createDevice.major||(el.createDevice.major=64);var i=el.makedev(el.createDevice.major++,0);return el.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i,s=0,u=0;u{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(a)try{e.contents=ei(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new el.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1)&&!(e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e,r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw Error("Couldn't load "+t+". Status: "+r.status);var n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ei(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw Error("doXHR failed!");return u.chunks[e]}),(a||!n)&&(i=n=1,i=n=this.getter(0).length,D("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i;throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"}var i={isDevice:!1,url:t},s=el.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=s.stream_ops[e];u[e]=function(){return el.forceLoadFile(s),r.apply(null,arguments)}}),u.read=(e,r,t,n,o)=>(el.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{el.forceLoadFile(s);var a=void V();if(!a)throw new el.ErrnoError(48);return l(e,d,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(e,r,t,n,o,a,s,u,l,c)=>{var d,f,m=r?ea.resolve(eo.join2(e,r)):e,h="cp "+m;function p(t){function i(t){c&&c(),u||el.createDataFile(e,r,t,n,o,l),a&&a(),G(h)}Browser.handledByPreloadPlugin(t,m,i,()=>{s&&s(),G(h)})||i(t)}Y(h),"string"==typeof t?(d=e=>p(e),f="al "+t,i(t,e=>{var r;r='Loading data file "'+t+'" failed (no arrayBuffer).',e||V(r),d(new Uint8Array(e)),f&&G(f)},e=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),f&&Y(f)):p(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r=()=>{},t=()=>{})=>{var n=el.indexedDB();try{var o=n.open(el.DB_NAME(),el.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{D("creating db"),o.result.createObjectStore(el.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([el.DB_STORE_NAME],"readwrite"),a=n.objectStore(el.DB_STORE_NAME),i=0,s=0,u=e.length;function l(){0==s?r():t()}e.forEach(e=>{var r=a.put(el.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&l()},r.onerror=()=>{i+ ++s==u&&l()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r=()=>{},t=()=>{})=>{var n=el.indexedDB();try{var o=n.open(el.DB_NAME(),el.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([el.DB_STORE_NAME],"readonly")}catch(e){t(e);return}var i=a.objectStore(el.DB_STORE_NAME),s=0,u=0,l=e.length;function c(){0==u?r():t()}e.forEach(e=>{var r=i.get(e);r.onsuccess=()=>{el.analyzePath(e).exists&&el.unlink(e),el.createDataFile(eo.dirname(e),eo.basename(e),r.result,!0,!0,!0),++s+u==l&&c()},r.onerror=()=>{s+ ++u==l&&c()}}),a.onerror=t},o.onerror=t}},ec={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(eo.isAbs(r))return r;if(-100===e)n=el.cwd();else{var n;n=ec.getStreamFromFD(e).path}if(0==r.length){if(!t)throw new el.ErrnoError(44);return n}return eo.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&eo.normalize(r)!==eo.normalize(el.getPath(e.node)))return -54;throw e}h[t>>2]=n.dev,h[t+8>>2]=n.ino,h[t+12>>2]=n.mode,p[t+16>>2]=n.nlink,h[t+20>>2]=n.uid,h[t+24>>2]=n.gid,h[t+28>>2]=n.rdev,g=[n.size>>>0,+Math.abs(w=n.size)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+40>>2]=g[0],h[t+44>>2]=g[1],h[t+48>>2]=4096,h[t+52>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return g=[Math.floor(o/1e3)>>>0,+Math.abs(w=Math.floor(o/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+56>>2]=g[0],h[t+60>>2]=g[1],p[t+64>>2]=o%1e3*1e3,g=[Math.floor(a/1e3)>>>0,+Math.abs(w=Math.floor(a/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+72>>2]=g[0],h[t+76>>2]=g[1],p[t+80>>2]=a%1e3*1e3,g=[Math.floor(i/1e3)>>>0,+Math.abs(w=Math.floor(i/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+88>>2]=g[0],h[t+92>>2]=g[1],p[t+96>>2]=i%1e3*1e3,g=[n.ino>>>0,+Math.abs(w=n.ino)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+104>>2]=g[0],h[t+108>>2]=g[1],0},doMsync:function(e,r,t,n,o){if(!el.isFile(r.node.mode))throw new el.ErrnoError(43);if(2&n)return 0;var a=f.slice(e,e+t);el.msync(r,a,o,t,n)},varargs:void 0,get:function(){return ec.varargs+=4,h[ec.varargs-4>>2]},getStr:function(e){return R(e)},getStreamFromFD:function(e){var r=el.getStream(e);if(!r)throw new el.ErrnoError(8);return r}};function ed(e){return e%4==0&&(e%100!=0||e%400==0)}var ef=[0,31,60,91,121,152,182,213,244,274,305,335],em=[0,31,59,90,120,151,181,212,243,273,304,334];function eh(e){var r=T(e)+1,t=ex(r);return t&&C(e,d,t,r),t}var ep={};function ev(){if(!ev.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(var r in ep)void 0===ep[r]?delete e[r]:e[r]=ep[r];var t=[];for(var r in e)t.push(r+"="+e[r]);ev.strings=t}return ev.strings}function ew(e,t){c=e,M||U>0||(eC(),Z(j),el.quit(),es.shutdown(),L=!0),c=e,M||U>0||(r.onExit&&r.onExit(e),P=!0),k(e,new J(e))}var eg=[31,29,31,30,31,30,31,31,30,31,30,31],e_=[31,28,31,30,31,30,31,31,30,31,30,31];function ey(e,r,t,n){var o=h[n+40>>2],a={tm_sec:h[n>>2],tm_min:h[n+4>>2],tm_hour:h[n+8>>2],tm_mday:h[n+12>>2],tm_mon:h[n+16>>2],tm_year:h[n+20>>2],tm_wday:h[n+24>>2],tm_yday:h[n+28>>2],tm_isdst:h[n+32>>2],tm_gmtoff:h[n+36>>2],tm_zone:o?R(o):""},i=R(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}return 0===(t=n(e.getFullYear()-r.getFullYear()))&&0===(t=n(e.getMonth()-r.getMonth()))&&(t=n(e.getDate()-r.getDate())),t}function v(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function w(e){var r=function(e,r){for(var t=new Date(e.getTime());r>0;){var n=ed(t.getFullYear()),o=t.getMonth(),a=(n?eg:e_)[o];if(r>a-t.getDate())r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else{t.setDate(t.getDate()+r);break}}return t}(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=v(t),a=v(n);return 0>=p(o,r)?0>=p(a,r)?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var g={"%a":function(e){return l[e.tm_wday].substring(0,3)},"%A":function(e){return l[e.tm_wday]},"%b":function(e){return c[e.tm_mon].substring(0,3)},"%B":function(e){return c[e.tm_mon]},"%C":function(e){return m((e.tm_year+1900)/100|0,2)},"%d":function(e){return m(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return w(e).toString().substring(2)},"%G":function(e){return w(e)},"%H":function(e){return m(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":function(e){return m(e.tm_mday+function(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}(ed(e.tm_year+1900)?eg:e_,e.tm_mon-1),3)},"%m":function(e){return m(e.tm_mon+1,2)},"%M":function(e){return m(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return m(e.tm_sec,2)},"%t":function(){return" "},"%u":function(e){return e.tm_wday||7},"%U":function(e){return m(Math.floor((e.tm_yday+7-e.tm_wday)/7),2)},"%V":function(e){var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&ed(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&ed(e.tm_year%400-1))&&r++}return m(r,2)},"%w":function(e){return e.tm_wday},"%W":function(e){return m(Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff;return(r>=0?"+":"-")+String("0000"+(r=(r=Math.abs(r)/60)/60*100+r%60)).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\x00\x00"),g)i.includes(u)&&(i=i.replace(RegExp(u,"g"),g[u](a)));var _=ei(i=i.replace(/\0\0/g,"%"),!1);return _.length>r?0:(d.set(_,e),_.length-1)}function eE(e){if(e instanceof J||"unwind"==e)return c;k(1,e)}function eb(e){try{return e()}catch(e){V(e)}}var ek={instrumentWasmImports:function(e){var r=["invoke_*","emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","SDL_Delay","emscripten_scan_registers","emscripten_lazy_load_code","emscripten_fiber_swap","__load_secondary_module","fd_sync","__wasi_fd_sync","_emval_await","_dlopen_js","__asyncjs__*"];for(var t in e)!function(t){var n=e[t];n.sig,"function"==typeof n&&(r.indexOf(t)>=0||t.startsWith("__asyncjs__"))}(t)},instrumentWasmExports:function(e){var r={};for(var t in e)!function(t){var n=e[t];"function"==typeof n?r[t]=function(){ek.exportCallStack.push(t);try{return n.apply(null,arguments)}finally{P||(ek.exportCallStack.pop()===t||V(void 0),ek.maybeStopUnwind())}}:r[t]=n}(t);return r},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:8192,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(e){var r=ek.callStackNameToId[e];return void 0===r&&(r=ek.callStackId++,ek.callStackNameToId[e]=r,ek.callStackIdToName[r]=e),r},maybeStopUnwind:function(){ek.currData&&ek.state===ek.State.Unwinding&&0===ek.exportCallStack.length&&(ek.state=ek.State.Normal,U+=1,eb(e7),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:function(){return new Promise((e,r)=>{ek.asyncPromiseHandlers={resolve:e,reject:r}})},allocateData:function(){var e=ex(12+ek.StackSize);return ek.setDataHeader(e,e+12,ek.StackSize),ek.setDataRewindFunc(e),e},setDataHeader:function(e,r,t){h[e>>2]=r,h[e+4>>2]=r+t},setDataRewindFunc:function(e){var r=ek.exportCallStack[0],t=ek.getCallStackId(r);h[e+8>>2]=t},getDataRewindFunc:function(e){var t=h[e+8>>2],n=ek.callStackIdToName[t];return r.asm[n]},doRewind:function(e){var r=ek.getDataRewindFunc(e);return U-=1,r()},handleSleep:function(e){if(!P){if(ek.state===ek.State.Normal){var r=!1,t=!1;e((e=0)=>{if(!P&&(ek.handleSleepReturnValue=e,r=!0,t)){ek.state=ek.State.Rewinding,eb(()=>re(ek.currData)),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=ek.doRewind(ek.currData)}catch(e){n=e,o=!0}var a=!1;if(!ek.currData){var i=ek.asyncPromiseHandlers;i&&(ek.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}}),t=!0,r||(ek.state=ek.State.Unwinding,ek.currData=ek.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),eb(()=>e5(ek.currData)))}else ek.state===ek.State.Rewinding?(ek.state=ek.State.Normal,eb(rr),eR(ek.currData),ek.currData=null,ek.sleepCallbacks.forEach(e=>(function(e){if(!L&&!P)try{e(),function(){if(!(M||U>0))try{ew(c)}catch(e){eE(e)}}()}catch(e){eE(e)}})(e))):V("invalid state: "+ek.state);return ek.handleSleepReturnValue}},handleAsync:function(e){return ek.handleSleep(r=>{e().then(r)})}},eS=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=el.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(eS.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return el.isDir(this.mode)}},isDevice:{get:function(){return el.isChrdev(this.mode)}}}),el.FSNode=eS,el.staticInit();var eD={S:function(e,t){return ek.handleAsync(async()=>{r.emglken_stdin_buffers.length||await new Promise(e=>{r.emglken_stdin_ready=e});let n=r.emglken_stdin_buffers.shift(),o=Math.min(n.length,t);return o==n.length?f.set(n,e):(f.set(n.subarray(0,o),e),r.emglken_stdin_buffers.unshift(n.subarray(o))),o})},k:function(e){var r=new et(e);return!r.get_caught()&&(r.set_caught(!0),ee--),r.set_rethrown(!1),Q.push(r),!function(e){e.add_ref()}(r),r.get_exception_ptr()},n:function(){eT(0),function(e){if(e.release_ref()&&!e.get_rethrown()){var r,t=e.get_destructor();t&&(r=e.excPtr,eL.apply(null,[t,r])),eF(e.excPtr)}}(Q.pop()),er=0},a:en,d:en,m:en,s:en,x:en,ca:en,K:function(){var e=Q.pop();e||V("no exception to throw");var r=e.excPtr;throw!e.get_rethrown()&&(Q.push(e),e.set_rethrown(!0),e.set_caught(!1),ee++),er=r,r},o:function(e,r,t){throw new et(e).init(r,t),er=e,ee++,e},ba:function(){return ee},g:function(e){throw er||(er=e),e},aa:function(e,r,t,n){try{if(r=ec.getStr(r),r=ec.calculateAt(e,r),-8&t)return -28;var o=el.lookupPath(r,{follow:!0}).node;if(!o)return -44;var a="";if(4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&el.nodePermissions(o,a))return -2;return 0}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return-e.errno}},J:function(e,r,t){ec.varargs=t;try{var n=ec.getStreamFromFD(e);switch(r){case 0:var o=ec.get();if(o<0)return -28;return el.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ec.get();return n.flags|=o,0;case 5:var o=ec.get();return m[o+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return h[eP()>>2]=28,-1}}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return-e.errno}},$:function(e,r){try{if(0===r)return -28;var t=el.cwd(),n=T(t)+1;if(r>2]=0,0;case 21520:if(!n.tty)return -59;return -28;case 21531:var o=ec.get();return el.ioctl(n,r,o);default:return -28}}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return-e.errno}},Z:function(e,r,t,n){ec.varargs=n;try{r=ec.getStr(r),r=ec.calculateAt(e,r);var o=n?ec.get():0;return el.open(r,t,o).fd}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return-e.errno}},V:function(){return!0},U:function(e,r){var t=new Date(1e3*(p[e>>2]+4294967296*h[e+4>>2]));h[r>>2]=t.getSeconds(),h[r+4>>2]=t.getMinutes(),h[r+8>>2]=t.getHours(),h[r+12>>2]=t.getDate(),h[r+16>>2]=t.getMonth(),h[r+20>>2]=t.getFullYear()-1900,h[r+24>>2]=t.getDay();var n=0|(ed(t.getFullYear())?ef:em)[t.getMonth()]+t.getDate()-1;h[r+28>>2]=n,h[r+36>>2]=-(60*t.getTimezoneOffset());var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&t.getTimezoneOffset()==Math.min(i,a));h[r+32>>2]=s},T:function(e,r,t){var n=new Date().getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset();function u(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}p[e>>2]=60*Math.max(i,s),h[r>>2]=Number(i!=s);var l=u(o),c=u(a),d=eh(l),f=eh(c);s>2]=d,p[t+4>>2]=f):(p[t>>2]=f,p[t+4>>2]=d)},D:function(){V("")},B:function(){return Date.now()},R:function(e,r,t){f.copyWithin(e,r,r+t)},Q:function(e){var r=f.length;if((e>>>=0)>2147483648)return!1;let t=(e,r)=>e+(r-e%r)%r;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),function(e){var r=l.buffer;try{return l.grow(e-r.byteLength+65535>>>16),N(),1}catch(e){}}(Math.min(2147483648,t(Math.max(e,o),65536))))return!0}return!1},Y:function(e,r){var t=0;return ev().forEach(function(n,o){var a=r+t;p[e+4*o>>2]=a,function(e,r,t){for(var n=0;n>0]=e.charCodeAt(n);d[r>>0]=0}(n,a),t+=n.length+1}),0},X:function(e,r){var t=ev();p[e>>2]=t.length;var n=0;return t.forEach(function(e){n+=e.length+1}),p[r>>2]=n,0},C:ew,I:function(e){try{var r=ec.getStreamFromFD(e);return el.close(r),0}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return e.errno}},W:function(e,r,t,n){try{var o=ec.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=el.read(e,d,i,s,n);if(u<0)return -1;if(o+=u,u>2]=a,0}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return e.errno}},P:function(e,r,t,n,o){try{var a=t+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*t:NaN;if(isNaN(a))return 61;var i=ec.getStreamFromFD(e);return el.llseek(i,a,n),g=[i.position>>>0,(w=i.position,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[o>>2]=g[0],h[o+4>>2]=g[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return e.errno}},H:function(e,r,t,n){try{var o=ec.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=el.write(e,d,i,s,n);if(u<0)return -1;o+=u,void 0!==n&&(n+=u)}return o}(o,r,t);return p[n>>2]=a,0}catch(e){if(void 0===el||"ErrnoError"!==e.name)throw e;return e.errno}},G:function(e,r,t,n){var o=ez();try{return e4(e,r,t,n)}catch(e){if(eB(o),e!==e+0)throw e;eT(1,0)}},F:function(e,r,t,n){var o=ez();try{return e2(e,r,t,n)}catch(e){if(eB(o),e!==e+0)throw e;eT(1,0)}},q:function(e){var r=ez();try{return eK(e)}catch(e){if(eB(r),e!==e+0)throw e;eT(1,0)}},b:function(e,r){var t=ez();try{return eL(e,r)}catch(e){if(eB(t),e!==e+0)throw e;eT(1,0)}},c:function(e,r,t){var n=ez();try{return eY(e,r,t)}catch(e){if(eB(n),e!==e+0)throw e;eT(1,0)}},e:function(e,r,t,n){var o=ez();try{return eU(e,r,t,n)}catch(e){if(eB(o),e!==e+0)throw e;eT(1,0)}},p:function(e,r,t,n,o){var a=ez();try{return eX(e,r,t,n,o)}catch(e){if(eB(a),e!==e+0)throw e;eT(1,0)}},u:function(e,r,t,n,o,a){var i=ez();try{return eV(e,r,t,n,o,a)}catch(e){if(eB(i),e!==e+0)throw e;eT(1,0)}},w:function(e,r,t,n,o,a,i){var s=ez();try{return e$(e,r,t,n,o,a,i)}catch(e){if(eB(s),e!==e+0)throw e;eT(1,0)}},E:function(e,r,t,n,o,a,i,s){var u=ez();try{return e0(e,r,t,n,o,a,i,s)}catch(e){if(eB(u),e!==e+0)throw e;eT(1,0)}},A:function(e,r,t,n,o,a,i,s,u,l,c,d){var f=ez();try{return e3(e,r,t,n,o,a,i,s,u,l,c,d)}catch(e){if(eB(f),e!==e+0)throw e;eT(1,0)}},O:function(e,r){var t=ez();try{return eZ(e,r)}catch(e){if(eB(t),e!==e+0)throw e;eT(1,0)}},N:function(e,r,t,n,o){var a=ez();try{return e1(e,r,t,n,o)}catch(e){if(eB(a),e!==e+0)throw e;eT(1,0)}},h:function(e){var r=ez();try{eW(e)}catch(e){if(eB(r),e!==e+0)throw e;eT(1,0)}},i:function(e,r){var t=ez();try{eq(e,r)}catch(e){if(eB(t),e!==e+0)throw e;eT(1,0)}},f:function(e,r,t){var n=ez();try{eG(e,r,t)}catch(e){if(eB(n),e!==e+0)throw e;eT(1,0)}},j:function(e,r,t,n){var o=ez();try{eH(e,r,t,n)}catch(e){if(eB(o),e!==e+0)throw e;eT(1,0)}},r:function(e,r,t,n,o){var a=ez();try{eJ(e,r,t,n,o)}catch(e){if(eB(a),e!==e+0)throw e;eT(1,0)}},t:function(e,r,t,n,o,a){var i=ez();try{eQ(e,r,t,n,o,a)}catch(e){if(eB(i),e!==e+0)throw e;eT(1,0)}},v:function(e,r,t,n,o,a,i,s){var u=ez();try{e6(e,r,t,n,o,a,i,s)}catch(e){if(eB(u),e!==e+0)throw e;eT(1,0)}},y:function(e,r,t,n,o,a,i,s,u,l,c){var d=ez();try{e9(e,r,t,n,o,a,i,s,u,l,c)}catch(e){if(eB(d),e!==e+0)throw e;eT(1,0)}},z:function(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p){var v=ez();try{e8(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p)}catch(e){if(eB(v),e!==e+0)throw e;eT(1,0)}},l:function(e){return e},M:ey,L:function(e,r,t,n,o){return ey(e,r,t,n)}};!function(){var e,t,n,a={a:eD};function i(e,t){var n,o=e.exports;return o=ek.instrumentWasmExports(o),r.asm=o,l=r.asm.da,N(),r.asm.na,n=r.asm.ea,B.unshift(n),G("wasm-instantiate"),o}if(Y("wasm-instantiate"),r.instantiateWasm)try{return r.instantiateWasm(a,i)}catch(e){F("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=u,t=v,n=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||X(t)||"function"!=typeof fetch?$(t,a,n):fetch(t,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return F("wasm streaming compile failed: "+e),F("falling back to ArrayBuffer instantiation"),$(t,a,n)})})).catch(o)}();var eF=function(){return(eF=r.asm.fa).apply(null,arguments)},eM=r._fflush=function(){return(eM=r._fflush=r.asm.ga).apply(null,arguments)},eP=function(){return(eP=r.asm.ha).apply(null,arguments)},eA=r._main=function(){return(eA=r._main=r.asm.ia).apply(null,arguments)},ex=function(){return(ex=r.asm.ja).apply(null,arguments)},eR=function(){return(eR=r.asm.ka).apply(null,arguments)},eC=(r._gidispatch_get_game_id=function(){return(r._gidispatch_get_game_id=r.asm.la).apply(null,arguments)},function(){return(eC=r.asm.ma).apply(null,arguments)}),eT=function(){return(eT=r.asm.oa).apply(null,arguments)},eN=function(){return(eN=r.asm.pa).apply(null,arguments)},ez=function(){return(ez=r.asm.qa).apply(null,arguments)},eB=function(){return(eB=r.asm.ra).apply(null,arguments)},eO=function(){return(eO=r.asm.sa).apply(null,arguments)},ej=function(){return(ej=r.asm.ta).apply(null,arguments)},eI=function(){return(eI=r.asm.ua).apply(null,arguments)},eL=r.dynCall_ii=function(){return(eL=r.dynCall_ii=r.asm.va).apply(null,arguments)},eU=r.dynCall_iiii=function(){return(eU=r.dynCall_iiii=r.asm.wa).apply(null,arguments)},eH=r.dynCall_viii=function(){return(eH=r.dynCall_viii=r.asm.xa).apply(null,arguments)},eW=r.dynCall_v=function(){return(eW=r.dynCall_v=r.asm.ya).apply(null,arguments)},eq=r.dynCall_vi=function(){return(eq=r.dynCall_vi=r.asm.za).apply(null,arguments)},eY=r.dynCall_iii=function(){return(eY=r.dynCall_iii=r.asm.Aa).apply(null,arguments)},eG=r.dynCall_vii=function(){return(eG=r.dynCall_vii=r.asm.Ba).apply(null,arguments)},eV=r.dynCall_iiiiii=function(){return(eV=r.dynCall_iiiiii=r.asm.Ca).apply(null,arguments)},eX=r.dynCall_iiiii=function(){return(eX=r.dynCall_iiiii=r.asm.Da).apply(null,arguments)},eK=r.dynCall_i=function(){return(eK=r.dynCall_i=r.asm.Ea).apply(null,arguments)},e$=r.dynCall_iiiiiii=function(){return(e$=r.dynCall_iiiiiii=r.asm.Fa).apply(null,arguments)},eJ=r.dynCall_viiii=function(){return(eJ=r.dynCall_viiii=r.asm.Ga).apply(null,arguments)},eZ=r.dynCall_ji=function(){return(eZ=r.dynCall_ji=r.asm.Ha).apply(null,arguments)},eQ=r.dynCall_viiiii=function(){return(eQ=r.dynCall_viiiii=r.asm.Ia).apply(null,arguments)},e0=r.dynCall_iiiiiiii=function(){return(e0=r.dynCall_iiiiiiii=r.asm.Ja).apply(null,arguments)},e1=r.dynCall_jiiii=function(){return(e1=r.dynCall_jiiii=r.asm.Ka).apply(null,arguments)},e2=r.dynCall_fiii=function(){return(e2=r.dynCall_fiii=r.asm.La).apply(null,arguments)},e4=r.dynCall_diii=function(){return(e4=r.dynCall_diii=r.asm.Ma).apply(null,arguments)},e6=r.dynCall_viiiiiii=function(){return(e6=r.dynCall_viiiiiii=r.asm.Na).apply(null,arguments)},e3=r.dynCall_iiiiiiiiiiii=function(){return(e3=r.dynCall_iiiiiiiiiiii=r.asm.Oa).apply(null,arguments)},e9=r.dynCall_viiiiiiiiii=function(){return(e9=r.dynCall_viiiiiiiiii=r.asm.Pa).apply(null,arguments)},e8=r.dynCall_viiiiiiiiiiiiiii=function(){return(e8=r.dynCall_viiiiiiiiiiiiiii=r.asm.Qa).apply(null,arguments)},e5=function(){return(e5=r.asm.Ra).apply(null,arguments)},e7=function(){return(e7=r.asm.Sa).apply(null,arguments)},re=function(){return(re=r.asm.Ta).apply(null,arguments)},rr=function(){return(rr=r.asm.Ua).apply(null,arguments)};function rt(e=E){!(H>0)&&(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),z.unshift(e)}Z(z)}(),H>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()));function t(){!_&&(_=!0,r.calledRun=!0,P||(r.noFSInit||el.init.initialized||el.init(),el.ignorePermissions=!1,es.init(),Z(B),Z(O),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),rn&&function(e=[]){var r=eA;e.unshift(b);var t=e.length,n=eO((t+1)*4),o=n>>2;e.forEach(e=>{var r,t;h[o++]=(t=eO(r=T(e)+1),C(e,d,t,r),t)}),h[o]=0;try{var a=r(t,n);ew(a,!0)}catch(e){return eE(e)}}(e),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),I.unshift(e)}Z(I)}()))}}if(r.___start_em_js=52440,r.___stop_em_js=55125,r.AsciiToString=function(e){for(var r="";;){var t=f[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}},r.FS=el,q=function e(){_||rt(),_||(q=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var rn=!0;return r.noInitialRun&&(rn=!1),rt(),r.ready}})(),rw={};rw=new URL(k("6MsPj").resolve("kBXOE"),import.meta.url).toString();var rg=(()=>{var e="file:///node_modules/emglken/build/git-core.js";return function(r={}){var t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,r=void 0!==r?r:{};r.ready=new Promise(function(e,r){n=e,o=r});var y=Object.assign({},r),E=[],b="./this.program",k=(e,r)=>{throw r},S="";"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),e&&(S=e),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(200==n.status||0==n.status&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null)};var D=r.print||console.log.bind(console),F=r.printErr||console.warn.bind(console);Object.assign(r,y),y=null,r.arguments&&(E=r.arguments),r.thisProgram&&(b=r.thisProgram),r.quit&&(k=r.quit),r.wasmBinary&&(u=r.wasmBinary);var M=r.noExitRuntime||!1;"object"!=typeof WebAssembly&&G("no native wasm support detected");var P=!1,A=new TextDecoder("utf8");function x(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;return A.decode(e.buffer?e.subarray(r,o):new Uint8Array(e.slice(r,o)))}function R(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function C(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function T(){var e=l.buffer;r.HEAP8=d=new Int8Array(e),r.HEAP16=m=new Int16Array(e),r.HEAP32=h=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var N=[],z=[],B=[],O=[],j=[],I=!1,L=0,U=0,H=null,W=null;function q(e){U++,r.monitorRunDependencies&&r.monitorRunDependencies(U)}function Y(e){if(U--,r.monitorRunDependencies&&r.monitorRunDependencies(U),0==U&&(null!==H&&(clearInterval(H),H=null),W)){var t=W;W=null,t()}}function G(e){r.onAbort&&r.onAbort(e),F(e="Aborted("+e+")"),P=!0,c=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function V(e){return e.startsWith("data:application/octet-stream;base64,")}function X(e){try{if(e==v&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){G(e)}}function K(e,r,t){return(u||"function"!=typeof fetch?Promise.resolve().then(function(){return X(e)}):fetch(e,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(function(){return X(e)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(t,function(e){F("failed to asynchronously prepare wasm: "+e),G(e)})}function $(e,r,t,n,o){let a=e>>2,i=p.subarray(a,a+t),s=o?i:i.reduce((e,r)=>e+String.fromCodePoint(r),""),u=n(s),l=Uint32Array.from(u,e=>e.codePointAt(0)),c=l.length;return p.set(l.subarray(0,Math.min(r,c)),a),c}function J(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Z(e){for(;e.length>0;)e.shift()(r)}r.locateFile?V(v="git-core.wasm")||(t=v,v=r.locateFile?r.locateFile(t,S):S+t):v=new URL(rw).href;var Q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Q.isAbs(e),t="/"===e.substr(-1);return(e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Q.normalize(e.join("/"))},join2:(e,r)=>Q.normalize(e+"/"+r)},ee={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:eo.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Q.isAbs(n)}return e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ee.resolve(e).substr(1),r=ee.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:C(e)+1),o=R(e,n,0,n.length);return r&&(n.length=o),n}var et={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){et.ttys[e]={input:[],output:[],ops:r},eo.registerDevice(e,et.stream_ops)},stream_ops:{open:function(e){var r=et.ttys[e.node.rdev];if(!r)throw new eo.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new eo.ErrnoError(60);for(var a,i=0,s=0;s0&&(D(x(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(F(x(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(F(x(e.output,0)),e.output=[])}}},en={ops_table:null,mount:function(e){return en.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(eo.isBlkdev(t)||eo.isFIFO(t))throw new eo.ErrnoError(63);en.ops_table||(en.ops_table={dir:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,lookup:en.node_ops.lookup,mknod:en.node_ops.mknod,rename:en.node_ops.rename,unlink:en.node_ops.unlink,rmdir:en.node_ops.rmdir,readdir:en.node_ops.readdir,symlink:en.node_ops.symlink},stream:{llseek:en.stream_ops.llseek}},file:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:{llseek:en.stream_ops.llseek,read:en.stream_ops.read,write:en.stream_ops.write,allocate:en.stream_ops.allocate,mmap:en.stream_ops.mmap,msync:en.stream_ops.msync}},link:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,readlink:en.node_ops.readlink},stream:{}},chrdev:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:eo.chrdev_stream_ops}});var o=eo.createNode(e,r,t,n);return eo.isDir(o.mode)?(o.node_ops=en.ops_table.dir.node,o.stream_ops=en.ops_table.dir.stream,o.contents={}):eo.isFile(o.mode)?(o.node_ops=en.ops_table.file.node,o.stream_ops=en.ops_table.file.stream,o.usedBytes=0,o.contents=null):eo.isLink(o.mode)?(o.node_ops=en.ops_table.link.node,o.stream_ops=en.ops_table.link.stream):eo.isChrdev(o.mode)&&(o.node_ops=en.ops_table.chrdev.node,o.stream_ops=en.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}}},node_ops:{getattr:function(e){var r={};return r.dev=eo.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,eo.isDir(e.mode)?r.size=4096:eo.isFile(e.mode)?r.size=e.usedBytes:eo.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&en.resizeFileStorage(e,r.size)},lookup:function(e,r){throw eo.genericErrors[44]},mknod:function(e,r,t,n){return en.createNode(e,r,t,n)},rename:function(e,r,t){if(eo.isDir(e.mode)){var n;try{n=eo.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new eo.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=eo.lookupNode(e,r);for(var n in t.contents)throw new eo.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=en.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!eo.isLink(e.mode))throw new eo.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=ee.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new eo.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=eo.root,o="/",a=0;a40)throw new eo.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(eo.isRoot(e)){var t=e.mount.mountpoint;if(!r)return t;return"/"!==t[t.length-1]?t+"/"+r:t+r}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%eo.nameTable.length},hashAddNode:e=>{var r=eo.hashName(e.parent.id,e.name);e.name_next=eo.nameTable[r],eo.nameTable[r]=e},hashRemoveNode:e=>{var r=eo.hashName(e.parent.id,e.name);if(eo.nameTable[r]===e)eo.nameTable[r]=e.name_next;else for(var t=eo.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=eo.mayLookup(e);if(t)throw new eo.ErrnoError(t,e);for(var n=eo.hashName(e.id,r),o=eo.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return eo.lookup(e,r)},createNode:(e,r,t,n)=>{var o=new eo.FSNode(e,r,t,n);return eo.hashAddNode(o),o},destroyNode:e=>{eo.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>(49152&e)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=eo.flagModes[e];if(void 0===r)throw Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>eo.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>eo.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,r)=>{try{return eo.lookupNode(e,r),20}catch(e){}return eo.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{try{n=eo.lookupNode(e,r)}catch(e){return e.errno}var n,o=eo.nodePermissions(e,"wx");if(o)return o;if(t){if(!eo.isDir(n.mode))return 54;if(eo.isRoot(n)||eo.getPath(n)===eo.cwd())return 10}else if(eo.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?eo.isLink(e.mode)?32:eo.isDir(e.mode)&&("r"!==eo.flagsToPermissionString(r)||512&r)?31:eo.nodePermissions(e,eo.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=eo.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!eo.streams[t])return t;throw new eo.ErrnoError(33)},getStream:e=>eo.streams[e],createStream:(e,r,t)=>{eo.FSStream||(eo.FSStream=function(){this.shared={}},eo.FSStream.prototype={},Object.defineProperties(eo.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new eo.FSStream,e);var n=eo.nextfd(r,t);return e.fd=n,eo.streams[n]=e,e},closeStream:e=>{eo.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=eo.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new eo.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{eo.devices[e]={stream_ops:r}},getDevice:e=>eo.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),eo.syncFSRequests++,eo.syncFSRequests>1&&F("warning: "+eo.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=eo.getMounts(eo.root.mount),n=0;function o(e){return eo.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount:(e,r,t)=>{var n,o="/"===t,a=!t;if(o&&eo.root)throw new eo.ErrnoError(10);if(!o&&!a){var i=eo.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,eo.isMountpoint(n))throw new eo.ErrnoError(10);if(!eo.isDir(n.mode))throw new eo.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?eo.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=eo.lookupPath(e,{follow_mount:!1});if(!eo.isMountpoint(r.node))throw new eo.ErrnoError(28);var t=r.node,n=t.mounted,o=eo.getMounts(n);Object.keys(eo.nameTable).forEach(e=>{for(var r=eo.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&eo.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=eo.lookupPath(e,{parent:!0}).node,o=Q.basename(e);if(!o||"."===o||".."===o)throw new eo.ErrnoError(28);var a=eo.mayCreate(n,o);if(a)throw new eo.ErrnoError(a);if(!n.node_ops.mknod)throw new eo.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=(void 0!==r?r:438)&4095|32768,eo.mknod(e,r,0)),mkdir:(e,r)=>(r=(void 0!==r?r:511)&1023|16384,eo.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,eo.mknod(e,r,t)),symlink:(e,r)=>{if(!ee.resolve(e))throw new eo.ErrnoError(44);var t=eo.lookupPath(r,{parent:!0}).node;if(!t)throw new eo.ErrnoError(44);var n=Q.basename(r),o=eo.mayCreate(t,n);if(o)throw new eo.ErrnoError(o);if(!t.node_ops.symlink)throw new eo.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o,a=Q.dirname(e),i=Q.dirname(r),s=Q.basename(e),u=Q.basename(r);if(t=eo.lookupPath(e,{parent:!0}).node,n=eo.lookupPath(r,{parent:!0}).node,!t||!n)throw new eo.ErrnoError(44);if(t.mount!==n.mount)throw new eo.ErrnoError(75);var l=eo.lookupNode(t,s),c=ee.relative(e,i);if("."!==c.charAt(0))throw new eo.ErrnoError(28);if("."!==(c=ee.relative(r,a)).charAt(0))throw new eo.ErrnoError(55);try{o=eo.lookupNode(n,u)}catch(e){}if(l!==o){var d=eo.isDir(l.mode),f=eo.mayDelete(t,s,d);if(f||(f=o?eo.mayDelete(n,u,d):eo.mayCreate(n,u)))throw new eo.ErrnoError(f);if(!t.node_ops.rename)throw new eo.ErrnoError(63);if(eo.isMountpoint(l)||o&&eo.isMountpoint(o))throw new eo.ErrnoError(10);if(n!==t&&(f=eo.nodePermissions(t,"w")))throw new eo.ErrnoError(f);eo.hashRemoveNode(l);try{t.node_ops.rename(l,n,u)}catch(e){throw e}finally{eo.hashAddNode(l)}}},rmdir:e=>{var r=eo.lookupPath(e,{parent:!0}).node,t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!0);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.rmdir)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.rmdir(r,t),eo.destroyNode(n)},readdir:e=>{var r=eo.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new eo.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=eo.lookupPath(e,{parent:!0}).node;if(!r)throw new eo.ErrnoError(44);var t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!1);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.unlink)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.unlink(r,t),eo.destroyNode(n)},readlink:e=>{var r=eo.lookupPath(e).node;if(!r)throw new eo.ErrnoError(44);if(!r.node_ops.readlink)throw new eo.ErrnoError(28);return ee.resolve(eo.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=eo.lookupPath(e,{follow:!r}).node;if(!t)throw new eo.ErrnoError(44);if(!t.node_ops.getattr)throw new eo.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>eo.stat(e,!0),chmod:(e,r,t)=>{var n;if(!(n="string"==typeof e?eo.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{eo.chmod(e,r,!0)},fchmod:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);eo.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;if(!(o="string"==typeof e?eo.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{eo.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=eo.getStream(e);if(!n)throw new eo.ErrnoError(8);eo.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new eo.ErrnoError(28);if("string"==typeof e){var t;t=eo.lookupPath(e,{follow:!0}).node}else t=e;if(!t.node_ops.setattr)throw new eo.ErrnoError(63);if(eo.isDir(t.mode))throw new eo.ErrnoError(31);if(!eo.isFile(t.mode))throw new eo.ErrnoError(28);var n=eo.nodePermissions(t,"w");if(n)throw new eo.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);if((2097155&t.flags)==0)throw new eo.ErrnoError(28);eo.truncate(t.node,r)},utime:(e,r,t)=>{var n=eo.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,t,n)=>{if(""===e)throw new eo.ErrnoError(44);if(t="string"==typeof t?eo.modeStringToFlags(t):t,n=void 0===n?438:n,n=64&t?4095&n|32768:0,"object"==typeof e)o=e;else{e=Q.normalize(e);try{var o;o=eo.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t){if(o){if(128&t)throw new eo.ErrnoError(20)}else o=eo.mknod(e,n,0),a=!0}if(!o)throw new eo.ErrnoError(44);if(eo.isChrdev(o.mode)&&(t&=-513),65536&t&&!eo.isDir(o.mode))throw new eo.ErrnoError(54);if(!a){var i=eo.mayOpen(o,t);if(i)throw new eo.ErrnoError(i)}512&t&&!a&&eo.truncate(o,0),t&=-131713;var s=eo.createStream({node:o,path:eo.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!r.logReadFiles||1&t||(eo.readFiles||(eo.readFiles={}),e in eo.readFiles||(eo.readFiles[e]=1)),s},close:e=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{eo.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new eo.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new eo.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==1)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.read)throw new eo.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==0)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.write)throw new eo.ErrnoError(28);e.seekable&&1024&e.flags&&eo.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(r<0||t<=0)throw new eo.ErrnoError(28);if((2097155&e.flags)==0)throw new eo.ErrnoError(8);if(!eo.isFile(e.node.mode)&&!eo.isDir(e.node.mode))throw new eo.ErrnoError(43);if(!e.stream_ops.allocate)throw new eo.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if((2&n)!=0&&(2&o)==0&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new eo.ErrnoError(2);if(!e.stream_ops.mmap)throw new eo.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new eo.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw Error('Invalid encoding type "'+r.encoding+'"');var t,n=eo.open(e,r.flags),o=eo.stat(e).size,a=new Uint8Array(o);return eo.read(n,a,0,o,0),"utf8"===r.encoding?t=x(a,0):"binary"===r.encoding&&(t=a),eo.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=eo.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(C(r)+1),a=R(r,o,0,o.length);eo.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))eo.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw Error("Unsupported data type");eo.close(n)},cwd:()=>eo.currentPath,chdir:e=>{var r=eo.lookupPath(e,{follow:!0});if(null===r.node)throw new eo.ErrnoError(44);if(!eo.isDir(r.node.mode))throw new eo.ErrnoError(54);var t=eo.nodePermissions(r.node,"x");if(t)throw new eo.ErrnoError(t);eo.currentPath=r.path},createDefaultDirectories:()=>{eo.mkdir("/tmp"),eo.mkdir("/home"),eo.mkdir("/home/web_user")},createDefaultDevices:()=>{eo.mkdir("/dev"),eo.registerDevice(eo.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),eo.mkdev("/dev/null",eo.makedev(1,3)),et.register(eo.makedev(5,0),et.default_tty_ops),et.register(eo.makedev(6,0),et.default_tty1_ops),eo.mkdev("/dev/tty",eo.makedev(5,0)),eo.mkdev("/dev/tty1",eo.makedev(6,0));var e=function(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return()=>G("randomDevice");var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}();eo.createDevice("/dev","random",e),eo.createDevice("/dev","urandom",e),eo.mkdir("/dev/shm"),eo.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{eo.mkdir("/proc");var e=eo.mkdir("/proc/self");eo.mkdir("/proc/self/fd"),eo.mount({mount:()=>{var r=eo.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=eo.getStream(+r);if(!t)throw new eo.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>t.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{r.stdin?eo.createDevice("/dev","stdin",r.stdin):eo.symlink("/dev/tty","/dev/stdin"),r.stdout?eo.createDevice("/dev","stdout",null,r.stdout):eo.symlink("/dev/tty","/dev/stdout"),r.stderr?eo.createDevice("/dev","stderr",null,r.stderr):eo.symlink("/dev/tty1","/dev/stderr"),eo.open("/dev/stdin",0),eo.open("/dev/stdout",1),eo.open("/dev/stderr",1)},ensureErrnoError:()=>{eo.ErrnoError||(eo.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},eo.ErrnoError.prototype=Error(),eo.ErrnoError.prototype.constructor=eo.ErrnoError,[44].forEach(e=>{eo.genericErrors[e]=new eo.ErrnoError(e),eo.genericErrors[e].stack=""}))},staticInit:()=>{eo.ensureErrnoError(),eo.nameTable=Array(4096),eo.mount(en,{},"/"),eo.createDefaultDirectories(),eo.createDefaultDevices(),eo.createSpecialDirectories(),eo.filesystems={MEMFS:en}},init:(e,t,n)=>{eo.init.initialized=!0,eo.ensureErrnoError(),r.stdin=e||r.stdin,r.stdout=t||r.stdout,r.stderr=n||r.stderr,eo.createStandardStreams()},quit:()=>{eo.init.initialized=!1,ey(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=eo.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{var t=eo.lookupPath(e,{follow:!r});e=t.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=eo.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Q.basename(e),t=eo.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(e){n.error=e.errno}return n},createPath:(e,r,t,n)=>{e="string"==typeof e?e:eo.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Q.join2(e,a);try{eo.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=Q.join2("string"==typeof e?e:eo.getPath(e),r),i=eo.getMode(n,o);return eo.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:eo.getPath(e),i=r?Q.join2(e,r):e);var s=eo.getMode(n,o),u=eo.create(i,s);if(t){if("string"==typeof t){for(var l=Array(t.length),c=0,d=t.length;c{var o=Q.join2("string"==typeof e?e:eo.getPath(e),r),a=eo.getMode(!!t,!!n);eo.createDevice.major||(eo.createDevice.major=64);var i=eo.makedev(eo.createDevice.major++,0);return eo.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i,s=0,u=0;u{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(a)try{e.contents=er(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new eo.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1)&&!(e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e,r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw Error("Couldn't load "+t+". Status: "+r.status);var n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):er(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw Error("doXHR failed!");return u.chunks[e]}),(a||!n)&&(i=n=1,i=n=this.getter(0).length,D("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i;throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"}var i={isDevice:!1,url:t},s=eo.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=s.stream_ops[e];u[e]=function(){return eo.forceLoadFile(s),r.apply(null,arguments)}}),u.read=(e,r,t,n,o)=>(eo.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{eo.forceLoadFile(s);var a=void G();if(!a)throw new eo.ErrnoError(48);return l(e,d,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(e,r,t,n,o,a,s,u,l,c)=>{var d,f,m=r?ee.resolve(Q.join2(e,r)):e,h="cp "+m;function p(t){function i(t){c&&c(),u||eo.createDataFile(e,r,t,n,o,l),a&&a(),Y(h)}Browser.handledByPreloadPlugin(t,m,i,()=>{s&&s(),Y(h)})||i(t)}q(h),"string"==typeof t?(d=e=>p(e),f="al "+t,i(t,e=>{var r;r='Loading data file "'+t+'" failed (no arrayBuffer).',e||G(r),d(new Uint8Array(e)),f&&Y(f)},e=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),f&&q(f)):p(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{D("creating db"),o.result.createObjectStore(eo.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([eo.DB_STORE_NAME],"readwrite"),a=n.objectStore(eo.DB_STORE_NAME),i=0,s=0,u=e.length;function l(){0==s?r():t()}e.forEach(e=>{var r=a.put(eo.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&l()},r.onerror=()=>{i+ ++s==u&&l()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([eo.DB_STORE_NAME],"readonly")}catch(e){t(e);return}var i=a.objectStore(eo.DB_STORE_NAME),s=0,u=0,l=e.length;function c(){0==u?r():t()}e.forEach(e=>{var r=i.get(e);r.onsuccess=()=>{eo.analyzePath(e).exists&&eo.unlink(e),eo.createDataFile(Q.dirname(e),Q.basename(e),r.result,!0,!0,!0),++s+u==l&&c()},r.onerror=()=>{s+ ++u==l&&c()}}),a.onerror=t},o.onerror=t}},ea={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(Q.isAbs(r))return r;if(-100===e)n=eo.cwd();else{var n;n=ea.getStreamFromFD(e).path}if(0==r.length){if(!t)throw new eo.ErrnoError(44);return n}return Q.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Q.normalize(r)!==Q.normalize(eo.getPath(e.node)))return -54;throw e}h[t>>2]=n.dev,h[t+8>>2]=n.ino,h[t+12>>2]=n.mode,p[t+16>>2]=n.nlink,h[t+20>>2]=n.uid,h[t+24>>2]=n.gid,h[t+28>>2]=n.rdev,g=[n.size>>>0,+Math.abs(w=n.size)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+40>>2]=g[0],h[t+44>>2]=g[1],h[t+48>>2]=4096,h[t+52>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return g=[Math.floor(o/1e3)>>>0,+Math.abs(w=Math.floor(o/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+56>>2]=g[0],h[t+60>>2]=g[1],p[t+64>>2]=o%1e3*1e3,g=[Math.floor(a/1e3)>>>0,+Math.abs(w=Math.floor(a/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+72>>2]=g[0],h[t+76>>2]=g[1],p[t+80>>2]=a%1e3*1e3,g=[Math.floor(i/1e3)>>>0,+Math.abs(w=Math.floor(i/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+88>>2]=g[0],h[t+92>>2]=g[1],p[t+96>>2]=i%1e3*1e3,g=[n.ino>>>0,+Math.abs(w=n.ino)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+104>>2]=g[0],h[t+108>>2]=g[1],0},doMsync:function(e,r,t,n,o){if(!eo.isFile(r.node.mode))throw new eo.ErrnoError(43);if(2&n)return 0;var a=f.slice(e,e+t);eo.msync(r,a,o,t,n)},varargs:void 0,get:function(){return ea.varargs+=4,h[ea.varargs-4>>2]},getStr:function(e){return function(e,r){if(!e)return"";for(var t=e+void 0,n=e;!(n>=t)&&f[n];)++n;return A.decode(f.subarray(e,n))}(e)},getStreamFromFD:function(e){var r=eo.getStream(e);if(!r)throw new eo.ErrnoError(8);return r}};function ei(e){return p[e>>2]+4294967296*h[e+4>>2]}var es=[0,31,60,91,121,152,182,213,244,274,305,335],eu=[0,31,59,90,120,151,181,212,243,273,304,334];function el(e){var r;return((r=e.getFullYear())%4==0&&(r%100!=0||r%400==0)?es:eu)[e.getMonth()]+e.getDate()-1}function ec(e){var r=C(e)+1,t=ew(r);return t&&R(e,d,t,r),t}function ed(e,t){c=e,M||L>0||(eb(),Z(O),eo.quit(),et.shutdown(),I=!0),c=e,M||L>0||(r.onExit&&r.onExit(e),P=!0),k(e,new J(e))}function ef(e){if(e instanceof J||"unwind"==e)return c;k(1,e)}function em(e){try{return e()}catch(e){G(e)}}var eh={instrumentWasmImports:function(e){var r=["emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","SDL_Delay","emscripten_scan_registers","emscripten_lazy_load_code","emscripten_fiber_swap","__load_secondary_module","fd_sync","__wasi_fd_sync","_emval_await","_dlopen_js","__asyncjs__*"];for(var t in e)!function(t){var n=e[t];n.sig,"function"==typeof n&&(r.indexOf(t)>=0||t.startsWith("__asyncjs__"))}(t)},instrumentWasmExports:function(e){var r={};for(var t in e)!function(t){var n=e[t];"function"==typeof n?r[t]=function(){eh.exportCallStack.push(t);try{return n.apply(null,arguments)}finally{P||(eh.exportCallStack.pop()===t||G(void 0),eh.maybeStopUnwind())}}:r[t]=n}(t);return r},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:8192,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(e){var r=eh.callStackNameToId[e];return void 0===r&&(r=eh.callStackId++,eh.callStackNameToId[e]=r,eh.callStackIdToName[r]=e),r},maybeStopUnwind:function(){eh.currData&&eh.state===eh.State.Unwinding&&0===eh.exportCallStack.length&&(eh.state=eh.State.Normal,L+=1,em(ex),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:function(){return new Promise((e,r)=>{eh.asyncPromiseHandlers={resolve:e,reject:r}})},allocateData:function(){var e=ew(12+eh.StackSize);return eh.setDataHeader(e,e+12,eh.StackSize),eh.setDataRewindFunc(e),e},setDataHeader:function(e,r,t){h[e>>2]=r,h[e+4>>2]=r+t},setDataRewindFunc:function(e){var r=eh.exportCallStack[0],t=eh.getCallStackId(r);h[e+8>>2]=t},getDataRewindFunc:function(e){var t=h[e+8>>2],n=eh.callStackIdToName[t];return r.asm[n]},doRewind:function(e){var r=eh.getDataRewindFunc(e);return L-=1,r()},handleSleep:function(e){if(!P){if(eh.state===eh.State.Normal){var r=!1,t=!1;e((e=0)=>{if(!P&&(eh.handleSleepReturnValue=e,r=!0,t)){eh.state=eh.State.Rewinding,em(()=>eR(eh.currData)),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=eh.doRewind(eh.currData)}catch(e){n=e,o=!0}var a=!1;if(!eh.currData){var i=eh.asyncPromiseHandlers;i&&(eh.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}}),t=!0,r||(eh.state=eh.State.Unwinding,eh.currData=eh.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),em(()=>eA(eh.currData)))}else eh.state===eh.State.Rewinding?(eh.state=eh.State.Normal,em(eC),eg(eh.currData),eh.currData=null,eh.sleepCallbacks.forEach(e=>(function(e){if(!I&&!P)try{e(),function(){if(!(M||L>0))try{ed(c)}catch(e){ef(e)}}()}catch(e){ef(e)}})(e))):G("invalid state: "+eh.state);return eh.handleSleepReturnValue}},handleAsync:function(e){return eh.handleSleep(r=>{e().then(r)})}},ep=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=eo.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(ep.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return eo.isDir(this.mode)}},isDevice:{get:function(){return eo.isChrdev(this.mode)}}}),eo.FSNode=ep,eo.staticInit();var ev={q:function(e,t){return eh.handleAsync(async()=>{r.emglken_stdin_buffers.length||await new Promise(e=>{r.emglken_stdin_ready=e});let n=r.emglken_stdin_buffers.shift(),o=Math.min(n.length,t);return o==n.length?f.set(n,e):(f.set(n.subarray(0,o),e),r.emglken_stdin_buffers.unshift(n.subarray(o))),o})},D:function(e,r,t,n){try{if(r=ea.getStr(r),r=ea.calculateAt(e,r),-8&t)return -28;var o=eo.lookupPath(r,{follow:!0}).node;if(!o)return -44;var a="";if(4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&eo.nodePermissions(o,a))return -2;return 0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},l:function(e,r,t){ea.varargs=t;try{var n=ea.getStreamFromFD(e);switch(r){case 0:var o=ea.get();if(o<0)return -28;return eo.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ea.get();return n.flags|=o,0;case 5:var o=ea.get();return m[o+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return h[eE()>>2]=28,-1}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},C:function(e,r){try{if(0===r)return -28;var t=eo.cwd(),n=C(t)+1;if(r>2]=0,0;case 21520:if(!n.tty)return -59;return -28;case 21531:var o=ea.get();return eo.ioctl(n,r,o);default:return -28}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},k:function(e,r,t,n){ea.varargs=n;try{r=ea.getStr(r),r=ea.calculateAt(e,r);var o=n?ea.get():0;return eo.open(r,t,o).fd}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},A:function(e,r){try{return e=ea.getStr(e),ea.doStat(eo.stat,e,r)}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},z:function(e,r,t){try{return r=ea.getStr(r),r=ea.calculateAt(e,r),0===t?eo.unlink(r):512===t?eo.rmdir(r):G("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},x:function(){return!0},w:function(){throw 1/0},v:function(e,r){var t=new Date(1e3*ei(e));h[r>>2]=t.getUTCSeconds(),h[r+4>>2]=t.getUTCMinutes(),h[r+8>>2]=t.getUTCHours(),h[r+12>>2]=t.getUTCDate(),h[r+16>>2]=t.getUTCMonth(),h[r+20>>2]=t.getUTCFullYear()-1900,h[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;h[r+28>>2]=o},u:function(e,r){var t=new Date(1e3*ei(e));h[r>>2]=t.getSeconds(),h[r+4>>2]=t.getMinutes(),h[r+8>>2]=t.getHours(),h[r+12>>2]=t.getDate(),h[r+16>>2]=t.getMonth(),h[r+20>>2]=t.getFullYear()-1900,h[r+24>>2]=t.getDay();var n=0|el(t);h[r+28>>2]=n,h[r+36>>2]=-(60*t.getTimezoneOffset());var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&t.getTimezoneOffset()==Math.min(i,a));h[r+32>>2]=s},t:function(e){var r=new Date(h[e+20>>2]+1900,h[e+16>>2],h[e+12>>2],h[e+8>>2],h[e+4>>2],h[e>>2],0),t=h[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)h[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=t>0?s:Math.max(i,a);r.setTime(r.getTime()+(u-n)*6e4)}h[e+24>>2]=r.getDay();var l=0|el(r);return h[e+28>>2]=l,h[e>>2]=r.getSeconds(),h[e+4>>2]=r.getMinutes(),h[e+8>>2]=r.getHours(),h[e+12>>2]=r.getDate(),h[e+16>>2]=r.getMonth(),h[e+20>>2]=r.getYear(),r.getTime()/1e3|0},s:function(e){var r=Date.UTC(h[e+20>>2]+1900,h[e+16>>2],h[e+12>>2],h[e+8>>2],h[e+4>>2],h[e>>2],0),t=new Date(r);h[e+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;return h[e+28>>2]=o,t.getTime()/1e3|0},r:function(e,r,t){var n=new Date().getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset();function u(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}p[e>>2]=60*Math.max(i,s),h[r>>2]=Number(i!=s);var l=u(o),c=u(a),d=ec(l),f=ec(c);s>2]=d,p[t+4>>2]=f):(p[t>>2]=f,p[t+4>>2]=d)},i:function(){return Date.now()},p:function(e,r,t){f.copyWithin(e,r,r+t)},o:function(e){var r=f.length;if((e>>>=0)>2147483648)return!1;let t=(e,r)=>e+(r-e%r)%r;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),function(e){var r=l.buffer;try{return l.grow(e-r.byteLength+65535>>>16),T(),1}catch(e){}}(Math.min(2147483648,t(Math.max(e,o),65536))))return!0}return!1},a:ed,c:function(e){try{var r=ea.getStreamFromFD(e);return eo.close(r),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},y:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.read(e,d,i,s,n);if(u<0)return -1;if(o+=u,u>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},m:function(e,r,t,n,o){try{var a=t+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*t:NaN;if(isNaN(a))return 61;var i=ea.getStreamFromFD(e);return eo.llseek(i,a,n),g=[i.position>>>0,(w=i.position,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[o>>2]=g[0],h[o+4>>2]=g[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},j:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.write(e,d,i,s,n);if(u<0)return -1;o+=u,void 0!==n&&(n+=u)}return o}(o,r,t);return p[n>>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},h:function(e,r,t){return $(e,r,t,e=>e.normalize("NFD"))},g:function(e,r,t){return $(e,r,t,e=>e.normalize("NFC"))},f:function(e,r,t){return $(e,r,t,e=>e.toLowerCase())},e:function(e,r,t,n){return $(e,r,t,e=>e.reduce((e,r,t)=>{let o={ß:"Ss",DŽ:"Dž",Dž:"Dž",dž:"Dž",LJ:"Lj",Lj:"Lj",lj:"Lj",NJ:"Nj",Nj:"Nj",nj:"Nj",DZ:"Dz",Dz:"Dz",dz:"Dz",և:"Եւ",ᾲ:"Ὰͅ",ᾳ:"ᾼ",ᾴ:"Άͅ",ᾷ:"ᾼ͂",ᾼ:"ᾼ",ῂ:"Ὴͅ",ῃ:"ῌ",ῄ:"Ήͅ",ῇ:"ῌ͂",ῌ:"ῌ",ῲ:"Ὼͅ",ῳ:"ῼ",ῴ:"Ώͅ",ῷ:"ῼ͂",ῼ:"ῼ",ff:"Ff",fi:"Fi",fl:"Fl",ffi:"Ffi",ffl:"Ffl",ſt:"St",st:"St",ﬓ:"Մն",ﬔ:"Մե",ﬕ:"Մի",ﬖ:"Վն",ﬗ:"Մխ"},a=String.fromCodePoint(r);return 0===t?a=o[a]?o[a]:r>=8064&&r<8112?["ᾈᾉᾊᾋᾌᾍᾎᾏ","ᾘᾙᾚᾛᾜᾝᾞᾟ","ᾨᾩᾪᾫᾬᾭᾮᾯ"][(r-8064)/16|0][r%8]:a.toUpperCase():n&&(a=a.toLowerCase()),e+a},""),1)},d:function(e,r,t){return $(e,r,t,e=>e.toUpperCase())},n:function(e,r){var t=eS();try{eP(e,r)}catch(e){if(eD(t),e!==e+0)throw e;ek(1,0)}},b:function(e,r,t){var n=eS();try{eM(e,r,t)}catch(e){if(eD(n),e!==e+0)throw e;ek(1,0)}}};!function(){var e,t,n,a={a:ev};function i(e,t){var n,o=e.exports;return o=eh.instrumentWasmExports(o),r.asm=o,l=r.asm.E,T(),r.asm.N,n=r.asm.F,z.unshift(n),Y("wasm-instantiate"),o}if(q("wasm-instantiate"),r.instantiateWasm)try{return r.instantiateWasm(a,i)}catch(e){F("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=u,t=v,n=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||V(t)||"function"!=typeof fetch?K(t,a,n):fetch(t,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return F("wasm streaming compile failed: "+e),F("falling back to ArrayBuffer instantiation"),K(t,a,n)})})).catch(o)}();var ew=function(){return(ew=r.asm.G).apply(null,arguments)},eg=function(){return(eg=r.asm.H).apply(null,arguments)},e_=r._main=function(){return(e_=r._main=r.asm.I).apply(null,arguments)},ey=(r._gidispatch_get_game_id=function(){return(r._gidispatch_get_game_id=r.asm.J).apply(null,arguments)},r._fflush=function(){return(ey=r._fflush=r.asm.K).apply(null,arguments)}),eE=function(){return(eE=r.asm.L).apply(null,arguments)},eb=function(){return(eb=r.asm.M).apply(null,arguments)},ek=function(){return(ek=r.asm.O).apply(null,arguments)},eS=function(){return(eS=r.asm.P).apply(null,arguments)},eD=function(){return(eD=r.asm.Q).apply(null,arguments)},eF=function(){return(eF=r.asm.R).apply(null,arguments)},eM=r.dynCall_vii=function(){return(eM=r.dynCall_vii=r.asm.S).apply(null,arguments)},eP=r.dynCall_vi=function(){return(eP=r.dynCall_vi=r.asm.T).apply(null,arguments)},eA=function(){return(eA=r.asm.U).apply(null,arguments)},ex=function(){return(ex=r.asm.V).apply(null,arguments)},eR=function(){return(eR=r.asm.W).apply(null,arguments)},eC=function(){return(eC=r.asm.X).apply(null,arguments)};function eT(e=E){!(U>0)&&(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),N.unshift(e)}Z(N)}(),U>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()));function t(){!_&&(_=!0,r.calledRun=!0,P||(r.noFSInit||eo.init.initialized||eo.init(),eo.ignorePermissions=!1,et.init(),Z(z),Z(B),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),eN&&function(e=[]){var r=e_;e.unshift(b);var t=e.length,n=eF((t+1)*4),o=n>>2;e.forEach(e=>{var r,t;h[o++]=(t=eF(r=C(e)+1),R(e,d,t,r),t)}),h[o]=0;try{var a=r(t,n);ed(a,!0)}catch(e){return ef(e)}}(e),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),j.unshift(e)}Z(j)}()))}}if(r.___start_em_js=33568,r.___stop_em_js=36253,r.AsciiToString=function(e){for(var r="";;){var t=f[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}},r.FS=eo,W=function e(){_||eT(),_||(W=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var eN=!0;return r.noInitialRun&&(eN=!1),eT(),r.ready}})(),r_={};r_=new URL(k("6MsPj").resolve("ida9s"),import.meta.url).toString();var ry=(()=>{var e="file:///node_modules/emglken/build/hugo-core.js";return function(r={}){var t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,r=void 0!==r?r:{};r.ready=new Promise(function(e,r){n=e,o=r});var y=Object.assign({},r),E=[],b="./this.program",k=(e,r)=>{throw r},S="";"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),e&&(S=e),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(200==n.status||0==n.status&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null)};var D=r.print||console.log.bind(console),F=r.printErr||console.warn.bind(console);Object.assign(r,y),y=null,r.arguments&&(E=r.arguments),r.thisProgram&&(b=r.thisProgram),r.quit&&(k=r.quit),r.wasmBinary&&(u=r.wasmBinary);var M=r.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var P=!1,A=new TextDecoder("utf8");function x(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;return A.decode(e.buffer?e.subarray(r,o):new Uint8Array(e.slice(r,o)))}function R(e,r){if(!e)return"";for(var t=e+r,n=e;!(n>=t)&&f[n];)++n;return A.decode(f.subarray(e,n))}function C(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function T(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function N(){var e=l.buffer;r.HEAP8=d=new Int8Array(e),r.HEAP16=m=new Int16Array(e),r.HEAP32=h=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var z=[],B=[],O=[],j=[],I=[],L=!1,U=0,H=0,W=null,q=null;function Y(e){H++,r.monitorRunDependencies&&r.monitorRunDependencies(H)}function G(e){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),0==H&&(null!==W&&(clearInterval(W),W=null),q)){var t=q;q=null,t()}}function V(e){r.onAbort&&r.onAbort(e),F(e="Aborted("+e+")"),P=!0,c=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function X(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e){try{if(e==v&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function $(e,r,t){return(u||"function"!=typeof fetch?Promise.resolve().then(function(){return K(e)}):fetch(e,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(function(){return K(e)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(t,function(e){F("failed to asynchronously prepare wasm: "+e),V(e)})}function J(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Z(e){for(;e.length>0;)e.shift()(r)}r.locateFile?X(v="hugo-core.wasm")||(t=v,v=r.locateFile?r.locateFile(t,S):S+t):v=new URL(r_).href;var Q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Q.isAbs(e),t="/"===e.substr(-1);return(e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Q.normalize(e.join("/"))},join2:(e,r)=>Q.normalize(e+"/"+r)},ee={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:eo.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Q.isAbs(n)}return e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ee.resolve(e).substr(1),r=ee.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:T(e)+1),o=C(e,n,0,n.length);return r&&(n.length=o),n}var et={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){et.ttys[e]={input:[],output:[],ops:r},eo.registerDevice(e,et.stream_ops)},stream_ops:{open:function(e){var r=et.ttys[e.node.rdev];if(!r)throw new eo.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new eo.ErrnoError(60);for(var a,i=0,s=0;s0&&(D(x(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(F(x(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(F(x(e.output,0)),e.output=[])}}},en={ops_table:null,mount:function(e){return en.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(eo.isBlkdev(t)||eo.isFIFO(t))throw new eo.ErrnoError(63);en.ops_table||(en.ops_table={dir:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,lookup:en.node_ops.lookup,mknod:en.node_ops.mknod,rename:en.node_ops.rename,unlink:en.node_ops.unlink,rmdir:en.node_ops.rmdir,readdir:en.node_ops.readdir,symlink:en.node_ops.symlink},stream:{llseek:en.stream_ops.llseek}},file:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:{llseek:en.stream_ops.llseek,read:en.stream_ops.read,write:en.stream_ops.write,allocate:en.stream_ops.allocate,mmap:en.stream_ops.mmap,msync:en.stream_ops.msync}},link:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,readlink:en.node_ops.readlink},stream:{}},chrdev:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:eo.chrdev_stream_ops}});var o=eo.createNode(e,r,t,n);return eo.isDir(o.mode)?(o.node_ops=en.ops_table.dir.node,o.stream_ops=en.ops_table.dir.stream,o.contents={}):eo.isFile(o.mode)?(o.node_ops=en.ops_table.file.node,o.stream_ops=en.ops_table.file.stream,o.usedBytes=0,o.contents=null):eo.isLink(o.mode)?(o.node_ops=en.ops_table.link.node,o.stream_ops=en.ops_table.link.stream):eo.isChrdev(o.mode)&&(o.node_ops=en.ops_table.chrdev.node,o.stream_ops=en.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}}},node_ops:{getattr:function(e){var r={};return r.dev=eo.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,eo.isDir(e.mode)?r.size=4096:eo.isFile(e.mode)?r.size=e.usedBytes:eo.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&en.resizeFileStorage(e,r.size)},lookup:function(e,r){throw eo.genericErrors[44]},mknod:function(e,r,t,n){return en.createNode(e,r,t,n)},rename:function(e,r,t){if(eo.isDir(e.mode)){var n;try{n=eo.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new eo.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=eo.lookupNode(e,r);for(var n in t.contents)throw new eo.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=en.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!eo.isLink(e.mode))throw new eo.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=ee.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new eo.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=eo.root,o="/",a=0;a40)throw new eo.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(eo.isRoot(e)){var t=e.mount.mountpoint;if(!r)return t;return"/"!==t[t.length-1]?t+"/"+r:t+r}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%eo.nameTable.length},hashAddNode:e=>{var r=eo.hashName(e.parent.id,e.name);e.name_next=eo.nameTable[r],eo.nameTable[r]=e},hashRemoveNode:e=>{var r=eo.hashName(e.parent.id,e.name);if(eo.nameTable[r]===e)eo.nameTable[r]=e.name_next;else for(var t=eo.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=eo.mayLookup(e);if(t)throw new eo.ErrnoError(t,e);for(var n=eo.hashName(e.id,r),o=eo.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return eo.lookup(e,r)},createNode:(e,r,t,n)=>{var o=new eo.FSNode(e,r,t,n);return eo.hashAddNode(o),o},destroyNode:e=>{eo.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>(49152&e)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=eo.flagModes[e];if(void 0===r)throw Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>eo.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>eo.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,r)=>{try{return eo.lookupNode(e,r),20}catch(e){}return eo.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{try{n=eo.lookupNode(e,r)}catch(e){return e.errno}var n,o=eo.nodePermissions(e,"wx");if(o)return o;if(t){if(!eo.isDir(n.mode))return 54;if(eo.isRoot(n)||eo.getPath(n)===eo.cwd())return 10}else if(eo.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?eo.isLink(e.mode)?32:eo.isDir(e.mode)&&("r"!==eo.flagsToPermissionString(r)||512&r)?31:eo.nodePermissions(e,eo.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=eo.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!eo.streams[t])return t;throw new eo.ErrnoError(33)},getStream:e=>eo.streams[e],createStream:(e,r,t)=>{eo.FSStream||(eo.FSStream=function(){this.shared={}},eo.FSStream.prototype={},Object.defineProperties(eo.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new eo.FSStream,e);var n=eo.nextfd(r,t);return e.fd=n,eo.streams[n]=e,e},closeStream:e=>{eo.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=eo.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new eo.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{eo.devices[e]={stream_ops:r}},getDevice:e=>eo.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),eo.syncFSRequests++,eo.syncFSRequests>1&&F("warning: "+eo.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=eo.getMounts(eo.root.mount),n=0;function o(e){return eo.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount:(e,r,t)=>{var n,o="/"===t,a=!t;if(o&&eo.root)throw new eo.ErrnoError(10);if(!o&&!a){var i=eo.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,eo.isMountpoint(n))throw new eo.ErrnoError(10);if(!eo.isDir(n.mode))throw new eo.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?eo.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=eo.lookupPath(e,{follow_mount:!1});if(!eo.isMountpoint(r.node))throw new eo.ErrnoError(28);var t=r.node,n=t.mounted,o=eo.getMounts(n);Object.keys(eo.nameTable).forEach(e=>{for(var r=eo.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&eo.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=eo.lookupPath(e,{parent:!0}).node,o=Q.basename(e);if(!o||"."===o||".."===o)throw new eo.ErrnoError(28);var a=eo.mayCreate(n,o);if(a)throw new eo.ErrnoError(a);if(!n.node_ops.mknod)throw new eo.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=(void 0!==r?r:438)&4095|32768,eo.mknod(e,r,0)),mkdir:(e,r)=>(r=(void 0!==r?r:511)&1023|16384,eo.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,eo.mknod(e,r,t)),symlink:(e,r)=>{if(!ee.resolve(e))throw new eo.ErrnoError(44);var t=eo.lookupPath(r,{parent:!0}).node;if(!t)throw new eo.ErrnoError(44);var n=Q.basename(r),o=eo.mayCreate(t,n);if(o)throw new eo.ErrnoError(o);if(!t.node_ops.symlink)throw new eo.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o,a=Q.dirname(e),i=Q.dirname(r),s=Q.basename(e),u=Q.basename(r);if(t=eo.lookupPath(e,{parent:!0}).node,n=eo.lookupPath(r,{parent:!0}).node,!t||!n)throw new eo.ErrnoError(44);if(t.mount!==n.mount)throw new eo.ErrnoError(75);var l=eo.lookupNode(t,s),c=ee.relative(e,i);if("."!==c.charAt(0))throw new eo.ErrnoError(28);if("."!==(c=ee.relative(r,a)).charAt(0))throw new eo.ErrnoError(55);try{o=eo.lookupNode(n,u)}catch(e){}if(l!==o){var d=eo.isDir(l.mode),f=eo.mayDelete(t,s,d);if(f||(f=o?eo.mayDelete(n,u,d):eo.mayCreate(n,u)))throw new eo.ErrnoError(f);if(!t.node_ops.rename)throw new eo.ErrnoError(63);if(eo.isMountpoint(l)||o&&eo.isMountpoint(o))throw new eo.ErrnoError(10);if(n!==t&&(f=eo.nodePermissions(t,"w")))throw new eo.ErrnoError(f);eo.hashRemoveNode(l);try{t.node_ops.rename(l,n,u)}catch(e){throw e}finally{eo.hashAddNode(l)}}},rmdir:e=>{var r=eo.lookupPath(e,{parent:!0}).node,t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!0);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.rmdir)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.rmdir(r,t),eo.destroyNode(n)},readdir:e=>{var r=eo.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new eo.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=eo.lookupPath(e,{parent:!0}).node;if(!r)throw new eo.ErrnoError(44);var t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!1);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.unlink)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.unlink(r,t),eo.destroyNode(n)},readlink:e=>{var r=eo.lookupPath(e).node;if(!r)throw new eo.ErrnoError(44);if(!r.node_ops.readlink)throw new eo.ErrnoError(28);return ee.resolve(eo.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=eo.lookupPath(e,{follow:!r}).node;if(!t)throw new eo.ErrnoError(44);if(!t.node_ops.getattr)throw new eo.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>eo.stat(e,!0),chmod:(e,r,t)=>{var n;if(!(n="string"==typeof e?eo.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{eo.chmod(e,r,!0)},fchmod:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);eo.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;if(!(o="string"==typeof e?eo.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{eo.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=eo.getStream(e);if(!n)throw new eo.ErrnoError(8);eo.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new eo.ErrnoError(28);if("string"==typeof e){var t;t=eo.lookupPath(e,{follow:!0}).node}else t=e;if(!t.node_ops.setattr)throw new eo.ErrnoError(63);if(eo.isDir(t.mode))throw new eo.ErrnoError(31);if(!eo.isFile(t.mode))throw new eo.ErrnoError(28);var n=eo.nodePermissions(t,"w");if(n)throw new eo.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);if((2097155&t.flags)==0)throw new eo.ErrnoError(28);eo.truncate(t.node,r)},utime:(e,r,t)=>{var n=eo.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,t,n)=>{if(""===e)throw new eo.ErrnoError(44);if(t="string"==typeof t?eo.modeStringToFlags(t):t,n=void 0===n?438:n,n=64&t?4095&n|32768:0,"object"==typeof e)o=e;else{e=Q.normalize(e);try{var o;o=eo.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t){if(o){if(128&t)throw new eo.ErrnoError(20)}else o=eo.mknod(e,n,0),a=!0}if(!o)throw new eo.ErrnoError(44);if(eo.isChrdev(o.mode)&&(t&=-513),65536&t&&!eo.isDir(o.mode))throw new eo.ErrnoError(54);if(!a){var i=eo.mayOpen(o,t);if(i)throw new eo.ErrnoError(i)}512&t&&!a&&eo.truncate(o,0),t&=-131713;var s=eo.createStream({node:o,path:eo.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!r.logReadFiles||1&t||(eo.readFiles||(eo.readFiles={}),e in eo.readFiles||(eo.readFiles[e]=1)),s},close:e=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{eo.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new eo.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new eo.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==1)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.read)throw new eo.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==0)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.write)throw new eo.ErrnoError(28);e.seekable&&1024&e.flags&&eo.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(r<0||t<=0)throw new eo.ErrnoError(28);if((2097155&e.flags)==0)throw new eo.ErrnoError(8);if(!eo.isFile(e.node.mode)&&!eo.isDir(e.node.mode))throw new eo.ErrnoError(43);if(!e.stream_ops.allocate)throw new eo.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if((2&n)!=0&&(2&o)==0&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new eo.ErrnoError(2);if(!e.stream_ops.mmap)throw new eo.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new eo.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw Error('Invalid encoding type "'+r.encoding+'"');var t,n=eo.open(e,r.flags),o=eo.stat(e).size,a=new Uint8Array(o);return eo.read(n,a,0,o,0),"utf8"===r.encoding?t=x(a,0):"binary"===r.encoding&&(t=a),eo.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=eo.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(T(r)+1),a=C(r,o,0,o.length);eo.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))eo.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw Error("Unsupported data type");eo.close(n)},cwd:()=>eo.currentPath,chdir:e=>{var r=eo.lookupPath(e,{follow:!0});if(null===r.node)throw new eo.ErrnoError(44);if(!eo.isDir(r.node.mode))throw new eo.ErrnoError(54);var t=eo.nodePermissions(r.node,"x");if(t)throw new eo.ErrnoError(t);eo.currentPath=r.path},createDefaultDirectories:()=>{eo.mkdir("/tmp"),eo.mkdir("/home"),eo.mkdir("/home/web_user")},createDefaultDevices:()=>{eo.mkdir("/dev"),eo.registerDevice(eo.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),eo.mkdev("/dev/null",eo.makedev(1,3)),et.register(eo.makedev(5,0),et.default_tty_ops),et.register(eo.makedev(6,0),et.default_tty1_ops),eo.mkdev("/dev/tty",eo.makedev(5,0)),eo.mkdev("/dev/tty1",eo.makedev(6,0));var e=function(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return()=>V("randomDevice");var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}();eo.createDevice("/dev","random",e),eo.createDevice("/dev","urandom",e),eo.mkdir("/dev/shm"),eo.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{eo.mkdir("/proc");var e=eo.mkdir("/proc/self");eo.mkdir("/proc/self/fd"),eo.mount({mount:()=>{var r=eo.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=eo.getStream(+r);if(!t)throw new eo.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>t.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{r.stdin?eo.createDevice("/dev","stdin",r.stdin):eo.symlink("/dev/tty","/dev/stdin"),r.stdout?eo.createDevice("/dev","stdout",null,r.stdout):eo.symlink("/dev/tty","/dev/stdout"),r.stderr?eo.createDevice("/dev","stderr",null,r.stderr):eo.symlink("/dev/tty1","/dev/stderr"),eo.open("/dev/stdin",0),eo.open("/dev/stdout",1),eo.open("/dev/stderr",1)},ensureErrnoError:()=>{eo.ErrnoError||(eo.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},eo.ErrnoError.prototype=Error(),eo.ErrnoError.prototype.constructor=eo.ErrnoError,[44].forEach(e=>{eo.genericErrors[e]=new eo.ErrnoError(e),eo.genericErrors[e].stack=""}))},staticInit:()=>{eo.ensureErrnoError(),eo.nameTable=Array(4096),eo.mount(en,{},"/"),eo.createDefaultDirectories(),eo.createDefaultDevices(),eo.createSpecialDirectories(),eo.filesystems={MEMFS:en}},init:(e,t,n)=>{eo.init.initialized=!0,eo.ensureErrnoError(),r.stdin=e||r.stdin,r.stdout=t||r.stdout,r.stderr=n||r.stderr,eo.createStandardStreams()},quit:()=>{eo.init.initialized=!1,eE(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=eo.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{var t=eo.lookupPath(e,{follow:!r});e=t.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=eo.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Q.basename(e),t=eo.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(e){n.error=e.errno}return n},createPath:(e,r,t,n)=>{e="string"==typeof e?e:eo.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Q.join2(e,a);try{eo.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=Q.join2("string"==typeof e?e:eo.getPath(e),r),i=eo.getMode(n,o);return eo.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:eo.getPath(e),i=r?Q.join2(e,r):e);var s=eo.getMode(n,o),u=eo.create(i,s);if(t){if("string"==typeof t){for(var l=Array(t.length),c=0,d=t.length;c{var o=Q.join2("string"==typeof e?e:eo.getPath(e),r),a=eo.getMode(!!t,!!n);eo.createDevice.major||(eo.createDevice.major=64);var i=eo.makedev(eo.createDevice.major++,0);return eo.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i,s=0,u=0;u{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(a)try{e.contents=er(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new eo.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1)&&!(e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e,r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw Error("Couldn't load "+t+". Status: "+r.status);var n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):er(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw Error("doXHR failed!");return u.chunks[e]}),(a||!n)&&(i=n=1,i=n=this.getter(0).length,D("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i;throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"}var i={isDevice:!1,url:t},s=eo.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=s.stream_ops[e];u[e]=function(){return eo.forceLoadFile(s),r.apply(null,arguments)}}),u.read=(e,r,t,n,o)=>(eo.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{eo.forceLoadFile(s);var a=void V();if(!a)throw new eo.ErrnoError(48);return l(e,d,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(e,r,t,n,o,a,s,u,l,c)=>{var d,f,m=r?ee.resolve(Q.join2(e,r)):e,h="cp "+m;function p(t){function i(t){c&&c(),u||eo.createDataFile(e,r,t,n,o,l),a&&a(),G(h)}Browser.handledByPreloadPlugin(t,m,i,()=>{s&&s(),G(h)})||i(t)}Y(h),"string"==typeof t?(d=e=>p(e),f="al "+t,i(t,e=>{var r;r='Loading data file "'+t+'" failed (no arrayBuffer).',e||V(r),d(new Uint8Array(e)),f&&G(f)},e=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),f&&Y(f)):p(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{D("creating db"),o.result.createObjectStore(eo.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([eo.DB_STORE_NAME],"readwrite"),a=n.objectStore(eo.DB_STORE_NAME),i=0,s=0,u=e.length;function l(){0==s?r():t()}e.forEach(e=>{var r=a.put(eo.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&l()},r.onerror=()=>{i+ ++s==u&&l()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([eo.DB_STORE_NAME],"readonly")}catch(e){t(e);return}var i=a.objectStore(eo.DB_STORE_NAME),s=0,u=0,l=e.length;function c(){0==u?r():t()}e.forEach(e=>{var r=i.get(e);r.onsuccess=()=>{eo.analyzePath(e).exists&&eo.unlink(e),eo.createDataFile(Q.dirname(e),Q.basename(e),r.result,!0,!0,!0),++s+u==l&&c()},r.onerror=()=>{s+ ++u==l&&c()}}),a.onerror=t},o.onerror=t}},ea={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(Q.isAbs(r))return r;if(-100===e)n=eo.cwd();else{var n;n=ea.getStreamFromFD(e).path}if(0==r.length){if(!t)throw new eo.ErrnoError(44);return n}return Q.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Q.normalize(r)!==Q.normalize(eo.getPath(e.node)))return -54;throw e}h[t>>2]=n.dev,h[t+8>>2]=n.ino,h[t+12>>2]=n.mode,p[t+16>>2]=n.nlink,h[t+20>>2]=n.uid,h[t+24>>2]=n.gid,h[t+28>>2]=n.rdev,g=[n.size>>>0,+Math.abs(w=n.size)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+40>>2]=g[0],h[t+44>>2]=g[1],h[t+48>>2]=4096,h[t+52>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return g=[Math.floor(o/1e3)>>>0,+Math.abs(w=Math.floor(o/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+56>>2]=g[0],h[t+60>>2]=g[1],p[t+64>>2]=o%1e3*1e3,g=[Math.floor(a/1e3)>>>0,+Math.abs(w=Math.floor(a/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+72>>2]=g[0],h[t+76>>2]=g[1],p[t+80>>2]=a%1e3*1e3,g=[Math.floor(i/1e3)>>>0,+Math.abs(w=Math.floor(i/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+88>>2]=g[0],h[t+92>>2]=g[1],p[t+96>>2]=i%1e3*1e3,g=[n.ino>>>0,+Math.abs(w=n.ino)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+104>>2]=g[0],h[t+108>>2]=g[1],0},doMsync:function(e,r,t,n,o){if(!eo.isFile(r.node.mode))throw new eo.ErrnoError(43);if(2&n)return 0;var a=f.slice(e,e+t);eo.msync(r,a,o,t,n)},varargs:void 0,get:function(){return ea.varargs+=4,h[ea.varargs-4>>2]},getStr:function(e){return R(e)},getStreamFromFD:function(e){var r=eo.getStream(e);if(!r)throw new eo.ErrnoError(8);return r}};function ei(e){return e%4==0&&(e%100!=0||e%400==0)}var es=[0,31,60,91,121,152,182,213,244,274,305,335],eu=[0,31,59,90,120,151,181,212,243,273,304,334];function el(e){var r=T(e)+1,t=eg(r);return t&&C(e,d,t,r),t}function ec(e,t){c=e,M||U>0||(ek(),Z(j),eo.quit(),et.shutdown(),L=!0),c=e,M||U>0||(r.onExit&&r.onExit(e),P=!0),k(e,new J(e))}var ed=[31,29,31,30,31,30,31,31,30,31,30,31],ef=[31,28,31,30,31,30,31,31,30,31,30,31];function em(e){if(e instanceof J||"unwind"==e)return c;k(1,e)}function eh(e){try{return e()}catch(e){V(e)}}var ep={instrumentWasmImports:function(e){var r=["emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","SDL_Delay","emscripten_scan_registers","emscripten_lazy_load_code","emscripten_fiber_swap","__load_secondary_module","fd_sync","__wasi_fd_sync","_emval_await","_dlopen_js","__asyncjs__*"];for(var t in e)!function(t){var n=e[t];n.sig,"function"==typeof n&&(r.indexOf(t)>=0||t.startsWith("__asyncjs__"))}(t)},instrumentWasmExports:function(e){var r={};for(var t in e)!function(t){var n=e[t];"function"==typeof n?r[t]=function(){ep.exportCallStack.push(t);try{return n.apply(null,arguments)}finally{P||(ep.exportCallStack.pop()===t||V(void 0),ep.maybeStopUnwind())}}:r[t]=n}(t);return r},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:8192,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(e){var r=ep.callStackNameToId[e];return void 0===r&&(r=ep.callStackId++,ep.callStackNameToId[e]=r,ep.callStackIdToName[r]=e),r},maybeStopUnwind:function(){ep.currData&&ep.state===ep.State.Unwinding&&0===ep.exportCallStack.length&&(ep.state=ep.State.Normal,U+=1,eh(eF),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:function(){return new Promise((e,r)=>{ep.asyncPromiseHandlers={resolve:e,reject:r}})},allocateData:function(){var e=eg(12+ep.StackSize);return ep.setDataHeader(e,e+12,ep.StackSize),ep.setDataRewindFunc(e),e},setDataHeader:function(e,r,t){h[e>>2]=r,h[e+4>>2]=r+t},setDataRewindFunc:function(e){var r=ep.exportCallStack[0],t=ep.getCallStackId(r);h[e+8>>2]=t},getDataRewindFunc:function(e){var t=h[e+8>>2],n=ep.callStackIdToName[t];return r.asm[n]},doRewind:function(e){var r=ep.getDataRewindFunc(e);return U-=1,r()},handleSleep:function(e){if(!P){if(ep.state===ep.State.Normal){var r=!1,t=!1;e((e=0)=>{if(!P&&(ep.handleSleepReturnValue=e,r=!0,t)){ep.state=ep.State.Rewinding,eh(()=>eM(ep.currData)),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=ep.doRewind(ep.currData)}catch(e){n=e,o=!0}var a=!1;if(!ep.currData){var i=ep.asyncPromiseHandlers;i&&(ep.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}}),t=!0,r||(ep.state=ep.State.Unwinding,ep.currData=ep.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),eh(()=>eD(ep.currData)))}else ep.state===ep.State.Rewinding?(ep.state=ep.State.Normal,eh(eP),e_(ep.currData),ep.currData=null,ep.sleepCallbacks.forEach(e=>(function(e){if(!L&&!P)try{e(),function(){if(!(M||U>0))try{ec(c)}catch(e){em(e)}}()}catch(e){em(e)}})(e))):V("invalid state: "+ep.state);return ep.handleSleepReturnValue}},handleAsync:function(e){return ep.handleSleep(r=>{e().then(r)})}},ev=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=eo.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(ev.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return eo.isDir(this.mode)}},isDevice:{get:function(){return eo.isChrdev(this.mode)}}}),eo.FSNode=ev,eo.staticInit();var ew={j:function(e,t){return ep.handleAsync(async()=>{r.emglken_stdin_buffers.length||await new Promise(e=>{r.emglken_stdin_ready=e});let n=r.emglken_stdin_buffers.shift(),o=Math.min(n.length,t);return o==n.length?f.set(n,e):(f.set(n.subarray(0,o),e),r.emglken_stdin_buffers.unshift(n.subarray(o))),o})},s:function(e,r,t,n){try{if(r=ea.getStr(r),r=ea.calculateAt(e,r),-8&t)return -28;var o=eo.lookupPath(r,{follow:!0}).node;if(!o)return -44;var a="";if(4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&eo.nodePermissions(o,a))return -2;return 0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},e:function(e,r,t){ea.varargs=t;try{var n=ea.getStreamFromFD(e);switch(r){case 0:var o=ea.get();if(o<0)return -28;return eo.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ea.get();return n.flags|=o,0;case 5:var o=ea.get();return m[o+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return h[eb()>>2]=28,-1}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},r:function(e,r){try{if(0===r)return -28;var t=eo.cwd(),n=T(t)+1;if(r>2]=0,0;case 21520:if(!n.tty)return -59;return -28;case 21531:var o=ea.get();return eo.ioctl(n,r,o);default:return -28}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},p:function(e,r,t,n){ea.varargs=n;try{r=ea.getStr(r),r=ea.calculateAt(e,r);var o=n?ea.get():0;return eo.open(r,t,o).fd}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},o:function(e,r){try{return e=ea.getStr(e),ea.doStat(eo.stat,e,r)}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},m:function(){return!0},l:function(e,r){var t=new Date(1e3*(p[e>>2]+4294967296*h[e+4>>2]));h[r>>2]=t.getSeconds(),h[r+4>>2]=t.getMinutes(),h[r+8>>2]=t.getHours(),h[r+12>>2]=t.getDate(),h[r+16>>2]=t.getMonth(),h[r+20>>2]=t.getFullYear()-1900,h[r+24>>2]=t.getDay();var n=0|(ei(t.getFullYear())?es:eu)[t.getMonth()]+t.getDate()-1;h[r+28>>2]=n,h[r+36>>2]=-(60*t.getTimezoneOffset());var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&t.getTimezoneOffset()==Math.min(i,a));h[r+32>>2]=s},k:function(e,r,t){var n=new Date().getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset();function u(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}p[e>>2]=60*Math.max(i,s),h[r>>2]=Number(i!=s);var l=u(o),c=u(a),d=el(l),f=el(c);s>2]=d,p[t+4>>2]=f):(p[t>>2]=f,p[t+4>>2]=d)},b:function(){return Date.now()},i:function(e,r,t){f.copyWithin(e,r,r+t)},h:function(e){var r=f.length;if((e>>>=0)>2147483648)return!1;let t=(e,r)=>e+(r-e%r)%r;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),function(e){var r=l.buffer;try{return l.grow(e-r.byteLength+65535>>>16),N(),1}catch(e){}}(Math.min(2147483648,t(Math.max(e,o),65536))))return!0}return!1},a:ec,d:function(e){try{var r=ea.getStreamFromFD(e);return eo.close(r),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},n:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.read(e,d,i,s,n);if(u<0)return -1;if(o+=u,u>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},g:function(e,r,t,n,o){try{var a=t+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*t:NaN;if(isNaN(a))return 61;var i=ea.getStreamFromFD(e);return eo.llseek(i,a,n),g=[i.position>>>0,(w=i.position,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[o>>2]=g[0],h[o+4>>2]=g[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},c:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.write(e,d,i,s,n);if(u<0)return -1;o+=u,void 0!==n&&(n+=u)}return o}(o,r,t);return p[n>>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},f:function(e,r,t,n){var o=h[n+40>>2],a={tm_sec:h[n>>2],tm_min:h[n+4>>2],tm_hour:h[n+8>>2],tm_mday:h[n+12>>2],tm_mon:h[n+16>>2],tm_year:h[n+20>>2],tm_wday:h[n+24>>2],tm_yday:h[n+28>>2],tm_isdst:h[n+32>>2],tm_gmtoff:h[n+36>>2],tm_zone:o?R(o):""},i=R(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}return 0===(t=n(e.getFullYear()-r.getFullYear()))&&0===(t=n(e.getMonth()-r.getMonth()))&&(t=n(e.getDate()-r.getDate())),t}function v(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function w(e){var r=function(e,r){for(var t=new Date(e.getTime());r>0;){var n=ei(t.getFullYear()),o=t.getMonth(),a=(n?ed:ef)[o];if(r>a-t.getDate())r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else{t.setDate(t.getDate()+r);break}}return t}(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=v(t),a=v(n);return 0>=p(o,r)?0>=p(a,r)?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var g={"%a":function(e){return l[e.tm_wday].substring(0,3)},"%A":function(e){return l[e.tm_wday]},"%b":function(e){return c[e.tm_mon].substring(0,3)},"%B":function(e){return c[e.tm_mon]},"%C":function(e){return m((e.tm_year+1900)/100|0,2)},"%d":function(e){return m(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return w(e).toString().substring(2)},"%G":function(e){return w(e)},"%H":function(e){return m(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":function(e){return m(e.tm_mday+function(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}(ei(e.tm_year+1900)?ed:ef,e.tm_mon-1),3)},"%m":function(e){return m(e.tm_mon+1,2)},"%M":function(e){return m(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return m(e.tm_sec,2)},"%t":function(){return" "},"%u":function(e){return e.tm_wday||7},"%U":function(e){return m(Math.floor((e.tm_yday+7-e.tm_wday)/7),2)},"%V":function(e){var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&ei(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&ei(e.tm_year%400-1))&&r++}return m(r,2)},"%w":function(e){return e.tm_wday},"%W":function(e){return m(Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff;return(r>=0?"+":"-")+String("0000"+(r=(r=Math.abs(r)/60)/60*100+r%60)).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\x00\x00"),g)i.includes(u)&&(i=i.replace(RegExp(u,"g"),g[u](a)));var _=er(i=i.replace(/\0\0/g,"%"),!1);return _.length>r?0:(d.set(_,e),_.length-1)}};!function(){var e,t,n,a={a:ew};function i(e,t){var n,o=e.exports;return o=ep.instrumentWasmExports(o),r.asm=o,l=r.asm.t,N(),r.asm.C,n=r.asm.u,B.unshift(n),G("wasm-instantiate"),o}if(Y("wasm-instantiate"),r.instantiateWasm)try{return r.instantiateWasm(a,i)}catch(e){F("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=u,t=v,n=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||X(t)||"function"!=typeof fetch?$(t,a,n):fetch(t,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return F("wasm streaming compile failed: "+e),F("falling back to ArrayBuffer instantiation"),$(t,a,n)})})).catch(o)}();var eg=function(){return(eg=r.asm.v).apply(null,arguments)},e_=function(){return(e_=r.asm.w).apply(null,arguments)},ey=r._main=function(){return(ey=r._main=r.asm.x).apply(null,arguments)},eE=(r._gidispatch_get_game_id=function(){return(r._gidispatch_get_game_id=r.asm.y).apply(null,arguments)},r._fflush=function(){return(eE=r._fflush=r.asm.z).apply(null,arguments)}),eb=function(){return(eb=r.asm.A).apply(null,arguments)},ek=function(){return(ek=r.asm.B).apply(null,arguments)},eS=function(){return(eS=r.asm.D).apply(null,arguments)},eD=function(){return(eD=r.asm.E).apply(null,arguments)},eF=function(){return(eF=r.asm.F).apply(null,arguments)},eM=function(){return(eM=r.asm.G).apply(null,arguments)},eP=function(){return(eP=r.asm.H).apply(null,arguments)};function eA(e=E){!(H>0)&&(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),z.unshift(e)}Z(z)}(),H>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()));function t(){!_&&(_=!0,r.calledRun=!0,P||(r.noFSInit||eo.init.initialized||eo.init(),eo.ignorePermissions=!1,et.init(),Z(B),Z(O),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),ex&&function(e=[]){var r=ey;e.unshift(b);var t=e.length,n=eS((t+1)*4),o=n>>2;e.forEach(e=>{var r,t;h[o++]=(t=eS(r=T(e)+1),C(e,d,t,r),t)}),h[o]=0;try{var a=r(t,n);ec(a,!0)}catch(e){return em(e)}}(e),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),I.unshift(e)}Z(I)}()))}}if(r.___start_em_js=18128,r.___stop_em_js=20813,r.AsciiToString=function(e){for(var r="";;){var t=f[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}},r.FS=eo,q=function e(){_||eA(),_||(q=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var ex=!0;return r.noInitialRun&&(ex=!1),eA(),r.ready}})(),rE={};rE=new URL(k("6MsPj").resolve("90qbH"),import.meta.url).toString();var rb=(()=>{var e="file:///node_modules/emglken/build/tads-core.js";return function(r={}){var t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,r=void 0!==r?r:{};r.ready=new Promise(function(e,r){n=e,o=r});var y=Object.assign({},r),E=[],b="./this.program",k=(e,r)=>{throw r},S="";"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),e&&(S=e),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(200==n.status||0==n.status&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null)};var D=r.print||console.log.bind(console),F=r.printErr||console.warn.bind(console);Object.assign(r,y),y=null,r.arguments&&(E=r.arguments),r.thisProgram&&(b=r.thisProgram),r.quit&&(k=r.quit),r.wasmBinary&&(u=r.wasmBinary);var M=r.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var P=!1,A=new TextDecoder("utf8");function x(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;return A.decode(e.buffer?e.subarray(r,o):new Uint8Array(e.slice(r,o)))}function R(e,r){if(!e)return"";for(var t=e+r,n=e;!(n>=t)&&f[n];)++n;return A.decode(f.subarray(e,n))}function C(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function T(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function N(){var e=l.buffer;r.HEAP8=d=new Int8Array(e),r.HEAP16=m=new Int16Array(e),r.HEAP32=h=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var z=[],B=[],O=[],j=[],I=[],L=!1,U=0,H=0,W=null,q=null;function Y(e){H++,r.monitorRunDependencies&&r.monitorRunDependencies(H)}function G(e){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),0==H&&(null!==W&&(clearInterval(W),W=null),q)){var t=q;q=null,t()}}function V(e){r.onAbort&&r.onAbort(e),F(e="Aborted("+e+")"),P=!0,c=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function X(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e){try{if(e==v&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function $(e,r,t){return(u||"function"!=typeof fetch?Promise.resolve().then(function(){return K(e)}):fetch(e,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(function(){return K(e)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(t,function(e){F("failed to asynchronously prepare wasm: "+e),V(e)})}function J(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Z(e){for(;e.length>0;)e.shift()(r)}r.locateFile?X(v="tads-core.wasm")||(t=v,v=r.locateFile?r.locateFile(t,S):S+t):v=new URL(rE).href;var Q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Q.isAbs(e),t="/"===e.substr(-1);return(e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Q.normalize(e.join("/"))},join2:(e,r)=>Q.normalize(e+"/"+r)},ee={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:eo.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Q.isAbs(n)}return e=Q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ee.resolve(e).substr(1),r=ee.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:T(e)+1),o=C(e,n,0,n.length);return r&&(n.length=o),n}var et={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){et.ttys[e]={input:[],output:[],ops:r},eo.registerDevice(e,et.stream_ops)},stream_ops:{open:function(e){var r=et.ttys[e.node.rdev];if(!r)throw new eo.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new eo.ErrnoError(60);for(var a,i=0,s=0;s0&&(D(x(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(F(x(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(F(x(e.output,0)),e.output=[])}}},en={ops_table:null,mount:function(e){return en.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(eo.isBlkdev(t)||eo.isFIFO(t))throw new eo.ErrnoError(63);en.ops_table||(en.ops_table={dir:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,lookup:en.node_ops.lookup,mknod:en.node_ops.mknod,rename:en.node_ops.rename,unlink:en.node_ops.unlink,rmdir:en.node_ops.rmdir,readdir:en.node_ops.readdir,symlink:en.node_ops.symlink},stream:{llseek:en.stream_ops.llseek}},file:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:{llseek:en.stream_ops.llseek,read:en.stream_ops.read,write:en.stream_ops.write,allocate:en.stream_ops.allocate,mmap:en.stream_ops.mmap,msync:en.stream_ops.msync}},link:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr,readlink:en.node_ops.readlink},stream:{}},chrdev:{node:{getattr:en.node_ops.getattr,setattr:en.node_ops.setattr},stream:eo.chrdev_stream_ops}});var o=eo.createNode(e,r,t,n);return eo.isDir(o.mode)?(o.node_ops=en.ops_table.dir.node,o.stream_ops=en.ops_table.dir.stream,o.contents={}):eo.isFile(o.mode)?(o.node_ops=en.ops_table.file.node,o.stream_ops=en.ops_table.file.stream,o.usedBytes=0,o.contents=null):eo.isLink(o.mode)?(o.node_ops=en.ops_table.link.node,o.stream_ops=en.ops_table.link.stream):eo.isChrdev(o.mode)&&(o.node_ops=en.ops_table.chrdev.node,o.stream_ops=en.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}}},node_ops:{getattr:function(e){var r={};return r.dev=eo.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,eo.isDir(e.mode)?r.size=4096:eo.isFile(e.mode)?r.size=e.usedBytes:eo.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&en.resizeFileStorage(e,r.size)},lookup:function(e,r){throw eo.genericErrors[44]},mknod:function(e,r,t,n){return en.createNode(e,r,t,n)},rename:function(e,r,t){if(eo.isDir(e.mode)){var n;try{n=eo.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new eo.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=eo.lookupNode(e,r);for(var n in t.contents)throw new eo.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=en.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!eo.isLink(e.mode))throw new eo.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=ee.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new eo.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=eo.root,o="/",a=0;a40)throw new eo.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(eo.isRoot(e)){var t=e.mount.mountpoint;if(!r)return t;return"/"!==t[t.length-1]?t+"/"+r:t+r}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%eo.nameTable.length},hashAddNode:e=>{var r=eo.hashName(e.parent.id,e.name);e.name_next=eo.nameTable[r],eo.nameTable[r]=e},hashRemoveNode:e=>{var r=eo.hashName(e.parent.id,e.name);if(eo.nameTable[r]===e)eo.nameTable[r]=e.name_next;else for(var t=eo.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=eo.mayLookup(e);if(t)throw new eo.ErrnoError(t,e);for(var n=eo.hashName(e.id,r),o=eo.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return eo.lookup(e,r)},createNode:(e,r,t,n)=>{var o=new eo.FSNode(e,r,t,n);return eo.hashAddNode(o),o},destroyNode:e=>{eo.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>(49152&e)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=eo.flagModes[e];if(void 0===r)throw Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>eo.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>eo.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,r)=>{try{return eo.lookupNode(e,r),20}catch(e){}return eo.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{try{n=eo.lookupNode(e,r)}catch(e){return e.errno}var n,o=eo.nodePermissions(e,"wx");if(o)return o;if(t){if(!eo.isDir(n.mode))return 54;if(eo.isRoot(n)||eo.getPath(n)===eo.cwd())return 10}else if(eo.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?eo.isLink(e.mode)?32:eo.isDir(e.mode)&&("r"!==eo.flagsToPermissionString(r)||512&r)?31:eo.nodePermissions(e,eo.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=eo.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!eo.streams[t])return t;throw new eo.ErrnoError(33)},getStream:e=>eo.streams[e],createStream:(e,r,t)=>{eo.FSStream||(eo.FSStream=function(){this.shared={}},eo.FSStream.prototype={},Object.defineProperties(eo.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new eo.FSStream,e);var n=eo.nextfd(r,t);return e.fd=n,eo.streams[n]=e,e},closeStream:e=>{eo.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=eo.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new eo.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{eo.devices[e]={stream_ops:r}},getDevice:e=>eo.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),eo.syncFSRequests++,eo.syncFSRequests>1&&F("warning: "+eo.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=eo.getMounts(eo.root.mount),n=0;function o(e){return eo.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount:(e,r,t)=>{var n,o="/"===t,a=!t;if(o&&eo.root)throw new eo.ErrnoError(10);if(!o&&!a){var i=eo.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,eo.isMountpoint(n))throw new eo.ErrnoError(10);if(!eo.isDir(n.mode))throw new eo.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?eo.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=eo.lookupPath(e,{follow_mount:!1});if(!eo.isMountpoint(r.node))throw new eo.ErrnoError(28);var t=r.node,n=t.mounted,o=eo.getMounts(n);Object.keys(eo.nameTable).forEach(e=>{for(var r=eo.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&eo.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=eo.lookupPath(e,{parent:!0}).node,o=Q.basename(e);if(!o||"."===o||".."===o)throw new eo.ErrnoError(28);var a=eo.mayCreate(n,o);if(a)throw new eo.ErrnoError(a);if(!n.node_ops.mknod)throw new eo.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=(void 0!==r?r:438)&4095|32768,eo.mknod(e,r,0)),mkdir:(e,r)=>(r=(void 0!==r?r:511)&1023|16384,eo.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,eo.mknod(e,r,t)),symlink:(e,r)=>{if(!ee.resolve(e))throw new eo.ErrnoError(44);var t=eo.lookupPath(r,{parent:!0}).node;if(!t)throw new eo.ErrnoError(44);var n=Q.basename(r),o=eo.mayCreate(t,n);if(o)throw new eo.ErrnoError(o);if(!t.node_ops.symlink)throw new eo.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o,a=Q.dirname(e),i=Q.dirname(r),s=Q.basename(e),u=Q.basename(r);if(t=eo.lookupPath(e,{parent:!0}).node,n=eo.lookupPath(r,{parent:!0}).node,!t||!n)throw new eo.ErrnoError(44);if(t.mount!==n.mount)throw new eo.ErrnoError(75);var l=eo.lookupNode(t,s),c=ee.relative(e,i);if("."!==c.charAt(0))throw new eo.ErrnoError(28);if("."!==(c=ee.relative(r,a)).charAt(0))throw new eo.ErrnoError(55);try{o=eo.lookupNode(n,u)}catch(e){}if(l!==o){var d=eo.isDir(l.mode),f=eo.mayDelete(t,s,d);if(f||(f=o?eo.mayDelete(n,u,d):eo.mayCreate(n,u)))throw new eo.ErrnoError(f);if(!t.node_ops.rename)throw new eo.ErrnoError(63);if(eo.isMountpoint(l)||o&&eo.isMountpoint(o))throw new eo.ErrnoError(10);if(n!==t&&(f=eo.nodePermissions(t,"w")))throw new eo.ErrnoError(f);eo.hashRemoveNode(l);try{t.node_ops.rename(l,n,u)}catch(e){throw e}finally{eo.hashAddNode(l)}}},rmdir:e=>{var r=eo.lookupPath(e,{parent:!0}).node,t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!0);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.rmdir)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.rmdir(r,t),eo.destroyNode(n)},readdir:e=>{var r=eo.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new eo.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=eo.lookupPath(e,{parent:!0}).node;if(!r)throw new eo.ErrnoError(44);var t=Q.basename(e),n=eo.lookupNode(r,t),o=eo.mayDelete(r,t,!1);if(o)throw new eo.ErrnoError(o);if(!r.node_ops.unlink)throw new eo.ErrnoError(63);if(eo.isMountpoint(n))throw new eo.ErrnoError(10);r.node_ops.unlink(r,t),eo.destroyNode(n)},readlink:e=>{var r=eo.lookupPath(e).node;if(!r)throw new eo.ErrnoError(44);if(!r.node_ops.readlink)throw new eo.ErrnoError(28);return ee.resolve(eo.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=eo.lookupPath(e,{follow:!r}).node;if(!t)throw new eo.ErrnoError(44);if(!t.node_ops.getattr)throw new eo.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>eo.stat(e,!0),chmod:(e,r,t)=>{var n;if(!(n="string"==typeof e?eo.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{eo.chmod(e,r,!0)},fchmod:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);eo.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;if(!(o="string"==typeof e?eo.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new eo.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{eo.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=eo.getStream(e);if(!n)throw new eo.ErrnoError(8);eo.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new eo.ErrnoError(28);if("string"==typeof e){var t;t=eo.lookupPath(e,{follow:!0}).node}else t=e;if(!t.node_ops.setattr)throw new eo.ErrnoError(63);if(eo.isDir(t.mode))throw new eo.ErrnoError(31);if(!eo.isFile(t.mode))throw new eo.ErrnoError(28);var n=eo.nodePermissions(t,"w");if(n)throw new eo.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=eo.getStream(e);if(!t)throw new eo.ErrnoError(8);if((2097155&t.flags)==0)throw new eo.ErrnoError(28);eo.truncate(t.node,r)},utime:(e,r,t)=>{var n=eo.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,t,n)=>{if(""===e)throw new eo.ErrnoError(44);if(t="string"==typeof t?eo.modeStringToFlags(t):t,n=void 0===n?438:n,n=64&t?4095&n|32768:0,"object"==typeof e)o=e;else{e=Q.normalize(e);try{var o;o=eo.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t){if(o){if(128&t)throw new eo.ErrnoError(20)}else o=eo.mknod(e,n,0),a=!0}if(!o)throw new eo.ErrnoError(44);if(eo.isChrdev(o.mode)&&(t&=-513),65536&t&&!eo.isDir(o.mode))throw new eo.ErrnoError(54);if(!a){var i=eo.mayOpen(o,t);if(i)throw new eo.ErrnoError(i)}512&t&&!a&&eo.truncate(o,0),t&=-131713;var s=eo.createStream({node:o,path:eo.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!r.logReadFiles||1&t||(eo.readFiles||(eo.readFiles={}),e in eo.readFiles||(eo.readFiles[e]=1)),s},close:e=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{eo.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new eo.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new eo.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==1)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.read)throw new eo.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new eo.ErrnoError(28);if(eo.isClosed(e)||(2097155&e.flags)==0)throw new eo.ErrnoError(8);if(eo.isDir(e.node.mode))throw new eo.ErrnoError(31);if(!e.stream_ops.write)throw new eo.ErrnoError(28);e.seekable&&1024&e.flags&&eo.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new eo.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(eo.isClosed(e))throw new eo.ErrnoError(8);if(r<0||t<=0)throw new eo.ErrnoError(28);if((2097155&e.flags)==0)throw new eo.ErrnoError(8);if(!eo.isFile(e.node.mode)&&!eo.isDir(e.node.mode))throw new eo.ErrnoError(43);if(!e.stream_ops.allocate)throw new eo.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if((2&n)!=0&&(2&o)==0&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new eo.ErrnoError(2);if(!e.stream_ops.mmap)throw new eo.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new eo.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw Error('Invalid encoding type "'+r.encoding+'"');var t,n=eo.open(e,r.flags),o=eo.stat(e).size,a=new Uint8Array(o);return eo.read(n,a,0,o,0),"utf8"===r.encoding?t=x(a,0):"binary"===r.encoding&&(t=a),eo.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=eo.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(T(r)+1),a=C(r,o,0,o.length);eo.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))eo.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw Error("Unsupported data type");eo.close(n)},cwd:()=>eo.currentPath,chdir:e=>{var r=eo.lookupPath(e,{follow:!0});if(null===r.node)throw new eo.ErrnoError(44);if(!eo.isDir(r.node.mode))throw new eo.ErrnoError(54);var t=eo.nodePermissions(r.node,"x");if(t)throw new eo.ErrnoError(t);eo.currentPath=r.path},createDefaultDirectories:()=>{eo.mkdir("/tmp"),eo.mkdir("/home"),eo.mkdir("/home/web_user")},createDefaultDevices:()=>{eo.mkdir("/dev"),eo.registerDevice(eo.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),eo.mkdev("/dev/null",eo.makedev(1,3)),et.register(eo.makedev(5,0),et.default_tty_ops),et.register(eo.makedev(6,0),et.default_tty1_ops),eo.mkdev("/dev/tty",eo.makedev(5,0)),eo.mkdev("/dev/tty1",eo.makedev(6,0));var e=function(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return()=>V("randomDevice");var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}();eo.createDevice("/dev","random",e),eo.createDevice("/dev","urandom",e),eo.mkdir("/dev/shm"),eo.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{eo.mkdir("/proc");var e=eo.mkdir("/proc/self");eo.mkdir("/proc/self/fd"),eo.mount({mount:()=>{var r=eo.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=eo.getStream(+r);if(!t)throw new eo.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>t.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{r.stdin?eo.createDevice("/dev","stdin",r.stdin):eo.symlink("/dev/tty","/dev/stdin"),r.stdout?eo.createDevice("/dev","stdout",null,r.stdout):eo.symlink("/dev/tty","/dev/stdout"),r.stderr?eo.createDevice("/dev","stderr",null,r.stderr):eo.symlink("/dev/tty1","/dev/stderr"),eo.open("/dev/stdin",0),eo.open("/dev/stdout",1),eo.open("/dev/stderr",1)},ensureErrnoError:()=>{eo.ErrnoError||(eo.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},eo.ErrnoError.prototype=Error(),eo.ErrnoError.prototype.constructor=eo.ErrnoError,[44].forEach(e=>{eo.genericErrors[e]=new eo.ErrnoError(e),eo.genericErrors[e].stack=""}))},staticInit:()=>{eo.ensureErrnoError(),eo.nameTable=Array(4096),eo.mount(en,{},"/"),eo.createDefaultDirectories(),eo.createDefaultDevices(),eo.createSpecialDirectories(),eo.filesystems={MEMFS:en}},init:(e,t,n)=>{eo.init.initialized=!0,eo.ensureErrnoError(),r.stdin=e||r.stdin,r.stdout=t||r.stdout,r.stderr=n||r.stderr,eo.createStandardStreams()},quit:()=>{eo.init.initialized=!1,ek(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=eo.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{var t=eo.lookupPath(e,{follow:!r});e=t.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=eo.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Q.basename(e),t=eo.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(e){n.error=e.errno}return n},createPath:(e,r,t,n)=>{e="string"==typeof e?e:eo.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Q.join2(e,a);try{eo.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=Q.join2("string"==typeof e?e:eo.getPath(e),r),i=eo.getMode(n,o);return eo.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:eo.getPath(e),i=r?Q.join2(e,r):e);var s=eo.getMode(n,o),u=eo.create(i,s);if(t){if("string"==typeof t){for(var l=Array(t.length),c=0,d=t.length;c{var o=Q.join2("string"==typeof e?e:eo.getPath(e),r),a=eo.getMode(!!t,!!n);eo.createDevice.major||(eo.createDevice.major=64);var i=eo.makedev(eo.createDevice.major++,0);return eo.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i,s=0,u=0;u{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(a)try{e.contents=er(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new eo.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1)&&!(e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e,r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw Error("Couldn't load "+t+". Status: "+r.status);var n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):er(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw Error("doXHR failed!");return u.chunks[e]}),(a||!n)&&(i=n=1,i=n=this.getter(0).length,D("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i;throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"}var i={isDevice:!1,url:t},s=eo.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=s.stream_ops[e];u[e]=function(){return eo.forceLoadFile(s),r.apply(null,arguments)}}),u.read=(e,r,t,n,o)=>(eo.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{eo.forceLoadFile(s);var a=void V();if(!a)throw new eo.ErrnoError(48);return l(e,d,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(e,r,t,n,o,a,s,u,l,c)=>{var d,f,m=r?ee.resolve(Q.join2(e,r)):e,h="cp "+m;function p(t){function i(t){c&&c(),u||eo.createDataFile(e,r,t,n,o,l),a&&a(),G(h)}Browser.handledByPreloadPlugin(t,m,i,()=>{s&&s(),G(h)})||i(t)}Y(h),"string"==typeof t?(d=e=>p(e),f="al "+t,i(t,e=>{var r;r='Loading data file "'+t+'" failed (no arrayBuffer).',e||V(r),d(new Uint8Array(e)),f&&G(f)},e=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),f&&Y(f)):p(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{D("creating db"),o.result.createObjectStore(eo.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([eo.DB_STORE_NAME],"readwrite"),a=n.objectStore(eo.DB_STORE_NAME),i=0,s=0,u=e.length;function l(){0==s?r():t()}e.forEach(e=>{var r=a.put(eo.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&l()},r.onerror=()=>{i+ ++s==u&&l()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r=()=>{},t=()=>{})=>{var n=eo.indexedDB();try{var o=n.open(eo.DB_NAME(),eo.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([eo.DB_STORE_NAME],"readonly")}catch(e){t(e);return}var i=a.objectStore(eo.DB_STORE_NAME),s=0,u=0,l=e.length;function c(){0==u?r():t()}e.forEach(e=>{var r=i.get(e);r.onsuccess=()=>{eo.analyzePath(e).exists&&eo.unlink(e),eo.createDataFile(Q.dirname(e),Q.basename(e),r.result,!0,!0,!0),++s+u==l&&c()},r.onerror=()=>{s+ ++u==l&&c()}}),a.onerror=t},o.onerror=t}},ea={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(Q.isAbs(r))return r;if(-100===e)n=eo.cwd();else{var n;n=ea.getStreamFromFD(e).path}if(0==r.length){if(!t)throw new eo.ErrnoError(44);return n}return Q.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Q.normalize(r)!==Q.normalize(eo.getPath(e.node)))return -54;throw e}h[t>>2]=n.dev,h[t+8>>2]=n.ino,h[t+12>>2]=n.mode,p[t+16>>2]=n.nlink,h[t+20>>2]=n.uid,h[t+24>>2]=n.gid,h[t+28>>2]=n.rdev,g=[n.size>>>0,+Math.abs(w=n.size)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+40>>2]=g[0],h[t+44>>2]=g[1],h[t+48>>2]=4096,h[t+52>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return g=[Math.floor(o/1e3)>>>0,+Math.abs(w=Math.floor(o/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+56>>2]=g[0],h[t+60>>2]=g[1],p[t+64>>2]=o%1e3*1e3,g=[Math.floor(a/1e3)>>>0,+Math.abs(w=Math.floor(a/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+72>>2]=g[0],h[t+76>>2]=g[1],p[t+80>>2]=a%1e3*1e3,g=[Math.floor(i/1e3)>>>0,+Math.abs(w=Math.floor(i/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+88>>2]=g[0],h[t+92>>2]=g[1],p[t+96>>2]=i%1e3*1e3,g=[n.ino>>>0,+Math.abs(w=n.ino)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+104>>2]=g[0],h[t+108>>2]=g[1],0},doMsync:function(e,r,t,n,o){if(!eo.isFile(r.node.mode))throw new eo.ErrnoError(43);if(2&n)return 0;var a=f.slice(e,e+t);eo.msync(r,a,o,t,n)},varargs:void 0,get:function(){return ea.varargs+=4,h[ea.varargs-4>>2]},getStr:function(e){return R(e)},getStreamFromFD:function(e){var r=eo.getStream(e);if(!r)throw new eo.ErrnoError(8);return r}};function ei(e){return p[e>>2]+4294967296*h[e+4>>2]}function es(e){return e%4==0&&(e%100!=0||e%400==0)}var eu=[0,31,60,91,121,152,182,213,244,274,305,335],el=[0,31,59,90,120,151,181,212,243,273,304,334];function ec(e){var r=T(e)+1,t=eE(r);return t&&C(e,d,t,r),t}var ed={};function ef(){if(!ef.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(var r in ed)void 0===ed[r]?delete e[r]:e[r]=ed[r];var t=[];for(var r in e)t.push(r+"="+e[r]);ef.strings=t}return ef.strings}function em(e,t){c=e,M||U>0||(eF(),Z(j),eo.quit(),et.shutdown(),L=!0),c=e,M||U>0||(r.onExit&&r.onExit(e),P=!0),k(e,new J(e))}var eh=[31,29,31,30,31,30,31,31,30,31,30,31],ep=[31,28,31,30,31,30,31,31,30,31,30,31];function ev(e){if(e instanceof J||"unwind"==e)return c;k(1,e)}function ew(e){try{return e()}catch(e){V(e)}}var eg={instrumentWasmImports:function(e){var r=["invoke_*","emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","SDL_Delay","emscripten_scan_registers","emscripten_lazy_load_code","emscripten_fiber_swap","__load_secondary_module","fd_sync","__wasi_fd_sync","_emval_await","_dlopen_js","__asyncjs__*"];for(var t in e)!function(t){var n=e[t];n.sig,"function"==typeof n&&(r.indexOf(t)>=0||t.startsWith("__asyncjs__"))}(t)},instrumentWasmExports:function(e){var r={};for(var t in e)!function(t){var n=e[t];"function"==typeof n?r[t]=function(){eg.exportCallStack.push(t);try{return n.apply(null,arguments)}finally{P||(eg.exportCallStack.pop()===t||V(void 0),eg.maybeStopUnwind())}}:r[t]=n}(t);return r},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:8192,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(e){var r=eg.callStackNameToId[e];return void 0===r&&(r=eg.callStackId++,eg.callStackNameToId[e]=r,eg.callStackIdToName[r]=e),r},maybeStopUnwind:function(){eg.currData&&eg.state===eg.State.Unwinding&&0===eg.exportCallStack.length&&(eg.state=eg.State.Normal,U+=1,ew(e3),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:function(){return new Promise((e,r)=>{eg.asyncPromiseHandlers={resolve:e,reject:r}})},allocateData:function(){var e=eE(12+eg.StackSize);return eg.setDataHeader(e,e+12,eg.StackSize),eg.setDataRewindFunc(e),e},setDataHeader:function(e,r,t){h[e>>2]=r,h[e+4>>2]=r+t},setDataRewindFunc:function(e){var r=eg.exportCallStack[0],t=eg.getCallStackId(r);h[e+8>>2]=t},getDataRewindFunc:function(e){var t=h[e+8>>2],n=eg.callStackIdToName[t];return r.asm[n]},doRewind:function(e){var r=eg.getDataRewindFunc(e);return U-=1,r()},handleSleep:function(e){if(!P){if(eg.state===eg.State.Normal){var r=!1,t=!1;e((e=0)=>{if(!P&&(eg.handleSleepReturnValue=e,r=!0,t)){eg.state=eg.State.Rewinding,ew(()=>e9(eg.currData)),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=eg.doRewind(eg.currData)}catch(e){n=e,o=!0}var a=!1;if(!eg.currData){var i=eg.asyncPromiseHandlers;i&&(eg.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}}),t=!0,r||(eg.state=eg.State.Unwinding,eg.currData=eg.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),ew(()=>e6(eg.currData)))}else eg.state===eg.State.Rewinding?(eg.state=eg.State.Normal,ew(e8),eb(eg.currData),eg.currData=null,eg.sleepCallbacks.forEach(e=>(function(e){if(!L&&!P)try{e(),function(){if(!(M||U>0))try{em(c)}catch(e){ev(e)}}()}catch(e){ev(e)}})(e))):V("invalid state: "+eg.state);return eg.handleSleepReturnValue}},handleAsync:function(e){return eg.handleSleep(r=>{e().then(r)})}},e_=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=eo.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(e_.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return eo.isDir(this.mode)}},isDevice:{get:function(){return eo.isChrdev(this.mode)}}}),eo.FSNode=e_,eo.staticInit();var ey={O:function(e,t){return eg.handleAsync(async()=>{r.emglken_stdin_buffers.length||await new Promise(e=>{r.emglken_stdin_ready=e});let n=r.emglken_stdin_buffers.shift(),o=Math.min(n.length,t);return o==n.length?f.set(n,e):(f.set(n.subarray(0,o),e),r.emglken_stdin_buffers.unshift(n.subarray(o))),o})},ga:function(e){try{var r=ea.getStreamFromFD(e);return eo.createStream(r,0).fd}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,r,t,n){try{if(r=ea.getStr(r),r=ea.calculateAt(e,r),-8&t)return -28;var o=eo.lookupPath(r,{follow:!0}).node;if(!o)return -44;var a="";if(4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&eo.nodePermissions(o,a))return -2;return 0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},G:function(e,r,t){ea.varargs=t;try{var n=ea.getStreamFromFD(e);switch(r){case 0:var o=ea.get();if(o<0)return -28;return eo.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ea.get();return n.flags|=o,0;case 5:var o=ea.get();return m[o+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return h[eD()>>2]=28,-1}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},ea:function(e,r){try{if(0===r)return -28;var t=eo.cwd(),n=T(t)+1;if(r>>0,(w=u,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[r+o>>2]=g[0],h[r+o+4>>2]=g[1],g=[(i+1)*280>>>0,(w=(i+1)*280,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[r+o+8>>2]=g[0],h[r+o+12>>2]=g[1],m[r+o+16>>1]=280,d[r+o+18>>0]=l,s=r+o+19,C(c,f,s,256),o+=280,i+=1}return eo.llseek(n,280*i,0),o}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},ca:function(e,r,t){ea.varargs=t;try{var n=ea.getStreamFromFD(e);switch(r){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:if(!n.tty)return -59;return 0;case 21519:if(!n.tty)return -59;var o=ea.get();return h[o>>2]=0,0;case 21520:if(!n.tty)return -59;return -28;case 21531:var o=ea.get();return eo.ioctl(n,r,o);default:return -28}}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},ba:function(e,r){try{return e=ea.getStr(e),ea.doStat(eo.lstat,e,r)}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},aa:function(e,r,t){try{return r=ea.getStr(r),r=ea.calculateAt(e,r),r=Q.normalize(r),"/"===r[r.length-1]&&(r=r.substr(0,r.length-1)),eo.mkdir(r,t,0),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},$:function(e,r,t,n){try{r=ea.getStr(r);var o=256&n,a=4096&n;return n&=-6401,r=ea.calculateAt(e,r,a),ea.doStat(o?eo.lstat:eo.stat,r,t)}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},F:function(e,r,t,n){ea.varargs=n;try{r=ea.getStr(r),r=ea.calculateAt(e,r);var o=n?ea.get():0;return eo.open(r,t,o).fd}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},_:function(e,r,t,n){try{if(r=ea.getStr(r),r=ea.calculateAt(e,r),n<=0)return -28;var o=eo.readlink(r),a=Math.min(n,T(o)),i=d[t+a];return C(o,f,t,n+1),d[t+a]=i,a}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},Z:function(e,r,t,n){try{return r=ea.getStr(r),n=ea.getStr(n),r=ea.calculateAt(e,r),n=ea.calculateAt(t,n),eo.rename(r,n),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},E:function(e){try{return e=ea.getStr(e),eo.rmdir(e),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},Y:function(e,r){try{return e=ea.getStr(e),ea.doStat(eo.stat,e,r)}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},X:function(e,r,t){try{return r=ea.getStr(r),r=ea.calculateAt(e,r),0===t?eo.unlink(r):512===t?eo.rmdir(r):V("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return-e.errno}},T:function(){return!0},S:function(){throw 1/0},R:function(e,r){var t=new Date(1e3*ei(e));h[r>>2]=t.getUTCSeconds(),h[r+4>>2]=t.getUTCMinutes(),h[r+8>>2]=t.getUTCHours(),h[r+12>>2]=t.getUTCDate(),h[r+16>>2]=t.getUTCMonth(),h[r+20>>2]=t.getUTCFullYear()-1900,h[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;h[r+28>>2]=o},Q:function(e,r){var t=new Date(1e3*ei(e));h[r>>2]=t.getSeconds(),h[r+4>>2]=t.getMinutes(),h[r+8>>2]=t.getHours(),h[r+12>>2]=t.getDate(),h[r+16>>2]=t.getMonth(),h[r+20>>2]=t.getFullYear()-1900,h[r+24>>2]=t.getDay();var n=0|(es(t.getFullYear())?eu:el)[t.getMonth()]+t.getDate()-1;h[r+28>>2]=n,h[r+36>>2]=-(60*t.getTimezoneOffset());var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&t.getTimezoneOffset()==Math.min(i,a));h[r+32>>2]=s},P:function(e,r,t){var n=new Date().getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset();function u(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}p[e>>2]=60*Math.max(i,s),h[r>>2]=Number(i!=s);var l=u(o),c=u(a),d=ec(l),f=ec(c);s>2]=d,p[t+4>>2]=f):(p[t>>2]=f,p[t+4>>2]=d)},C:function(){V("")},B:function(){return Date.now()},A:()=>performance.now(),N:function(e,r,t){f.copyWithin(e,r,r+t)},M:function(e){var r=f.length;if((e>>>=0)>2147483648)return!1;let t=(e,r)=>e+(r-e%r)%r;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),function(e){var r=l.buffer;try{return l.grow(e-r.byteLength+65535>>>16),N(),1}catch(e){}}(Math.min(2147483648,t(Math.max(e,o),65536))))return!0}return!1},W:function(e,r){var t=0;return ef().forEach(function(n,o){var a=r+t;p[e+4*o>>2]=a,function(e,r,t){for(var n=0;n>0]=e.charCodeAt(n);d[r>>0]=0}(n,a),t+=n.length+1}),0},V:function(e,r){var t=ef();p[e>>2]=t.length;var n=0;return t.forEach(function(e){n+=e.length+1}),p[r>>2]=n,0},y:em,w:function(e){try{var r=ea.getStreamFromFD(e);return eo.close(r),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},U:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.read(e,d,i,s,n);if(u<0)return -1;if(o+=u,u>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},I:function(e,r,t,n,o){try{var a=t+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*t:NaN;if(isNaN(a))return 61;var i=ea.getStreamFromFD(e);return eo.llseek(i,a,n),g=[i.position>>>0,(w=i.position,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[o>>2]=g[0],h[o+4>>2]=g[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},D:function(e,r,t,n){try{var o=ea.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=eo.write(e,d,i,s,n);if(u<0)return -1;o+=u,void 0!==n&&(n+=u)}return o}(o,r,t);return p[n>>2]=a,0}catch(e){if(void 0===eo||"ErrnoError"!==e.name)throw e;return e.errno}},L:function(e){var r=eP();try{return e1(e)}catch(e){if(eA(r),e!==e+0)throw e;eM(1,0)}},b:function(e,r){var t=eP();try{return eC(e,r)}catch(e){if(eA(t),e!==e+0)throw e;eM(1,0)}},f:function(e,r,t){var n=eP();try{return eN(e,r,t)}catch(e){if(eA(n),e!==e+0)throw e;eM(1,0)}},e:function(e,r,t,n){var o=eP();try{return eH(e,r,t,n)}catch(e){if(eA(o),e!==e+0)throw e;eM(1,0)}},c:function(e,r,t,n,o){var a=eP();try{return eR(e,r,t,n,o)}catch(e){if(eA(a),e!==e+0)throw e;eM(1,0)}},j:function(e,r,t,n,o,a){var i=eP();try{return eI(e,r,t,n,o,a)}catch(e){if(eA(i),e!==e+0)throw e;eM(1,0)}},l:function(e,r,t,n,o,a,i){var s=eP();try{return eY(e,r,t,n,o,a,i)}catch(e){if(eA(s),e!==e+0)throw e;eM(1,0)}},m:function(e,r,t,n,o,a,i,s){var u=eP();try{return eX(e,r,t,n,o,a,i,s)}catch(e){if(eA(u),e!==e+0)throw e;eM(1,0)}},s:function(e,r,t,n,o,a,i,s,u){var l=eP();try{return eU(e,r,t,n,o,a,i,s,u)}catch(e){if(eA(l),e!==e+0)throw e;eM(1,0)}},t:function(e,r,t,n,o,a,i,s,u,l){var c=eP();try{return eV(e,r,t,n,o,a,i,s,u,l)}catch(e){if(eA(c),e!==e+0)throw e;eM(1,0)}},p:function(e,r,t,n,o,a,i,s,u,l,c){var d=eP();try{return eK(e,r,t,n,o,a,i,s,u,l,c)}catch(e){if(eA(d),e!==e+0)throw e;eM(1,0)}},x:function(e,r,t,n,o,a,i,s,u,l,c,d){var f=eP();try{return e2(e,r,t,n,o,a,i,s,u,l,c,d)}catch(e){if(eA(f),e!==e+0)throw e;eM(1,0)}},q:function(e,r,t,n,o,a,i,s,u,l,c,d,f,m){var h=eP();try{return e$(e,r,t,n,o,a,i,s,u,l,c,d,f,m)}catch(e){if(eA(h),e!==e+0)throw e;eM(1,0)}},z:function(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p){var v=eP();try{return e4(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p)}catch(e){if(eA(v),e!==e+0)throw e;eM(1,0)}},v:function(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w){var g=eP();try{return eZ(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w)}catch(e){if(eA(g),e!==e+0)throw e;eM(1,0)}},i:function(e){var r=eP();try{eJ(e)}catch(e){if(eA(r),e!==e+0)throw e;eM(1,0)}},h:function(e,r){var t=eP();try{eT(e,r)}catch(e){if(eA(t),e!==e+0)throw e;eM(1,0)}},d:function(e,r,t){var n=eP();try{eO(e,r,t)}catch(e){if(eA(n),e!==e+0)throw e;eM(1,0)}},a:function(e,r,t,n){var o=eP();try{ez(e,r,t,n)}catch(e){if(eA(o),e!==e+0)throw e;eM(1,0)}},g:function(e,r,t,n,o){var a=eP();try{eq(e,r,t,n,o)}catch(e){if(eA(a),e!==e+0)throw e;eM(1,0)}},o:function(e,r,t,n,o,a){var i=eP();try{ej(e,r,t,n,o,a)}catch(e){if(eA(i),e!==e+0)throw e;eM(1,0)}},n:function(e,r,t,n,o,a,i){var s=eP();try{eL(e,r,t,n,o,a,i)}catch(e){if(eA(s),e!==e+0)throw e;eM(1,0)}},K:function(e,r,t,n,o,a,i,s){var u=eP();try{eQ(e,r,t,n,o,a,i,s)}catch(e){if(eA(u),e!==e+0)throw e;eM(1,0)}},r:function(e,r,t,n,o,a,i,s,u){var l=eP();try{eB(e,r,t,n,o,a,i,s,u)}catch(e){if(eA(l),e!==e+0)throw e;eM(1,0)}},k:function(e,r,t,n,o,a,i,s,u,l){var c=eP();try{eW(e,r,t,n,o,a,i,s,u,l)}catch(e){if(eA(c),e!==e+0)throw e;eM(1,0)}},u:function(e,r,t,n,o,a,i,s,u,l,c,d){var f=eP();try{eG(e,r,t,n,o,a,i,s,u,l,c,d)}catch(e){if(eA(f),e!==e+0)throw e;eM(1,0)}},J:function(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p){var v=eP();try{e0(e,r,t,n,o,a,i,s,u,l,c,d,f,m,h,p)}catch(e){if(eA(v),e!==e+0)throw e;eM(1,0)}},H:function(e,r,t,n){var o=h[n+40>>2],a={tm_sec:h[n>>2],tm_min:h[n+4>>2],tm_hour:h[n+8>>2],tm_mday:h[n+12>>2],tm_mon:h[n+16>>2],tm_year:h[n+20>>2],tm_wday:h[n+24>>2],tm_yday:h[n+28>>2],tm_isdst:h[n+32>>2],tm_gmtoff:h[n+36>>2],tm_zone:o?R(o):""},i=R(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}return 0===(t=n(e.getFullYear()-r.getFullYear()))&&0===(t=n(e.getMonth()-r.getMonth()))&&(t=n(e.getDate()-r.getDate())),t}function v(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function w(e){var r=function(e,r){for(var t=new Date(e.getTime());r>0;){var n=es(t.getFullYear()),o=t.getMonth(),a=(n?eh:ep)[o];if(r>a-t.getDate())r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else{t.setDate(t.getDate()+r);break}}return t}(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=v(t),a=v(n);return 0>=p(o,r)?0>=p(a,r)?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var g={"%a":function(e){return l[e.tm_wday].substring(0,3)},"%A":function(e){return l[e.tm_wday]},"%b":function(e){return c[e.tm_mon].substring(0,3)},"%B":function(e){return c[e.tm_mon]},"%C":function(e){return m((e.tm_year+1900)/100|0,2)},"%d":function(e){return m(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return w(e).toString().substring(2)},"%G":function(e){return w(e)},"%H":function(e){return m(e.tm_hour,2)},"%I":function(e){var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":function(e){return m(e.tm_mday+function(e,r){for(var t=0,n=0;n<=r;t+=e[n++]);return t}(es(e.tm_year+1900)?eh:ep,e.tm_mon-1),3)},"%m":function(e){return m(e.tm_mon+1,2)},"%M":function(e){return m(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return m(e.tm_sec,2)},"%t":function(){return" "},"%u":function(e){return e.tm_wday||7},"%U":function(e){return m(Math.floor((e.tm_yday+7-e.tm_wday)/7),2)},"%V":function(e){var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&es(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&es(e.tm_year%400-1))&&r++}return m(r,2)},"%w":function(e){return e.tm_wday},"%W":function(e){return m(Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var r=e.tm_gmtoff;return(r>=0?"+":"-")+String("0000"+(r=(r=Math.abs(r)/60)/60*100+r%60)).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\x00\x00"),g)i.includes(u)&&(i=i.replace(RegExp(u,"g"),g[u](a)));var _=er(i=i.replace(/\0\0/g,"%"),!1);return _.length>r?0:(d.set(_,e),_.length-1)}};!function(){var e,t,n,a={a:ey};function i(e,t){var n,o=e.exports;return o=eg.instrumentWasmExports(o),r.asm=o,l=r.asm.ha,N(),r.asm.qa,n=r.asm.ia,B.unshift(n),G("wasm-instantiate"),o}if(Y("wasm-instantiate"),r.instantiateWasm)try{return r.instantiateWasm(a,i)}catch(e){F("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=u,t=v,n=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||X(t)||"function"!=typeof fetch?$(t,a,n):fetch(t,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return F("wasm streaming compile failed: "+e),F("falling back to ArrayBuffer instantiation"),$(t,a,n)})})).catch(o)}();var eE=function(){return(eE=r.asm.ja).apply(null,arguments)},eb=function(){return(eb=r.asm.ka).apply(null,arguments)},ek=r._fflush=function(){return(ek=r._fflush=r.asm.la).apply(null,arguments)},eS=r._main=function(){return(eS=r._main=r.asm.ma).apply(null,arguments)},eD=(r._gidispatch_get_game_id=function(){return(r._gidispatch_get_game_id=r.asm.na).apply(null,arguments)},function(){return(eD=r.asm.oa).apply(null,arguments)}),eF=function(){return(eF=r.asm.pa).apply(null,arguments)},eM=function(){return(eM=r.asm.ra).apply(null,arguments)},eP=function(){return(eP=r.asm.sa).apply(null,arguments)},eA=function(){return(eA=r.asm.ta).apply(null,arguments)},ex=function(){return(ex=r.asm.ua).apply(null,arguments)},eR=r.dynCall_iiiii=function(){return(eR=r.dynCall_iiiii=r.asm.va).apply(null,arguments)},eC=r.dynCall_ii=function(){return(eC=r.dynCall_ii=r.asm.wa).apply(null,arguments)},eT=r.dynCall_vi=function(){return(eT=r.dynCall_vi=r.asm.xa).apply(null,arguments)},eN=r.dynCall_iii=function(){return(eN=r.dynCall_iii=r.asm.ya).apply(null,arguments)},ez=r.dynCall_viii=function(){return(ez=r.dynCall_viii=r.asm.za).apply(null,arguments)},eB=r.dynCall_viiiiiiii=function(){return(eB=r.dynCall_viiiiiiii=r.asm.Aa).apply(null,arguments)},eO=r.dynCall_vii=function(){return(eO=r.dynCall_vii=r.asm.Ba).apply(null,arguments)},ej=r.dynCall_viiiii=function(){return(ej=r.dynCall_viiiii=r.asm.Ca).apply(null,arguments)},eI=r.dynCall_iiiiii=function(){return(eI=r.dynCall_iiiiii=r.asm.Da).apply(null,arguments)},eL=r.dynCall_viiiiii=function(){return(eL=r.dynCall_viiiiii=r.asm.Ea).apply(null,arguments)},eU=r.dynCall_iiiiiiiii=function(){return(eU=r.dynCall_iiiiiiiii=r.asm.Fa).apply(null,arguments)},eH=r.dynCall_iiii=function(){return(eH=r.dynCall_iiii=r.asm.Ga).apply(null,arguments)},eW=r.dynCall_viiiiiiiii=function(){return(eW=r.dynCall_viiiiiiiii=r.asm.Ha).apply(null,arguments)},eq=r.dynCall_viiii=function(){return(eq=r.dynCall_viiii=r.asm.Ia).apply(null,arguments)},eY=r.dynCall_iiiiiii=function(){return(eY=r.dynCall_iiiiiii=r.asm.Ja).apply(null,arguments)},eG=r.dynCall_viiiiiiiiiii=function(){return(eG=r.dynCall_viiiiiiiiiii=r.asm.Ka).apply(null,arguments)},eV=r.dynCall_iiiiiiiiii=function(){return(eV=r.dynCall_iiiiiiiiii=r.asm.La).apply(null,arguments)},eX=r.dynCall_iiiiiiii=function(){return(eX=r.dynCall_iiiiiiii=r.asm.Ma).apply(null,arguments)},eK=r.dynCall_iiiiiiiiiii=function(){return(eK=r.dynCall_iiiiiiiiiii=r.asm.Na).apply(null,arguments)},e$=r.dynCall_iiiiiiiiiiiiii=function(){return(e$=r.dynCall_iiiiiiiiiiiiii=r.asm.Oa).apply(null,arguments)},eJ=r.dynCall_v=function(){return(eJ=r.dynCall_v=r.asm.Pa).apply(null,arguments)},eZ=r.dynCall_iiiiiiiiiiiiiiiiii=function(){return(eZ=r.dynCall_iiiiiiiiiiiiiiiiii=r.asm.Qa).apply(null,arguments)},eQ=r.dynCall_viiiiiii=function(){return(eQ=r.dynCall_viiiiiii=r.asm.Ra).apply(null,arguments)},e0=r.dynCall_viiiiiiiiiiiiiii=function(){return(e0=r.dynCall_viiiiiiiiiiiiiii=r.asm.Sa).apply(null,arguments)},e1=r.dynCall_i=function(){return(e1=r.dynCall_i=r.asm.Ta).apply(null,arguments)},e2=r.dynCall_iiiiiiiiiiii=function(){return(e2=r.dynCall_iiiiiiiiiiii=r.asm.Ua).apply(null,arguments)},e4=r.dynCall_iiiiiiiiiiiiiiii=function(){return(e4=r.dynCall_iiiiiiiiiiiiiiii=r.asm.Va).apply(null,arguments)},e6=function(){return(e6=r.asm.Wa).apply(null,arguments)},e3=function(){return(e3=r.asm.Xa).apply(null,arguments)},e9=function(){return(e9=r.asm.Ya).apply(null,arguments)},e8=function(){return(e8=r.asm.Za).apply(null,arguments)};function e5(e=E){!(H>0)&&(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),z.unshift(e)}Z(z)}(),H>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()));function t(){!_&&(_=!0,r.calledRun=!0,P||(r.noFSInit||eo.init.initialized||eo.init(),eo.ignorePermissions=!1,et.init(),Z(B),Z(O),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),e7&&function(e=[]){var r=eS;e.unshift(b);var t=e.length,n=ex((t+1)*4),o=n>>2;e.forEach(e=>{var r,t;h[o++]=(t=ex(r=T(e)+1),C(e,d,t,r),t)}),h[o]=0;try{var a=r(t,n);em(a,!0)}catch(e){return ev(e)}}(e),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),I.unshift(e)}Z(I)}()))}}if(r.___start_em_js=356528,r.___stop_em_js=359213,r.AsciiToString=function(e){for(var r="";;){var t=f[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}},r.FS=eo,q=function e(){_||e5(),_||(q=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var e7=!0;return r.noInitialRun&&(e7=!1),e5(),r.ready}})(),rk={};rk=new URL(k("6MsPj").resolve("32xWV"),import.meta.url).toString();var rS=(()=>{var e="file:///node_modules/emglken/build/scare-core.js";return function(r={}){var t,n,o,a,i,s,u,l,c,d,f,m,h,p,v,w,g,_,r=void 0!==r?r:{};r.ready=new Promise(function(e,r){n=e,o=r});var y=Object.assign({},r),E=[],b="./this.program",k=(e,r)=>{throw r},S="";"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),e&&(S=e),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(200==n.status||0==n.status&&n.response){r(n.response);return}t()},n.onerror=t,n.send(null)};var D=r.print||console.log.bind(console),F=r.printErr||console.warn.bind(console);Object.assign(r,y),y=null,r.arguments&&(E=r.arguments),r.thisProgram&&(b=r.thisProgram),r.quit&&(k=r.quit),r.wasmBinary&&(u=r.wasmBinary);var M=r.noExitRuntime||!1;"object"!=typeof WebAssembly&&G("no native wasm support detected");var P=!1,A=new TextDecoder("utf8");function x(e,r,t){for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;return A.decode(e.buffer?e.subarray(r,o):new Uint8Array(e.slice(r,o)))}function R(e,r,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function C(e){for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r}function T(){var e=l.buffer;r.HEAP8=d=new Int8Array(e),r.HEAP16=m=new Int16Array(e),r.HEAP32=h=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var N=[],z=[],B=[],O=[],j=[],I=!1,L=0,U=0,H=null,W=null;function q(e){U++,r.monitorRunDependencies&&r.monitorRunDependencies(U)}function Y(e){if(U--,r.monitorRunDependencies&&r.monitorRunDependencies(U),0==U&&(null!==H&&(clearInterval(H),H=null),W)){var t=W;W=null,t()}}function G(e){r.onAbort&&r.onAbort(e),F(e="Aborted("+e+")"),P=!0,c=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function V(e){return e.startsWith("data:application/octet-stream;base64,")}function X(e){try{if(e==v&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){G(e)}}function K(e,r,t){return(u||"function"!=typeof fetch?Promise.resolve().then(function(){return X(e)}):fetch(e,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()}).catch(function(){return X(e)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(t,function(e){F("failed to asynchronously prepare wasm: "+e),G(e)})}function $(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function J(e){for(;e.length>0;)e.shift()(r)}r.locateFile?V(v="scare-core.wasm")||(t=v,v=r.locateFile?r.locateFile(t,S):S+t):v=new URL(rk).href;var Z={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=Z.isAbs(e),t="/"===e.substr(-1);return(e=Z.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=Z.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=Z.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return Z.normalize(e.join("/"))},join2:(e,r)=>Z.normalize(e+"/"+r)},Q={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:en.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=Z.isAbs(n)}return e=Z.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+e||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=Q.resolve(e).substr(1),r=Q.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s0?t:C(e)+1),o=R(e,n,0,n.length);return r&&(n.length=o),n}var er={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){er.ttys[e]={input:[],output:[],ops:r},en.registerDevice(e,er.stream_ops)},stream_ops:{open:function(e){var r=er.ttys[e.node.rdev];if(!r)throw new en.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new en.ErrnoError(60);for(var a,i=0,s=0;s0&&(D(x(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(F(x(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync:function(e){e.output&&e.output.length>0&&(F(x(e.output,0)),e.output=[])}}},et={ops_table:null,mount:function(e){return et.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(en.isBlkdev(t)||en.isFIFO(t))throw new en.ErrnoError(63);et.ops_table||(et.ops_table={dir:{node:{getattr:et.node_ops.getattr,setattr:et.node_ops.setattr,lookup:et.node_ops.lookup,mknod:et.node_ops.mknod,rename:et.node_ops.rename,unlink:et.node_ops.unlink,rmdir:et.node_ops.rmdir,readdir:et.node_ops.readdir,symlink:et.node_ops.symlink},stream:{llseek:et.stream_ops.llseek}},file:{node:{getattr:et.node_ops.getattr,setattr:et.node_ops.setattr},stream:{llseek:et.stream_ops.llseek,read:et.stream_ops.read,write:et.stream_ops.write,allocate:et.stream_ops.allocate,mmap:et.stream_ops.mmap,msync:et.stream_ops.msync}},link:{node:{getattr:et.node_ops.getattr,setattr:et.node_ops.setattr,readlink:et.node_ops.readlink},stream:{}},chrdev:{node:{getattr:et.node_ops.getattr,setattr:et.node_ops.setattr},stream:en.chrdev_stream_ops}});var o=en.createNode(e,r,t,n);return en.isDir(o.mode)?(o.node_ops=et.ops_table.dir.node,o.stream_ops=et.ops_table.dir.stream,o.contents={}):en.isFile(o.mode)?(o.node_ops=et.ops_table.file.node,o.stream_ops=et.ops_table.file.stream,o.usedBytes=0,o.contents=null):en.isLink(o.mode)?(o.node_ops=et.ops_table.link.node,o.stream_ops=et.ops_table.link.stream):en.isChrdev(o.mode)&&(o.node_ops=et.ops_table.chrdev.node,o.stream_ops=et.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}}},node_ops:{getattr:function(e){var r={};return r.dev=en.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,en.isDir(e.mode)?r.size=4096:en.isFile(e.mode)?r.size=e.usedBytes:en.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&et.resizeFileStorage(e,r.size)},lookup:function(e,r){throw en.genericErrors[44]},mknod:function(e,r,t,n){return et.createNode(e,r,t,n)},rename:function(e,r,t){if(en.isDir(e.mode)){var n;try{n=en.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new en.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink:function(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir:function(e,r){var t=en.lookupNode(e,r);for(var n in t.contents)throw new en.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=et.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!en.isLink(e.mode))throw new en.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r{if(!(e=Q.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new en.ErrnoError(32);for(var t=e.split("/").filter(e=>!!e),n=en.root,o="/",a=0;a40)throw new en.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var r;;){if(en.isRoot(e)){var t=e.mount.mountpoint;if(!r)return t;return"/"!==t[t.length-1]?t+"/"+r:t+r}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:(e,r)=>{for(var t=0,n=0;n>>0)%en.nameTable.length},hashAddNode:e=>{var r=en.hashName(e.parent.id,e.name);e.name_next=en.nameTable[r],en.nameTable[r]=e},hashRemoveNode:e=>{var r=en.hashName(e.parent.id,e.name);if(en.nameTable[r]===e)en.nameTable[r]=e.name_next;else for(var t=en.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:(e,r)=>{var t=en.mayLookup(e);if(t)throw new en.ErrnoError(t,e);for(var n=en.hashName(e.id,r),o=en.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return en.lookup(e,r)},createNode:(e,r,t,n)=>{var o=new en.FSNode(e,r,t,n);return en.hashAddNode(o),o},destroyNode:e=>{en.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>(49152&e)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var r=en.flagModes[e];if(void 0===r)throw Error("Unknown file open mode: "+e);return r},flagsToPermissionString:e=>{var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>en.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>en.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,r)=>{try{return en.lookupNode(e,r),20}catch(e){}return en.nodePermissions(e,"wx")},mayDelete:(e,r,t)=>{try{n=en.lookupNode(e,r)}catch(e){return e.errno}var n,o=en.nodePermissions(e,"wx");if(o)return o;if(t){if(!en.isDir(n.mode))return 54;if(en.isRoot(n)||en.getPath(n)===en.cwd())return 10}else if(en.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?en.isLink(e.mode)?32:en.isDir(e.mode)&&("r"!==en.flagsToPermissionString(r)||512&r)?31:en.nodePermissions(e,en.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,r=en.MAX_OPEN_FDS)=>{for(var t=e;t<=r;t++)if(!en.streams[t])return t;throw new en.ErrnoError(33)},getStream:e=>en.streams[e],createStream:(e,r,t)=>{en.FSStream||(en.FSStream=function(){this.shared={}},en.FSStream.prototype={},Object.defineProperties(en.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new en.FSStream,e);var n=en.nextfd(r,t);return e.fd=n,en.streams[n]=e,e},closeStream:e=>{en.streams[e]=null},chrdev_stream_ops:{open:e=>{var r=en.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new en.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice:(e,r)=>{en.devices[e]={stream_ops:r}},getDevice:e=>en.devices[e],getMounts:e=>{for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:(e,r)=>{"function"==typeof e&&(r=e,e=!1),en.syncFSRequests++,en.syncFSRequests>1&&F("warning: "+en.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=en.getMounts(en.root.mount),n=0;function o(e){return en.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount:(e,r,t)=>{var n,o="/"===t,a=!t;if(o&&en.root)throw new en.ErrnoError(10);if(!o&&!a){var i=en.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,en.isMountpoint(n))throw new en.ErrnoError(10);if(!en.isDir(n.mode))throw new en.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?en.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var r=en.lookupPath(e,{follow_mount:!1});if(!en.isMountpoint(r.node))throw new en.ErrnoError(28);var t=r.node,n=t.mounted,o=en.getMounts(n);Object.keys(en.nameTable).forEach(e=>{for(var r=en.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&en.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod:(e,r,t)=>{var n=en.lookupPath(e,{parent:!0}).node,o=Z.basename(e);if(!o||"."===o||".."===o)throw new en.ErrnoError(28);var a=en.mayCreate(n,o);if(a)throw new en.ErrnoError(a);if(!n.node_ops.mknod)throw new en.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=(void 0!==r?r:438)&4095|32768,en.mknod(e,r,0)),mkdir:(e,r)=>(r=(void 0!==r?r:511)&1023|16384,en.mknod(e,r,0)),mkdirTree:(e,r)=>{for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,en.mknod(e,r,t)),symlink:(e,r)=>{if(!Q.resolve(e))throw new en.ErrnoError(44);var t=en.lookupPath(r,{parent:!0}).node;if(!t)throw new en.ErrnoError(44);var n=Z.basename(r),o=en.mayCreate(t,n);if(o)throw new en.ErrnoError(o);if(!t.node_ops.symlink)throw new en.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:(e,r)=>{var t,n,o,a=Z.dirname(e),i=Z.dirname(r),s=Z.basename(e),u=Z.basename(r);if(t=en.lookupPath(e,{parent:!0}).node,n=en.lookupPath(r,{parent:!0}).node,!t||!n)throw new en.ErrnoError(44);if(t.mount!==n.mount)throw new en.ErrnoError(75);var l=en.lookupNode(t,s),c=Q.relative(e,i);if("."!==c.charAt(0))throw new en.ErrnoError(28);if("."!==(c=Q.relative(r,a)).charAt(0))throw new en.ErrnoError(55);try{o=en.lookupNode(n,u)}catch(e){}if(l!==o){var d=en.isDir(l.mode),f=en.mayDelete(t,s,d);if(f||(f=o?en.mayDelete(n,u,d):en.mayCreate(n,u)))throw new en.ErrnoError(f);if(!t.node_ops.rename)throw new en.ErrnoError(63);if(en.isMountpoint(l)||o&&en.isMountpoint(o))throw new en.ErrnoError(10);if(n!==t&&(f=en.nodePermissions(t,"w")))throw new en.ErrnoError(f);en.hashRemoveNode(l);try{t.node_ops.rename(l,n,u)}catch(e){throw e}finally{en.hashAddNode(l)}}},rmdir:e=>{var r=en.lookupPath(e,{parent:!0}).node,t=Z.basename(e),n=en.lookupNode(r,t),o=en.mayDelete(r,t,!0);if(o)throw new en.ErrnoError(o);if(!r.node_ops.rmdir)throw new en.ErrnoError(63);if(en.isMountpoint(n))throw new en.ErrnoError(10);r.node_ops.rmdir(r,t),en.destroyNode(n)},readdir:e=>{var r=en.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new en.ErrnoError(54);return r.node_ops.readdir(r)},unlink:e=>{var r=en.lookupPath(e,{parent:!0}).node;if(!r)throw new en.ErrnoError(44);var t=Z.basename(e),n=en.lookupNode(r,t),o=en.mayDelete(r,t,!1);if(o)throw new en.ErrnoError(o);if(!r.node_ops.unlink)throw new en.ErrnoError(63);if(en.isMountpoint(n))throw new en.ErrnoError(10);r.node_ops.unlink(r,t),en.destroyNode(n)},readlink:e=>{var r=en.lookupPath(e).node;if(!r)throw new en.ErrnoError(44);if(!r.node_ops.readlink)throw new en.ErrnoError(28);return Q.resolve(en.getPath(r.parent),r.node_ops.readlink(r))},stat:(e,r)=>{var t=en.lookupPath(e,{follow:!r}).node;if(!t)throw new en.ErrnoError(44);if(!t.node_ops.getattr)throw new en.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>en.stat(e,!0),chmod:(e,r,t)=>{var n;if(!(n="string"==typeof e?en.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new en.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,r)=>{en.chmod(e,r,!0)},fchmod:(e,r)=>{var t=en.getStream(e);if(!t)throw new en.ErrnoError(8);en.chmod(t.node,r)},chown:(e,r,t,n)=>{var o;if(!(o="string"==typeof e?en.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new en.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,r,t)=>{en.chown(e,r,t,!0)},fchown:(e,r,t)=>{var n=en.getStream(e);if(!n)throw new en.ErrnoError(8);en.chown(n.node,r,t)},truncate:(e,r)=>{if(r<0)throw new en.ErrnoError(28);if("string"==typeof e){var t;t=en.lookupPath(e,{follow:!0}).node}else t=e;if(!t.node_ops.setattr)throw new en.ErrnoError(63);if(en.isDir(t.mode))throw new en.ErrnoError(31);if(!en.isFile(t.mode))throw new en.ErrnoError(28);var n=en.nodePermissions(t,"w");if(n)throw new en.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:(e,r)=>{var t=en.getStream(e);if(!t)throw new en.ErrnoError(8);if((2097155&t.flags)==0)throw new en.ErrnoError(28);en.truncate(t.node,r)},utime:(e,r,t)=>{var n=en.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:(e,t,n)=>{if(""===e)throw new en.ErrnoError(44);if(t="string"==typeof t?en.modeStringToFlags(t):t,n=void 0===n?438:n,n=64&t?4095&n|32768:0,"object"==typeof e)o=e;else{e=Z.normalize(e);try{var o;o=en.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t){if(o){if(128&t)throw new en.ErrnoError(20)}else o=en.mknod(e,n,0),a=!0}if(!o)throw new en.ErrnoError(44);if(en.isChrdev(o.mode)&&(t&=-513),65536&t&&!en.isDir(o.mode))throw new en.ErrnoError(54);if(!a){var i=en.mayOpen(o,t);if(i)throw new en.ErrnoError(i)}512&t&&!a&&en.truncate(o,0),t&=-131713;var s=en.createStream({node:o,path:en.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!r.logReadFiles||1&t||(en.readFiles||(en.readFiles={}),e in en.readFiles||(en.readFiles[e]=1)),s},close:e=>{if(en.isClosed(e))throw new en.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{en.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,r,t)=>{if(en.isClosed(e))throw new en.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new en.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new en.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:(e,r,t,n,o)=>{if(n<0||o<0)throw new en.ErrnoError(28);if(en.isClosed(e)||(2097155&e.flags)==1)throw new en.ErrnoError(8);if(en.isDir(e.node.mode))throw new en.ErrnoError(31);if(!e.stream_ops.read)throw new en.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new en.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write:(e,r,t,n,o,a)=>{if(n<0||o<0)throw new en.ErrnoError(28);if(en.isClosed(e)||(2097155&e.flags)==0)throw new en.ErrnoError(8);if(en.isDir(e.node.mode))throw new en.ErrnoError(31);if(!e.stream_ops.write)throw new en.ErrnoError(28);e.seekable&&1024&e.flags&&en.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new en.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate:(e,r,t)=>{if(en.isClosed(e))throw new en.ErrnoError(8);if(r<0||t<=0)throw new en.ErrnoError(28);if((2097155&e.flags)==0)throw new en.ErrnoError(8);if(!en.isFile(e.node.mode)&&!en.isDir(e.node.mode))throw new en.ErrnoError(43);if(!e.stream_ops.allocate)throw new en.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:(e,r,t,n,o)=>{if((2&n)!=0&&(2&o)==0&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new en.ErrnoError(2);if(!e.stream_ops.mmap)throw new en.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl:(e,r,t)=>{if(!e.stream_ops.ioctl)throw new en.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:(e,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw Error('Invalid encoding type "'+r.encoding+'"');var t,n=en.open(e,r.flags),o=en.stat(e).size,a=new Uint8Array(o);return en.read(n,a,0,o,0),"utf8"===r.encoding?t=x(a,0):"binary"===r.encoding&&(t=a),en.close(n),t},writeFile:(e,r,t={})=>{t.flags=t.flags||577;var n=en.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(C(r)+1),a=R(r,o,0,o.length);en.write(n,o,0,a,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))en.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw Error("Unsupported data type");en.close(n)},cwd:()=>en.currentPath,chdir:e=>{var r=en.lookupPath(e,{follow:!0});if(null===r.node)throw new en.ErrnoError(44);if(!en.isDir(r.node.mode))throw new en.ErrnoError(54);var t=en.nodePermissions(r.node,"x");if(t)throw new en.ErrnoError(t);en.currentPath=r.path},createDefaultDirectories:()=>{en.mkdir("/tmp"),en.mkdir("/home"),en.mkdir("/home/web_user")},createDefaultDevices:()=>{en.mkdir("/dev"),en.registerDevice(en.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),en.mkdev("/dev/null",en.makedev(1,3)),er.register(en.makedev(5,0),er.default_tty_ops),er.register(en.makedev(6,0),er.default_tty1_ops),en.mkdev("/dev/tty",en.makedev(5,0)),en.mkdev("/dev/tty1",en.makedev(6,0));var e=function(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return()=>G("randomDevice");var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}();en.createDevice("/dev","random",e),en.createDevice("/dev","urandom",e),en.mkdir("/dev/shm"),en.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{en.mkdir("/proc");var e=en.mkdir("/proc/self");en.mkdir("/proc/self/fd"),en.mount({mount:()=>{var r=en.createNode(e,"fd",16895,73);return r.node_ops={lookup:(e,r)=>{var t=en.getStream(+r);if(!t)throw new en.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>t.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{r.stdin?en.createDevice("/dev","stdin",r.stdin):en.symlink("/dev/tty","/dev/stdin"),r.stdout?en.createDevice("/dev","stdout",null,r.stdout):en.symlink("/dev/tty","/dev/stdout"),r.stderr?en.createDevice("/dev","stderr",null,r.stderr):en.symlink("/dev/tty1","/dev/stderr"),en.open("/dev/stdin",0),en.open("/dev/stdout",1),en.open("/dev/stderr",1)},ensureErrnoError:()=>{en.ErrnoError||(en.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},en.ErrnoError.prototype=Error(),en.ErrnoError.prototype.constructor=en.ErrnoError,[44].forEach(e=>{en.genericErrors[e]=new en.ErrnoError(e),en.genericErrors[e].stack=""}))},staticInit:()=>{en.ensureErrnoError(),en.nameTable=Array(4096),en.mount(et,{},"/"),en.createDefaultDirectories(),en.createDefaultDevices(),en.createSpecialDirectories(),en.filesystems={MEMFS:et}},init:(e,t,n)=>{en.init.initialized=!0,en.ensureErrnoError(),r.stdin=e||r.stdin,r.stdout=t||r.stdout,r.stderr=n||r.stderr,en.createStandardStreams()},quit:()=>{en.init.initialized=!1,ev(0);for(var e=0;e{var t=0;return e&&(t|=365),r&&(t|=146),t},findObject:(e,r)=>{var t=en.analyzePath(e,r);return t.exists?t.object:null},analyzePath:(e,r)=>{try{var t=en.lookupPath(e,{follow:!r});e=t.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=en.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=Z.basename(e),t=en.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot="/"===t.path}catch(e){n.error=e.errno}return n},createPath:(e,r,t,n)=>{e="string"==typeof e?e:en.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Z.join2(e,a);try{en.mkdir(i)}catch(e){}e=i}}return i},createFile:(e,r,t,n,o)=>{var a=Z.join2("string"==typeof e?e:en.getPath(e),r),i=en.getMode(n,o);return en.create(a,i)},createDataFile:(e,r,t,n,o,a)=>{var i=r;e&&(e="string"==typeof e?e:en.getPath(e),i=r?Z.join2(e,r):e);var s=en.getMode(n,o),u=en.create(i,s);if(t){if("string"==typeof t){for(var l=Array(t.length),c=0,d=t.length;c{var o=Z.join2("string"==typeof e?e:en.getPath(e),r),a=en.getMode(!!t,!!n);en.createDevice.major||(en.createDevice.major=64);var i=en.makedev(en.createDevice.major++,0);return en.registerDevice(i,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,r,n,o,a)=>{for(var i,s=0,u=0;u{for(var i=0;i{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(a)try{e.contents=ee(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new en.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(e,r,t,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1)&&!(e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e,r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw Error("Couldn't load "+t+". Status: "+r.status);var n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ee(o.responseText||"",!0)},u=this;u.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw Error("doXHR failed!");return u.chunks[e]}),(a||!n)&&(i=n=1,i=n=this.getter(0).length,D("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var i;throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"}var i={isDevice:!1,url:t},s=en.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=s.stream_ops[e];u[e]=function(){return en.forceLoadFile(s),r.apply(null,arguments)}}),u.read=(e,r,t,n,o)=>(en.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{en.forceLoadFile(s);var a=void G();if(!a)throw new en.ErrnoError(48);return l(e,d,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(e,r,t,n,o,a,s,u,l,c)=>{var d,f,m=r?Q.resolve(Z.join2(e,r)):e,h="cp "+m;function p(t){function i(t){c&&c(),u||en.createDataFile(e,r,t,n,o,l),a&&a(),Y(h)}Browser.handledByPreloadPlugin(t,m,i,()=>{s&&s(),Y(h)})||i(t)}q(h),"string"==typeof t?(d=e=>p(e),f="al "+t,i(t,e=>{var r;r='Loading data file "'+t+'" failed (no arrayBuffer).',e||G(r),d(new Uint8Array(e)),f&&Y(f)},e=>{if(s)s();else throw'Loading data file "'+t+'" failed.'}),f&&q(f)):p(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,r=()=>{},t=()=>{})=>{var n=en.indexedDB();try{var o=n.open(en.DB_NAME(),en.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=()=>{D("creating db"),o.result.createObjectStore(en.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([en.DB_STORE_NAME],"readwrite"),a=n.objectStore(en.DB_STORE_NAME),i=0,s=0,u=e.length;function l(){0==s?r():t()}e.forEach(e=>{var r=a.put(en.analyzePath(e).object.contents,e);r.onsuccess=()=>{++i+s==u&&l()},r.onerror=()=>{i+ ++s==u&&l()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:(e,r=()=>{},t=()=>{})=>{var n=en.indexedDB();try{var o=n.open(en.DB_NAME(),en.DB_VERSION)}catch(e){return t(e)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([en.DB_STORE_NAME],"readonly")}catch(e){t(e);return}var i=a.objectStore(en.DB_STORE_NAME),s=0,u=0,l=e.length;function c(){0==u?r():t()}e.forEach(e=>{var r=i.get(e);r.onsuccess=()=>{en.analyzePath(e).exists&&en.unlink(e),en.createDataFile(Z.dirname(e),Z.basename(e),r.result,!0,!0,!0),++s+u==l&&c()},r.onerror=()=>{s+ ++u==l&&c()}}),a.onerror=t},o.onerror=t}},eo={DEFAULT_POLLMASK:5,calculateAt:function(e,r,t){if(Z.isAbs(r))return r;if(-100===e)n=en.cwd();else{var n;n=eo.getStreamFromFD(e).path}if(0==r.length){if(!t)throw new en.ErrnoError(44);return n}return Z.join2(n,r)},doStat:function(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&Z.normalize(r)!==Z.normalize(en.getPath(e.node)))return -54;throw e}h[t>>2]=n.dev,h[t+8>>2]=n.ino,h[t+12>>2]=n.mode,p[t+16>>2]=n.nlink,h[t+20>>2]=n.uid,h[t+24>>2]=n.gid,h[t+28>>2]=n.rdev,g=[n.size>>>0,+Math.abs(w=n.size)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+40>>2]=g[0],h[t+44>>2]=g[1],h[t+48>>2]=4096,h[t+52>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return g=[Math.floor(o/1e3)>>>0,+Math.abs(w=Math.floor(o/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+56>>2]=g[0],h[t+60>>2]=g[1],p[t+64>>2]=o%1e3*1e3,g=[Math.floor(a/1e3)>>>0,+Math.abs(w=Math.floor(a/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+72>>2]=g[0],h[t+76>>2]=g[1],p[t+80>>2]=a%1e3*1e3,g=[Math.floor(i/1e3)>>>0,+Math.abs(w=Math.floor(i/1e3))>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+88>>2]=g[0],h[t+92>>2]=g[1],p[t+96>>2]=i%1e3*1e3,g=[n.ino>>>0,+Math.abs(w=n.ino)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0],h[t+104>>2]=g[0],h[t+108>>2]=g[1],0},doMsync:function(e,r,t,n,o){if(!en.isFile(r.node.mode))throw new en.ErrnoError(43);if(2&n)return 0;var a=f.slice(e,e+t);en.msync(r,a,o,t,n)},varargs:void 0,get:function(){return eo.varargs+=4,h[eo.varargs-4>>2]},getStr:function(e){return function(e,r){if(!e)return"";for(var t=e+void 0,n=e;!(n>=t)&&f[n];)++n;return A.decode(f.subarray(e,n))}(e)},getStreamFromFD:function(e){var r=en.getStream(e);if(!r)throw new en.ErrnoError(8);return r}},ea={};function ei(){if(!ei.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(var r in ea)void 0===ea[r]?delete e[r]:e[r]=ea[r];var t=[];for(var r in e)t.push(r+"="+e[r]);ei.strings=t}return ei.strings}function es(e,t){c=e,M||L>0||(eg(),J(O),en.quit(),er.shutdown(),I=!0),c=e,M||L>0||(r.onExit&&r.onExit(e),P=!0),k(e,new $(e))}function eu(e){if(e instanceof $||"unwind"==e)return c;k(1,e)}function el(e){try{return e()}catch(e){G(e)}}var ec={instrumentWasmImports:function(e){var r=["invoke_*","emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","SDL_Delay","emscripten_scan_registers","emscripten_lazy_load_code","emscripten_fiber_swap","__load_secondary_module","fd_sync","__wasi_fd_sync","_emval_await","_dlopen_js","__asyncjs__*"];for(var t in e)!function(t){var n=e[t];n.sig,"function"==typeof n&&(r.indexOf(t)>=0||t.startsWith("__asyncjs__"))}(t)},instrumentWasmExports:function(e){var r={};for(var t in e)!function(t){var n=e[t];"function"==typeof n?r[t]=function(){ec.exportCallStack.push(t);try{return n.apply(null,arguments)}finally{P||(ec.exportCallStack.pop()===t||G(void 0),ec.maybeStopUnwind())}}:r[t]=n}(t);return r},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:8192,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(e){var r=ec.callStackNameToId[e];return void 0===r&&(r=ec.callStackId++,ec.callStackNameToId[e]=r,ec.callStackIdToName[r]=e),r},maybeStopUnwind:function(){ec.currData&&ec.state===ec.State.Unwinding&&0===ec.exportCallStack.length&&(ec.state=ec.State.Normal,L+=1,el(eN),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:function(){return new Promise((e,r)=>{ec.asyncPromiseHandlers={resolve:e,reject:r}})},allocateData:function(){var e=eh(12+ec.StackSize);return ec.setDataHeader(e,e+12,ec.StackSize),ec.setDataRewindFunc(e),e},setDataHeader:function(e,r,t){h[e>>2]=r,h[e+4>>2]=r+t},setDataRewindFunc:function(e){var r=ec.exportCallStack[0],t=ec.getCallStackId(r);h[e+8>>2]=t},getDataRewindFunc:function(e){var t=h[e+8>>2],n=ec.callStackIdToName[t];return r.asm[n]},doRewind:function(e){var r=ec.getDataRewindFunc(e);return L-=1,r()},handleSleep:function(e){if(!P){if(ec.state===ec.State.Normal){var r=!1,t=!1;e((e=0)=>{if(!P&&(ec.handleSleepReturnValue=e,r=!0,t)){ec.state=ec.State.Rewinding,el(()=>ez(ec.currData)),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=ec.doRewind(ec.currData)}catch(e){n=e,o=!0}var a=!1;if(!ec.currData){var i=ec.asyncPromiseHandlers;i&&(ec.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}}),t=!0,r||(ec.state=ec.State.Unwinding,ec.currData=ec.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),el(()=>eT(ec.currData)))}else ec.state===ec.State.Rewinding?(ec.state=ec.State.Normal,el(eB),em(ec.currData),ec.currData=null,ec.sleepCallbacks.forEach(e=>(function(e){if(!I&&!P)try{e(),function(){if(!(M||L>0))try{es(c)}catch(e){eu(e)}}()}catch(e){eu(e)}})(e))):G("invalid state: "+ec.state);return ec.handleSleepReturnValue}},handleAsync:function(e){return ec.handleSleep(r=>{e().then(r)})}},ed=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=en.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(ed.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return en.isDir(this.mode)}},isDevice:{get:function(){return en.isChrdev(this.mode)}}}),en.FSNode=ed,en.staticInit();var ef={s:function(e,t){return ec.handleAsync(async()=>{r.emglken_stdin_buffers.length||await new Promise(e=>{r.emglken_stdin_ready=e});let n=r.emglken_stdin_buffers.shift(),o=Math.min(n.length,t);return o==n.length?f.set(n,e):(f.set(n.subarray(0,o),e),r.emglken_stdin_buffers.unshift(n.subarray(o))),o})},D:function(e,r,t,n){try{if(r=eo.getStr(r),r=eo.calculateAt(e,r),-8&t)return -28;var o=en.lookupPath(r,{follow:!0}).node;if(!o)return -44;var a="";if(4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&en.nodePermissions(o,a))return -2;return 0}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return-e.errno}},n:function(e,r,t){eo.varargs=t;try{var n=eo.getStreamFromFD(e);switch(r){case 0:var o=eo.get();if(o<0)return -28;return en.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=eo.get();return n.flags|=o,0;case 5:var o=eo.get();return m[o+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return h[ew()>>2]=28,-1}}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return-e.errno}},C:function(e,r){try{if(0===r)return -28;var t=en.cwd(),n=C(t)+1;if(r>2]=0,0;case 21520:if(!n.tty)return -59;return -28;case 21531:var o=eo.get();return en.ioctl(n,r,o);default:return -28}}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return-e.errno}},A:function(e,r,t,n){eo.varargs=n;try{r=eo.getStr(r),r=eo.calculateAt(e,r);var o=n?eo.get():0;return en.open(r,t,o).fd}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return-e.errno}},z:function(e,r){try{return e=eo.getStr(e),eo.doStat(en.stat,e,r)}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return-e.errno}},v:function(){return!0},u:function(){throw 1/0},t:function(){G("")},k:function(){return Date.now()},r:function(e,r,t){f.copyWithin(e,r,r+t)},q:function(e){var r=f.length;if((e>>>=0)>2147483648)return!1;let t=(e,r)=>e+(r-e%r)%r;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),function(e){var r=l.buffer;try{return l.grow(e-r.byteLength+65535>>>16),T(),1}catch(e){}}(Math.min(2147483648,t(Math.max(e,o),65536))))return!0}return!1},y:function(e,r){var t=0;return ei().forEach(function(n,o){var a=r+t;p[e+4*o>>2]=a,function(e,r,t){for(var n=0;n>0]=e.charCodeAt(n);d[r>>0]=0}(n,a),t+=n.length+1}),0},x:function(e,r){var t=ei();p[e>>2]=t.length;var n=0;return t.forEach(function(e){n+=e.length+1}),p[r>>2]=n,0},i:es,m:function(e){try{var r=eo.getStreamFromFD(e);return en.close(r),0}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return e.errno}},w:function(e,r,t,n){try{var o=eo.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=en.read(e,d,i,s,n);if(u<0)return -1;if(o+=u,u>2]=a,0}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return e.errno}},p:function(e,r,t,n,o){try{var a=t+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*t:NaN;if(isNaN(a))return 61;var i=eo.getStreamFromFD(e);return en.llseek(i,a,n),g=[i.position>>>0,(w=i.position,+Math.abs(w)>=1?w>0?(0|Math.min(+Math.floor(w/4294967296),4294967295))>>>0:~~+Math.ceil((w-+(~~w>>>0))/4294967296)>>>0:0)],h[o>>2]=g[0],h[o+4>>2]=g[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return e.errno}},l:function(e,r,t,n){try{var o=eo.getStreamFromFD(e),a=function(e,r,t,n){for(var o=0,a=0;a>2],s=p[r+4>>2];r+=8;var u=en.write(e,d,i,s,n);if(u<0)return -1;o+=u,void 0!==n&&(n+=u)}return o}(o,r,t);return p[n>>2]=a,0}catch(e){if(void 0===en||"ErrnoError"!==e.name)throw e;return e.errno}},c:function(e){var r=ey();try{return eM(e)}catch(e){if(eE(r),e!==e+0)throw e;e_(1,0)}},g:function(e,r){var t=ey();try{return eD(e,r)}catch(e){if(eE(t),e!==e+0)throw e;e_(1,0)}},f:function(e,r,t,n){var o=ey();try{return eS(e,r,t,n)}catch(e){if(eE(o),e!==e+0)throw e;e_(1,0)}},d:function(e,r,t,n,o){var a=ey();try{return eA(e,r,t,n,o)}catch(e){if(eE(a),e!==e+0)throw e;e_(1,0)}},o:function(e,r){var t=ey();try{return eC(e,r)}catch(e){if(eE(t),e!==e+0)throw e;e_(1,0)}},j:function(e){var r=ey();try{eP(e)}catch(e){if(eE(r),e!==e+0)throw e;e_(1,0)}},b:function(e,r){var t=ey();try{ek(e,r)}catch(e){if(eE(t),e!==e+0)throw e;e_(1,0)}},a:function(e,r,t){var n=ey();try{eF(e,r,t)}catch(e){if(eE(n),e!==e+0)throw e;e_(1,0)}},h:function(e,r,t,n){var o=ey();try{ex(e,r,t,n)}catch(e){if(eE(o),e!==e+0)throw e;e_(1,0)}},e:function(e,r,t,n,o){var a=ey();try{eR(e,r,t,n,o)}catch(e){if(eE(a),e!==e+0)throw e;e_(1,0)}}};!function(){var e,t,n,a={a:ef};function i(e,t){var n,o=e.exports;return o=ec.instrumentWasmExports(o),r.asm=o,l=r.asm.E,T(),r.asm.N,n=r.asm.F,z.unshift(n),Y("wasm-instantiate"),o}if(q("wasm-instantiate"),r.instantiateWasm)try{return r.instantiateWasm(a,i)}catch(e){F("Module.instantiateWasm callback failed with error: "+e),o(e)}(e=u,t=v,n=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||V(t)||"function"!=typeof fetch?K(t,a,n):fetch(t,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return F("wasm streaming compile failed: "+e),F("falling back to ArrayBuffer instantiation"),K(t,a,n)})})).catch(o)}();var em=function(){return(em=r.asm.G).apply(null,arguments)},eh=function(){return(eh=r.asm.H).apply(null,arguments)},ep=r._main=function(){return(ep=r._main=r.asm.I).apply(null,arguments)},ev=(r._gidispatch_get_game_id=function(){return(r._gidispatch_get_game_id=r.asm.J).apply(null,arguments)},r._fflush=function(){return(ev=r._fflush=r.asm.K).apply(null,arguments)}),ew=function(){return(ew=r.asm.L).apply(null,arguments)},eg=function(){return(eg=r.asm.M).apply(null,arguments)},e_=function(){return(e_=r.asm.O).apply(null,arguments)},ey=function(){return(ey=r.asm.P).apply(null,arguments)},eE=function(){return(eE=r.asm.Q).apply(null,arguments)},eb=function(){return(eb=r.asm.R).apply(null,arguments)},ek=r.dynCall_vi=function(){return(ek=r.dynCall_vi=r.asm.S).apply(null,arguments)},eS=r.dynCall_iiii=function(){return(eS=r.dynCall_iiii=r.asm.T).apply(null,arguments)},eD=r.dynCall_ii=function(){return(eD=r.dynCall_ii=r.asm.U).apply(null,arguments)},eF=r.dynCall_vii=function(){return(eF=r.dynCall_vii=r.asm.V).apply(null,arguments)},eM=r.dynCall_i=function(){return(eM=r.dynCall_i=r.asm.W).apply(null,arguments)},eP=r.dynCall_v=function(){return(eP=r.dynCall_v=r.asm.X).apply(null,arguments)},eA=r.dynCall_iiiii=function(){return(eA=r.dynCall_iiiii=r.asm.Y).apply(null,arguments)},ex=r.dynCall_viii=function(){return(ex=r.dynCall_viii=r.asm.Z).apply(null,arguments)},eR=r.dynCall_viiii=function(){return(eR=r.dynCall_viiii=r.asm._).apply(null,arguments)},eC=r.dynCall_ji=function(){return(eC=r.dynCall_ji=r.asm.$).apply(null,arguments)},eT=function(){return(eT=r.asm.aa).apply(null,arguments)},eN=function(){return(eN=r.asm.ba).apply(null,arguments)},ez=function(){return(ez=r.asm.ca).apply(null,arguments)},eB=function(){return(eB=r.asm.da).apply(null,arguments)};function eO(e=E){!(U>0)&&(!function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),N.unshift(e)}J(N)}(),U>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()));function t(){!_&&(_=!0,r.calledRun=!0,P||(r.noFSInit||en.init.initialized||en.init(),en.ignorePermissions=!1,er.init(),J(z),J(B),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),ej&&function(e=[]){var r=ep;e.unshift(b);var t=e.length,n=eb((t+1)*4),o=n>>2;e.forEach(e=>{var r,t;h[o++]=(t=eb(r=C(e)+1),R(e,d,t,r),t)}),h[o]=0;try{var a=r(t,n);es(a,!0)}catch(e){return eu(e)}}(e),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),j.unshift(e)}J(j)}()))}}if(r.___start_em_js=107504,r.___stop_em_js=110189,r.AsciiToString=function(e){for(var r="";;){var t=f[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}},r.FS=en,W=function e(){_||eO(),_||(W=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var ej=!0;return r.noInitialRun&&(ej=!1),eO(),r.ready}})();const rD=[{id:"bocfel",extensions:/z([3458]|blorb)$/,engine:class extends rh{default_options(){return{vmcore:rv}}}},{id:"git",extensions:/(gblorb|ulx)$/,engine:class extends rh{default_options(){return{vmcore:rg}}}},{id:"hugo",extensions:/hex$/,engine:class extends rh{default_options(){return{vmcore:ry}}}},{id:"scare",extensions:/taf$/,engine:class extends rh{default_options(){return{vmcore:rS}}}},{id:"tads",extensions:/(gam|t3)$/,engine:class extends rh{default_options(){return{vmcore:rb}}}}],rF=e=>{let r=rD.find(r=>r.extensions.test(e));if(r)return{...r,wasmBinaryName:`emglken/${r.id}-core.wasm`};throw Error("Unsupported file type")};var rM=class{constructor(e,r){this.streaming=!1,this.handlers=e,this.loggers=r}file_ref_exists({usage:e}){return"save"===e}file_remove_ref(){return!0}file_construct_ref(e,r){return{filename:e,usage:r||""}}file_read(e,r){return this.handlers.onFileRead(e,r)}file_write(e,r,t){0!==r.length&&this.handlers.onFileWrite(e,r,t)}open(e,r,t,n){this.handlers.onFileNameRequest(e,r,t,n)}log(e){this.loggers.log(e)}warning(e){this.loggers.warn(e)}error(e){this.loggers.error(e)}},rP=class{constructor({width:e,height:r}){this.width=e,this.height=r,this.current_metrics=null,this.disabled=!1,this.generation=0,this.interface=null,this.version="0.5.1"}measure_window(){return{width:this.width,height:this.height,buffercharheight:1,buffercharwidth:1,buffermarginx:0,buffermarginy:0,graphicsmarginx:0,graphicsmarginy:0,gridcharheight:1,gridcharwidth:1,gridmarginx:0,gridmarginy:0,inspacingx:0,inspacingy:0,outspacingx:0,outspacingy:0}}getinterface(){return this.interface}init(e){e||this.error("No game interface object has been provided."),e.accept||this.error("The game interface object must have an accept() function."),this.interface=e,this.current_metrics=this.measure_window(),this.send_response("init",null,this.current_metrics)}update(e){if("error"===e.type&&this.error(e.message),"pass"!==e.type){if("update"!==e.type&&"exit"!==e.type){this.log(`Ignoring unknown message type: ${e.type}`);return}if(e.gen===this.generation){this.log(`Ignoring repeated generation number: ${e.gen}`);return}if(e.genthis.send_response("specialresponse",null,"fileref_prompt",e)):this.error("Request for unknown special input type: "+e.type)}update_content(e){this.handlers.onUpdateContent(e)}exit(){this.handlers.onExit(),super.exit()}cancel_inputs(e){this.handlers.onUpdateInputs(e)}disable(e){this.handlers.onDisable(e)}update_windows(e){this.handlers.onUpdateWindows(e)}log(e){this.loggers.log(e)}warning(e){this.loggers.warn(e)}error(e){this.loggers.error(e)}};const rx=()=>void 0,rR=["onInit","onUpdateWindows","onUpdateInputs","onUpdateContent","onDisable","onFileNameRequest","onFileRead","onFileWrite","onExit"].reduce((e,r)=>(e[r]=rx,e),{}),rC={log:console.log,warning:console.warn,error:console.error},rT={width:80,height:25};var rN=(e,{loggers:r,size:t}={})=>{let n=Object.assign({},rR,e),o=Object.assign({},rC,r),a=Object.assign({},rT,t),i=new rM(n,o),s=new rA(n,o,a),u=s.sendFn.bind(s);return{Dialog:i,GlkOte:s,send:u}},rz={};function rB({style:e,text:r}){let t=eo("span",{className:[rz.message,rz[e]].join(" "),children:r});return({grid:r?.length>0?eo("div",{children:r}):eo("br",{}),input:eo("span",{className:[rz.message,rz.input].join(" "),children:["> ",r]}),subheader:eo("strong",{className:[rz.message,rz.subheader].join(" "),children:r}),emphasized:eo("em",{className:[rz.message,rz.emphasized].join(" "),children:r}),scrollTarget:eo("div",{className:[rz.scrollTarget,e].join(" ")}),endOfLine:eo("br",{})})[e]||t}e(rz,"emphasized",function(){return i},function(e){return i=e}),e(rz,"input",function(){return s},function(e){return s=e}),e(rz,"message",function(){return u},function(e){return u=e}),e(rz,"scrollTarget",function(){return l},function(e){return l=e}),e(rz,"subheader",function(){return c},function(e){return c=e}),i="hBGgUq_emphasized",s="hBGgUq_input",u="hBGgUq_message",l="hBGgUq_scrollTarget",c="hBGgUq_subheader",d="PwGQsW_buffer",f="PwGQsW_gridBuffer";const rO={style:"endOfLine"},rj={style:"scrollTarget"},rI=e=>e.height<5,rL=e=>e.length<1?e:">"===e.slice(-1)[0].text?e.slice(0,e.length-1):e,rU=(e,r)=>{let t=e.find(({id:e})=>e===r.id);if(!t)return{clear:!1,incoming:[rj]};let{text:n}=t,o=n.map(({content:e})=>e?[...rL(e),rO]:[rO]).reduce((e,r)=>e.concat(r),[rj]);return{incoming:o,clear:!!rI(r)||t.clear}};function rH({inbox:e,currentWindow:r}){let[t,n]=eg([]),o=eE(null);return e_(()=>{let{incoming:t,clear:a}=rU(e,r);n(e=>a?t:e.concat(t)),setTimeout(()=>{let e=o.current.querySelectorAll(`.${rj.style}`),r=e[e.length-1];r?r.scrollIntoView():o.current.scrollTo({top:o.current.scrollHeight,behavior:"smooth"})},0)},[r,e]),eo("section",{tabindex:"0",ref:o,className:[d,rI(r)?f:"PwGQsW_textBuffer"].join(" "),children:t.map(rB)})}function rW({inbox:e,currentWindow:r}){let[t,n]=eg([]),[o,a]=eg([]);return e_(()=>{let o=e.find(({id:e})=>e===r.id),i=o?.lines??[],s=Array(r.gridheight).fill(null).map((e,r)=>r).map(e=>{let r=(e,r)=>e.find(({line:e})=>e===r);return r(i,e)||r(t,e)});((e,r)=>{let t=JSON.stringify;return t(e)!==t(r)})(s,t)&&n(s);let u=s.map(e=>e.content).flat().map(e=>({...e,text:e.text.trim()})),l=u.map(({text:e})=>e.length).every(e=>0===e),c=({style:e})=>["alert","normal"].includes(e)?"grid":e||"grid",d=u.map(e=>({style:c(e),text:e.text.replace(" "," / ")}));a(l?[]:d)},[e,r,t]),eo("section",{className:[d,f].join(" "),children:o.map(rB)})}function rq({onClick:e}){return eo("button",{"aria-label":"Menu",className:"gUkI1a_menuButton",onClick:e,children:eo("svg",{class:"gUkI1a_menuIcon",viewBox:"0 0 28 32",xmlns:"http://www.w3.org/2000/svg",children:[eo("rect",{x:"12",y:"4",width:"4",height:"4"}),eo("rect",{x:"12",y:"14",width:"4",height:"4"}),eo("rect",{x:"12",y:"24",width:"4",height:"4"})]})})}const rY={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40},rG={[rY.KEY_BACKSPACE]:"delete",[rY.KEY_TAB]:"tab",[rY.KEY_RETURN]:"return",[rY.KEY_ESC]:"escape",[rY.KEY_PAGEUP]:"pageup",[rY.KEY_PAGEDOWN]:"pagedown",[rY.KEY_END]:"end",[rY.KEY_HOME]:"home",[rY.KEY_LEFT]:"left",[rY.KEY_UP]:"up",[rY.KEY_RIGHT]:"right",[rY.KEY_DOWN]:"down"},rV=e=>{let r=[e.altKey,e.ctrlKey,e.metaKey,e.shiftKey];return r.some(e=>!0===e)};function rX({inputType:e,windows:r,currentWindowId:t,sendMessage:n,onFullscreenRequest:o,setMenuOpen:a}){let[i,s]=eg(null),[u,l]=eg(""),[c,d]=eg(""),f=eE(null);e_(()=>{let e=()=>{f.current&&f.current.focus()};return l(""),e(),document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[e]),e_(()=>{s(r.find(({id:e})=>e===t))},[t,r]);let m=r=>{n(r,e,i),d(r),l("")},h=e=>{if(rV(e))return;e.preventDefault();let r=rG[e.keyCode]||e.key;m(r)},p=e=>setTimeout(()=>{m(e.target.value.slice(-1).toUpperCase()),l("")});return eo("section",{className:"LdLucW_inputControls",children:[eo("input",{...{char:{maxlength:"1",placeholder:"Press any key here",onKeyDown:e=>(229===e.keyCode?p:h)(e)},line:{placeholder:" > ",onKeyDown:({keyCode:e})=>{e===rY.KEY_UP&&(l(c),setTimeout(()=>{let e=c.length;f.current.setSelectionRange(e,e)},0)),e===rY.KEY_DOWN&&l("")},onKeyPress:({keyCode:e,target:{value:r}})=>{e===rY.KEY_RETURN&&m(r)}},finished:{placeholder:"The program has finished",disabled:!0}}[e],className:"LdLucW_inputBox",ref:f,value:u,autofocus:!0,autocomplete:"off",spellCheck:"false",autocapitalize:"off",autocorrect:"off",onDblClick:o,onInput:({target:{value:e}})=>l(e),type:"search"}),eo(rq,{onClick:()=>a(!0)})]})}m="zi213q_status";const rK=e=>eo("div",{className:[m].join(" "),children:[eo("h1",{children:"Error"}),e.map(e=>eo("p",{children:e},e)),eo("hr",{}),eo(eQ,{href:"/",children:"Home"}),"|",eo("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/He4eT/elseifplayer/issues",children:"Report bug"})]}),r$=e=>eo("div",{className:[m,"zi213q_loading"].join(" "),children:e.map(e=>eo("div",{children:e},e))});var rJ=({stage:e,details:r})=>({fail:rK,loading:r$})[e](r);const rZ={},rQ={};["ҠҿԀԟڀڿݠޟ߀ߟကဟႠႿᄀᅟᆀᆟᇠሿበቿዠዿጠጿᎠᏟᐠᙟᚠᛟកសᠠᡟᣀᣟᦀᦟ᧠᧿ᨠᨿᯀᯟᰀᰟᴀᴟ⇠⇿⋀⋟⍀⏟␀␟─❟➀➿⠀⥿⦠⦿⨠⩟⪀⪿⫠⭟ⰀⰟⲀⳟⴀⴟⵀⵟ⺠⻟㇀㇟㐀䶟䷀龿ꀀꑿ꒠꒿ꔀꗿꙀꙟꚠꛟ꜀ꝟꞀꞟꡀꡟ","ƀƟɀʟ"].forEach((e,r)=>{let t=[];e.match(/../gu).forEach(e=>{let r=e.codePointAt(0),n=e.codePointAt(1);for(let e=r;e<=n;e++)t.push(String.fromCodePoint(e))});let n=15-8*r;rZ[n]=t,t.forEach((e,r)=>{rQ[e]=[n,r]})});const r0=e=>{let r=e.length,t="",n=0,o=0;for(let a=0;a=0;e--){let a=r>>e&1;n=(n<<1)+a,15==++o&&(t+=rZ[o][n],n=0,o=0)}}if(0!==o){for(;!(o in rZ);)n=(n<<1)+1,o++;t+=rZ[o][n]}return t},r1=e=>{let r=e.length,t=new Uint8Array(Math.floor(15*r/8)),n=0,o=0,a=0;for(let i=0;i=0;e--){let r=l>>e&1;o=(o<<1)+r,8==++a&&(t[n]=o,n++,o=0,a=0)}}if(o!==(1<({onInit:()=>{e({stage:"ready"})},onUpdateWindows:e=>{r(e)},onUpdateInputs:e=>{if(0===e.length)return null;let{type:r,id:o}=e[0];t(o),n(r)},onUpdateContent:e=>{o(e)},onDisable:()=>{n(null)},onFileNameRequest:(e,r,t,n)=>{n({usage:r,filename:prompt("Enter the filename")})},onFileRead:({filename:e})=>{let r=localStorage.getItem(`fake-fs/${e}`);return r1(r)},onFileWrite:({filename:e},r)=>{localStorage.setItem(`fake-fs/${e}`,r0(r))},onExit:()=>{n("finished")}}),r4=e=>r=>{"ExitStatus"===r.reason.name||"Program terminated with exit(0)"===r.reason.message?e():console.error("Unhandled rejection (promise: ",r.promise,", reason: ",r.reason,")."),r.preventDefault()},r6={stage:"loading",details:["Preparing"]},r3=({engine:e,wasmBinary:r,storyfile:t,handlers:n})=>{let{Dialog:o,GlkOte:a,send:i}=rN(n),s=new e;return s.init(t,{Dialog:o,GlkOte:a,Glk:{},wasmBinary:r,arguments:["storyfile"]}),s.start(),{send:i,instance:s}};function r9({vmParts:{storyfile:e,engine:r,wasmBinary:t},onFullscreenRequest:n,setMenuOpen:o,singleWindow:a}){let[i,s]=eg(r6),[u,l]=eg([]),[c,d]=eg(null),[f,m]=eg(null),[h,p]=eg([]),[v,w]=eg(null),[g,_]=eg(null);return e_(()=>{let n=r2({setStatus:s,setWindows:l,setCurrentWindowId:d,setInputType:m,setInbox:p});w(r3({engine:r,wasmBinary:t,storyfile:e,handlers:n}));let o=r4(n.onExit);return window.addEventListener("unhandledrejection",o),()=>{w(null),window.removeEventListener("unhandledrejection",o)}},[e,r,t]),e_(()=>(_(()=>v?v.send:null),()=>_(null)),[v]),"ready"!==i.stage?eo(rJ,{...i}):eo("section",{className:"PwGQsW_elseifplayer",children:[eo("section",{className:"PwGQsW_output",children:u.sort((e,r)=>e.top-r.top).filter(a?({id:e})=>e===c:()=>!0).map(e=>{let r={inbox:h,currentWindow:e};return({buffer:eo(rH,{...r}),grid:eo(rW,{...r})})[e.type]})}),eo(rX,{inputType:f,windows:u,currentWindowId:c,sendMessage:g,onFullscreenRequest:n,setMenuOpen:o})]})}const r8={stage:"loading",details:["Loading"]},r5=({url:e,setStatus:r,setParts:t})=>{let n=(e,t)=>n=>(r({stage:e,details:[t]}),n),o=e=>fetch(e).then(e=>e.arrayBuffer());return Promise.resolve(e).then(n("loading","Downloading file")).then(e=>e.startsWith("blob:")?e.replace(/#(.*)$/g,""):e).then(fetch).then(e=>{if(e.ok)return e;throw Error(e.statusText)}).then(n("loading","Processing file")).then(e=>e.arrayBuffer()).then(e=>new Uint8Array(e)).then(n("loading","Downloading engine")).then(r=>{let t=rF(e);return[r,t.engine,t.wasmBinaryName]}).then(([e,r,t])=>Promise.all([e,r,o(t)])).then(([e,r,n])=>t({storyfile:e,engine:r,wasmBinary:n})).then(n("loading","Running")).catch(t=>{console.error(t),r({stage:"fail",details:[t.message,e]})})};function r7({url:e,singleWindow:r,onFullscreenRequest:t,setMenuOpen:n}){let[o,a]=eg(r8),[i,s]=eg(null);return e_(()=>(a(r8),s(null),r5({url:e,setStatus:a,setParts:s}),()=>s(null)),[e]),i?eo(r9,{vmParts:i,onFullscreenRequest:t,setMenuOpen:n,singleWindow:r}):eo(rJ,{...o})}function te({themeEngine:e,onFullscreenRequest:r,menuOpen:t,setMenuOpen:n}){let o=eE(null);return e_(()=>{let e=o.current.open;t&&!e&&o.current.showModal(),!t&&e&&o.current.close()},[t]),e_(()=>{let e=o.current,r=()=>{n(!1)};return e.addEventListener("close",r),()=>e.removeEventListener("close",r)},[o,n]),eo("dialog",{ref:o,className:"J9zJZG_menu",children:eo("section",{children:[eo("div",{children:eo("button",{tabIndex:0,onClick:()=>o.current.close(),children:"Close this menu"})}),eo("div",{className:"J9zJZG_appearance",children:[eo("button",{onClick:()=>{o.current.close(),r()},children:"Full screen"}),eo("button",{onClick:()=>e.setRandomTheme(),children:"Set a random theme"}),eo("label",{children:["Current theme:",eo(ro,{themeEngine:e})]})]}),eo("div",{className:"J9zJZG_navigation",children:eo(eQ,{href:"/",tabIndex:0,children:"ElseIfPlayer"})})]})})}const tr=e=>decodeURIComponent(e);function tt({theme:e,themeEngine:r,encodedUrl:t,singleWindow:n}){e_(()=>{r.setTheme(e)},[e,r]);let[o,a]=eg(tr(t));e_(()=>{a(tr(t))},[t]);let[i,s]=eg(!1),u=()=>{document.documentElement.requestFullscreen()};return eo("main",{children:[eo(te,{themeEngine:r,onFullscreenRequest:u,menuOpen:i,setMenuOpen:s}),eo(r7,{url:o,onFullscreenRequest:u,setMenuOpen:s,singleWindow:n})]})}function tn(){return eo("main",{children:eo(rJ,{stage:"fail",details:["404","Page Not Found"]})})}var to={};e(to,"app",function(){return h},function(e){return h=e}),e(to,"focus",function(){return p},function(e){return p=e}),e(to,"games",function(){return v},function(e){return v=e}),e(to,"home",function(){return w},function(e){return w=e}),e(to,"play",function(){return g},function(e){return g=e}),e(to,"themes",function(){return _},function(e){return _=e}),h="X8uEDW_app",p="X8uEDW_focus",v="X8uEDW_games",w="X8uEDW_home",g="X8uEDW_play",_="X8uEDW_themes",function(e,r,t){var n,o,a;D.__&&D.__(e,r),o=(n="function"==typeof t)?null:t&&t.__k||r.__k,a=[],Z(r,e=(!n&&t||r).__k=I(U,null,[e]),o||T,T,void 0!==r.ownerSVGElement,!n&&t?[t]:o?null:r.firstChild?S.call(r.childNodes):null,a,!n&&t?t:o?o.__e:r.firstChild,n),Q(a,e)}(eo(function(){let e=rr(),[r]=e3(),t=(e,r)=>function(t){return eo(tt,{themeEngine:e,singleWindow:r,...t})};return eo(eJ,{hook:e3,children:eo("div",{className:[to.app,to[e6(r)],e.currentTheme].join(" "),children:eo(e1,{children:[eo(eZ,{path:"/",children:eo(ra,{themeEngine:e})}),eo(eZ,{path:"/games/",children:eo(rl,{})}),eo(eZ,{path:"/themes/",children:eo(rd,{themeEngine:e})}),eo(eZ,{path:"/play/:encodedUrl",children:t(e,!1)}),eo(eZ,{path:"/play/:encodedUrl/:theme",children:t(e,!1)}),eo(eZ,{path:"/focus/:encodedUrl",children:t(e,!0)}),eo(eZ,{path:"/focus/:encodedUrl/:theme",children:t(e,!0)}),eo(eZ,{children:eo(tn,{})})]})})})},{}),document.getElementById("root")); //# sourceMappingURL=index.4a5edb74.js.map