",{id:"win"+t.id+"_moreprompt",class:"MorePrompt"})).append("More");var f=t.coords.right+20,d=t.coords.bottom;s.css({bottom:d+"px",right:f+"px"}),$("#"+n,r).append(s)}u.length||(u=$("
",{id:"win"+t.id+"_prevmark",class:"PreviousMark"}),i.prepend(u)),u.css("top",t.pagefrommark+"px")}else s.length&&s.remove(),u.length&&u.remove()}})),ee(!1),s=!1,(t.disable||t.specialinput)&&(s=!0,jQuery.each(d,(function(e,t){t.inputel&&t.inputel.prop("disabled",!0)})));var l=0;if(s||h||jQuery.each(d,(function(e,t){t.input&&(l&&t.id!=p||(l=t.id))})),l){fe((function(){var e=d[l];e.inputel&&e.inputel.focus()}))}i&&(i.history&&jQuery.each(i.history,(function(e,t){const i=d[e];null!=i&&(i.history=t.slice(0),i.historypos=i.history.length)})),i.defcolor&&jQuery.each(i.defcolor,(function(e,t){const i=d[e];null!=i&&(i.defcolor=t)})),jQuery.each(d,(function(e,t){"buffer"==t.type&&function(e){var t=e.frameel,i=t.outerHeight();t.scrollTop(t.get(0).scrollHeight-i);var n=Z(e),l=t.scrollTop()+i;l>n&&(l=n);e.topunseen=t.get(0).scrollHeight){e.needspaging=!1;var o=$("#win"+e.id+"_moreprompt",r);o.length&&o.remove(),ee(!0)}}(t)})),i.metrics&&i.metrics.width==c.width&&i.metrics.height==c.height||(c.width+=2,pe())),t.page_bg&&H.css("background-color",t.page_bg)}else ie("Ignoring repeated generation number: "+o);else ie("Ignoring unknown message type "+t.type+".");else v?ie("Event has timed out, but a retry is already queued!"):(ie("Event has timed out; will retry..."),function(){if(1==u)return;u=!0;var e=document.getElementById("loadingpane");e&&(e.style.display="")}(),v=ue(2,ne))}else re(t.message)},extevent:function(e){ce("external",null,e)},getinterface:function(){return i},getdomcontext:function(){return r},setdomcontext:function(e){r=e},save_allstate:function(){var e={metrics:{width:c.width,height:c.height},history:{}};return jQuery.each(d,(function(t,i){i.history&&i.history.length&&(e.history[t]=i.history.slice(0)),i.defcolor&&(void 0===e.defcolor&&(e.defcolor={}),e.defcolor[t]=i.defcolor)})),e},log:ie,warning:function(e){if(!f)if(e){var t=document.getElementById("errorcontent");oe(t),t.appendChild(document.createTextNode(e)),$("#errorpane").addClass("WarningPane"),$("#errorpane").show(),le()}else $("#errorpane").hide()},error:re}}();function text_to_array(e){const t=[];let i,r=0;for(i=e.length%8;r{GlkOte.error("Error loading engine: "+e.status)}).then(()=>$.ajax({dataType:"jsonp",jsonp:!1,jsonpCallback:"processBase64Zcode",url:t})).catch(e=>{GlkOte.error("Error loading storyfile: "+e.status)}).then(t=>{const r=text_to_array(atob(t));if("zcode"===i){const t=new window.ZVM,i=Uint8Array.from(r),n=Object.assign({},e,{vm:t,Dialog:Dialog,GiDispa:new window.ZVMDispatch,Glk:Glk,GlkOte:GlkOte});t.prepare(i,n),Glk.init(n)}if("glulx"===i){window.Glk=Glk,window.GlkOte=GlkOte;const t=Object.assign({},e,{blorb_gamechunk_type:"GLUL",Dialog:Dialog,GiDispa:window.GiDispa,GiLoad:window.GiLoad,GlkOte:GlkOte,image_info_map:"StaticImageInfo",io:Glk,set_page_title:!1,spacing:0,vm:window.Quixe});window.GiLoad.load_run(t,r,"array")}}).catch(e=>{GlkOte.error(e)})}$(launch)})();