From e02e0327703fda84ba1147c61c9e4f93769bd504 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Mon, 6 Jan 2020 23:37:38 +0100 Subject: [PATCH] Release 46. --- ...84baa0bf1.js => 10.7df8399f968d198f371e.js | 0 ...0631f1f6b.js => 11.b1a318c0d8cb789efd94.js | 2 +- ...1b0c2d0f1.js => 12.4f45381d7f5aa03836f8.js | 2 +- 13.3fa984b8b512214c9fe0.js | 1 - 13.8c79362dc8ce9b9e7b84.js | 1 + 15.93bade89986b73950565.js | 1 + 15.ad5ebebe72b2c68cf2c5.js | 1 - 2.66f2ce46ba0f9bee08a1.js | 1 + 2.b1070a6f6fa6c5cf2aec.js | 1 - 5.484ba491fa0b7a3f94c1.js | 1 - 5.85f54f44b22e8a9e8c68.js | 1 + 6.4173c52cb2f49ac1ff21.js | 1 + 6.7067b685cd3472ddb13b.js | 1 - 7.12a9f57f99de709e8c1c.js | 1 - 7.e42840da74990ac175d2.js | 1 + ...4f3d09cd0f.js => 8.3a5cee225e5403852e30.js | 2 +- ...ec6a9c9fd2.js => 9.2c3800646e748ae2301e.js | 2 +- ...orker.js => f44b87d30b148fb9b4ec.worker.js | 2 +- index.html | 4 +- main.5341660f114e006490ee.js | 1 - main.b0be83b1e294ee64c730.js | 1 + runtime.ac99347ea364f42024a3.js | 1 - runtime.b95a150ab85352ccc02b.js | 1 + style.25d4019ddf9d3dbe0e1b.js | 1 + style.5ccbed331faa3f3853f4.js | 1 - ...f9d2.css => style.c0c047aaf2518ba440d3.css | 47 ++++++++++++++++++- 26 files changed, 62 insertions(+), 17 deletions(-) rename 10.24bc12dc67a84baa0bf1.js => 10.7df8399f968d198f371e.js (100%) rename 11.701c5dbadf50631f1f6b.js => 11.b1a318c0d8cb789efd94.js (95%) rename 12.59bd51c313f1b0c2d0f1.js => 12.4f45381d7f5aa03836f8.js (73%) delete mode 100644 13.3fa984b8b512214c9fe0.js create mode 100644 13.8c79362dc8ce9b9e7b84.js create mode 100644 15.93bade89986b73950565.js delete mode 100644 15.ad5ebebe72b2c68cf2c5.js create mode 100644 2.66f2ce46ba0f9bee08a1.js delete mode 100644 2.b1070a6f6fa6c5cf2aec.js delete mode 100644 5.484ba491fa0b7a3f94c1.js create mode 100644 5.85f54f44b22e8a9e8c68.js create mode 100644 6.4173c52cb2f49ac1ff21.js delete mode 100644 6.7067b685cd3472ddb13b.js delete mode 100644 7.12a9f57f99de709e8c1c.js create mode 100644 7.e42840da74990ac175d2.js rename 8.1adc3cf2844f3d09cd0f.js => 8.3a5cee225e5403852e30.js (64%) rename 9.aae25720b6ec6a9c9fd2.js => 9.2c3800646e748ae2301e.js (95%) rename a4d592df6dd06fe18358.worker.js => f44b87d30b148fb9b4ec.worker.js (77%) delete mode 100644 main.5341660f114e006490ee.js create mode 100644 main.b0be83b1e294ee64c730.js delete mode 100644 runtime.ac99347ea364f42024a3.js create mode 100644 runtime.b95a150ab85352ccc02b.js create mode 100644 style.25d4019ddf9d3dbe0e1b.js delete mode 100644 style.5ccbed331faa3f3853f4.js rename style.9441c4b2b261abd7f9d2.css => style.c0c047aaf2518ba440d3.css (95%) diff --git a/10.24bc12dc67a84baa0bf1.js b/10.7df8399f968d198f371e.js similarity index 100% rename from 10.24bc12dc67a84baa0bf1.js rename to 10.7df8399f968d198f371e.js diff --git a/11.701c5dbadf50631f1f6b.js b/11.b1a318c0d8cb789efd94.js similarity index 95% rename from 11.701c5dbadf50631f1f6b.js rename to 11.b1a318c0d8cb789efd94.js index a8530a4c..137c72f8 100644 --- a/11.701c5dbadf50631f1f6b.js +++ b/11.b1a318c0d8cb789efd94.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{KUR2:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));var i=s("nN8q"),r=s("FXpb");class n extends i.a{constructor(e){super(),this.renderer=e,this.element=Object(r.h)({className:"core_RendererWidget"}),this.children=[],this.element.append(e.canvas_element),this.disposable(e),this.finalize_construction()}start_rendering(){this.renderer.start_rendering()}stop_rendering(){this.renderer.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer.set_size(e,t),this}}},puLw:function(e,t,s){"use strict";s.r(t);s("zwwH");var i=s("KUR2"),r=(s("c3F4"),s("FXpb")),n=s("zsIO");class a extends n.a{constructor(e,t,s,i){super(),this.character_classes=e,this.selected=t,this.set_selected=s,this.border_left=i,this.element=Object(r.z)({className:"viewer_model_CharacterClassSelectionView"}),this.list_click=e=>{if(e.target instanceof HTMLLIElement&&e.target.dataset.index){this.selected_element&&this.selected_element.classList.remove("active"),e.target.classList.add("active");const t=parseInt(e.target.dataset.index,10);this.selected_element=e.target,this.set_selected(this.character_classes[t])}},this.element.onclick=this.list_click,i&&(this.element.style.borderLeft="var(--border)"),e.forEach((e,t)=>{this.element.append(Object(r.n)({data:{index:t.toString()}},e.name))}),this.disposables(t.observe(({value:e})=>{if(this.selected_element&&(this.selected_element.classList.remove("active"),this.selected_element=void 0),e&&e!==this.selected_model){const t=this.character_classes.indexOf(e);-1!==t&&(this.selected_element=this.element.childNodes[t],this.selected_element.classList.add("active"))}},{call_now:!0})),this.finalize_construction()}}s.d(t,"ModelView",(function(){return d}));const c=100,l=220,h=140;class d extends n.a{constructor(e,t,s,n){super(),this.element=Object(r.h)({className:"viewer_model_ModelView"}),this.tool_bar_view=this.add(t),this.character_class_selection_view=this.add(new a(e.character_classes,e.current_character_class,e.set_current_character_class,!1)),this.options_view=this.add(s),this.renderer_view=this.add(new i.a(n)),this.animation_selection_view=this.add(new a(e.animations,e.current_animation,e.set_current_animation,!0)),this.element.append(this.tool_bar_view.element,Object(r.h)({className:"viewer_model_ModelView_container"},this.character_class_selection_view.element,this.options_view.element,this.renderer_view.element,this.animation_selection_view.element)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){super.resize(e,t);const s=Math.max(0,t-this.tool_bar_view.height);return this.character_class_selection_view.resize(c,s),this.options_view.resize(l,s),this.renderer_view.resize(Math.max(0,e-c-l-h),s),this.animation_selection_view.resize(h,s),this}}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{KUR2:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));var i=s("nN8q"),r=s("FXpb");class n extends i.a{constructor(e){super(),this.renderer=e,this.element=Object(r.h)({className:"core_RendererWidget"}),this.children=[],this.element.append(e.canvas_element),this.disposable(e),this.finalize_construction()}start_rendering(){this.renderer.start_rendering()}stop_rendering(){this.renderer.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer.set_size(e,t),this}}},puLw:function(e,t,s){"use strict";s.r(t);s("zwwH");var i=s("KUR2"),r=(s("c3F4"),s("FXpb")),n=s("zsIO");class a extends n.a{constructor(e,t,s,i){super(),this.character_classes=e,this.selected=t,this.set_selected=s,this.border_left=i,this.element=Object(r.B)({className:"viewer_model_CharacterClassSelectionView"}),this.list_click=e=>{if(e.target instanceof HTMLLIElement&&e.target.dataset.index){this.selected_element&&this.selected_element.classList.remove("active"),e.target.classList.add("active");const t=parseInt(e.target.dataset.index,10);this.selected_element=e.target,this.set_selected(this.character_classes[t])}},this.element.onclick=this.list_click,i&&(this.element.style.borderLeft="var(--border)"),e.forEach((e,t)=>{this.element.append(Object(r.o)({data:{index:t.toString()}},e.name))}),this.disposables(t.observe(({value:e})=>{if(this.selected_element&&(this.selected_element.classList.remove("active"),this.selected_element=void 0),e&&e!==this.selected_model){const t=this.character_classes.indexOf(e);-1!==t&&(this.selected_element=this.element.childNodes[t],this.selected_element.classList.add("active"))}},{call_now:!0})),this.finalize_construction()}}s.d(t,"ModelView",(function(){return d}));const c=100,l=220,h=140;class d extends n.a{constructor(e,t,s,n){super(),this.element=Object(r.h)({className:"viewer_model_ModelView"}),this.tool_bar_view=this.add(t),this.character_class_selection_view=this.add(new a(e.character_classes,e.current_character_class,e.set_current_character_class,!1)),this.options_view=this.add(s),this.renderer_view=this.add(new i.a(n)),this.animation_selection_view=this.add(new a(e.animations,e.current_animation,e.set_current_animation,!0)),this.element.append(this.tool_bar_view.element,Object(r.h)({className:"viewer_model_ModelView_container"},this.character_class_selection_view.element,this.options_view.element,this.renderer_view.element,this.animation_selection_view.element)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){super.resize(e,t);const s=Math.max(0,t-this.tool_bar_view.height);return this.character_class_selection_view.resize(c,s),this.options_view.resize(l,s),this.renderer_view.resize(Math.max(0,e-c-l-h),s),this.animation_selection_view.resize(h,s),this}}}}]); \ No newline at end of file diff --git a/12.59bd51c313f1b0c2d0f1.js b/12.4f45381d7f5aa03836f8.js similarity index 73% rename from 12.59bd51c313f1b0c2d0f1.js rename to 12.4f45381d7f5aa03836f8.js index 20fb5a6b..6787a2ff 100644 --- a/12.59bd51c313f1b0c2d0f1.js +++ b/12.4f45381d7f5aa03836f8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{F0Xh:function(t,e,o){"use strict";o.r(e),o.d(e,"HelpView",(function(){return s}));o("bknw");var i=o("FXpb"),n=o("zsIO");class s extends n.a{constructor(){super(),this.element=Object(i.h)({className:"hunt_optimizer_HelpView"},Object(i.o)("Add some items with the combo box on the left to see the optimal combination of hunt methods on the right."),Object(i.o)('At the moment a hunt method is simply a quest run-through. Partial quest run-throughs are coming. View the list of methods on the "Methods" tab. Each method takes a certain amount of time, which affects the optimization result. Make sure the times are correct for you.'),Object(i.o)("Only enemy drops are considered. Box drops are coming."),Object(i.o)("The optimal result is calculated using linear optimization. The optimizer takes into account rare enemies and the fact that pan arms can be split in two.")),this.finalize_construction()}}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{F0Xh:function(t,e,o){"use strict";o.r(e),o.d(e,"HelpView",(function(){return s}));o("bknw");var i=o("FXpb"),n=o("zsIO");class s extends n.a{constructor(){super(),this.element=Object(i.h)({className:"hunt_optimizer_HelpView"},Object(i.p)("Add some items with the combo box on the left to see the optimal combination of hunt methods on the right."),Object(i.p)('At the moment a hunt method is simply a quest run-through. Partial quest run-throughs are coming. View the list of methods on the "Methods" tab. Each method takes a certain amount of time, which affects the optimization result. Make sure the times are correct for you.'),Object(i.p)("Only enemy drops are considered. Box drops are coming."),Object(i.p)("The optimal result is calculated using linear optimization. The optimizer takes into account rare enemies and the fact that pan arms can be split in two.")),this.finalize_construction()}}}}]); \ No newline at end of file diff --git a/13.3fa984b8b512214c9fe0.js b/13.3fa984b8b512214c9fe0.js deleted file mode 100644 index 138c18b1..00000000 --- a/13.3fa984b8b512214c9fe0.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{QRTb:function(t,e,n){"use strict";n.r(e),n.d(e,"TextureController",(function(){return x}));var o=n("mKaR"),c=n("wtpc"),r=n("iPoI"),s=n("yub1"),i=n("NRxM"),u=n("bcBH"),a=n("/UnV"),l=n("rwco"),f=n("ouMO"),w=function(t,e,n,o){return new(n||(n=Promise))((function(c,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function i(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?c(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,i)}u((o=o.apply(t,e||[])).next())}))};const h=l.c.get("viewer/controllers/TextureController");class x extends o.a{constructor(){super(...arguments),this._textures=Object(f.c)(),this.textures=this._textures,this.load_file=t=>w(this,void 0,void 0,(function*(){try{const e=Object(c.g)(t.name).toLowerCase(),n=yield Object(r.b)(t);if("xvm"===e){const t=Object(s.a)(new i.a(n,u.a.Little));this._textures.splice(0,1/0,...t.textures)}else if("afs"===e){const t=Object(a.a)(new i.a(n,u.a.Little)),e=[];for(const n of t){const t=Object(s.a)(new i.a(n,u.a.Little));e.push(...t.textures)}this._textures.val=e}}catch(t){h.error("Couldn't read file.",t)}}))}}}}]); \ No newline at end of file diff --git a/13.8c79362dc8ce9b9e7b84.js b/13.8c79362dc8ce9b9e7b84.js new file mode 100644 index 00000000..c4b33092 --- /dev/null +++ b/13.8c79362dc8ce9b9e7b84.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{QRTb:function(e,t,n){"use strict";n.r(t),n.d(t,"TextureController",(function(){return h}));var s=n("mKaR"),r=n("wtpc"),o=n("iPoI"),c=n("yub1"),u=n("NRxM"),a=n("bcBH"),i=n("/UnV"),l=n("rwco"),b=n("ouMO"),d=n("IMNf"),f=n("BAAx"),v=n("EVkk"),p=n("5cb6"),x=function(e,t,n,s){return new(n||(n=Promise))((function(r,o){function c(e){try{a(s.next(e))}catch(e){o(e)}}function u(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}a((s=s.apply(e,t||[])).next())}))};const w=l.a.get("viewer/controllers/TextureController");class h extends s.a{constructor(){super(...arguments),this._textures=Object(b.c)(),this.textures=this._textures,this.load_file=e=>x(this,void 0,void 0,(function*(){let t;try{const n=Object(r.g)(e.name).toLowerCase(),s=yield Object(o.b)(e),l=new u.a(s,a.a.Little);if("xvm"===n){const e=t=Object(c.b)(l);e.success&&(this._textures.val=e.value.textures)}else if("afs"===n){const e=Object(f.b)(w),n=Object(i.a)(l);if(e.add_result(n),n.success){const s=n.value.flatMap(t=>{var n,s,r,o;const i=new u.a(t,a.a.Little);if(Object(c.a)(i)){const t=Object(c.b)(i);return e.add_result(t),null!=(s=null===(n=t.value)||void 0===n?void 0:n.textures)?s:[]}{const t=Object(c.b)(Object(d.a)(i.seek_start(0)));return e.add_result(t),null!=(o=null===(r=t.value)||void 0===r?void 0:r.textures)?o:[]}});t=s.length?e.success(s):e.failure(),this._textures.val=s}else t=e.failure()}else w.debug(`Unsupported file extension in filename "${e.name}".`),t=Object(f.a)([{severity:p.b.Error,ui_message:"Unsupported file type."}])}catch(e){w.error("Couldn't read file.",e),t=Object(f.a)()}Object(v.a)(t,`Encountered some problems while opening "${e.name}".`,`Couldn't open "${e.name}".`)}))}}}}]); \ No newline at end of file diff --git a/15.93bade89986b73950565.js b/15.93bade89986b73950565.js new file mode 100644 index 00000000..ffd5dfa0 --- /dev/null +++ b/15.93bade89986b73950565.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{ZV42:function(e,t,o){"use strict";o.r(t),o.d(t,"CharacterClassAssetLoader",(function(){return l}));var s=o("kwt4"),a=o("NRxM"),n=o("bcBH"),i=o("VwSi"),c=o("9fJw"),r=o("yub1"),d=o("/UnV"),h=o("nsCy"),_=o("BAAx"),u=function(e,t,o,s){return new(o||(o=Promise))((function(a,n){function i(e){try{r(s.next(e))}catch(e){n(e)}}function c(e){try{r(s.throw(e))}catch(e){n(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,c)}r((s=s.apply(e,t||[])).next())}))};class l{constructor(e){this.http_client=e,this.nj_object_cache=new Map,this.xvr_texture_cache=new Map,this.nj_motion_cache=new Map}dispose(){for(const e of this.nj_object_cache.values())e.dispose();for(const e of this.nj_motion_cache.values())e.dispose();this.nj_object_cache.clear(),this.nj_motion_cache.clear()}load_geometry(e){let t=this.nj_object_cache.get(e.name);return t||(t=this.load_all_nj_objects(e),this.nj_object_cache.set(e.name,t)),t}load_all_nj_objects(e){const t=b(e,h.e.Viridia,0);return this.load_body_part_geometry(e.name,"Body").then(o=>{if(!o)throw new Error(`Couldn't load body for player class ${e.name}.`);return this.load_body_part_geometry(e.name,"Head",0).then(s=>{if(!s)return o;let a=1+t.body.length;return this.shift_texture_ids(s,a),this.add_to_bone(o,s,59),0===e.hair_style_count?o:this.load_body_part_geometry(e.name,"Hair",0).then(n=>n?(a+=t.head.length,this.shift_texture_ids(n,a),this.add_to_bone(s,n,0),e.hair_styles_with_accessory.has(0)?this.load_body_part_geometry(e.name,"Accessory",0).then(e=>(e&&(a+=t.hair.length,this.shift_texture_ids(e,a),this.add_to_bone(n,e,0)),o)):o):o)})})}load_body_part_geometry(e,t,o){return this.http_client.get(function(e,t,o){return`/player/${e}${t}${null==o?"":o}.nj`}(e,t,o)).array_buffer().then(e=>Object(_.d)(Object(s.c)(new a.a(e,n.a.Little)))[0])}shift_texture_ids(e,t){if(e.model)for(const o of e.model.meshes)null!=o.texture_id&&(o.texture_id+=t);for(const o of e.children)this.shift_texture_ids(o,t)}add_to_bone(e,t,o){const s=e.get_bone(o);s&&(s.evaluation_flags.hidden=!1,s.evaluation_flags.break_child_trace=!1,s.add_child(t))}load_textures(e,t,o){return u(this,void 0,void 0,(function*(){let s=this.xvr_texture_cache.get(e.name);s||(s=this.http_client.get(`/player/${e.name}Tex.afs`).array_buffer().then(e=>{const t=Object(d.a)(new a.a(e,n.a.Little)),o=[];if(t.success)for(const e of t.value){const t=Object(r.b)(new a.a(e,n.a.Little));t.success&&o.push(...t.value.textures)}return o}));const i=yield s,c=b(e,t,o);return[c.section_id,...c.body,...c.head,...c.hair,...c.accessories].map(e=>null==e?void 0:i[e])}))}load_animation(e,t){let o=this.nj_motion_cache.get(e);return o||(o=this.http_client.get(`/player/animation/animation_${e.toString().padStart(3,"0")}.njm`).array_buffer().then(e=>Object(i.c)(new a.a(e,n.a.Little),t))),o}}function b(e,t,o){switch(e){case c.g:{const e=3*o;return{section_id:t+126,body:[e,e+1,e+2,o+108],head:[54,55],hair:[94,95],accessories:[]}}case c.h:{const e=13*o;return{section_id:t+299,body:[e+13,e,e+1,e+2,e+3,277,o+281],head:[235,239],hair:[260,259],accessories:[]}}case c.f:{const e=5*o;return{section_id:t+275,body:[e,e+1,e+2,o+250],head:[e+3,e+4],hair:[],accessories:[]}}case c.e:{const e=5*o;return{section_id:t+375,body:[e,e+1,e+2],head:[e+3,e+4],hair:[],accessories:[]}}case c.k:{const e=7*o;return{section_id:t+197,body:[e+4,e+5,e+6,o+179],head:[126,127],hair:[166,167],accessories:[void 0,void 0,e+2]}}case c.l:{const e=16*o;return{section_id:t+322,body:[e+15,e+1,e],head:[288],hair:[308,309],accessories:[void 0,void 0,e+8]}}case c.j:{const e=5*o;return{section_id:t+300,body:[e,e+1,e+2,e+3,o+275],head:[e+4],hair:[],accessories:[]}}case c.i:{const e=5*o;return{section_id:t+375,body:[o+350,e,e+1,e+2],head:[e+3],hair:[e+4],accessories:[]}}case c.a:{const e=0===o?0:15*o+2;return{section_id:t+310,body:[e+12,e+13,e+14,e],head:[276,272],hair:[void 0,296,297],accessories:[e+4]}}case c.b:{const e=16*o;return{section_id:t+326,body:[e,e+2,e+1,322],head:[288],hair:[void 0,void 0,308],accessories:[e+3,e+4]}}case c.d:{const e=17*o;return{section_id:t+344,body:[e+4,340,e,e+5],head:[306,310],hair:[void 0,void 0,330],accessories:[e+6,e+16,330]}}case c.c:{const e=26*o;return{section_id:t+505,body:[e+1,e,e+2,501],head:[472,468],hair:[void 0,void 0,492],accessories:[e+12,e+13]}}default:throw new Error(`No textures for character class ${e.name}.`)}}}}]); \ No newline at end of file diff --git a/15.ad5ebebe72b2c68cf2c5.js b/15.ad5ebebe72b2c68cf2c5.js deleted file mode 100644 index a1013476..00000000 --- a/15.ad5ebebe72b2c68cf2c5.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{ZV42:function(e,t,o){"use strict";o.r(t),o.d(t,"CharacterClassAssetLoader",(function(){return u}));var s=o("kwt4"),a=o("NRxM"),n=o("bcBH"),i=o("VwSi"),r=o("9fJw"),c=o("yub1"),d=o("/UnV"),h=o("nsCy"),_=function(e,t,o,s){return new(o||(o=Promise))((function(a,n){function i(e){try{c(s.next(e))}catch(e){n(e)}}function r(e){try{c(s.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,r)}c((s=s.apply(e,t||[])).next())}))};class u{constructor(e){this.http_client=e,this.nj_object_cache=new Map,this.xvr_texture_cache=new Map,this.nj_motion_cache=new Map}dispose(){for(const e of this.nj_object_cache.values())e.dispose();for(const e of this.nj_motion_cache.values())e.dispose();this.nj_object_cache.clear(),this.nj_motion_cache.clear()}load_geometry(e){let t=this.nj_object_cache.get(e.name);return t||(t=this.load_all_nj_objects(e),this.nj_object_cache.set(e.name,t)),t}load_all_nj_objects(e){const t=l(e,h.e.Viridia,0);return this.load_body_part_geometry(e.name,"Body").then(o=>{if(!o)throw new Error(`Couldn't load body for player class ${e.name}.`);return this.load_body_part_geometry(e.name,"Head",0).then(s=>{if(!s)return o;let a=1+t.body.length;return this.shift_texture_ids(s,a),this.add_to_bone(o,s,59),0===e.hair_style_count?o:this.load_body_part_geometry(e.name,"Hair",0).then(n=>n?(a+=t.head.length,this.shift_texture_ids(n,a),this.add_to_bone(s,n,0),e.hair_styles_with_accessory.has(0)?this.load_body_part_geometry(e.name,"Accessory",0).then(e=>(e&&(a+=t.hair.length,this.shift_texture_ids(e,a),this.add_to_bone(n,e,0)),o)):o):o)})})}load_body_part_geometry(e,t,o){return this.http_client.get(function(e,t,o){return`/player/${e}${t}${null==o?"":o}.nj`}(e,t,o)).array_buffer().then(e=>Object(s.c)(new a.a(e,n.a.Little))[0])}shift_texture_ids(e,t){if(e.model)for(const o of e.model.meshes)null!=o.texture_id&&(o.texture_id+=t);for(const o of e.children)this.shift_texture_ids(o,t)}add_to_bone(e,t,o){const s=e.get_bone(o);s&&(s.evaluation_flags.hidden=!1,s.evaluation_flags.break_child_trace=!1,s.add_child(t))}load_textures(e,t,o){return _(this,void 0,void 0,(function*(){let s=this.xvr_texture_cache.get(e.name);s||(s=this.http_client.get(`/player/${e.name}Tex.afs`).array_buffer().then(e=>{const t=Object(d.a)(new a.a(e,n.a.Little)),o=[];for(const e of t){const t=Object(c.a)(new a.a(e,n.a.Little));o.push(...t.textures)}return o}));const i=yield s,r=l(e,t,o);return[r.section_id,...r.body,...r.head,...r.hair,...r.accessories].map(e=>null==e?void 0:i[e])}))}load_animation(e,t){let o=this.nj_motion_cache.get(e);return o||(o=this.http_client.get(`/player/animation/animation_${e.toString().padStart(3,"0")}.njm`).array_buffer().then(e=>Object(i.c)(new a.a(e,n.a.Little),t))),o}}function l(e,t,o){switch(e){case r.g:{const e=3*o;return{section_id:t+126,body:[e,e+1,e+2,o+108],head:[54,55],hair:[94,95],accessories:[]}}case r.h:{const e=13*o;return{section_id:t+299,body:[e+13,e,e+1,e+2,e+3,277,o+281],head:[235,239],hair:[260,259],accessories:[]}}case r.f:{const e=5*o;return{section_id:t+275,body:[e,e+1,e+2,o+250],head:[e+3,e+4],hair:[],accessories:[]}}case r.e:{const e=5*o;return{section_id:t+375,body:[e,e+1,e+2],head:[e+3,e+4],hair:[],accessories:[]}}case r.k:{const e=7*o;return{section_id:t+197,body:[e+4,e+5,e+6,o+179],head:[126,127],hair:[166,167],accessories:[void 0,void 0,e+2]}}case r.l:{const e=16*o;return{section_id:t+322,body:[e+15,e+1,e],head:[288],hair:[308,309],accessories:[void 0,void 0,e+8]}}case r.j:{const e=5*o;return{section_id:t+300,body:[e,e+1,e+2,e+3,o+275],head:[e+4],hair:[],accessories:[]}}case r.i:{const e=5*o;return{section_id:t+375,body:[o+350,e,e+1,e+2],head:[e+3],hair:[e+4],accessories:[]}}case r.a:{const e=0===o?0:15*o+2;return{section_id:t+310,body:[e+12,e+13,e+14,e],head:[276,272],hair:[void 0,296,297],accessories:[e+4]}}case r.b:{const e=16*o;return{section_id:t+326,body:[e,e+2,e+1,322],head:[288],hair:[void 0,void 0,308],accessories:[e+3,e+4]}}case r.d:{const e=17*o;return{section_id:t+344,body:[e+4,340,e,e+5],head:[306,310],hair:[void 0,void 0,330],accessories:[e+6,e+16,330]}}case r.c:{const e=26*o;return{section_id:t+505,body:[e+1,e,e+2,501],head:[472,468],hair:[void 0,void 0,492],accessories:[e+12,e+13]}}default:throw new Error(`No textures for character class ${e.name}.`)}}}}]); \ No newline at end of file diff --git a/2.66f2ce46ba0f9bee08a1.js b/2.66f2ce46ba0f9bee08a1.js new file mode 100644 index 00000000..4b697831 --- /dev/null +++ b/2.66f2ce46ba0f9bee08a1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"/Wax":function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("9dYx");class n extends s.a{constructor(t,e,i=0,s=t.size-i){if(i<0||i>t.size)throw new Error(`Offset ${i} is out of bounds.`);if(s<0||i+s>t.size)throw new Error(`Size ${s} is out of bounds.`);super(e,i),this.buffer=t,this._size=s}get size(){return this._size}set size(t){t>this._size?this.ensure_size(t-this.position):this._size=t}get backing_buffer(){return this.buffer.backing_buffer}get dv(){return this.buffer.view}take(t){this.check_size("size",t,t);const e=this.offset+this.position,i=new n(this.buffer,this.endianness,e,t);return this._position+=t,i}ensure_size(t,e=this.position){const i=e+t-this._size;i>0&&(this._size+=i,this.buffer.size{this._value.set_val(this.get_value(),{silent:!1})}),n&&n.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(t){super.set_enabled(t),this.input_element.disabled=!t}set_attr(t,e,i){if(null==e)return;const s=this.input_element,r=i||(t=>t);Object(n.a)(e)?(s[t]=r(e.val),this.disposable(e.observe(({value:e})=>s[t]=r(e)))):s[t]=r(e)}}},"488w":function(t,e,i){"use strict";i.d(e,"b",(function(){return l})),i.d(e,"a",(function(){return d}));var s=i("Womt"),n=i("tRdk"),r=i("kwt4"),o=i("vM2b");const a=new s.Vector3(0,1,0),u=new s.Vector2(0,0),h=new s.Vector3(0,0,0),c=new s.Quaternion(0,0,0,1),_=new s.Vector3(1,1,1);function l(t,e){new p(e).to_geometry_builder(t)}function d(t){return new p(new o.a).create_buffer_geometry(t)}class f{constructor(){this.vertices_stack=[]}put(t){this.vertices_stack.push(t)}get(t){const e=[];for(let i=this.vertices_stack.length-1;i>=0;i--){const s=this.vertices_stack[i][t];s&&e.push(s)}return e}}class p{constructor(t){this.vertices=new f,this.bone_id=0,this.builder=t}to_geometry_builder(t){this.object_to_geometry(t,void 0,new s.Matrix4)}create_buffer_geometry(t){return this.to_geometry_builder(t),this.builder.build()}object_to_geometry(t,e,i){const{no_translate:r,no_rotate:o,no_scale:a,hidden:u,break_child_trace:l,zxy_rotation_order:d,skip:f}=t.evaluation_flags,{position:p,rotation:b,scale:g}=t,w=new s.Euler(b.x,b.y,b.z,d?"ZXY":"ZYX"),m=(new s.Matrix4).compose(r?h:Object(n.a)(p),o?c:(new s.Quaternion).setFromEuler(w),a?_:Object(n.a)(g)).premultiply(i);let v;if(f?v=e:(v=new s.Bone,v.name=this.bone_id.toString(),v.position.set(p.x,p.y,p.z),v.setRotationFromEuler(w),v.scale.set(g.x,g.y,g.z),this.builder.add_bone(v),e&&e.add(v)),t.model&&!u&&this.model_to_geometry(t.model,m),this.bone_id++,!l)for(const e of t.children)this.object_to_geometry(e,v,m)}model_to_geometry(t,e){Object(r.b)(t)?this.njcm_model_to_geometry(t,e):this.xj_model_to_geometry(t,e)}njcm_model_to_geometry(t,e){const i=(new s.Matrix3).getNormalMatrix(e),r=t.vertices.map(t=>{const r=Object(n.a)(t.position),o=t.normal?Object(n.a)(t.normal):new s.Vector3(0,1,0);return r.applyMatrix4(e),o.applyMatrix3(i),{bone_id:this.bone_id,position:r,normal:o,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}});this.vertices.put(r);for(const e of t.meshes){const t=this.builder.index_count;for(let t=0;t=2&&(t%2==(e.clockwise_winding?1:0)?(this.builder.add_index(o-2),this.builder.add_index(o-1),this.builder.add_index(o)):(this.builder.add_index(o-2),this.builder.add_index(o),this.builder.add_index(o-1)));const h=[[0,0],[0,0],[0,0],[0,0]];for(let t=s.length-1;t>=0;t--){const e=s[t];h[e.bone_weight_status]=[e.bone_id,e.bone_weight]}const c=h.reduce((t,[,e])=>t+e,0);for(const[t,e]of h)this.builder.add_bone_weight(t,c>0?e/c:e)}}this.builder.add_group(t,this.builder.index_count-t,e.texture_id)}}xj_model_to_geometry(t,e){const i=this.builder.vertex_count,r=(new s.Matrix3).getNormalMatrix(e);for(const{position:i,normal:o,uv:a}of t.vertices){const t=Object(n.a)(i).applyMatrix4(e),h=(o?Object(n.a)(o):new s.Vector3(0,1,0)).applyMatrix3(r),c=a||u;this.builder.add_vertex(t,h,c)}let o;for(const e of t.meshes){const t=this.builder.index_count;let s=!1;for(let t=2;t=2&&(s=!s),s?(this.builder.add_index(r),this.builder.add_index(n),this.builder.add_index(o)):(this.builder.add_index(n),this.builder.add_index(r),this.builder.add_index(o)),s=!s}null!=e.material_properties.texture_id&&(o=e.material_properties.texture_id),this.builder.add_group(t,this.builder.index_count-t,o)}}}},"6cU9":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("ouMO"),n=i("KVVN"),r=i("iPoI"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{u(s.next(t))}catch(t){r(t)}}function a(t){try{u(s.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((s=s.apply(t,e||[])).next())}))};class a extends n.a{constructor(t){super(t),this._files=Object(s.e)([]),this.files=this._files,this.element.classList.add("core_FileButton"),this.disposables(this.onclick.observe(()=>o(this,void 0,void 0,(function*(){this._files.val=yield Object(r.a)(t)})))),this.finalize_construction()}}},"9Ykw":function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return u}));var s=i("BAAx"),n=i("rwco"),r=i("5cb6");const o=n.a.get("core/data_formats/parsing/iff");function a(t,e=!1){return h(t,e,[],(t,e,i)=>({type:e,data:t.take(i)}))}function u(t,e=!1){return h(t,e,[],(t,e,i)=>({type:e,size:i}))}function h(t,e,i,n){const a=Object(s.b)(o);let u=!1;for(;t.bytes_left>=8;){const s=t.u32(),o=t.position,h=t.u32();if(h>t.bytes_left){u=!0,e||a.add_problem(0===i.length?r.b.Error:r.b.Warning,"Invalid IFF format.",`Size ${h} was too large (only ${t.bytes_left} bytes left) at position ${o}.`);break}i.push(n(t,s,h))}return u&&0===i.length?a.failure():a.success(i)}},"9dYx":function(t,e,i){"use strict";var s=i("bcBH");class n{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends n{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_i32_array(t){return this.write_i32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let s=0;si)throw new Error(`${t} Bytes required but only ${i} available.`)}}},BAAx:function(t,e,i){"use strict";function s(t,e){return{success:!0,value:t,problems:null!=e?e:[]}}function n(t){return{success:!1,problems:null!=t?t:[]}}function r(t){if(t.success)return t.value;throw new Error(t.problems.join("\n"))}function o(t){return new a(t)}i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return n})),i.d(e,"d",(function(){return r})),i.d(e,"b",(function(){return o}));class a{constructor(t){this.logger=t,this.problems=[]}add_problem(t,e,i,s){return this.logger.log(t,i,s),this.problems.push({severity:t,ui_message:e}),this}add_result(t){return this.problems.push(...t.problems),this}success(t){return s(t,this.problems)}failure(){return n(this.problems)}}},Eqai:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return u}));var s=i("Womt");const n=new s.MeshLambertMaterial({color:65280,side:s.DoubleSide}),r=new s.MeshLambertMaterial({color:16711935,side:s.DoubleSide}),o=new s.MeshLambertMaterial({skinning:!0,color:16711935,side:s.DoubleSide});function a(t,e,i=r){return h(t,e,i,s.Mesh)}function u(t,e,i=o){return h(t,e,i,s.SkinnedMesh)}function h(t,e,i,r){const{created_by_geometry_builder:o,normalized_material_indices:a,bones:u}=t.userData;let h;if(Array.isArray(e))if(o){h=[n];for(const[t,s]of a.entries())s>0&&(h[s]=e[t]||i)}else h=e;else h=e||i;const c=new r(t,h);return o&&u.length&&c instanceof s.SkinnedMesh&&(c.add(u[0]),c.bind(new s.Skeleton(u))),c}},Ftn7:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("pVCM"),n=i("Womt");s.a.install({THREE:Object.assign(Object.assign({},n),{MOUSE:Object.assign(Object.assign({},n.MOUSE),{LEFT:n.MOUSE.RIGHT,RIGHT:n.MOUSE.LEFT})})});class r{constructor(t){this._debug=!1,this.scene=new n.Scene,this.light_holder=new n.Group,this.render_scheduled=!1,this.animation_frame_handle=void 0,this.light=new n.HemisphereLight(16777215,5263440,1),this.controls_clock=new n.Clock,this.size=new n.Vector2(0,0),this.schedule_render=()=>{this.render_scheduled=!0},this.on_mouse_down=t=>{t.currentTarget&&t.currentTarget.focus()},this.call_render=()=>{const t=this.controls.update(this.controls_clock.getDelta()),e=this.render_scheduled||t;this.render_scheduled=!1,e&&this.render(),this.animation_frame_handle=requestAnimationFrame(this.call_render)},this.renderer=t,this.renderer.domElement.tabIndex=0,this.renderer.domElement.addEventListener("mousedown",this.on_mouse_down),this.renderer.domElement.style.outline="none",this.scene.background=new n.Color(1579032),this.light_holder.add(this.light),this.scene.add(this.light_holder)}get debug(){return this._debug}set debug(t){this._debug=t}get canvas_element(){return this.renderer.domElement}set_size(t,e){this.size.set(t,e),this.renderer.setSize(t,e),this.schedule_render()}pointer_pos_to_device_coords(t){t.set(t.x/this.size.width*2-1,t.y/this.size.height*-2+1)}start_rendering(){null==this.animation_frame_handle&&(this.schedule_render(),this.animation_frame_handle=requestAnimationFrame(this.call_render))}stop_rendering(){null!=this.animation_frame_handle&&(cancelAnimationFrame(this.animation_frame_handle),this.animation_frame_handle=void 0)}reset_camera(t,e){this.controls.setLookAt(t.x,t.y,t.z,e.x,e.y,e.z)}dispose(){this.renderer.dispose(),this.controls.dispose()}init_camera_controls(){this.controls=new s.a(this.camera,this.renderer.domElement),this.controls.dampingFactor=1,this.controls.draggingDampingFactor=1}render(){this.renderer.render(this.scene,this.camera)}}},IMNf:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("/Wax"),n=i("tjEv");const r=i("rwco").a.get("core/data_formats/compression/prs/decompress");function o(t){const e=new a(t);for(;;)if(1===e.read_flag_bit())e.copy_u8();else{let t,i;if(0===e.read_flag_bit())t=e.read_flag_bit()<<1,t|=e.read_flag_bit(),t+=2,i=e.read_u8()-256;else{if(i=e.read_u16(),0===i)break;t=7&i,i>>>=3,0===t?(t=e.read_u8(),t+=1):t+=2,i-=8192}e.offset_copy(i,t)}return e.dst.seek_start(0)}class a{constructor(t){this.src=t,this.dst=new s.a(new n.a(Math.floor(1.5*t.size)),t.endianness),this.flags=0,this.flag_bits_left=0}read_flag_bit(){0===this.flag_bits_left&&(this.flags=this.read_u8(),this.flag_bits_left=8);const t=1&this.flags;return this.flags>>>=1,this.flag_bits_left-=1,t}copy_u8(){this.dst.write_u8(this.read_u8())}read_u8(){return this.src.u8()}read_u16(){return this.src.u16()}offset_copy(t,e){(t<-8192||t>0)&&r.error(`offset was ${t}, should be between -8192 and 0.`),(e<1||e>256)&&r.error(`length was ${e}, should be between 1 and 256.`);const i=Math.min(-t,e);this.dst.seek(t);const s=this.dst.take(i);this.dst.seek(-t-i);for(let t=0;tthis.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new n(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},PE7g:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("0Xme");i("rY5A");class n extends s.a{constructor(t=0,e){if(super(t,"core_NumberInput","number","core_NumberInput_inner",e),this.preferred_label_position="left",e){const{min:t,max:i,step:s,width:n}=e;this.set_attr("min",t,String),this.set_attr("max",i,String),this.input_element.step="any",this.set_attr("step",s,String),null!=n&&(this.element.style.width=`${n}px`)}e&&null!=e.round_to&&e.round_to>=0?this.rounding_factor=Math.pow(10,e.round_to):this.rounding_factor=1,this.set_value(t),this.finalize_construction()}get_value(){return parseFloat(this.input_element.value)}set_value(t){this.input_element.valueAsNumber=Math.round(this.rounding_factor*t)/this.rounding_factor}}},bcBH:function(t,e,i){"use strict";var s;i.d(e,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},iPoI:function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return r}));var s=i("FXpb");function n(t){return new Promise(e=>{var i,n,r,o;const a=Object(s.m)({type:"file"});a.accept=null!=(n=null===(i=t)||void 0===i?void 0:i.accept)?n:"",a.multiple=null!=(o=null===(r=t)||void 0===r?void 0:r.multiple)&&o,a.onchange=()=>{a.files&&a.files.length?e([...a.files]):e([])},a.click()})}function r(t){return new Promise((e,i)=>{const s=new FileReader;s.addEventListener("loadend",()=>{s.result instanceof ArrayBuffer?e(s.result):i(new Error("Couldn't read file."))}),s.readAsArrayBuffer(t)})}},iR5r:function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return r}));var s=i("Womt");function n(t){return t.textures.map(r)}function r(t){let e,i;switch(t.format[1]){case 6:e=s.RGBA_S3TC_DXT1_Format,i=t.width*t.height/2;break;case 7:e=s.RGBA_S3TC_DXT3_Format,i=t.width*t.height;break;default:throw new Error(`Format ${t.format.join(", ")} not supported.`)}const n=new s.CompressedTexture([{data:new Uint8Array(t.data,0,i),width:t.width,height:t.height}],t.width,t.height,e);return n.minFilter=s.LinearFilter,n.wrapS=s.MirroredRepeatWrapping,n.wrapT=s.MirroredRepeatWrapping,n.needsUpdate=!0,n}},kwt4:function(t,e,i){"use strict";var s=i("9Ykw"),n=i("rwco");const r=n.a.get("core/data_formats/parsing/ninja/njcm");var o;function a(t,e){const i=t.u32(),s=t.u32(),n=t.vec3_f32(),r=t.f32(),a=[],h=[];if(i){t.seek_start(i);for(const i of u(t,e,!0))if(i.type===o.Vertex)for(const t of i.vertices)a[t.index]={position:t.position,normal:t.normal,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}}if(s){t.seek_start(s);let i=void 0;for(const s of u(t,e,!1))if(s.type===o.Tiny)i=s.texture_id;else if(s.type===o.Strip){for(const t of s.triangle_strips)t.texture_id=i;h.push(...s.triangle_strips)}}return{type:"njcm",vertices:a,meshes:h,collision_sphere_center:n,collision_sphere_radius:r}}function u(t,e,i){const s=[];let n=!0;for(;n;){const a=t.u8(),_=t.u8(),l=t.position;let d=0;if(0===a)s.push({type:o.Null,type_id:a});else if(1<=a&&a<=3)s.push({type:o.Bits,type_id:a});else if(4===a){const i=_,r=t.position;s.push({type:o.CachePolygonList,type_id:a,cache_index:i,offset:r}),e[i]=r,n=!1}else if(5===a){const n=_,r=e[n];null!=r&&(t.seek_start(r),s.push(...u(t,e,i))),s.push({type:o.DrawPolygonList,type_id:a,cache_index:n})}else if(8<=a&&a<=9){d=2;const e=t.u16();s.push({type:o.Tiny,type_id:a,flip_u:0!=(128&a),flip_v:0!=(64&a),clamp_u:0!=(32&a),clamp_v:0!=(16&a),mipmap_d_adjust:15&a,filter_mode:e>>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(d=2+2*t.u16(),s.push({type:o.Material,type_id:a})):32<=a&&a<=50?(d=2+4*t.u16(),s.push({type:o.Vertex,type_id:a,vertices:h(t,a,_)})):56<=a&&a<=58?(d=2+2*t.u16(),s.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(d=2+2*t.u16(),s.push({type:o.Strip,type_id:a,triangle_strips:c(t,a,_)})):255===a?(d=i?2:0,s.push({type:o.End,type_id:a}),n=!1):(d=2+2*t.u16(),s.push({type:o.Unknown,type_id:a}),r.warning(`Unknown chunk type ${a} at offset ${l}.`));t.seek_start(l+d)}return s}function h(t,e,i){if(e<32||e>50)return r.warning(`Unknown vertex chunk type ${e}.`),[];const s=3&i,n=0!=(128&i),o=t.u16(),a=t.u16(),u=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}u.push(r)}return u}function c(t,e,i){const s={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},n=t.u16(),r=n>>>14,o=16383&n;let a=!1,u=!1,h=!1,c=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:h=!0;break;case 68:case 69:a=!0,h=!0;break;case 70:u=!0;break;case 71:case 72:a=!0,u=!0;break;case 73:break;case 74:case 75:c=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const _=[];for(let e=0;e=2&&t.seek(2*r)}_.push(Object.assign(Object.assign({},s),{clockwise_winding:i,has_tex_coords:a,has_normal:h,vertices:o}))}return _}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const _=n.a.get("core/data_formats/parsing/ninja/xj");function l(t){t.seek(4);const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&_.warning(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const s=t.u32(),n=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===g),o=[];for(const t of r)o.push(...z(t.data,e,i));return Object(p.c)(o,n.problems)}function z(t,e,i){const s=t.u32(),n=0!=(1&s),r=0!=(2&s),o=0!=(4&s),a=0!=(8&s),u=0!=(16&s),h=0!=(32&s),c=0!=(64&s),_=0!=(128&s),l=t.u32(),d=t.vec3_f32(),f={x:t.i32()*b,y:t.i32()*b,z:t.i32()*b},p=t.vec3_f32(),g=t.u32(),w=t.u32();let v,y,k;return l&&(t.seek_start(l),v=e(t,i)),g?(t.seek_start(g),y=z(t,e,i)):y=[],w?(t.seek_start(w),k=z(t,e,i)):k=[],[new m({no_translate:n,no_rotate:r,no_scale:o,hidden:a,break_child_trace:u,zxy_rotation_order:h,skip:c,shape_skip:_},v,d,f,p,y),...k]}},mKaR:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("Tpfs");class n{constructor(){this.disposer=new s.a}dispose(){this.disposer.dispose()}disposable(t){return this.disposer.add(t)}disposables(...t){this.disposer.add_all(...t)}}},oyid:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("sDu+"),n=i("4VsB"),r=i("FXpb");class o extends s.a{constructor(t=!1,e){super(e),this.element=Object(r.m)({className:"core_CheckBox"}),this.preferred_label_position="right",this._checked=new n.a(this,t,this.set_checked),this.checked=this._checked,this.set_checked(t),this.element.type="checkbox",this.element.onchange=()=>this._checked.set_val(this.element.checked,{silent:!1}),this.finalize_construction()}set_enabled(t){super.set_enabled(t),this.element.disabled=!t}set_checked(t){this.element.checked=t}}},tRdk:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("Womt");function n(t){return new s.Vector3(t.x,t.y,t.z)}},tjEv:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t=8192){this._size=0,this._buffer=new ArrayBuffer(t),this._data_view=new DataView(this._buffer)}get size(){return this._size}set size(t){if(t<0)throw new Error("Size should be non-negative.");this.ensure_capacity(t),this._size=t}get capacity(){return this._buffer.byteLength}get backing_buffer(){return this._buffer}get view(){return this._data_view}sub_view(t,e){return new DataView(this._buffer,t,e)}ensure_capacity(t){if(t>this.capacity){let e=this.capacity||t;do{e*=2}while(et-e))i.set(t,n++);for(const e of this.groups)t.addGroup(e.offset,e.size,i.get(e.material_index));return e.normalized_material_indices=i,t.computeBoundingSphere(),t.computeBoundingBox(),t}}},w6HN:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("TRid"),n=(i("IQIM"),i("sDu+")),r=i("FXpb");class o extends s.a{constructor(t,...e){super(t instanceof s.a?void 0:t),this.element=Object(r.h)({className:"core_ToolBar"}),this.height=33,this.element.style.height=`${this.height}px`,this.children=t instanceof s.a?[t,...e]:e;for(const t of this.children)if(this.disposable(t),t instanceof n.a&&t.label){const e=Object(r.h)({className:"core_ToolBar_group"});"left"===t.preferred_label_position||"top"===t.preferred_label_position?e.append(t.label.element,t.element):e.append(t.element,t.label.element),this.element.append(e)}else this.element.append(t.element);this.finalize_construction()}set_enabled(t){super.set_enabled(t);for(const e of this.children)e.enabled.val=t}}},yub1:function(t,e,i){"use strict";i.d(e,"a",(function(){return c})),i.d(e,"b",(function(){return _}));var s=i("9Ykw"),n=i("rwco"),r=i("BAAx"),o=i("5cb6");const a=n.a.get("core/data_formats/parsing/ninja/texture"),u=1213027928,h=1414682200;function c(t){const e=Object(s.b)(t,!0);return t.seek_start(0),e.success&&null!=e.value.find(t=>t.type===u||t.type===h)}function _(t){const e=Object(s.a)(t);if(!e.success)return e;const i=Object(r.b)(a);i.add_result(e);const n=e.value,c=n.find(t=>t.type===u),_=c&&function(t){return{texture_count:t.u16()}}(c.data),l=n.filter(t=>t.type===h).map(t=>(function(t){const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u16(),r=t.u16(),o=t.u32();return t.seek(36),{id:s,format:[e,i],width:n,height:r,size:o,data:t.array_buffer(o)}})(t.data));return _||0!==l.length?(_&&_.texture_count!==l.length&&i.add_problem(o.b.Warning,"Corrupted XVM file.",`Found ${l.length} textures instead of ${_.texture_count} as defined in the header.`),i.success({textures:l})):(i.add_problem(o.b.Error,"Corrupted XVM file.","No header and no XVRT chunks found."),i.failure())}}}]); \ No newline at end of file diff --git a/2.b1070a6f6fa6c5cf2aec.js b/2.b1070a6f6fa6c5cf2aec.js deleted file mode 100644 index 9c5e385c..00000000 --- a/2.b1070a6f6fa6c5cf2aec.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"0Xme":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("sDu+"),n=i("jJhE"),r=(i("x1yY"),i("4VsB")),o=i("FXpb");class a extends s.a{constructor(t,e,i,s,n){super(n),this.element=Object(o.q)({className:`${e} core_Input`}),this._value=new r.a(this,t,this.set_value),this.value=this._value,this.input_element=Object(o.l)({className:`${s} core_Input_inner`}),this.input_element.type=i,this.input_element.addEventListener("change",()=>{this._value.set_val(this.get_value(),{silent:!1})}),n&&n.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(t){super.set_enabled(t),this.input_element.disabled=!t}set_attr(t,e,i){if(null==e)return;const s=this.input_element,r=i||(t=>t);Object(n.a)(e)?(s[t]=r(e.val),this.disposable(e.observe(({value:e})=>s[t]=r(e)))):s[t]=r(e)}}},"488w":function(t,e,i){"use strict";i.d(e,"b",(function(){return l})),i.d(e,"a",(function(){return d}));var s=i("Womt"),n=i("tRdk"),r=i("kwt4"),o=i("vM2b");const a=new s.Vector3(0,1,0),h=new s.Vector2(0,0),u=new s.Vector3(0,0,0),c=new s.Quaternion(0,0,0,1),_=new s.Vector3(1,1,1);function l(t,e){new p(e).to_geometry_builder(t)}function d(t){return new p(new o.a).create_buffer_geometry(t)}class f{constructor(){this.vertices_stack=[]}put(t){this.vertices_stack.push(t)}get(t){const e=[];for(let i=this.vertices_stack.length-1;i>=0;i--){const s=this.vertices_stack[i][t];s&&e.push(s)}return e}}class p{constructor(t){this.vertices=new f,this.bone_id=0,this.builder=t}to_geometry_builder(t){this.object_to_geometry(t,void 0,new s.Matrix4)}create_buffer_geometry(t){return this.to_geometry_builder(t),this.builder.build()}object_to_geometry(t,e,i){const{no_translate:r,no_rotate:o,no_scale:a,hidden:h,break_child_trace:l,zxy_rotation_order:d,skip:f}=t.evaluation_flags,{position:p,rotation:b,scale:g}=t,m=new s.Euler(b.x,b.y,b.z,d?"ZXY":"ZYX"),w=(new s.Matrix4).compose(r?u:Object(n.a)(p),o?c:(new s.Quaternion).setFromEuler(m),a?_:Object(n.a)(g)).premultiply(i);let v;if(f?v=e:(v=new s.Bone,v.name=this.bone_id.toString(),v.position.set(p.x,p.y,p.z),v.setRotationFromEuler(m),v.scale.set(g.x,g.y,g.z),this.builder.add_bone(v),e&&e.add(v)),t.model&&!h&&this.model_to_geometry(t.model,w),this.bone_id++,!l)for(const e of t.children)this.object_to_geometry(e,v,w)}model_to_geometry(t,e){Object(r.b)(t)?this.njcm_model_to_geometry(t,e):this.xj_model_to_geometry(t,e)}njcm_model_to_geometry(t,e){const i=(new s.Matrix3).getNormalMatrix(e),r=t.vertices.map(t=>{const r=Object(n.a)(t.position),o=t.normal?Object(n.a)(t.normal):new s.Vector3(0,1,0);return r.applyMatrix4(e),o.applyMatrix3(i),{bone_id:this.bone_id,position:r,normal:o,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}});this.vertices.put(r);for(const e of t.meshes){const t=this.builder.index_count;for(let t=0;t=2&&(t%2==(e.clockwise_winding?1:0)?(this.builder.add_index(o-2),this.builder.add_index(o-1),this.builder.add_index(o)):(this.builder.add_index(o-2),this.builder.add_index(o),this.builder.add_index(o-1)));const u=[[0,0],[0,0],[0,0],[0,0]];for(let t=s.length-1;t>=0;t--){const e=s[t];u[e.bone_weight_status]=[e.bone_id,e.bone_weight]}const c=u.reduce((t,[,e])=>t+e,0);for(const[t,e]of u)this.builder.add_bone_weight(t,c>0?e/c:e)}}this.builder.add_group(t,this.builder.index_count-t,e.texture_id)}}xj_model_to_geometry(t,e){const i=this.builder.vertex_count,r=(new s.Matrix3).getNormalMatrix(e);for(const{position:i,normal:o,uv:a}of t.vertices){const t=Object(n.a)(i).applyMatrix4(e),u=(o?Object(n.a)(o):new s.Vector3(0,1,0)).applyMatrix3(r),c=a||h;this.builder.add_vertex(t,u,c)}let o;for(const e of t.meshes){const t=this.builder.index_count;let s=!1;for(let t=2;t=2&&(s=!s),s?(this.builder.add_index(r),this.builder.add_index(n),this.builder.add_index(o)):(this.builder.add_index(n),this.builder.add_index(r),this.builder.add_index(o)),s=!s}null!=e.material_properties.texture_id&&(o=e.material_properties.texture_id),this.builder.add_group(t,this.builder.index_count-t,o)}}}},"6cU9":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("ouMO"),n=i("KVVN"),r=i("iPoI"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((s=s.apply(t,e||[])).next())}))};class a extends n.a{constructor(t){super(t),this._files=Object(s.e)([]),this.files=this._files,this.element.classList.add("core_FileButton"),this.disposables(this.click.observe(()=>o(this,void 0,void 0,(function*(){this._files.val=yield Object(r.a)(t)})))),this.finalize_construction()}}},"9Ykw":function(t,e,i){"use strict";function s(t){const e=[];for(;t.bytes_left;){const i=t.u32(),s=t.u32();if(s>t.bytes_left)break;e.push({type:i,data:t.take(s)})}return e}i.d(e,"a",(function(){return s}))},"9dYx":function(t,e,i){"use strict";var s=i("bcBH");class n{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends n{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_i32_array(t){return this.write_i32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let s=0;si)throw new Error(`${t} Bytes required but only ${i} available.`)}}},Eqai:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return h}));var s=i("Womt");const n=new s.MeshLambertMaterial({color:65280,side:s.DoubleSide}),r=new s.MeshLambertMaterial({color:16711935,side:s.DoubleSide}),o=new s.MeshLambertMaterial({skinning:!0,color:16711935,side:s.DoubleSide});function a(t,e,i=r){return u(t,e,i,s.Mesh)}function h(t,e,i=o){return u(t,e,i,s.SkinnedMesh)}function u(t,e,i,r){const{created_by_geometry_builder:o,normalized_material_indices:a,bones:h}=t.userData;let u;if(Array.isArray(e))if(o){u=[n];for(const[t,s]of a.entries())s>0&&(u[s]=e[t]||i)}else u=e;else u=e||i;const c=new r(t,u);return o&&h.length&&c instanceof s.SkinnedMesh&&(c.add(h[0]),c.bind(new s.Skeleton(h))),c}},Ftn7:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("pVCM"),n=i("Womt");s.a.install({THREE:Object.assign(Object.assign({},n),{MOUSE:Object.assign(Object.assign({},n.MOUSE),{LEFT:n.MOUSE.RIGHT,RIGHT:n.MOUSE.LEFT})})});class r{constructor(t){this._debug=!1,this.scene=new n.Scene,this.light_holder=new n.Group,this.render_scheduled=!1,this.animation_frame_handle=void 0,this.light=new n.HemisphereLight(16777215,5263440,1),this.controls_clock=new n.Clock,this.size=new n.Vector2(0,0),this.schedule_render=()=>{this.render_scheduled=!0},this.on_mouse_down=t=>{t.currentTarget&&t.currentTarget.focus()},this.call_render=()=>{const t=this.controls.update(this.controls_clock.getDelta()),e=this.render_scheduled||t;this.render_scheduled=!1,e&&this.render(),this.animation_frame_handle=requestAnimationFrame(this.call_render)},this.renderer=t,this.renderer.domElement.tabIndex=0,this.renderer.domElement.addEventListener("mousedown",this.on_mouse_down),this.renderer.domElement.style.outline="none",this.scene.background=new n.Color(1579032),this.light_holder.add(this.light),this.scene.add(this.light_holder)}get debug(){return this._debug}set debug(t){this._debug=t}get canvas_element(){return this.renderer.domElement}set_size(t,e){this.size.set(t,e),this.renderer.setSize(t,e),this.schedule_render()}pointer_pos_to_device_coords(t){t.set(t.x/this.size.width*2-1,t.y/this.size.height*-2+1)}start_rendering(){null==this.animation_frame_handle&&(this.schedule_render(),this.animation_frame_handle=requestAnimationFrame(this.call_render))}stop_rendering(){null!=this.animation_frame_handle&&(cancelAnimationFrame(this.animation_frame_handle),this.animation_frame_handle=void 0)}reset_camera(t,e){this.controls.setLookAt(t.x,t.y,t.z,e.x,e.y,e.z)}dispose(){this.renderer.dispose(),this.controls.dispose()}init_camera_controls(){this.controls=new s.a(this.camera,this.renderer.domElement),this.controls.dampingFactor=1,this.controls.draggingDampingFactor=1}render(){this.renderer.render(this.scene,this.camera)}}},NRxM:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("9dYx");class n extends s.a{constructor(t,e,i=0,s=t.byteLength-i){super(e,i),this._size=s,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new n(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},PE7g:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("0Xme");i("rY5A");class n extends s.a{constructor(t=0,e){if(super(t,"core_NumberInput","number","core_NumberInput_inner",e),this.preferred_label_position="left",e){const{min:t,max:i,step:s,width:n}=e;this.set_attr("min",t,String),this.set_attr("max",i,String),this.input_element.step="any",this.set_attr("step",s,String),null!=n&&(this.element.style.width=`${n}px`)}e&&null!=e.round_to&&e.round_to>=0?this.rounding_factor=Math.pow(10,e.round_to):this.rounding_factor=1,this.set_value(t),this.finalize_construction()}get_value(){return parseFloat(this.input_element.value)}set_value(t){this.input_element.valueAsNumber=Math.round(this.rounding_factor*t)/this.rounding_factor}}},bcBH:function(t,e,i){"use strict";var s;i.d(e,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},iPoI:function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return r}));var s=i("FXpb");function n(t){return new Promise(e=>{var i,n,r,o;const a=Object(s.l)({type:"file"});a.accept=null!=(n=null===(i=t)||void 0===i?void 0:i.accept)?n:"",a.multiple=null!=(o=null===(r=t)||void 0===r?void 0:r.multiple)&&o,a.onchange=()=>{a.files&&a.files.length?e([...a.files]):e([])},a.click()})}function r(t){return new Promise((e,i)=>{const s=new FileReader;s.addEventListener("loadend",()=>{s.result instanceof ArrayBuffer?e(s.result):i(new Error("Couldn't read file."))}),s.readAsArrayBuffer(t)})}},iR5r:function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return r}));var s=i("Womt");function n(t){return t.textures.map(r)}function r(t){let e,i;switch(t.format[1]){case 6:e=s.RGBA_S3TC_DXT1_Format,i=t.width*t.height/2;break;case 7:e=s.RGBA_S3TC_DXT3_Format,i=t.width*t.height;break;default:throw new Error(`Format ${t.format.join(", ")} not supported.`)}const n=new s.CompressedTexture([{data:new Uint8Array(t.data,0,i),width:t.width,height:t.height}],t.width,t.height,e);return n.minFilter=s.LinearFilter,n.wrapS=s.MirroredRepeatWrapping,n.wrapT=s.MirroredRepeatWrapping,n.needsUpdate=!0,n}},kwt4:function(t,e,i){"use strict";var s=i("9Ykw"),n=i("rwco");const r=n.c.get("core/data_formats/parsing/ninja/njcm");var o;function a(t,e){const i=t.u32(),s=t.u32(),n=t.vec3_f32(),r=t.f32(),a=[],u=[];if(i){t.seek_start(i);for(const i of h(t,e,!0))if(i.type===o.Vertex)for(const t of i.vertices)a[t.index]={position:t.position,normal:t.normal,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}}if(s){t.seek_start(s);let i=void 0;for(const s of h(t,e,!1))if(s.type===o.Tiny)i=s.texture_id;else if(s.type===o.Strip){for(const t of s.triangle_strips)t.texture_id=i;u.push(...s.triangle_strips)}}return{type:"njcm",vertices:a,meshes:u,collision_sphere_center:n,collision_sphere_radius:r}}function h(t,e,i){const s=[];let n=!0;for(;n;){const a=t.u8(),_=t.u8(),l=t.position;let d=0;if(0===a)s.push({type:o.Null,type_id:a});else if(1<=a&&a<=3)s.push({type:o.Bits,type_id:a});else if(4===a){const i=_,r=t.position;s.push({type:o.CachePolygonList,type_id:a,cache_index:i,offset:r}),e[i]=r,n=!1}else if(5===a){const n=_,r=e[n];null!=r&&(t.seek_start(r),s.push(...h(t,e,i))),s.push({type:o.DrawPolygonList,type_id:a,cache_index:n})}else if(8<=a&&a<=9){d=2;const e=t.u16();s.push({type:o.Tiny,type_id:a,flip_u:0!=(128&a),flip_v:0!=(64&a),clamp_u:0!=(32&a),clamp_v:0!=(16&a),mipmap_d_adjust:15&a,filter_mode:e>>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(d=2+2*t.u16(),s.push({type:o.Material,type_id:a})):32<=a&&a<=50?(d=2+4*t.u16(),s.push({type:o.Vertex,type_id:a,vertices:u(t,a,_)})):56<=a&&a<=58?(d=2+2*t.u16(),s.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(d=2+2*t.u16(),s.push({type:o.Strip,type_id:a,triangle_strips:c(t,a,_)})):255===a?(d=i?2:0,s.push({type:o.End,type_id:a}),n=!1):(d=2+2*t.u16(),s.push({type:o.Unknown,type_id:a}),r.warn(`Unknown chunk type ${a} at offset ${l}.`));t.seek_start(l+d)}return s}function u(t,e,i){if(e<32||e>50)return r.warn(`Unknown vertex chunk type ${e}.`),[];const s=3&i,n=0!=(128&i),o=t.u16(),a=t.u16(),h=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}h.push(r)}return h}function c(t,e,i){const s={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},n=t.u16(),r=n>>>14,o=16383&n;let a=!1,h=!1,u=!1,c=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:u=!0;break;case 68:case 69:a=!0,u=!0;break;case 70:h=!0;break;case 71:case 72:a=!0,h=!0;break;case 73:break;case 74:case 75:c=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const _=[];for(let e=0;e=2&&t.seek(2*r)}_.push(Object.assign(Object.assign({},s),{clockwise_winding:i,has_tex_coords:a,has_normal:u,vertices:o}))}return _}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const _=n.c.get("core/data_formats/parsing/ninja/xj");function l(t){t.seek(4);const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&_.warn(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const s=t.u32(),n=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===b),r=[];for(const t of n)r.push(...x(t.data,e,i));return r}function x(t,e,i){const s=t.u32(),n=0!=(1&s),r=0!=(2&s),o=0!=(4&s),a=0!=(8&s),h=0!=(16&s),u=0!=(32&s),c=0!=(64&s),_=0!=(128&s),l=t.u32(),d=t.vec3_f32(),f={x:t.i32()*p,y:t.i32()*p,z:t.i32()*p},b=t.vec3_f32(),g=t.u32(),w=t.u32();let v,y,k;return l&&(t.seek_start(l),v=e(t,i)),g?(t.seek_start(g),y=x(t,e,i)):y=[],w?(t.seek_start(w),k=x(t,e,i)):k=[],[new m({no_translate:n,no_rotate:r,no_scale:o,hidden:a,break_child_trace:h,zxy_rotation_order:u,skip:c,shape_skip:_},v,d,f,b,y),...k]}},mKaR:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("Tpfs");class n{constructor(){this.disposer=new s.a}dispose(){this.disposer.dispose()}disposable(t){return this.disposer.add(t)}disposables(...t){this.disposer.add_all(...t)}}},oyid:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("sDu+"),n=i("4VsB"),r=i("FXpb");class o extends s.a{constructor(t=!1,e){super(e),this.element=Object(r.l)({className:"core_CheckBox"}),this.preferred_label_position="right",this._checked=new n.a(this,t,this.set_checked),this.checked=this._checked,this.set_checked(t),this.element.type="checkbox",this.element.onchange=()=>this._checked.set_val(this.element.checked,{silent:!1}),this.finalize_construction()}set_enabled(t){super.set_enabled(t),this.element.disabled=!t}set_checked(t){this.element.checked=t}}},tRdk:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("Womt");function n(t){return new s.Vector3(t.x,t.y,t.z)}},vM2b:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("Womt");class n{constructor(){this.positions=[],this.normals=[],this.uvs=[],this.indices=[],this.bones=[],this.bone_indices=[],this.bone_weights=[],this.groups=[],this.material_indices=new Set([-1])}get vertex_count(){return this.positions.length/3}get index_count(){return this.indices.length}get_position(t){return new s.Vector3(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2])}get_normal(t){return new s.Vector3(this.normals[3*t],this.normals[3*t+1],this.normals[3*t+2])}add_vertex(t,e,i){this.positions.push(t.x,t.y,t.z),this.normals.push(e.x,e.y,e.z),this.uvs.push(i.x,i.y)}add_index(t){this.indices.push(t)}add_bone(t){this.bones.push(t)}add_bone_weight(t,e){this.bone_indices.push(t),this.bone_weights.push(e)}add_group(t,e,i){const s=this.groups[this.groups.length-1],n=null==i?-1:i;s&&s.material_index===n?s.size+=e:(this.groups.push({offset:t,size:e,material_index:n}),this.material_indices.add(n))}build(){const t=new s.BufferGeometry,e=t.userData;e.created_by_geometry_builder=!0,t.setAttribute("position",new s.Float32BufferAttribute(this.positions,3)),t.setAttribute("normal",new s.Float32BufferAttribute(this.normals,3)),t.setAttribute("uv",new s.Float32BufferAttribute(this.uvs,2)),t.setIndex(new s.Uint16BufferAttribute(this.indices,1)),this.bone_indices.length&&this.bones.length?(t.setAttribute("skinIndex",new s.Uint16BufferAttribute(this.bone_indices,4)),t.setAttribute("skinWeight",new s.Float32BufferAttribute(this.bone_weights,4)),e.bones=this.bones):e.bones=[];const i=new Map;let n=0;for(const t of[...this.material_indices].sort((t,e)=>t-e))i.set(t,n++);for(const e of this.groups)t.addGroup(e.offset,e.size,i.get(e.material_index));return e.normalized_material_indices=i,t.computeBoundingSphere(),t.computeBoundingBox(),t}}},w6HN:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("TRid"),n=(i("IQIM"),i("sDu+")),r=i("FXpb");class o extends s.a{constructor(t,...e){super(t instanceof s.a?void 0:t),this.element=Object(r.h)({className:"core_ToolBar"}),this.height=33,this.element.style.height=`${this.height}px`,this.children=t instanceof s.a?[t,...e]:e;for(const t of this.children)if(this.disposable(t),t instanceof n.a&&t.label){const e=Object(r.h)({className:"core_ToolBar_group"});"left"===t.preferred_label_position||"top"===t.preferred_label_position?e.append(t.label.element,t.element):e.append(t.element,t.label.element),this.element.append(e)}else this.element.append(t.element);this.finalize_construction()}set_enabled(t){super.set_enabled(t);for(const e of this.children)e.enabled.val=t}}},yub1:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("9Ykw");const n=i("rwco").c.get("core/data_formats/parsing/ninja/texture"),r=1213027928,o=1414682200;function a(t){const e=Object(s.a)(t),i=e.find(t=>t.type===r),a=i&&function(t){return{texture_count:t.u16()}}(i.data),h=e.filter(t=>t.type===o).map(t=>(function(t){const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u16(),r=t.u16(),o=t.u32();return t.seek(36),{id:s,format:[e,i],width:n,height:r,size:o,data:t.array_buffer(o)}})(t.data));return a&&a.texture_count!==h.length&&n.warn(`Found ${h.length} textures instead of ${a.texture_count} as defined in the header.`),{textures:h}}}}]); \ No newline at end of file diff --git a/5.484ba491fa0b7a3f94c1.js b/5.484ba491fa0b7a3f94c1.js deleted file mode 100644 index 8f5c53bb..00000000 --- a/5.484ba491fa0b7a3f94c1.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"/UnV":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const i=n("rwco").c.get("core/data_formats/parsing/afs"),s=5457473;function a(t){if(t.u32()!==s)return i.error("Not an AFS archive."),[];const e=t.u16();t.seek(2);const n=[];for(let i=0;i{if(t.target instanceof HTMLElement){const e=t.target.dataset.key;e&&this.activate_key(e)}},this.bar_element.onmousedown=this.bar_mousedown;for(const t of e.tabs){const e=Object(a.q)({className:"core_TabContainer_Tab",data:{key:t.key}},t.title);this.bar_element.append(e);const n=this.disposable(new i.a(t.create_view)),s=Object.assign(Object.assign({},t),{tab_element:e,lazy_view:n});this.tabs.push(s),this.panes_element.append(n.element)}this.element.append(this.bar_element,this.panes_element),this.finalize_construction()}get children(){return this.tabs.flatMap(t=>t.lazy_view.children)}resize(t,e){super.resize(t,e),this.bar_element.style.width=`${t}px`,this.bar_element.style.height=`${r}px`;const n=e-r;this.panes_element.style.width=`${t}px`,this.panes_element.style.height=`${n}px`;for(const e of this.tabs)e.lazy_view.resize(t,n);return this}activate(){if(this.active_tab)this.activate_tab(this.active_tab);else{let t;for(const e of this.tabs)null!=e.path&&this.gui_store.path.val.startsWith(e.path)&&(t=e);t?this.activate_tab(t):this.tabs.length&&this.activate_tab(this.tabs[0])}}activate_key(t){for(const e of this.tabs)if(e.key===t){this.activate_tab(e);break}}activate_tab(t){this.active_tab!==t&&(this.active_tab&&(this.active_tab.tab_element.classList.remove("active"),this.active_tab.lazy_view.visible.val=!1,this.active_tab.lazy_view.deactivate()),this.active_tab=t,t.tab_element.classList.add("active"),t.lazy_view.visible.val=!0),null!=t.path&&(this.gui_store.set_path_prefix(t.path),t.lazy_view.activate())}}},U6CM:function(t,e,n){"use strict";n.r(e);var i=n("HjM1"),s=n("zsIO");class a extends s.a{constructor(t,e,n){super(),this.tab_container=this.add(new i.a(t,{class:"viewer_ViewerView",tabs:[{title:"Models",key:"model",path:"/models",create_view:e},{title:"Textures",key:"texture",path:"/textures",create_view:n}]})),this.finalize_construction()}get element(){return this.tab_container.element}resize(t,e){this.tab_container.resize(t,e)}}var r=n("Tpfs"),o=n("Womt"),c=n("Ftn7"),_=n("iR5r"),l=n("rwco");const h=l.c.get("viewer/rendering/TextureRenderer");class u extends c.a{constructor(t,e){super(e),this.disposer=new r.a,this.quad_meshes=[],this.camera=new o.OrthographicCamera(-400,400,300,-300,1,10),this.disposer.add_all(t.textures.observe(({value:t})=>{this.scene.remove(...this.quad_meshes),this.render_textures(t),this.reset_camera(new o.Vector3(0,0,5),new o.Vector3),this.schedule_render()})),this.init_camera_controls(),this.controls.dollySpeed=-1,this.controls.azimuthRotateSpeed=0,this.controls.polarRotateSpeed=0}set_size(t,e){this.camera.left=-Math.floor(t/2),this.camera.right=Math.ceil(t/2),this.camera.top=Math.floor(e/2),this.camera.bottom=-Math.ceil(e/2),this.camera.updateProjectionMatrix(),super.set_size(t,e)}dispose(){super.dispose(),this.disposer.dispose()}render_textures(t){let e=10*(t.length-1),n=0;for(const i of t)e+=i.width,n=Math.max(n,i.height);let i=-Math.floor(e/2);const s=-Math.floor(n/2);for(const e of t){let t=void 0;try{t=Object(_.b)(e)}catch(t){h.error("Couldn't convert XVR texture.",t)}const a=new o.Mesh(this.create_quad(i,s+Math.floor((n-e.height)/2),e.width,e.height),t?new o.MeshBasicMaterial({map:t,transparent:!0}):new o.MeshBasicMaterial({color:16711935}));this.quad_meshes.push(a),this.scene.add(a),i+=10+e.width}}create_quad(t,e,n,i){const s=new o.PlaneGeometry(n,i,1,1);return s.faceVertexUvs=[[[new o.Vector2(0,0),new o.Vector2(0,1),new o.Vector2(1,0)],[new o.Vector2(0,1),new o.Vector2(1,1),new o.Vector2(1,0)]]],s.translate(t+n/2,e+i/2,-5),s}}var d=n("Eqai"),m=n("488w"),b=n("VwSi");const v=30;function f(t,e){const n=e.interpolation===b.a.Spline?o.InterpolateSmooth:o.InterpolateLinear,i=[];return e.motion_data.forEach((e,s)=>{const a=t.get_bone(s);a&&e.tracks.forEach(({type:t,keyframes:e})=>{const r=[],c=[];for(const n of e)if(r.push(n.frame/v),t===b.b.Rotation){const t=a.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",e=(new o.Quaternion).setFromEuler(new o.Euler(n.value.x,n.value.y,n.value.z,t));c.push(e.x,e.y,e.z,e.w)}else c.push(n.value.x,n.value.y,n.value.z);if(t===b.b.Rotation)i.push(new o.QuaternionKeyframeTrack(`.bones[${s}].quaternion`,r,c,n));else{const e=t===b.b.Position?`.bones[${s}].position`:`.bones[${s}].scale`;i.push(new o.VectorKeyframeTrack(e,r,c,n))}})}),new o.AnimationClip("Animation",(e.frame_count-1)/v,i).optimize()}const y=l.c.get("viewer/rendering/ModelRenderer"),p=new o.MeshLambertMaterial({color:16777215,side:o.DoubleSide}),w=new o.MeshLambertMaterial({skinning:!0,color:16777215,side:o.DoubleSide}),j=Object.freeze(new o.Vector3(0,10,20)),x=Object.freeze(new o.Vector3(0,0,0));class g extends c.a{constructor(t,e){super(e),this.store=t,this.disposer=new r.a,this.clock=new o.Clock,this.update_animation_time=!0,this.camera=new o.PerspectiveCamera(75,1,1,200),this.current_character_class_changed=t=>{const e=null!=t.value;this.character_class_active!==e&&this.reset_camera(j,x),this.character_class_active=e},this.nj_object_or_xvm_changed=()=>{var t;this.mesh&&(this.scene.remove(this.mesh),this.mesh=void 0,this.scene.remove(this.skeleton_helper),this.skeleton_helper=void 0);const e=this.store.current_nj_object.val;if(e){let n;if(this.animation){const e=this.animation.mixer;n=null===(t=e.existingAction(this.animation.clip))||void 0===t?void 0:t.time,e.stopAllAction(),e.uncacheAction(this.animation.clip),this.animation=void 0}const i=this.store.current_textures.val.map(t=>{if(t)try{return Object(_.b)(t)}catch(t){y.error("Couldn't convert XVR texture.",t)}}),s=Object(m.a)(e),a=null!=s.getAttribute("skinIndex"),r=i.map(t=>t?new o.MeshBasicMaterial({skinning:a,map:t,side:o.DoubleSide,alphaTest:.1,transparent:!0}):new o.MeshLambertMaterial({skinning:a,side:o.DoubleSide}));this.mesh=a?Object(d.b)(s,r,w):Object(d.a)(s,r,p);const c=s.boundingBox,l=c.max.y-c.min.y;this.mesh.translateY(-l/2-c.min.y),this.scene.add(this.mesh),this.skeleton_helper=new o.SkeletonHelper(this.mesh),this.skeleton_helper.visible=this.store.show_skeleton.val,this.skeleton_helper.material.linewidth=3,this.scene.add(this.skeleton_helper);const h=this.store.current_nj_motion.val;if(h){const t=new o.AnimationMixer(this.mesh);t.timeScale=this.store.animation_frame_rate.val/v;const i=f(e,h);this.animation={mixer:t,clip:i};const s=t.clipAction(i,this.mesh);s.time=null!=n?n:0,s.play()}}this.schedule_render()},this.nj_motion_changed=({value:t})=>{let e;this.animation&&(this.animation.mixer.stopAllAction(),this.animation.mixer.uncacheAction(this.animation.clip),e=this.animation.mixer);const n=this.store.current_nj_object.val;if(!(this.mesh&&this.mesh instanceof o.SkinnedMesh&&t&&n))return;e||(e=new o.AnimationMixer(this.mesh));const i=f(n,t);this.animation={mixer:e,clip:i},this.clock.start(),e.clipAction(i).play(),this.schedule_render()},this.show_skeleton_changed=({value:t})=>{this.skeleton_helper&&(this.skeleton_helper.visible=t,this.schedule_render())},this.animation_playing_changed=({value:t})=>{this.animation&&(this.animation.mixer.clipAction(this.animation.clip).paused=!t,t?(this.clock.start(),this.schedule_render()):this.clock.stop())},this.animation_frame_rate_changed=({value:t})=>{this.animation&&(this.animation.mixer.timeScale=t/v)},this.animation_frame_changed=({value:t})=>{const e=this.store.current_nj_motion.val;if(this.animation&&e){const n=e.frame_count;t>n&&(t=1),t<1&&(t=n),this.update_animation_time&&(this.animation.mixer.clipAction(this.animation.clip).time=(t-1)/v),this.schedule_render()}},this.character_class_active=null!=t.current_character_class.val,this.disposer.add_all(t.current_character_class.observe(this.current_character_class_changed),t.current_nj_object.observe(this.nj_object_or_xvm_changed),t.current_textures.observe(this.nj_object_or_xvm_changed),t.current_nj_motion.observe(this.nj_motion_changed),t.show_skeleton.observe(this.show_skeleton_changed),t.animation_playing.observe(this.animation_playing_changed),t.animation_frame_rate.observe(this.animation_frame_rate_changed),t.animation_frame.observe(this.animation_frame_changed)),this.init_camera_controls(),this.reset_camera(j,x)}set_size(t,e){this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),super.set_size(t,e)}dispose(){super.dispose(),this.disposer.dispose()}render(){this.animation&&this.animation.mixer.update(this.clock.getDelta()),this.light_holder.quaternion.copy(this.camera.quaternion),super.render(),this.animation&&!this.animation.mixer.clipAction(this.animation.clip).paused&&(this.update_animation_frame(),this.schedule_render())}update_animation_frame(){if(this.animation){const t=this.animation.mixer.clipAction(this.animation.clip);t.paused||(this.update_animation_time=!1,this.store.set_animation_frame(t.time*v+1),this.update_animation_time=!0)}}}var k=n("w6HN"),O=n("6cU9"),M=n("oyid"),S=n("PE7g"),z=n("7ZX1"),V=n("FXpb"),A=n("6Fug");class C extends A.a{constructor(t){super();const e=new O.a({icon_left:V.a.File,text:"Open file...",accept:".afs, .nj, .njm, .xj, .xvm"}),n=new M.a(!1,{label:"Show skeleton"}),i=new M.a(!0,{label:"Play animation"}),s=new S.a(v,{label:"Frame rate:",min:1,max:240,step:1}),a=new S.a(1,{label:"Frame:",min:1,max:t.animation_frame_count,step:1}),r=new z.a(t.animation_frame_count_label);this.toolbar=this.add(new k.a(e,n,i,s,a,r)),this.disposables(e.files.observe(({value:e})=>{e.length&&t.load_file(e[0])}),n.checked.observe(({value:e})=>t.set_show_skeleton(e)));const o=t.animation_controls_enabled;this.disposables(i.enabled.bind_to(o),i.checked.bind_to(t.animation_playing),i.checked.observe(({value:e})=>t.set_animation_playing(e)),s.enabled.bind_to(o),s.value.observe(({value:e})=>t.set_animation_frame_rate(e)),a.enabled.bind_to(o),a.value.bind_to(t.animation_frame),a.value.observe(({value:e})=>t.set_animation_frame(e)),r.enabled.bind_to(o)),this.finalize_construction()}get element(){return this.toolbar.element}get height(){return this.toolbar.height}}var R=n("kcKQ"),P=n("9fJw"),T=n("ouMO");class F{constructor(t,e){this.id=t,this.name=e}}var L=n("nsCy"),U=n("4SjJ"),$=n("uiJh"),q=function(t,e,n,i){return new(n||(n=Promise))((function(s,a){function r(t){try{c(i.next(t))}catch(t){a(t)}}function o(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,o)}c((i=i.apply(t,e||[])).next())}))};const H=l.c.get("viewer/stores/ModelStore");class N extends R.a{constructor(t,e,n){super(),this.asset_loader=e,this.random=n,this._current_character_class=Object(T.e)(void 0),this._current_section_id=Object(T.e)(void 0),this._current_body=Object(T.e)(void 0),this._current_animation=Object(T.e)(void 0),this._current_nj_object=Object(T.e)(void 0),this._current_textures=Object(T.c)(),this._current_nj_motion=Object(T.e)(void 0),this._show_skeleton=Object(T.e)(!1),this._animation_playing=Object(T.e)(!0),this._animation_frame_rate=Object(T.e)(v),this._animation_frame=Object(T.e)(0),this.character_classes=[P.g,P.h,P.f,P.e,P.k,P.l,P.j,P.i,P.a,P.b,P.d,P.c],this.current_character_class=this._current_character_class,this.current_section_id=this._current_section_id,this.current_body=this._current_body,this.animations=new Array(572).fill(void 0).map((t,e)=>new F(e,`Animation ${e+1}`)),this.current_animation=this._current_animation,this.current_nj_object=this._current_nj_object,this.current_textures=this._current_textures,this.current_nj_motion=this._current_nj_motion,this.animation_frame_count=this.current_nj_motion.map(t=>t?t.frame_count:0),this.show_skeleton=this._show_skeleton,this.animation_playing=this._animation_playing,this.animation_frame_rate=this._animation_frame_rate,this.animation_frame=this._animation_frame,this.set_current_character_class=t=>{var e;if(this._current_character_class.val!==t){if(null==t)this.set_current_body(void 0);else{const n=this.current_body.val;(void 0===n||n>=(null===(e=t)||void 0===e?void 0:e.body_style_count))&&this.set_current_body(t.body_style_count-1)}this._current_character_class.val=t,null==this.current_animation.val&&this.set_current_nj_motion(void 0)}},this.set_current_section_id=t=>{this._current_section_id.val=t},this.set_current_body=t=>{this._current_body.val=t},this.set_current_animation=t=>{this._current_animation.val!==t&&(this._current_animation.val=t)},this.set_current_nj_object=t=>{this.set_current_character_class(void 0),this.set_current_animation(void 0),this.set_current_textures([]),this.set_current_nj_motion(void 0),this._current_nj_object.val=t},this.set_current_textures=t=>{this._current_textures.val=t},this.set_current_nj_motion=t=>{this.set_current_animation(void 0),this._current_nj_motion.val=t},this.set_show_skeleton=t=>{this._show_skeleton.val=t},this.set_animation_playing=t=>{this._animation_playing.val=t},this.set_animation_frame_rate=t=>{this._animation_frame_rate.val=t},this.set_animation_frame=t=>{this._animation_frame.val=t},this.load_character_class_model=()=>q(this,void 0,void 0,(function*(){const t=this.current_character_class.val;if(null==t)return;const e=this.current_section_id.val;if(null==e)return;const n=this.current_body.val;if(null!=n)try{this._current_nj_object.val=void 0;const i=yield this.asset_loader.load_geometry(t);this._current_textures.val=yield this.asset_loader.load_textures(t,e,n),this._current_nj_object.val=i}catch(e){H.error(`Couldn't load model for ${t.name}.`),this._current_nj_object.val=void 0}})),this.load_animation=()=>q(this,void 0,void 0,(function*(){const t=this._current_nj_object.val,e=this.current_animation.val;if(t&&e)try{this._current_nj_motion.val=yield this.asset_loader.load_animation(e.id,64),this.set_animation_playing(!0)}catch(t){H.error(`Couldn't load animation "${e.name}".`,t),this._current_nj_motion.val=void 0}else this._current_nj_motion.val=void 0})),this.disposables(this.current_character_class.observe(this.load_character_class_model),this.current_section_id.observe(this.load_character_class_model),this.current_body.observe(this.load_character_class_model),this.current_animation.observe(this.load_animation)),this.disposables(t.bind_parameter(U.b.Viewer,"/models","model",this.current_character_class.map(t=>void 0===t?void 0:t.name)),t.bind_parameter(U.b.Viewer,"/models","section_id",this.current_section_id.map(t=>void 0===t?void 0:L.e[t])),t.bind_parameter(U.b.Viewer,"/models","body",this.current_body.map(t=>void 0===t?void 0:String(t+1))));const i=t.get_parameter(U.b.Viewer,"/models","model");let s=this.character_classes.find(t=>t.name===i);null==s&&(s=n.sample_array(this.character_classes));const a=t.get_parameter(U.b.Viewer,"/models","body");let r=null==a?void 0:parseInt(a,10);null!=r&&Number.isInteger(r)?r--:r=n.integer(0,s.body_style_count);const o=t.get_parameter(U.b.Viewer,"/models","section_id"),c=void 0===o?void 0:Object($.b)(L.e,o);this._current_section_id.val=null!=c?c:n.sample_array(L.f),this._current_body.val=r,this._current_character_class.val=s}}var B=n("mKaR"),I=n("iPoI"),X=n("NRxM"),D=n("bcBH"),E=n("kwt4"),W=n("yub1"),J=n("/UnV"),Z=function(t,e,n,i){return new(n||(n=Promise))((function(s,a){function r(t){try{c(i.next(t))}catch(t){a(t)}}function o(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,o)}c((i=i.apply(t,e||[])).next())}))};const Q=l.c.get("viewer/controllers/model/ModelToolBarController");class K extends B.a{constructor(t){super(),this.store=t,this.set_show_skeleton=t=>{this.store.set_show_skeleton(t)},this.set_animation_playing=t=>{this.store.set_animation_playing(t)},this.set_animation_frame_rate=t=>{this.store.set_animation_frame_rate(t)},this.set_animation_frame=t=>{this.store.set_animation_frame(t)},this.load_file=t=>Z(this,void 0,void 0,(function*(){try{const e=yield Object(I.b)(t),n=new X.a(e,D.a.Little);if(t.name.endsWith(".nj"))this.store.set_current_nj_object(Object(E.c)(n)[0]);else if(t.name.endsWith(".xj"))this.store.set_current_nj_object(Object(E.d)(n)[0]);else if(t.name.endsWith(".njm")){this.store.set_current_animation(void 0),this.store.set_current_nj_motion(void 0);const t=this.store.current_nj_object.val;t&&(this.set_animation_playing(!0),this.store.set_current_nj_motion(Object(b.c)(n,t.bone_count())))}else if(t.name.endsWith(".xvm"))this.store.set_current_textures(Object(W.a)(n).textures);else if(t.name.endsWith(".afs")){const t=Object(J.a)(n).flatMap(t=>Object(W.a)(new X.a(t,D.a.Little)).textures);this.store.set_current_textures(t)}else Q.error(`Unknown file extension in filename "${t.name}".`)}catch(t){Q.error("Couldn't read file.",t)}})),this.show_skeleton=t.show_skeleton,this.animation_frame_count=t.animation_frame_count,this.animation_frame_count_label=t.animation_frame_count.map(t=>`/ ${t}`),this.animation_controls_enabled=t.current_nj_motion.map(t=>null!=t),this.animation_playing=t.animation_playing,this.animation_frame_rate=t.animation_frame_rate,this.animation_frame=t.animation_frame.map(t=>Math.round(t))}}var Y=n("sv1z");n("ePAx");class G extends s.a{constructor(t){var e,n;super();const i=this.add(new Y.a({class:"viewer_model_CharacterClassOptionsView_section_id",label:"Section ID:",items:L.f,selected:t.current_section_id,to_label:t=>null==t?"":L.e[t],enabled:t.enabled})),s=this.add(new Y.a({class:"viewer_model_CharacterClassOptionsView_body",label:"Body:",items:t.current_body_options,selected:t.current_body,enabled:t.enabled}));this.element=Object(V.h)({className:"viewer_model_CharacterClassOptionsView"},Object(V.r)(Object(V.y)(Object(V.t)(null===(e=i.label)||void 0===e?void 0:e.element),Object(V.t)(i.element)),Object(V.y)(Object(V.t)(null===(n=s.label)||void 0===n?void 0:n.element),Object(V.t)(s.element)))),this.disposables(i.selected.observe(({value:e})=>t.set_current_section_id(e)),s.selected.observe(({value:e})=>t.set_current_body(e))),this.finalize_construction()}}var tt=n("LvDl");class et extends B.a{constructor(t){super(),this.store=t,this.set_current_section_id=t=>{null!=t&&this.store.set_current_section_id(t)},this.set_current_body=t=>{this.store.set_current_body(null==t?void 0:t-1)},this.enabled=t.current_character_class.map(t=>null!=t),this.current_section_id=t.current_section_id,this.current_body_options=t.current_character_class.map(t=>t?Object(tt.range)(1,t.body_style_count+1):[]),this.current_body=t.current_body.map(t=>null==t?void 0:t+1)}}n.d(e,"initialize_viewer",(function(){return it}));var nt=function(t,e,n,i){return new(n||(n=Promise))((function(s,a){function r(t){try{c(i.next(t))}catch(t){a(t)}}function o(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,o)}c((i=i.apply(t,e||[])).next())}))};function it(t,e,i,s){const o=new r.a;return{view:new a(i,()=>nt(this,void 0,void 0,(function*(){const{ModelController:a}=yield n.e(14).then(n.bind(null,"UwGQ")),{ModelView:r}=yield Promise.all([n.e(1),n.e(11)]).then(n.bind(null,"puLw")),{CharacterClassAssetLoader:c}=yield n.e(15).then(n.bind(null,"ZV42")),_=o.add(new c(t)),l=o.add(new N(i,_,e)),h=new a(l),u=new K(l),d=new et(l);return new r(h,new C(u),new G(d),new g(l,s()))})),()=>nt(this,void 0,void 0,(function*(){const{TextureController:t}=yield n.e(13).then(n.bind(null,"QRTb")),{TextureView:e}=yield n.e(10).then(n.bind(null,"Za3H")),i=o.add(new t);return new e(i,new u(i,s()))}))),dispose(){o.dispose()}}}},VwSi:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o}));var i=n("kwt4");const s=1296321870;var a,r;function o(t,e){return t.u32()===s?function(t,e){const n=t.u32();return c(t.take(n),e)}(t,e):(t.seek_start(0),function(t,e){t.seek_end(16);const n=t.u32();t.seek_start(n);const i=t.u32();return t.seek_start(i),function(t,e){t.seek(4);const n=t.u32();return t.seek_start(n),c(t,e)}(t,e)}(t,e))}function c(t,e){let n=t.u32();const i=t.u32(),s=t.u16(),a=t.u16(),o=(192&a)>>6,c=15&a,h=[];for(let a=0;a=n)return t.seek_start(a),h(t,e);r=i}return s}function h(t,e){const n=[];for(let s=0;se.size)t.add_problem(a.b.Warning,`AFS file entry ${n} is invalid.`,`Invalid file offset ${s} for entry ${n}.`);else if(s+r>e.size)t.add_problem(a.b.Warning,`AFS file entry ${n} is invalid.`,`File size ${r} (offset: ${s}) of entry ${n} too large.`);else{const t=e.position;e.seek_start(s),i.push(e.array_buffer(r)),e.seek_start(t)}}return t.success(i)}},"9fJw":function(e,t,s){"use strict";s.d(t,"g",(function(){return n})),s.d(t,"h",(function(){return a})),s.d(t,"f",(function(){return r})),s.d(t,"e",(function(){return o})),s.d(t,"k",(function(){return c})),s.d(t,"l",(function(){return _})),s.d(t,"j",(function(){return l})),s.d(t,"i",(function(){return h})),s.d(t,"a",(function(){return u})),s.d(t,"b",(function(){return d})),s.d(t,"d",(function(){return m})),s.d(t,"c",(function(){return b}));class i{constructor(e){var t,s,i,n,a;this.name=e.name,this.body_style_count=null!=(t=e.body_style_count)?t:1,this.head_style_count=e.head_style_count,this.hair_style_count=e.hair_style_count,this.hair_styles_with_accessory=e.hair_styles_with_accessory,this.body_tex_ids=null!=(s=e.body_tex_ids)?s:[],this.head_tex_ids=null!=(i=e.head_tex_ids)?i:[],this.hair_tex_ids=null!=(n=e.hair_tex_ids)?n:[],this.accessory_tex_ids=null!=(a=e.accessory_tex_ids)?a:[]}}const n=new i({name:"HUmar",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([6])}),a=new i({name:"HUnewearl",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set}),r=new i({name:"HUcast",body_style_count:25,head_style_count:5,hair_style_count:0,hair_styles_with_accessory:new Set}),o=new i({name:"HUcaseal",body_style_count:25,head_style_count:5,hair_style_count:0,hair_styles_with_accessory:new Set}),c=new i({name:"RAmar",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])}),_=new i({name:"RAmarl",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])}),l=new i({name:"RAcast",body_style_count:25,head_style_count:5,hair_style_count:0,hair_styles_with_accessory:new Set}),h=new i({name:"RAcaseal",body_style_count:25,head_style_count:5,hair_style_count:0,hair_styles_with_accessory:new Set}),u=new i({name:"FOmar",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])}),d=new i({name:"FOmarl",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])}),m=new i({name:"FOnewm",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])}),b=new i({name:"FOnewearl",body_style_count:18,head_style_count:1,hair_style_count:10,hair_styles_with_accessory:new Set([0,1,2,3,4,5,6,7,8,9])})},EVkk:function(e,t,s){"use strict";s.d(t,"a",(function(){return _}));var i=s("nN8q"),n=s("FXpb"),a=s("KVVN");s("Gmhn");const r=500,o=500;class c extends i.a{constructor(e,t,s=[]){let i;super(),this.x=0,this.y=0,this.prev_mouse_x=0,this.prev_mouse_y=0,this.children=[],this.dismiss_button=this.disposable(new a.a({text:"Dismiss"})),this.mousedown=e=>{this.prev_mouse_x=e.clientX,this.prev_mouse_y=e.clientY,window.addEventListener("mousemove",this.window_mousemove),window.addEventListener("mouseup",this.window_mouseup)},this.window_mousemove=e=>{e.preventDefault(),this.set_position(this.x+e.clientX-this.prev_mouse_x,this.y+e.clientY-this.prev_mouse_y),this.prev_mouse_x=e.clientX,this.prev_mouse_y=e.clientY},this.window_mouseup=e=>{e.preventDefault(),window.removeEventListener("mousemove",this.window_mousemove),window.removeEventListener("mouseup",this.window_mouseup)},this.keydown=e=>{"Escape"===e.key&&this.dispose()},this.element=Object(n.q)({className:"core_ResultPopup",tabIndex:0},i=Object(n.i)(e),Object(n.h)({className:"core_ResultPopup_description"},t),Object(n.h)({className:"core_ResultPopup_body"},Object(n.B)(...s.map(e=>Object(n.o)(e.ui_message)))),Object(n.h)({className:"core_ResultPopup_footer"},this.dismiss_button.element)),this.element.style.width=`${r}px`,this.element.style.maxHeight=`${o}px`,this.set_position((window.innerWidth-r)/2,(window.innerHeight-o)/2),this.element.addEventListener("keydown",this.keydown),i.addEventListener("mousedown",this.mousedown),this.disposables(this.dismiss_button.onclick.observe(()=>this.dispose())),this.finalize_construction()}set_position(e,t){this.x=e,this.y=t,this.element.style.transform=`translate(${Math.floor(e)}px, ${Math.floor(t)}px)`}}function _(e,t,s){let i;e.success?e.problems.length&&(i=new c("Problems",t,e.problems)):i=new c("Error",s,e.problems),i&&(document.body.append(i.element),i.focus())}},HjM1:function(e,t,s){"use strict";s.d(t,"a",(function(){return o}));var i=s("39ZU"),n=s("nN8q"),a=(s("4AvX"),s("FXpb"));const r=28;class o extends n.a{constructor(e,t){super(t),this.gui_store=e,this.tabs=[],this.bar_element=Object(a.h)({className:"core_TabContainer_Bar"}),this.panes_element=Object(a.h)({className:"core_TabContainer_Panes"}),this.element=Object(a.h)({className:"core_TabContainer"}),this.bar_mousedown=e=>{if(e.target instanceof HTMLElement){const t=e.target.dataset.key;t&&this.activate_key(t)}},this.bar_element.onmousedown=this.bar_mousedown;for(const e of t.tabs){const t=Object(a.s)({className:"core_TabContainer_Tab",data:{key:e.key}},e.title);this.bar_element.append(t);const s=this.disposable(new i.a(e.create_view)),n=Object.assign(Object.assign({},e),{tab_element:t,lazy_view:s});this.tabs.push(n),this.panes_element.append(s.element)}this.element.append(this.bar_element,this.panes_element),this.finalize_construction()}get children(){return this.tabs.flatMap(e=>e.lazy_view.children)}resize(e,t){super.resize(e,t),this.bar_element.style.width=`${e}px`,this.bar_element.style.height=`${r}px`;const s=t-r;this.panes_element.style.width=`${e}px`,this.panes_element.style.height=`${s}px`;for(const t of this.tabs)t.lazy_view.resize(e,s);return this}activate(){if(this.active_tab)this.activate_tab(this.active_tab);else{let e;for(const t of this.tabs)null!=t.path&&this.gui_store.path.val.startsWith(t.path)&&(e=t);e?this.activate_tab(e):this.tabs.length&&this.activate_tab(this.tabs[0])}}activate_key(e){for(const t of this.tabs)if(t.key===e){this.activate_tab(t);break}}activate_tab(e){this.active_tab!==e&&(this.active_tab&&(this.active_tab.tab_element.classList.remove("active"),this.active_tab.lazy_view.visible.val=!1,this.active_tab.lazy_view.deactivate()),this.active_tab=e,e.tab_element.classList.add("active"),e.lazy_view.visible.val=!0),null!=e.path&&(this.gui_store.set_path_prefix(e.path),e.lazy_view.activate())}}},U6CM:function(e,t,s){"use strict";s.r(t);var i=s("HjM1"),n=s("zsIO");class a extends n.a{constructor(e,t,s){super(),this.tab_container=this.add(new i.a(e,{class:"viewer_ViewerView",tabs:[{title:"Models",key:"model",path:"/models",create_view:t},{title:"Textures",key:"texture",path:"/textures",create_view:s}]})),this.finalize_construction()}get element(){return this.tab_container.element}resize(e,t){this.tab_container.resize(e,t)}}var r=s("Tpfs"),o=s("Womt"),c=s("Ftn7"),_=s("iR5r"),l=s("rwco");const h=l.a.get("viewer/rendering/TextureRenderer");class u extends c.a{constructor(e,t){super(t),this.disposer=new r.a,this.quad_meshes=[],this.camera=new o.OrthographicCamera(-400,400,300,-300,1,10),this.disposer.add_all(e.textures.observe(({value:e})=>{this.scene.remove(...this.quad_meshes),this.render_textures(e),this.reset_camera(new o.Vector3(0,0,5),new o.Vector3),this.schedule_render()})),this.init_camera_controls(),this.controls.azimuthRotateSpeed=0,this.controls.polarRotateSpeed=0}set_size(e,t){this.camera.left=-Math.floor(e/2),this.camera.right=Math.ceil(e/2),this.camera.top=Math.floor(t/2),this.camera.bottom=-Math.ceil(t/2),this.camera.updateProjectionMatrix(),super.set_size(e,t)}dispose(){super.dispose(),this.disposer.dispose()}render_textures(e){let t=10*(e.length-1),s=0;for(const i of e)t+=i.width,s=Math.max(s,i.height);let i=-Math.floor(t/2);const n=-Math.floor(s/2);for(const t of e){let e=void 0;try{e=Object(_.b)(t)}catch(e){h.error("Couldn't convert XVR texture.",e)}const a=new o.Mesh(this.create_quad(i,n+Math.floor((s-t.height)/2),t.width,t.height),e?new o.MeshBasicMaterial({map:e,transparent:!0}):new o.MeshBasicMaterial({color:16711935}));this.quad_meshes.push(a),this.scene.add(a),i+=10+t.width}}create_quad(e,t,s,i){const n=new o.PlaneGeometry(s,i,1,1);return n.faceVertexUvs=[[[new o.Vector2(0,0),new o.Vector2(0,1),new o.Vector2(1,0)],[new o.Vector2(0,1),new o.Vector2(1,1),new o.Vector2(1,0)]]],n.translate(e+s/2,t+i/2,-5),n}}var d=s("Eqai"),m=s("488w"),b=s("VwSi");const v=30;function p(e,t){const s=t.interpolation===b.a.Spline?o.InterpolateSmooth:o.InterpolateLinear,i=[];return t.motion_data.forEach((t,n)=>{const a=e.get_bone(n);a&&t.tracks.forEach(({type:e,keyframes:t})=>{const r=[],c=[];for(const s of t)if(r.push(s.frame/v),e===b.b.Rotation){const e=a.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",t=(new o.Quaternion).setFromEuler(new o.Euler(s.value.x,s.value.y,s.value.z,e));c.push(t.x,t.y,t.z,t.w)}else c.push(s.value.x,s.value.y,s.value.z);if(e===b.b.Rotation)i.push(new o.QuaternionKeyframeTrack(`.bones[${n}].quaternion`,r,c,s));else{const t=e===b.b.Position?`.bones[${n}].position`:`.bones[${n}].scale`;i.push(new o.VectorKeyframeTrack(t,r,c,s))}})}),new o.AnimationClip("Animation",(t.frame_count-1)/v,i).optimize()}const f=l.a.get("viewer/rendering/ModelRenderer"),y=new o.MeshLambertMaterial({color:16777215,side:o.DoubleSide}),w=new o.MeshLambertMaterial({skinning:!0,color:16777215,side:o.DoubleSide}),j=Object.freeze(new o.Vector3(0,10,20)),x=Object.freeze(new o.Vector3(0,0,0));class g extends c.a{constructor(e,t){super(t),this.store=e,this.disposer=new r.a,this.clock=new o.Clock,this.update_animation_time=!0,this.camera=new o.PerspectiveCamera(75,1,1,200),this.current_character_class_changed=e=>{const t=null!=e.value;this.character_class_active!==t&&this.reset_camera(j,x),this.character_class_active=t},this.nj_object_or_xvm_changed=()=>{var e;this.mesh&&(this.scene.remove(this.mesh),this.mesh=void 0,this.scene.remove(this.skeleton_helper),this.skeleton_helper=void 0);const t=this.store.current_nj_object.val;if(t){let s;if(this.animation){const t=this.animation.mixer;s=null===(e=t.existingAction(this.animation.clip))||void 0===e?void 0:e.time,t.stopAllAction(),t.uncacheAction(this.animation.clip),this.animation=void 0}const i=this.store.current_textures.val.map(e=>{if(e)try{return Object(_.b)(e)}catch(e){f.error("Couldn't convert XVR texture.",e)}}),n=Object(m.a)(t),a=null!=n.getAttribute("skinIndex"),r=i.map(e=>e?new o.MeshBasicMaterial({skinning:a,map:e,side:o.DoubleSide,alphaTest:.1,transparent:!0}):new o.MeshLambertMaterial({skinning:a,side:o.DoubleSide}));this.mesh=a?Object(d.b)(n,r,w):Object(d.a)(n,r,y);const c=n.boundingBox,l=c.max.y-c.min.y;this.mesh.translateY(-l/2-c.min.y),this.scene.add(this.mesh),this.skeleton_helper=new o.SkeletonHelper(this.mesh),this.skeleton_helper.visible=this.store.show_skeleton.val,this.skeleton_helper.material.linewidth=3,this.scene.add(this.skeleton_helper);const h=this.store.current_nj_motion.val;if(h){const e=new o.AnimationMixer(this.mesh);e.timeScale=this.store.animation_frame_rate.val/v;const i=p(t,h);this.animation={mixer:e,clip:i};const n=e.clipAction(i,this.mesh);n.time=null!=s?s:0,n.play()}}this.schedule_render()},this.nj_motion_changed=({value:e})=>{let t;this.animation&&(this.animation.mixer.stopAllAction(),this.animation.mixer.uncacheAction(this.animation.clip),t=this.animation.mixer);const s=this.store.current_nj_object.val;if(!(this.mesh&&this.mesh instanceof o.SkinnedMesh&&e&&s))return;t||(t=new o.AnimationMixer(this.mesh));const i=p(s,e);this.animation={mixer:t,clip:i},this.clock.start(),t.clipAction(i).play(),this.schedule_render()},this.show_skeleton_changed=({value:e})=>{this.skeleton_helper&&(this.skeleton_helper.visible=e,this.schedule_render())},this.animation_playing_changed=({value:e})=>{this.animation&&(this.animation.mixer.clipAction(this.animation.clip).paused=!e,e?(this.clock.start(),this.schedule_render()):this.clock.stop())},this.animation_frame_rate_changed=({value:e})=>{this.animation&&(this.animation.mixer.timeScale=e/v)},this.animation_frame_changed=({value:e})=>{const t=this.store.current_nj_motion.val;if(this.animation&&t){const s=t.frame_count;e>s&&(e=1),e<1&&(e=s),this.update_animation_time&&(this.animation.mixer.clipAction(this.animation.clip).time=(e-1)/v),this.schedule_render()}},this.character_class_active=null!=e.current_character_class.val,this.disposer.add_all(e.current_character_class.observe(this.current_character_class_changed),e.current_nj_object.observe(this.nj_object_or_xvm_changed),e.current_textures.observe(this.nj_object_or_xvm_changed),e.current_nj_motion.observe(this.nj_motion_changed),e.show_skeleton.observe(this.show_skeleton_changed),e.animation_playing.observe(this.animation_playing_changed),e.animation_frame_rate.observe(this.animation_frame_rate_changed),e.animation_frame.observe(this.animation_frame_changed)),this.init_camera_controls(),this.reset_camera(j,x)}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}dispose(){super.dispose(),this.disposer.dispose()}render(){this.animation&&this.animation.mixer.update(this.clock.getDelta()),this.light_holder.quaternion.copy(this.camera.quaternion),super.render(),this.animation&&!this.animation.mixer.clipAction(this.animation.clip).paused&&(this.update_animation_frame(),this.schedule_render())}update_animation_frame(){if(this.animation){const e=this.animation.mixer.clipAction(this.animation.clip);e.paused||(this.update_animation_time=!1,this.store.set_animation_frame(e.time*v+1),this.update_animation_time=!0)}}}var k=s("w6HN"),O=s("6cU9"),M=s("oyid"),S=s("PE7g"),A=s("7ZX1"),z=s("FXpb"),V=s("6Fug");class C extends V.a{constructor(e){super();const t=new O.a({icon_left:z.a.File,text:"Open file...",accept:".afs, .nj, .njm, .xj, .xvm"}),s=new M.a(!1,{label:"Show skeleton"}),i=new M.a(!0,{label:"Play animation"}),n=new S.a(v,{label:"Frame rate:",min:1,max:240,step:1}),a=new S.a(1,{label:"Frame:",min:1,max:e.animation_frame_count,step:1}),r=new A.a(e.animation_frame_count_label);this.toolbar=this.add(new k.a(t,s,i,n,a,r)),this.disposables(t.files.observe(({value:t})=>{t.length&&e.load_file(t[0])}),s.checked.observe(({value:t})=>e.set_show_skeleton(t)));const o=e.animation_controls_enabled;this.disposables(i.enabled.bind_to(o),i.checked.bind_to(e.animation_playing),i.checked.observe(({value:t})=>e.set_animation_playing(t)),n.enabled.bind_to(o),n.value.observe(({value:t})=>e.set_animation_frame_rate(t)),a.enabled.bind_to(o),a.value.bind_to(e.animation_frame),a.value.observe(({value:t})=>e.set_animation_frame(t)),r.enabled.bind_to(o)),this.finalize_construction()}get element(){return this.toolbar.element}get height(){return this.toolbar.height}}var $=s("kcKQ"),R=s("9fJw"),E=s("ouMO");class F{constructor(e,t){this.id=e,this.name=t}}var P=s("nsCy"),L=s("4SjJ"),N=s("uiJh"),T=function(e,t,s,i){return new(s||(s=Promise))((function(n,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,o)}c((i=i.apply(e,t||[])).next())}))};const U=l.a.get("viewer/stores/ModelStore");class H extends $.a{constructor(e,t,s){super(),this.asset_loader=t,this.random=s,this._current_character_class=Object(E.e)(void 0),this._current_section_id=Object(E.e)(void 0),this._current_body=Object(E.e)(void 0),this._current_animation=Object(E.e)(void 0),this._current_nj_object=Object(E.e)(void 0),this._current_textures=Object(E.c)(),this._current_nj_motion=Object(E.e)(void 0),this._show_skeleton=Object(E.e)(!1),this._animation_playing=Object(E.e)(!0),this._animation_frame_rate=Object(E.e)(v),this._animation_frame=Object(E.e)(0),this.character_classes=[R.g,R.h,R.f,R.e,R.k,R.l,R.j,R.i,R.a,R.b,R.d,R.c],this.current_character_class=this._current_character_class,this.current_section_id=this._current_section_id,this.current_body=this._current_body,this.animations=new Array(572).fill(void 0).map((e,t)=>new F(t,`Animation ${t+1}`)),this.current_animation=this._current_animation,this.current_nj_object=this._current_nj_object,this.current_textures=this._current_textures,this.current_nj_motion=this._current_nj_motion,this.animation_frame_count=this.current_nj_motion.map(e=>e?e.frame_count:0),this.show_skeleton=this._show_skeleton,this.animation_playing=this._animation_playing,this.animation_frame_rate=this._animation_frame_rate,this.animation_frame=this._animation_frame,this.set_current_character_class=e=>{var t;if(this._current_character_class.val!==e){if(null==e)this.set_current_body(void 0);else{const s=this.current_body.val;(void 0===s||s>=(null===(t=e)||void 0===t?void 0:t.body_style_count))&&this.set_current_body(e.body_style_count-1)}this._current_character_class.val=e,null==this.current_animation.val&&this.set_current_nj_motion(void 0)}},this.set_current_section_id=e=>{this._current_section_id.val=e},this.set_current_body=e=>{this._current_body.val=e},this.set_current_animation=e=>{this._current_animation.val!==e&&(this._current_animation.val=e)},this.set_current_nj_object=e=>{this.set_current_character_class(void 0),this.set_current_animation(void 0),this.set_current_textures([]),this.set_current_nj_motion(void 0),this._current_nj_object.val=e},this.set_current_textures=e=>{this._current_textures.val=e},this.set_current_nj_motion=e=>{this.set_current_animation(void 0),this._current_nj_motion.val=e},this.set_show_skeleton=e=>{this._show_skeleton.val=e},this.set_animation_playing=e=>{this._animation_playing.val=e},this.set_animation_frame_rate=e=>{this._animation_frame_rate.val=e},this.set_animation_frame=e=>{this._animation_frame.val=e},this.load_character_class_model=()=>T(this,void 0,void 0,(function*(){const e=this.current_character_class.val;if(null==e)return;const t=this.current_section_id.val;if(null==t)return;const s=this.current_body.val;if(null!=s)try{const i=yield this.asset_loader.load_geometry(e);this._current_textures.val=yield this.asset_loader.load_textures(e,t,s),this._current_nj_object.val=i}catch(t){U.error(`Couldn't load model for ${e.name}.`),this._current_nj_object.val=void 0}})),this.load_animation=()=>T(this,void 0,void 0,(function*(){const e=this._current_nj_object.val,t=this.current_animation.val;if(e&&t)try{this._current_nj_motion.val=yield this.asset_loader.load_animation(t.id,64),this.set_animation_playing(!0)}catch(e){U.error(`Couldn't load animation "${t.name}".`,e),this._current_nj_motion.val=void 0}else this._current_nj_motion.val=void 0})),this.disposables(this.current_character_class.observe(this.load_character_class_model),this.current_section_id.observe(this.load_character_class_model),this.current_body.observe(this.load_character_class_model),this.current_animation.observe(this.load_animation)),this.disposables(e.bind_parameter(L.b.Viewer,"/models","model",this.current_character_class.map(e=>void 0===e?void 0:e.name)),e.bind_parameter(L.b.Viewer,"/models","section_id",this.current_section_id.map(e=>void 0===e?void 0:P.e[e])),e.bind_parameter(L.b.Viewer,"/models","body",this.current_body.map(e=>void 0===e?void 0:String(e+1))));const i=e.get_parameter(L.b.Viewer,"/models","model");let n=this.character_classes.find(e=>e.name===i);null==n&&(n=s.sample_array(this.character_classes));const a=e.get_parameter(L.b.Viewer,"/models","body");let r=null==a?void 0:parseInt(a,10);null!=r&&Number.isInteger(r)?r--:r=s.integer(0,n.body_style_count);const o=e.get_parameter(L.b.Viewer,"/models","section_id"),c=void 0===o?void 0:Object(N.b)(P.e,o);this._current_section_id.val=null!=c?c:s.sample_array(P.f),this._current_body.val=r,this._current_character_class.val=n}}var q=s("mKaR"),X=s("iPoI"),B=s("NRxM"),I=s("bcBH"),W=s("kwt4"),D=s("yub1"),J=s("/UnV"),Y=s("IMNf"),Z=s("BAAx"),K=s("EVkk"),Q=s("5cb6"),G=function(e,t,s,i){return new(s||(s=Promise))((function(n,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,o)}c((i=i.apply(e,t||[])).next())}))};const ee=l.a.get("viewer/controllers/model/ModelToolBarController");class te extends q.a{constructor(e){super(),this.store=e,this.set_show_skeleton=e=>{this.store.set_show_skeleton(e)},this.set_animation_playing=e=>{this.store.set_animation_playing(e)},this.set_animation_frame_rate=e=>{this.store.set_animation_frame_rate(e)},this.set_animation_frame=e=>{this.store.set_animation_frame(e)},this.load_file=e=>G(this,void 0,void 0,(function*(){let t;try{const s=yield Object(X.b)(e),i=new B.a(s,I.a.Little);if(e.name.endsWith(".nj")){const e=t=Object(W.c)(i);e.success&&this.store.set_current_nj_object(e.value[0])}else if(e.name.endsWith(".xj")){const e=t=Object(W.d)(i);e.success&&this.store.set_current_nj_object(e.value[0])}else if(e.name.endsWith(".njm")){this.store.set_current_animation(void 0),this.store.set_current_nj_motion(void 0);const e=this.store.current_nj_object.val;e?(this.set_animation_playing(!0),this.store.set_current_nj_motion(Object(b.c)(i,e.bone_count())),t=Object(Z.c)(void 0)):t=Object(Z.a)([{severity:Q.b.Error,ui_message:"No model to animate"}])}else if(e.name.endsWith(".xvm")){const e=t=Object(D.b)(i);e.success?this.store.set_current_textures(e.value.textures):this.store.set_current_textures([])}else if(e.name.endsWith(".afs")){const e=Object(Z.b)(ee),s=Object(J.a)(i);if(e.add_result(s),s.success){const i=s.value.flatMap(t=>{var s,i,n,a;const r=new B.a(t,I.a.Little);if(Object(D.a)(r)){const t=Object(D.b)(r);return e.add_result(t),null!=(i=null===(s=t.value)||void 0===s?void 0:s.textures)?i:[]}{const t=Object(D.b)(Object(Y.a)(r.seek_start(0)));return e.add_result(t),null!=(a=null===(n=t.value)||void 0===n?void 0:n.textures)?a:[]}});t=i.length?e.success(i):e.failure(),this.store.set_current_textures(i)}else t=e.failure()}else ee.debug(`Unsupported file extension in filename "${e.name}".`),t=Object(Z.a)([{severity:Q.b.Error,ui_message:"Unsupported file type."}])}catch(e){ee.error("Couldn't read file.",e),t=Object(Z.a)()}Object(K.a)(t,`Encountered some problems while opening "${e.name}".`,`Couldn't open "${e.name}".`)})),this.show_skeleton=e.show_skeleton,this.animation_frame_count=e.animation_frame_count,this.animation_frame_count_label=e.animation_frame_count.map(e=>`/ ${e}`),this.animation_controls_enabled=e.current_nj_motion.map(e=>null!=e),this.animation_playing=e.animation_playing,this.animation_frame_rate=e.animation_frame_rate,this.animation_frame=e.animation_frame.map(e=>Math.round(e))}}var se=s("sv1z");s("ePAx");class ie extends n.a{constructor(e){var t,s;super();const i=this.add(new se.a({class:"viewer_model_CharacterClassOptionsView_section_id",label:"Section ID:",items:P.f,selected:e.current_section_id,to_label:e=>null==e?"":P.e[e],enabled:e.enabled})),n=this.add(new se.a({class:"viewer_model_CharacterClassOptionsView_body",label:"Body:",items:e.current_body_options,selected:e.current_body,enabled:e.enabled}));this.element=Object(z.h)({className:"viewer_model_CharacterClassOptionsView"},Object(z.t)(Object(z.A)(Object(z.v)(null===(t=i.label)||void 0===t?void 0:t.element),Object(z.v)(i.element)),Object(z.A)(Object(z.v)(null===(s=n.label)||void 0===s?void 0:s.element),Object(z.v)(n.element)))),this.disposables(i.selected.observe(({value:t})=>e.set_current_section_id(t)),n.selected.observe(({value:t})=>e.set_current_body(t))),this.finalize_construction()}}var ne=s("LvDl");class ae extends q.a{constructor(e){super(),this.store=e,this.set_current_section_id=e=>{null!=e&&this.store.set_current_section_id(e)},this.set_current_body=e=>{this.store.set_current_body(null==e?void 0:e-1)},this.enabled=e.current_character_class.map(e=>null!=e),this.current_section_id=e.current_section_id,this.current_body_options=e.current_character_class.map(e=>e?Object(ne.range)(1,e.body_style_count+1):[]),this.current_body=e.current_body.map(e=>null==e?void 0:e+1)}}s.d(t,"initialize_viewer",(function(){return oe}));var re=function(e,t,s,i){return new(s||(s=Promise))((function(n,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,o)}c((i=i.apply(e,t||[])).next())}))};function oe(e,t,i,n){const o=new r.a;return{view:new a(i,()=>re(this,void 0,void 0,(function*(){const{ModelController:a}=yield s.e(14).then(s.bind(null,"UwGQ")),{ModelView:r}=yield Promise.all([s.e(1),s.e(11)]).then(s.bind(null,"puLw")),{CharacterClassAssetLoader:c}=yield s.e(15).then(s.bind(null,"ZV42")),_=o.add(new c(e)),l=o.add(new H(i,_,t)),h=new a(l),u=new te(l),d=new ae(l);return new r(h,new C(u),new ie(d),new g(l,n()))})),()=>re(this,void 0,void 0,(function*(){const{TextureController:e}=yield s.e(13).then(s.bind(null,"QRTb")),{TextureView:t}=yield s.e(10).then(s.bind(null,"Za3H")),i=o.add(new e);return new t(i,new u(i,n()))}))),dispose(){o.dispose()}}}},VwSi:function(e,t,s){"use strict";s.d(t,"a",(function(){return a})),s.d(t,"b",(function(){return r})),s.d(t,"c",(function(){return o}));var i=s("kwt4");const n=1296321870;var a,r;function o(e,t){return e.u32()===n?function(e,t){const s=e.u32();return c(e.take(s),t)}(e,t):(e.seek_start(0),function(e,t){e.seek_end(16);const s=e.u32();e.seek_start(s);const i=e.u32();return e.seek_start(i),function(e,t){e.seek(4);const s=e.u32();return e.seek_start(s),c(e,t)}(e,t)}(e,t))}function c(e,t){let s=e.u32();const i=e.u32(),n=e.u16(),a=e.u16(),o=(192&a)>>6,c=15&a,h=[];for(let a=0;a=s)return e.seek_start(a),h(e,t);r=i}return n}function h(e,t){const s=[];for(let n=0;n{this._value.set_val(this.get_value(),{silent:!1})}),n&&n.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(e){super.set_enabled(e),this.input_element.disabled=!e}set_attr(e,t,i){if(null==t)return;const s=this.input_element,o=i||(e=>e);Object(n.a)(t)?(s[e]=o(t.val),this.disposable(t.observe(({value:t})=>s[e]=o(t)))):s[e]=o(t)}}},FNQV:function(e,t,i){"use strict";i.r(t);var s=i("FXpb"),n=(i("XfQH"),i("KVVN")),o=i("Tpfs"),l=i("PE7g"),r=i("sDu+"),a=(i("rlVZ"),i("x1yY"),i("LSoc")),c=i("4VsB");class u extends r.a{constructor(e){super(e),this.element=Object(s.s)({className:"core_ComboBox core_Input"}),this.preferred_label_position="left",this.input_element=Object(s.m)(),this.to_label=e.to_label,this._selected=new c.a(this,void 0,this.set_selected),this.selected=this._selected,this.menu=this.disposable(new a.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.menu.element.onmousedown=e=>e.preventDefault(),this.input_element.placeholder=e.placeholder_text||"",this.input_element.onmousedown=()=>{this.menu.visible.set_val(!0,{silent:!1})},this.input_element.onkeydown=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.menu.hover_next();break;case"ArrowUp":e.preventDefault(),this.menu.hover_prev();break;case"Enter":this.menu.select_hovered()}};const t=e.filter;if(t){let e="";this.input_element.onkeyup=()=>{this.input_element.value!==e&&(e=this.input_element.value,t(e),(this.menu.visible.val||e)&&this.menu.hover_next())}}this.input_element.onblur=()=>{this.menu.visible.set_val(!1,{silent:!1})};const i=Object(s.k)(s.a.TriangleDown),n=Object(s.k)(s.a.TriangleUp),o=Object(s.s)({className:"core_ComboBox_button"},i,n);o.onmousedown=e=>{e.preventDefault(),this.menu.visible.set_val(!this.menu.visible.val,{silent:!1})},this.element.append(Object(s.s)({className:"core_ComboBox_inner core_Input_inner"},this.input_element,o),this.menu.element),this.disposables(this.menu.visible.observe(({value:e})=>{e&&this.menu.hover_next()}),this.menu.selected.observe(({value:e})=>{this.selected.set_val(e,{silent:!1}),this.input_element.focus()}),Object(s.c)(n,"hidden",this.menu.visible.map(e=>!e)),Object(s.c)(i,"hidden",this.menu.visible)),this.finalize_construction()}set_selected(e){this.input_element.value=e?this.to_label(e):"",this.menu.selected.val=e}}var h=i("ouMO"),d=i("rwco"),_=i("6Fug"),m=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};const p=d.a.get("hunt_optimizer/gui/WantedItemsView");class b extends _.a{constructor(e){super(),this.hunt_optimizer_stores=e,this.tbody_element=Object(s.u)(),this.store_disposer=this.disposable(new o.a),this.element=Object(s.h)({className:"hunt_optimizer_WantedItemsView"}),this.create_row=e=>{const t=new o.a,i=t.add(new l.a(e.amount.val,{min:0,step:1}));t.add_all(i.value.bind_to(e.amount),i.value.observe(({value:t})=>e.set_amount(t)));const r=t.add(new n.a({icon_left:s.a.Remove}));return t.add(r.onclick.observe(()=>m(this,void 0,void 0,(function*(){return(yield this.hunt_optimizer_stores.current.val).remove_wanted_item(e)})))),[Object(s.A)(Object(s.v)(i.element),Object(s.v)(e.item_type.name),Object(s.v)(r.element)),t]};const t=Object(h.c)(),i=Object(h.c)(),r=this.add(new u({items:i,to_label:e=>e.name,placeholder_text:"Add an item",filter(e){const s=e.toLowerCase();i.val=t.val.filter(e=>e.name.toLowerCase().includes(s))}}));this.element.append(Object(s.j)("Wanted Items"),r.element,Object(s.h)({className:"hunt_optimizer_WantedItemsView_table_wrapper"},Object(s.t)(this.tbody_element))),this.disposables(e.current.observe(({value:e})=>m(this,void 0,void 0,(function*(){try{const n=yield e;this.store_disposer.dispose_all(),this.store_disposer.add_all(Object(s.d)(this.tbody_element,n.wanted_items,this.create_row),r.selected.observe(({value:e})=>{e&&(n.add_wanted_item(e),r.selected.val=void 0)})),t.val=n.huntable_item_types.slice().sort((e,t)=>e.name.localeCompare(t.name)),i.val=t.val}catch(e){p.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}}i("l8iQ");var f=i("yar8"),v=i("nsCy"),w=i("xs7i"),x=(i("a0xr"),i("ExVU")),O=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};const y=d.a.get("hunt_optimizer/gui/OptimizationResultView");class g extends _.a{constructor(e){super(),this.element=Object(s.h)({className:"hunt_optimizer_OptimizationResultView"},Object(s.j)("Ideal Combination of Methods")),this.disposable(e.current.observe(({value:e})=>O(this,void 0,void 0,(function*(){try{const t=yield e;if(this.disposed)return;this.results_observer&&this.remove_disposable(this.results_observer),this.results_observer=this.disposable(t.result.observe(({value:e})=>this.update_table(e),{call_now:!0}))}catch(e){y.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}update_table(e){this.table&&this.remove(this.table);let t=0,i=x.Duration.fromMillis(0);if(e)for(const s of e.optimal_methods)t+=s.runs,i=i.plus(s.total_time);const n=[{title:"Difficulty",fixed:!0,width:80,render_cell:e=>v.b[e.difficulty],footer:{render_cell:()=>"Totals:"}},{title:"Method",fixed:!0,width:250,render_cell:e=>e.method_name},{title:"Ep.",fixed:!0,width:40,render_cell:e=>w.b[e.method_episode]},{title:"Section ID",fixed:!0,width:90,render_cell(e){const t=Object(s.s)(...e.section_ids.map(e=>Object(s.r)(e,{size:17})));return t.style.display="flex",t}},{title:"Time/Run",width:90,text_align:"center",render_cell:e=>e.method_time.toFormat("hh:mm")},{title:"Runs",width:60,text_align:"right",render_cell:e=>e.runs.toFixed(1),tooltip:e=>e.runs.toString(),footer:{render_cell:()=>t.toFixed(1),tooltip:()=>t.toString()}},{title:"Total Hours",width:60,text_align:"right",render_cell:e=>e.total_time.as("hours").toFixed(1),tooltip:e=>e.total_time.as("hours").toString(),footer:{render_cell:()=>i.as("hours").toFixed(1),tooltip:()=>i.as("hours").toString()}}];if(e)for(const t of e.wanted_items){let i=0;for(const s of e.optimal_methods)i+=s.item_counts.get(t)||0;n.push({title:t.name,width:80,text_align:"right",render_cell(e){const i=e.item_counts.get(t);return i?i.toFixed(2):""},tooltip(e){const i=e.item_counts.get(t);return i?i.toString():""},footer:{render_cell:()=>i.toFixed(2),tooltip:()=>i.toString()}})}this.table=this.add(new f.b({class:"hunt_optimizer_OptimizationResultView_table",values:e?Object(h.c)(void 0,...e.optimal_methods):Object(h.c)(),columns:n})),this.element.append(this.table.element)}}var j=i("zsIO");i.d(t,"OptimizerView",(function(){return z}));class z extends j.a{constructor(e){super(),this.element=Object(s.h)({className:"hunt_optimizer_OptimizerView"}),this.element.append(this.add(new b(e)).element,this.add(new g(e)).element),this.finalize_construction()}}},PE7g:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("0Xme");i("rY5A");class n extends s.a{constructor(e=0,t){if(super(e,"core_NumberInput","number","core_NumberInput_inner",t),this.preferred_label_position="left",t){const{min:e,max:i,step:s,width:n}=t;this.set_attr("min",e,String),this.set_attr("max",i,String),this.input_element.step="any",this.set_attr("step",s,String),null!=n&&(this.element.style.width=`${n}px`)}t&&null!=t.round_to&&t.round_to>=0?this.rounding_factor=Math.pow(10,t.round_to):this.rounding_factor=1,this.set_value(e),this.finalize_construction()}get_value(){return parseFloat(this.input_element.value)}set_value(e){this.input_element.valueAsNumber=Math.round(this.rounding_factor*e)/this.rounding_factor}}},yar8:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a}));var s=i("TRid"),n=i("FXpb"),o=i("Tpfs");i("/KYB");const l=i("rwco").a.get("core/gui/Table");var r;!function(e){e[e.Asc=0]="Asc",e[e.Desc=1]="Desc"}(r||(r={}));class a extends s.a{constructor(e){super(e),this.tbody_element=Object(n.u)(),this.element=Object(n.t)({className:"core_Table"}),this.children=[],this.create_row=(e,t)=>{const i=new o.a;let s=0;return[Object(n.A)(...this.columns.map((o,r)=>{const a=o.fixed?Object(n.y)():Object(n.v)();try{const t=o.render_cell(e,i);a.append(t),o.input&&a.classList.add("input"),o.fixed&&(a.classList.add("fixed"),a.style.left=`${s}px`,s+=o.width||0),a.style.width=`${o.width}px`,o.text_align&&(a.style.textAlign=o.text_align),o.tooltip&&(a.title=o.tooltip(e))}catch(e){l.warning(`Error while rendering cell for index ${t}, column ${r}.`,e)}return a})),i]},this.update_footer=()=>{if(!this.footer_row_element)return;const e=this.columns.length;for(let t=0;t{const i=Object(n.y)({data:{index:t.toString()}},Object(n.s)(e.title));return e.fixed&&(i.style.position="sticky",i.style.left=`${a}px`,a+=e.width),i.style.width=`${e.width}px`,e.footer&&(c=!0),i}));const u=e.sort;u&&(s.onmousedown=e=>{if(e.target instanceof HTMLElement){let i=e.target;for(let e=0;e<5&&!i.dataset.index;e++){if(!i.parentElement)return;i=i.parentElement}if(!i.dataset.index)return;const s=parseInt(i.dataset.index,10),n=this.columns[s];if(!n.sortable)return;const o=t.findIndex(e=>e.column===n);if(0===o){const e=t[0];e.direction=e.direction===r.Asc?r.Desc:r.Asc}else-1!==o&&t.splice(o,1),t.unshift({column:n,direction:r.Asc});u(t)}}),i.append(s),this.tbody_element=Object(n.u)(),this.element.append(i,this.tbody_element),c&&(this.footer_row_element=Object(n.A)(),this.element.append(Object(n.x)({},this.footer_row_element)),this.create_footer()),this.disposables(Object(n.d)(this.tbody_element,this.values,this.create_row),this.values.observe(this.update_footer)),this.finalize_construction()}create_footer(){const e=[];let t=0;for(let i=0;i{this._value.set_val(this.get_value(),{silent:!1})}),n&&n.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(e){super.set_enabled(e),this.input_element.disabled=!e}set_attr(e,t,i){if(null==t)return;const s=this.input_element,o=i||(e=>e);Object(n.a)(t)?(s[e]=o(t.val),this.disposable(t.observe(({value:t})=>s[e]=o(t)))):s[e]=o(t)}}},FNQV:function(e,t,i){"use strict";i.r(t);var s=i("FXpb"),n=(i("XfQH"),i("KVVN")),o=i("Tpfs"),l=i("PE7g"),r=i("sDu+"),a=(i("rlVZ"),i("x1yY"),i("LSoc")),c=i("4VsB");class u extends r.a{constructor(e){super(e),this.element=Object(s.q)({className:"core_ComboBox core_Input"}),this.preferred_label_position="left",this.input_element=Object(s.l)(),this.to_label=e.to_label,this._selected=new c.a(this,void 0,this.set_selected),this.selected=this._selected,this.menu=this.disposable(new a.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.menu.element.onmousedown=e=>e.preventDefault(),this.input_element.placeholder=e.placeholder_text||"",this.input_element.onmousedown=()=>{this.menu.visible.set_val(!0,{silent:!1})},this.input_element.onkeydown=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.menu.hover_next();break;case"ArrowUp":e.preventDefault(),this.menu.hover_prev();break;case"Enter":this.menu.select_hovered()}};const t=e.filter;if(t){let e="";this.input_element.onkeyup=()=>{this.input_element.value!==e&&(e=this.input_element.value,t(e),(this.menu.visible.val||e)&&this.menu.hover_next())}}this.input_element.onblur=()=>{this.menu.visible.set_val(!1,{silent:!1})};const i=Object(s.j)(s.a.TriangleDown),n=Object(s.j)(s.a.TriangleUp),o=Object(s.q)({className:"core_ComboBox_button"},i,n);o.onmousedown=e=>{e.preventDefault(),this.menu.visible.set_val(!this.menu.visible.val,{silent:!1})},this.element.append(Object(s.q)({className:"core_ComboBox_inner core_Input_inner"},this.input_element,o),this.menu.element),this.disposables(this.menu.visible.observe(({value:e})=>{e&&this.menu.hover_next()}),this.menu.selected.observe(({value:e})=>{this.selected.set_val(e,{silent:!1}),this.input_element.focus()}),Object(s.c)(n,"hidden",this.menu.visible.map(e=>!e)),Object(s.c)(i,"hidden",this.menu.visible)),this.finalize_construction()}set_selected(e){this.input_element.value=e?this.to_label(e):"",this.menu.selected.val=e}}var h=i("ouMO"),d=i("rwco"),_=i("6Fug"),m=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};const p=d.c.get("hunt_optimizer/gui/WantedItemsView");class b extends _.a{constructor(e){super(),this.hunt_optimizer_stores=e,this.tbody_element=Object(s.s)(),this.store_disposer=this.disposable(new o.a),this.element=Object(s.h)({className:"hunt_optimizer_WantedItemsView"}),this.create_row=e=>{const t=new o.a,i=t.add(new l.a(e.amount.val,{min:0,step:1}));t.add_all(i.value.bind_to(e.amount),i.value.observe(({value:t})=>e.set_amount(t)));const r=t.add(new n.a({icon_left:s.a.Remove}));return t.add(r.click.observe(()=>m(this,void 0,void 0,(function*(){return(yield this.hunt_optimizer_stores.current.val).remove_wanted_item(e)})))),[Object(s.y)(Object(s.t)(i.element),Object(s.t)(e.item_type.name),Object(s.t)(r.element)),t]};const t=Object(h.c)(),i=Object(h.c)(),r=this.add(new u({items:i,to_label:e=>e.name,placeholder_text:"Add an item",filter(e){const s=e.toLowerCase();i.val=t.val.filter(e=>e.name.toLowerCase().includes(s))}}));this.element.append(Object(s.i)("Wanted Items"),r.element,Object(s.h)({className:"hunt_optimizer_WantedItemsView_table_wrapper"},Object(s.r)(this.tbody_element))),this.disposables(e.current.observe(({value:e})=>m(this,void 0,void 0,(function*(){try{const n=yield e;this.store_disposer.dispose_all(),this.store_disposer.add_all(Object(s.d)(this.tbody_element,n.wanted_items,this.create_row),r.selected.observe(({value:e})=>{e&&(n.add_wanted_item(e),r.selected.val=void 0)})),t.val=n.huntable_item_types.slice().sort((e,t)=>e.name.localeCompare(t.name)),i.val=t.val}catch(e){p.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}}i("l8iQ");var f=i("yar8"),v=i("nsCy"),w=i("xs7i"),x=(i("a0xr"),i("ExVU")),y=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function l(e){try{a(s.next(e))}catch(e){o(e)}}function r(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(l,r)}a((s=s.apply(e,t||[])).next())}))};const O=d.c.get("hunt_optimizer/gui/OptimizationResultView");class g extends _.a{constructor(e){super(),this.element=Object(s.h)({className:"hunt_optimizer_OptimizationResultView"},Object(s.i)("Ideal Combination of Methods")),this.disposable(e.current.observe(({value:e})=>y(this,void 0,void 0,(function*(){try{const t=yield e;if(this.disposed)return;this.results_observer&&this.remove_disposable(this.results_observer),this.results_observer=this.disposable(t.result.observe(({value:e})=>this.update_table(e),{call_now:!0}))}catch(e){O.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}update_table(e){this.table&&this.remove(this.table);let t=0,i=x.Duration.fromMillis(0);if(e)for(const s of e.optimal_methods)t+=s.runs,i=i.plus(s.total_time);const n=[{title:"Difficulty",fixed:!0,width:80,render_cell:e=>v.b[e.difficulty],footer:{render_cell:()=>"Totals:"}},{title:"Method",fixed:!0,width:250,render_cell:e=>e.method_name},{title:"Ep.",fixed:!0,width:40,render_cell:e=>w.b[e.method_episode]},{title:"Section ID",fixed:!0,width:90,render_cell(e){const t=Object(s.q)(...e.section_ids.map(e=>Object(s.p)(e,{size:17})));return t.style.display="flex",t}},{title:"Time/Run",width:90,text_align:"center",render_cell:e=>e.method_time.toFormat("hh:mm")},{title:"Runs",width:60,text_align:"right",render_cell:e=>e.runs.toFixed(1),tooltip:e=>e.runs.toString(),footer:{render_cell:()=>t.toFixed(1),tooltip:()=>t.toString()}},{title:"Total Hours",width:60,text_align:"right",render_cell:e=>e.total_time.as("hours").toFixed(1),tooltip:e=>e.total_time.as("hours").toString(),footer:{render_cell:()=>i.as("hours").toFixed(1),tooltip:()=>i.as("hours").toString()}}];if(e)for(const t of e.wanted_items){let i=0;for(const s of e.optimal_methods)i+=s.item_counts.get(t)||0;n.push({title:t.name,width:80,text_align:"right",render_cell(e){const i=e.item_counts.get(t);return i?i.toFixed(2):""},tooltip(e){const i=e.item_counts.get(t);return i?i.toString():""},footer:{render_cell:()=>i.toFixed(2),tooltip:()=>i.toString()}})}this.table=this.add(new f.b({class:"hunt_optimizer_OptimizationResultView_table",values:e?Object(h.c)(void 0,...e.optimal_methods):Object(h.c)(),columns:n})),this.element.append(this.table.element)}}var j=i("zsIO");i.d(t,"OptimizerView",(function(){return z}));class z extends j.a{constructor(e){super(),this.element=Object(s.h)({className:"hunt_optimizer_OptimizerView"}),this.element.append(this.add(new b(e)).element,this.add(new g(e)).element),this.finalize_construction()}}},PE7g:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("0Xme");i("rY5A");class n extends s.a{constructor(e=0,t){if(super(e,"core_NumberInput","number","core_NumberInput_inner",t),this.preferred_label_position="left",t){const{min:e,max:i,step:s,width:n}=t;this.set_attr("min",e,String),this.set_attr("max",i,String),this.input_element.step="any",this.set_attr("step",s,String),null!=n&&(this.element.style.width=`${n}px`)}t&&null!=t.round_to&&t.round_to>=0?this.rounding_factor=Math.pow(10,t.round_to):this.rounding_factor=1,this.set_value(e),this.finalize_construction()}get_value(){return parseFloat(this.input_element.value)}set_value(e){this.input_element.valueAsNumber=Math.round(this.rounding_factor*e)/this.rounding_factor}}},yar8:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a}));var s=i("TRid"),n=i("FXpb"),o=i("Tpfs");i("/KYB");const l=i("rwco").c.get("core/gui/Table");var r;!function(e){e[e.Asc=0]="Asc",e[e.Desc=1]="Desc"}(r||(r={}));class a extends s.a{constructor(e){super(e),this.tbody_element=Object(n.s)(),this.element=Object(n.r)({className:"core_Table"}),this.children=[],this.create_row=(e,t)=>{const i=new o.a;let s=0;return[Object(n.y)(...this.columns.map((o,r)=>{const a=o.fixed?Object(n.w)():Object(n.t)();try{const t=o.render_cell(e,i);a.append(t),o.input&&a.classList.add("input"),o.fixed&&(a.classList.add("fixed"),a.style.left=`${s}px`,s+=o.width||0),a.style.width=`${o.width}px`,o.text_align&&(a.style.textAlign=o.text_align),o.tooltip&&(a.title=o.tooltip(e))}catch(e){l.warn(`Error while rendering cell for index ${t}, column ${r}.`,e)}return a})),i]},this.update_footer=()=>{if(!this.footer_row_element)return;const e=this.columns.length;for(let t=0;t{const i=Object(n.w)({data:{index:t.toString()}},Object(n.q)(e.title));return e.fixed&&(i.style.position="sticky",i.style.left=`${a}px`,a+=e.width),i.style.width=`${e.width}px`,e.footer&&(c=!0),i}));const u=e.sort;u&&(s.onmousedown=e=>{if(e.target instanceof HTMLElement){let i=e.target;for(let e=0;e<5&&!i.dataset.index;e++){if(!i.parentElement)return;i=i.parentElement}if(!i.dataset.index)return;const s=parseInt(i.dataset.index,10),n=this.columns[s];if(!n.sortable)return;const o=t.findIndex(e=>e.column===n);if(0===o){const e=t[0];e.direction=e.direction===r.Asc?r.Desc:r.Asc}else-1!==o&&t.splice(o,1),t.unshift({column:n,direction:r.Asc});u(t)}}),i.append(s),this.tbody_element=Object(n.s)(),this.element.append(i,this.tbody_element),c&&(this.footer_row_element=Object(n.y)(),this.element.append(Object(n.v)({},this.footer_row_element)),this.create_footer()),this.disposables(Object(n.d)(this.tbody_element,this.values,this.create_row),this.values.observe(this.update_footer)),this.finalize_construction()}create_footer(){const e=[];let t=0;for(let i=0;ithis._value.set_val(this.text_element.value,{silent:!1}),this.element.append(this.text_element),this.finalize_construction()}set_value(e){this.text_element.value=e}}i("ObFr");var h=i("7ZX1"),p=(i("7YJZ"),i("6Fug"));class g extends p.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_UnavailableView"}),this.label=this.disposable(new h.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}var b=i("zsIO");class f extends b.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_QuestInfoView",tabIndex:-1}),this.table_element=Object(u.r)(),this.id_input=this.add(new r.a(0,{min:0,step:1})),this.name_input=this.add(new c("",{max_length:32})),this.short_description_input=this.add(new v("",{max_length:128,font_family:'"Courier New", monospace',cols:25,rows:5})),this.long_description_input=this.add(new v("",{max_length:288,font_family:'"Courier New", monospace',cols:25,rows:10})),this.unavailable_view=this.add(new g("No quest loaded.")),this.quest_disposer=this.disposable(new a.a);const t=e.current_quest;this.table_element.append(Object(u.y)(Object(u.w)("Episode:"),this.episode_element=Object(u.t)()),Object(u.y)(Object(u.w)("ID:"),Object(u.t)(this.id_input.element)),Object(u.y)(Object(u.w)("Name:"),Object(u.t)(this.name_input.element)),Object(u.y)(Object(u.w)({colSpan:2},"Short description:")),Object(u.y)(Object(u.t)({colSpan:2},this.short_description_input.element)),Object(u.y)(Object(u.w)({colSpan:2},"Long description:")),Object(u.y)(Object(u.t)({colSpan:2},this.long_description_input.element))),this.element.append(this.table_element,this.unavailable_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(this.unavailable_view.visible.bind_to(e.unavailable),Object(u.c)(this.table_element,"hidden",e.unavailable),t.observe(({value:t})=>{this.quest_disposer.dispose_all(),this.episode_element.textContent=t?s.b[t.episode]:"",t&&this.quest_disposer.add_all(this.id_input.value.bind_to(t.id),this.id_input.value.observe(({value:t})=>e.set_id(t)),this.name_input.value.bind_to(t.name),this.name_input.value.observe(({value:t})=>e.set_name(t)),this.short_description_input.value.bind_to(t.short_description),this.short_description_input.value.observe(({value:t})=>e.set_short_description(t)),this.long_description_input.value.bind_to(t.long_description),this.long_description_input.value.observe(({value:t})=>e.set_long_description(t)),this.enabled.bind_to(e.enabled))})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.id_input.enabled.val=e,this.name_input.enabled.val=e,this.short_description_input.enabled.val=e,this.long_description_input.enabled.val=e}}i("88+i"),i("UrNz"),i("5sDa");class m extends b.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_NpcCountsView"}),this.table_element=Object(u.r)(),this.unavailable_view=this.add(new g("No quest loaded.")),this.element.append(this.table_element,this.unavailable_view.element),this.disposables(Object(u.c)(this.table_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),e.npc_counts.observe(({value:e})=>this.update_view(e),{call_now:!0})),this.finalize_construction()}update_view(e){const t=document.createDocumentFragment();for(const{name:i,count:o}of e)t.append(Object(u.y)(Object(u.w)(i+":"),Object(u.t)(String(o))));this.table_element.innerHTML="",this.table_element.append(t)}}var w,k=i("Ftn7"),y=i("Womt"),R=i("Eqai"),I=i("sZ1+");!function(e){e[e.Unknown=1e3]="Unknown",e[e.PlayerSet=1001]="PlayerSet",e[e.Particle=1002]="Particle",e[e.Teleporter=1003]="Teleporter",e[e.Warp=1004]="Warp",e[e.LightCollision=1005]="LightCollision",e[e.Item=1006]="Item",e[e.EnvSound=1007]="EnvSound",e[e.FogCollision=1008]="FogCollision",e[e.EventCollision=1009]="EventCollision",e[e.CharaCollision=1010]="CharaCollision",e[e.ElementalTrap=1011]="ElementalTrap",e[e.StatusTrap=1012]="StatusTrap",e[e.HealTrap=1013]="HealTrap",e[e.LargeElementalTrap=1014]="LargeElementalTrap",e[e.ObjRoomID=1015]="ObjRoomID",e[e.Sensor=1016]="Sensor",e[e.UnknownItem16=1017]="UnknownItem16",e[e.LensFlare=1018]="LensFlare",e[e.ScriptCollision=1019]="ScriptCollision",e[e.HealRing=1020]="HealRing",e[e.MapCollision=1021]="MapCollision",e[e.ScriptCollisionA=1022]="ScriptCollisionA",e[e.ItemLight=1023]="ItemLight",e[e.RadarCollision=1024]="RadarCollision",e[e.FogCollisionSW=1025]="FogCollisionSW",e[e.BossTeleporter=1026]="BossTeleporter",e[e.ImageBoard=1027]="ImageBoard",e[e.QuestWarp=1028]="QuestWarp",e[e.Epilogue=1029]="Epilogue",e[e.UnknownItem29=1030]="UnknownItem29",e[e.UnknownItem30=1031]="UnknownItem30",e[e.UnknownItem31=1032]="UnknownItem31",e[e.BoxDetectObject=1033]="BoxDetectObject",e[e.SymbolChatObject=1034]="SymbolChatObject",e[e.TouchPlateObject=1035]="TouchPlateObject",e[e.TargetableObject=1036]="TargetableObject",e[e.EffectObject=1037]="EffectObject",e[e.CountDownObject=1038]="CountDownObject",e[e.UnknownItem38=1039]="UnknownItem38",e[e.UnknownItem39=1040]="UnknownItem39",e[e.UnknownItem40=1041]="UnknownItem40",e[e.UnknownItem41=1042]="UnknownItem41",e[e.MenuActivation=1043]="MenuActivation",e[e.TelepipeLocation=1044]="TelepipeLocation",e[e.BGMCollision=1045]="BGMCollision",e[e.MainRagolTeleporter=1046]="MainRagolTeleporter",e[e.LobbyTeleporter=1047]="LobbyTeleporter",e[e.PrincipalWarp=1048]="PrincipalWarp",e[e.ShopDoor=1049]="ShopDoor",e[e.HuntersGuildDoor=1050]="HuntersGuildDoor",e[e.TeleporterDoor=1051]="TeleporterDoor",e[e.MedicalCenterDoor=1052]="MedicalCenterDoor",e[e.Elevator=1053]="Elevator",e[e.EasterEgg=1054]="EasterEgg",e[e.ValentinesHeart=1055]="ValentinesHeart",e[e.ChristmasTree=1056]="ChristmasTree",e[e.ChristmasWreath=1057]="ChristmasWreath",e[e.HalloweenPumpkin=1058]="HalloweenPumpkin",e[e.TwentyFirstCentury=1059]="TwentyFirstCentury",e[e.Sonic=1060]="Sonic",e[e.WelcomeBoard=1061]="WelcomeBoard",e[e.Firework=1062]="Firework",e[e.LobbyScreenDoor=1063]="LobbyScreenDoor",e[e.MainRagolTeleporterBattleInNextArea=1064]="MainRagolTeleporterBattleInNextArea",e[e.LabTeleporterDoor=1065]="LabTeleporterDoor",e[e.Pioneer2InvisibleTouchplate=1066]="Pioneer2InvisibleTouchplate",e[e.ForestDoor=1067]="ForestDoor",e[e.ForestSwitch=1068]="ForestSwitch",e[e.LaserFence=1069]="LaserFence",e[e.LaserSquareFence=1070]="LaserSquareFence",e[e.ForestLaserFenceSwitch=1071]="ForestLaserFenceSwitch",e[e.LightRays=1072]="LightRays",e[e.BlueButterfly=1073]="BlueButterfly",e[e.Probe=1074]="Probe",e[e.RandomTypeBox1=1075]="RandomTypeBox1",e[e.ForestWeatherStation=1076]="ForestWeatherStation",e[e.Battery=1077]="Battery",e[e.ForestConsole=1078]="ForestConsole",e[e.BlackSlidingDoor=1079]="BlackSlidingDoor",e[e.RicoMessagePod=1080]="RicoMessagePod",e[e.EnergyBarrier=1081]="EnergyBarrier",e[e.ForestRisingBridge=1082]="ForestRisingBridge",e[e.SwitchNoneDoor=1083]="SwitchNoneDoor",e[e.EnemyBoxGrey=1084]="EnemyBoxGrey",e[e.FixedTypeBox=1085]="FixedTypeBox",e[e.EnemyBoxBrown=1086]="EnemyBoxBrown",e[e.EmptyTypeBox=1087]="EmptyTypeBox",e[e.LaserFenceEx=1088]="LaserFenceEx",e[e.LaserSquareFenceEx=1089]="LaserSquareFenceEx",e[e.FloorPanel1=1090]="FloorPanel1",e[e.Caves4ButtonDoor=1091]="Caves4ButtonDoor",e[e.CavesNormalDoor=1092]="CavesNormalDoor",e[e.CavesSmashingPillar=1093]="CavesSmashingPillar",e[e.CavesSign1=1094]="CavesSign1",e[e.CavesSign2=1095]="CavesSign2",e[e.CavesSign3=1096]="CavesSign3",e[e.HexagonalTank=1097]="HexagonalTank",e[e.BrownPlatform=1098]="BrownPlatform",e[e.WarningLightObject=1099]="WarningLightObject",e[e.Rainbow=1100]="Rainbow",e[e.FloatingJellyfish=1101]="FloatingJellyfish",e[e.FloatingDragonfly=1102]="FloatingDragonfly",e[e.CavesSwitchDoor=1103]="CavesSwitchDoor",e[e.RobotRechargeStation=1104]="RobotRechargeStation",e[e.CavesCakeShop=1105]="CavesCakeShop",e[e.Caves1SmallRedRock=1106]="Caves1SmallRedRock",e[e.Caves1MediumRedRock=1107]="Caves1MediumRedRock",e[e.Caves1LargeRedRock=1108]="Caves1LargeRedRock",e[e.Caves2SmallRock1=1109]="Caves2SmallRock1",e[e.Caves2MediumRock1=1110]="Caves2MediumRock1",e[e.Caves2LargeRock1=1111]="Caves2LargeRock1",e[e.Caves2SmallRock2=1112]="Caves2SmallRock2",e[e.Caves2MediumRock2=1113]="Caves2MediumRock2",e[e.Caves2LargeRock2=1114]="Caves2LargeRock2",e[e.Caves3SmallRock=1115]="Caves3SmallRock",e[e.Caves3MediumRock=1116]="Caves3MediumRock",e[e.Caves3LargeRock=1117]="Caves3LargeRock",e[e.FloorPanel2=1118]="FloorPanel2",e[e.DestructableRockCaves1=1119]="DestructableRockCaves1",e[e.DestructableRockCaves2=1120]="DestructableRockCaves2",e[e.DestructableRockCaves3=1121]="DestructableRockCaves3",e[e.MinesDoor=1122]="MinesDoor",e[e.FloorPanel3=1123]="FloorPanel3",e[e.MinesSwitchDoor=1124]="MinesSwitchDoor",e[e.LargeCryoTube=1125]="LargeCryoTube",e[e.ComputerLikeCalus=1126]="ComputerLikeCalus",e[e.GreenScreenOpeningAndClosing=1127]="GreenScreenOpeningAndClosing",e[e.FloatingRobot=1128]="FloatingRobot",e[e.FloatingBlueLight=1129]="FloatingBlueLight",e[e.SelfDestructingObject1=1130]="SelfDestructingObject1",e[e.SelfDestructingObject2=1131]="SelfDestructingObject2",e[e.SelfDestructingObject3=1132]="SelfDestructingObject3",e[e.SparkMachine=1133]="SparkMachine",e[e.MinesLargeFlashingCrate=1134]="MinesLargeFlashingCrate",e[e.RuinsSeal=1135]="RuinsSeal",e[e.RuinsTeleporter=1136]="RuinsTeleporter",e[e.RuinsWarpSiteToSite=1137]="RuinsWarpSiteToSite",e[e.RuinsSwitch=1138]="RuinsSwitch",e[e.FloorPanel4=1139]="FloorPanel4",e[e.Ruins1Door=1140]="Ruins1Door",e[e.Ruins3Door=1141]="Ruins3Door",e[e.Ruins2Door=1142]="Ruins2Door",e[e.Ruins11ButtonDoor=1143]="Ruins11ButtonDoor",e[e.Ruins21ButtonDoor=1144]="Ruins21ButtonDoor",e[e.Ruins31ButtonDoor=1145]="Ruins31ButtonDoor",e[e.Ruins4ButtonDoor=1146]="Ruins4ButtonDoor",e[e.Ruins2ButtonDoor=1147]="Ruins2ButtonDoor",e[e.RuinsSensor=1148]="RuinsSensor",e[e.RuinsFenceSwitch=1149]="RuinsFenceSwitch",e[e.RuinsLaserFence4x2=1150]="RuinsLaserFence4x2",e[e.RuinsLaserFence6x2=1151]="RuinsLaserFence6x2",e[e.RuinsLaserFence4x4=1152]="RuinsLaserFence4x4",e[e.RuinsLaserFence6x4=1153]="RuinsLaserFence6x4",e[e.RuinsPoisonBlob=1154]="RuinsPoisonBlob",e[e.RuinsPillarTrap=1155]="RuinsPillarTrap",e[e.PopupTrapNoTech=1156]="PopupTrapNoTech",e[e.RuinsCrystal=1157]="RuinsCrystal",e[e.Monument=1158]="Monument",e[e.RuinsRock1=1159]="RuinsRock1",e[e.RuinsRock2=1160]="RuinsRock2",e[e.RuinsRock3=1161]="RuinsRock3",e[e.RuinsRock4=1162]="RuinsRock4",e[e.RuinsRock5=1163]="RuinsRock5",e[e.RuinsRock6=1164]="RuinsRock6",e[e.RuinsRock7=1165]="RuinsRock7",e[e.Poison=1166]="Poison",e[e.FixedBoxTypeRuins=1167]="FixedBoxTypeRuins",e[e.RandomBoxTypeRuins=1168]="RandomBoxTypeRuins",e[e.EnemyTypeBoxYellow=1169]="EnemyTypeBoxYellow",e[e.EnemyTypeBoxBlue=1170]="EnemyTypeBoxBlue",e[e.EmptyTypeBoxBlue=1171]="EmptyTypeBoxBlue",e[e.DestructableRock=1172]="DestructableRock",e[e.PopupTrapsTechs=1173]="PopupTrapsTechs",e[e.FlyingWhiteBird=1174]="FlyingWhiteBird",e[e.Tower=1175]="Tower",e[e.FloatingRocks=1176]="FloatingRocks",e[e.FloatingSoul=1177]="FloatingSoul",e[e.Butterfly=1178]="Butterfly",e[e.LobbyGameMenu=1179]="LobbyGameMenu",e[e.LobbyWarpObject=1180]="LobbyWarpObject",e[e.Lobby1EventObjectDefaultTree=1181]="Lobby1EventObjectDefaultTree",e[e.UnknownItem387=1182]="UnknownItem387",e[e.UnknownItem388=1183]="UnknownItem388",e[e.UnknownItem389=1184]="UnknownItem389",e[e.LobbyEventObjectStaticPumpkin=1185]="LobbyEventObjectStaticPumpkin",e[e.LobbyEventObject3ChristmasWindows=1186]="LobbyEventObject3ChristmasWindows",e[e.LobbyEventObjectRedAndWhiteCurtain=1187]="LobbyEventObjectRedAndWhiteCurtain",e[e.UnknownItem393=1188]="UnknownItem393",e[e.UnknownItem394=1189]="UnknownItem394",e[e.LobbyFishTank=1190]="LobbyFishTank",e[e.LobbyEventObjectButterflies=1191]="LobbyEventObjectButterflies",e[e.UnknownItem400=1192]="UnknownItem400",e[e.GreyWallLow=1193]="GreyWallLow",e[e.SpaceshipDoor=1194]="SpaceshipDoor",e[e.GreyWallHigh=1195]="GreyWallHigh",e[e.TempleNormalDoor=1196]="TempleNormalDoor",e[e.BreakableWallWallButUnbreakable=1197]="BreakableWallWallButUnbreakable",e[e.BrokenCylinderAndRubble=1198]="BrokenCylinderAndRubble",e[e.ThreeBrokenWallPiecesOnFloor=1199]="ThreeBrokenWallPiecesOnFloor",e[e.HighBrickCylinder=1200]="HighBrickCylinder",e[e.LyingCylinder=1201]="LyingCylinder",e[e.BrickConeWithFlatTop=1202]="BrickConeWithFlatTop",e[e.BreakableTempleWall=1203]="BreakableTempleWall",e[e.TempleMapDetect=1204]="TempleMapDetect",e[e.SmallBrownBrickRisingBridge=1205]="SmallBrownBrickRisingBridge",e[e.LongRisingBridgeWithPinkHighEdges=1206]="LongRisingBridgeWithPinkHighEdges",e[e.FourSwitchTempleDoor=1207]="FourSwitchTempleDoor",e[e.FourButtonSpaceshipDoor=1208]="FourButtonSpaceshipDoor",e[e.ItemBoxCca=1209]="ItemBoxCca",e[e.TeleporterEp2=1210]="TeleporterEp2",e[e.CCADoor=1211]="CCADoor",e[e.SpecialBoxCCA=1212]="SpecialBoxCCA",e[e.BigCCADoor=1213]="BigCCADoor",e[e.BigCCADoorSwitch=1214]="BigCCADoorSwitch",e[e.LittleRock=1215]="LittleRock",e[e.Little3StoneWall=1216]="Little3StoneWall",e[e.Medium3StoneWall=1217]="Medium3StoneWall",e[e.SpiderPlant=1218]="SpiderPlant",e[e.CCAAreaTeleporter=1219]="CCAAreaTeleporter",e[e.UnknownItem523=1220]="UnknownItem523",e[e.WhiteBird=1221]="WhiteBird",e[e.OrangeBird=1222]="OrangeBird",e[e.Saw=1223]="Saw",e[e.LaserDetect=1224]="LaserDetect",e[e.UnknownItem529=1225]="UnknownItem529",e[e.UnknownItem530=1226]="UnknownItem530",e[e.Seagull=1227]="Seagull",e[e.Fish=1228]="Fish",e[e.SeabedDoorWithBlueEdges=1229]="SeabedDoorWithBlueEdges",e[e.SeabedDoorAlwaysOpenNonTriggerable=1230]="SeabedDoorAlwaysOpenNonTriggerable",e[e.LittleCryotube=1231]="LittleCryotube",e[e.WideGlassWallBreakable=1232]="WideGlassWallBreakable",e[e.BlueFloatingRobot=1233]="BlueFloatingRobot",e[e.RedFloatingRobot=1234]="RedFloatingRobot",e[e.Dolphin=1235]="Dolphin",e[e.CaptureTrap=1236]="CaptureTrap",e[e.VRLink=1237]="VRLink",e[e.UnknownItem576=1238]="UnknownItem576",e[e.WarpInBarbaRayRoom=1239]="WarpInBarbaRayRoom",e[e.UnknownItem672=1240]="UnknownItem672",e[e.GeeNest=1241]="GeeNest",e[e.LabComputerConsole=1242]="LabComputerConsole",e[e.LabComputerConsoleGreenScreen=1243]="LabComputerConsoleGreenScreen",e[e.ChairYellowPillow=1244]="ChairYellowPillow",e[e.OrangeWallWithHoleInMiddle=1245]="OrangeWallWithHoleInMiddle",e[e.GreyWallWithHoleInMiddle=1246]="GreyWallWithHoleInMiddle",e[e.LongTable=1247]="LongTable",e[e.GBAStation=1248]="GBAStation",e[e.TalkLinkToSupport=1249]="TalkLinkToSupport",e[e.InstaWarp=1250]="InstaWarp",e[e.LabInvisibleObject=1251]="LabInvisibleObject",e[e.LabGlassWindowDoor=1252]="LabGlassWindowDoor",e[e.UnknownItem700=1253]="UnknownItem700",e[e.LabCeilingWarp=1254]="LabCeilingWarp",e[e.Ep4LightSource=1255]="Ep4LightSource",e[e.Cacti=1256]="Cacti",e[e.BigBrownRock=1257]="BigBrownRock",e[e.BreakableBrownRock=1258]="BreakableBrownRock",e[e.UnknownItem832=1259]="UnknownItem832",e[e.UnknownItem833=1260]="UnknownItem833",e[e.PoisonPlant=1261]="PoisonPlant",e[e.UnknownItem897=1262]="UnknownItem897",e[e.UnknownItem898=1263]="UnknownItem898",e[e.OozingDesertPlant=1264]="OozingDesertPlant",e[e.UnknownItem901=1265]="UnknownItem901",e[e.BigBlackRocks=1266]="BigBlackRocks",e[e.UnknownItem903=1267]="UnknownItem903",e[e.UnknownItem904=1268]="UnknownItem904",e[e.UnknownItem905=1269]="UnknownItem905",e[e.UnknownItem906=1270]="UnknownItem906",e[e.FallingRock=1271]="FallingRock",e[e.DesertPlantHasCollision=1272]="DesertPlantHasCollision",e[e.DesertFixedTypeBoxBreakableCrystals=1273]="DesertFixedTypeBoxBreakableCrystals",e[e.UnknownItem910=1274]="UnknownItem910",e[e.BeeHive=1275]="BeeHive",e[e.UnknownItem912=1276]="UnknownItem912",e[e.Heat=1277]="Heat",e[e.TopOfSaintMillionEgg=1278]="TopOfSaintMillionEgg",e[e.UnknownItem961=1279]="UnknownItem961"}(w||(w={}));const j=[];function T(e){return x[e]}const x=[];function S(e,t,i,o){j.push(e);const n=[];for(const[e,t]of o)n[e]=t;x[e]=Object.freeze({name:i,area_ids:n,pso_id:t})}function C(e){var t;return null!=(t=I.c[e])?t:w[e]}function O(e){return null!=I.c[e]}function L(e){var t;return null!=(t=Object(I.d)(e))?t:T(e)}var P;S(w.Unknown,void 0,"Unknown",[]),S(w.PlayerSet,0,"Player Set",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Particle,1,"Particle",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Teleporter,2,"Teleporter",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14]],[s.b.II,[0,1,2,3,4,12,13,14,15]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Warp,3,"Warp",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LightCollision,4,"Light Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Item,5,"Item",[]),S(w.EnvSound,6,"Env Sound",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.FogCollision,7,"Fog Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.EventCollision,8,"Event Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.CharaCollision,9,"Chara Collision",[[s.b.I,[0,1,2,3,4,5,8,9,10]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ElementalTrap,10,"Elemental Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.StatusTrap,11,"Status Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.HealTrap,12,"Heal Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.LargeElementalTrap,13,"Large Elemental Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.ObjRoomID,14,"Obj Room ID",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Sensor,15,"Sensor",[[s.b.I,[1,2,4,5,6,7]]]),S(w.UnknownItem16,16,"Unknown Item (16)",[]),S(w.LensFlare,17,"Lens Flare",[[s.b.I,[1,2,3,4,8,14]]]),S(w.ScriptCollision,18,"Script Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.HealRing,19,"Heal Ring",[[s.b.I,[1,2,3,4,5,6,7,8,9,10]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MapCollision,20,"Map Collision",[[s.b.I,[0,1,2,3,4,5,8,9,10,16,17]],[s.b.II,[0,5,6,7,8,9,10,11,16,17]],[s.b.IV,[0]]]),S(w.ScriptCollisionA,21,"Script Collision A",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.ItemLight,22,"Item Light",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.RadarCollision,23,"Radar Collision",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FogCollisionSW,24,"Fog Collision SW",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BossTeleporter,25,"Boss Teleporter",[[s.b.I,[0,2,5,7,10]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[5,6,7,8,0]]]),S(w.ImageBoard,26,"Image Board",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.QuestWarp,27,"Quest Warp",[[s.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[s.b.IV,[9]]]),S(w.Epilogue,28,"Epilogue",[[s.b.I,[14]],[s.b.II,[13]],[s.b.IV,[9]]]),S(w.UnknownItem29,29,"Unknown Item (29)",[[s.b.I,[1]]]),S(w.UnknownItem30,30,"Unknown Item (30)",[[s.b.I,[1,2,17]],[s.b.II,[1,2,14]],[s.b.IV,[1,2,3,4,5]]]),S(w.UnknownItem31,31,"Unknown Item (31)",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BoxDetectObject,32,"Box Detect Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.SymbolChatObject,33,"Symbol Chat Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.TouchPlateObject,34,"Touch plate Object",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.TargetableObject,35,"Targetable Object",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EffectObject,36,"Effect object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[0]]]),S(w.CountDownObject,37,"Count Down Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem38,38,"Unknown Item (38)",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem39,39,"Unknown Item (39)",[[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem40,40,"Unknown Item (40)",[[s.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem41,41,"Unknown Item (41)",[[s.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.MenuActivation,64,"Menu activation",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.TelepipeLocation,65,"Telepipe Location",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.BGMCollision,66,"BGM Collision",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.MainRagolTeleporter,67,"Main Ragol Teleporter",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.LobbyTeleporter,68,"Lobby Teleporter",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.PrincipalWarp,69,"Principal warp",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ShopDoor,70,"Shop Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.HuntersGuildDoor,71,"Hunter's Guild Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.TeleporterDoor,72,"Teleporter Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.MedicalCenterDoor,73,"Medical Center Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.Elevator,74,"Elevator",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.EasterEgg,75,"Easter Egg",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ValentinesHeart,76,"Valentines Heart",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ChristmasTree,77,"Christmas Tree",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ChristmasWreath,78,"Christmas Wreath",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.HalloweenPumpkin,79,"Halloween Pumpkin",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.TwentyFirstCentury,80,"21st Century",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.Sonic,81,"Sonic",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.WelcomeBoard,82,"Welcome Board",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.Firework,83,"Firework",[[s.b.I,[0]],[s.b.II,[0,16]],[s.b.IV,[0]]]),S(w.LobbyScreenDoor,84,"Lobby Screen Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.MainRagolTeleporterBattleInNextArea,85,"Main Ragol Teleporter (Battle in next area?)",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.LabTeleporterDoor,86,"Lab Teleporter Door",[[s.b.II,[0]]]),S(w.Pioneer2InvisibleTouchplate,87,"Pioneer 2 Invisible Touchplate",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ForestDoor,128,"Forest Door",[[s.b.I,[1,2]]]),S(w.ForestSwitch,129,"Forest Switch",[[s.b.I,[1,2,3,4,5]],[s.b.II,[1,2,3,4]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFence,130,"Laser Fence",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFence,131,"Laser Square Fence",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestLaserFenceSwitch,132,"Forest Laser Fence Switch",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LightRays,133,"Light rays",[[s.b.I,[1,2]],[s.b.II,[5,6,7,8,9]],[s.b.IV,[6,7,8]]]),S(w.BlueButterfly,134,"Blue Butterfly",[[s.b.I,[1,2]],[s.b.IV,[6,7,8]]]),S(w.Probe,135,"Probe",[[s.b.I,[1,2]]]),S(w.RandomTypeBox1,136,"Random Type Box 1",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11,13]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestWeatherStation,137,"Forest Weather Station",[[s.b.I,[1,2]]]),S(w.Battery,138,"Battery",[]),S(w.ForestConsole,139,"Forest Console",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BlackSlidingDoor,140,"Black Sliding Door",[[s.b.I,[1,2,3]]]),S(w.RicoMessagePod,141,"Rico Message Pod",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,13]]]),S(w.EnergyBarrier,142,"Energy Barrier",[[s.b.I,[1,2,4,5,6,7]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestRisingBridge,143,"Forest Rising Bridge",[[s.b.I,[1,2]]]),S(w.SwitchNoneDoor,144,"Switch (none door)",[[s.b.I,[1,2,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EnemyBoxGrey,145,"Enemy Box (Grey)",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedTypeBox,146,"Fixed Type Box",[[s.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[s.b.II,[10,11,13]],[s.b.IV,[1,2,3,4,6,7,8,9]]]),S(w.EnemyBoxBrown,147,"Enemy Box (Brown)",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EmptyTypeBox,149,"Empty Type Box",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFenceEx,150,"Laser Fence Ex",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFenceEx,151,"Laser Square Fence Ex",[]),S(w.FloorPanel1,192,"Floor Panel 1",[[s.b.I,[3,4,5,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves4ButtonDoor,193,"Caves 4 Button door",[[s.b.I,[3,4,5]]]),S(w.CavesNormalDoor,194,"Caves Normal door",[[s.b.I,[3,4,5]]]),S(w.CavesSmashingPillar,195,"Caves Smashing Pillar",[[s.b.I,[3,4,5]],[s.b.II,[1,2,3,4,17]]]),S(w.CavesSign1,196,"Caves Sign 1",[[s.b.I,[4,5]]]),S(w.CavesSign2,197,"Caves Sign 2",[[s.b.I,[4,5]]]),S(w.CavesSign3,198,"Caves Sign 3",[[s.b.I,[4,5]]]),S(w.HexagonalTank,199,"Hexagonal Tank",[[s.b.I,[4,5]]]),S(w.BrownPlatform,200,"Brown Platform",[[s.b.I,[4,5]]]),S(w.WarningLightObject,201,"Warning Light Object",[[s.b.I,[4,5]],[s.b.IV,[5]]]),S(w.Rainbow,203,"Rainbow",[[s.b.I,[4]]]),S(w.FloatingJellyfish,204,"Floating Jellyfish",[[s.b.I,[4]],[s.b.II,[10,11]]]),S(w.FloatingDragonfly,205,"Floating Dragonfly",[[s.b.I,[4,16]],[s.b.II,[3,4]],[s.b.IV,[6,7,8]]]),S(w.CavesSwitchDoor,206,"Caves Switch Door",[[s.b.I,[3,4,5]]]),S(w.RobotRechargeStation,207,"Robot Recharge Station",[[s.b.I,[3,4,5,6,7]],[s.b.II,[17]]]),S(w.CavesCakeShop,208,"Caves Cake Shop",[[s.b.I,[5]]]),S(w.Caves1SmallRedRock,209,"Caves 1 Small Red Rock",[[s.b.I,[3]]]),S(w.Caves1MediumRedRock,210,"Caves 1 Medium Red Rock",[[s.b.I,[3]]]),S(w.Caves1LargeRedRock,211,"Caves 1 Large Red Rock",[[s.b.I,[3]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves2SmallRock1,212,"Caves 2 Small Rock 1",[[s.b.I,[4]]]),S(w.Caves2MediumRock1,213,"Caves 2 Medium Rock 1",[[s.b.I,[4]]]),S(w.Caves2LargeRock1,214,"Caves 2 Large Rock 1",[[s.b.I,[4]]]),S(w.Caves2SmallRock2,215,"Caves 2 Small Rock 2",[[s.b.I,[4]]]),S(w.Caves2MediumRock2,216,"Caves 2 Medium Rock 2",[[s.b.I,[4]]]),S(w.Caves2LargeRock2,217,"Caves 2 Large Rock 2",[[s.b.I,[4]]]),S(w.Caves3SmallRock,218,"Caves 3 Small Rock",[[s.b.I,[5]]]),S(w.Caves3MediumRock,219,"Caves 3 Medium Rock",[[s.b.I,[5]]]),S(w.Caves3LargeRock,220,"Caves 3 Large Rock",[[s.b.I,[5]]]),S(w.FloorPanel2,222,"Floor Panel 2",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.DestructableRockCaves1,223,"Destructable Rock (Caves 1)",[[s.b.I,[3]]]),S(w.DestructableRockCaves2,224,"Destructable Rock (Caves 2)",[[s.b.I,[4]]]),S(w.DestructableRockCaves3,225,"Destructable Rock (Caves 3)",[[s.b.I,[5]]]),S(w.MinesDoor,256,"Mines Door",[[s.b.I,[6,7]]]),S(w.FloorPanel3,257,"Floor Panel 3",[[s.b.I,[1,2,6,7,16,17]],[s.b.II,[1,2,3,4]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MinesSwitchDoor,258,"Mines Switch Door",[[s.b.I,[6,7]],[s.b.IV,[6,7,8]]]),S(w.LargeCryoTube,259,"Large Cryo-Tube",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.ComputerLikeCalus,260,"Computer (like calus)",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.GreenScreenOpeningAndClosing,261,"Green Screen opening and closing",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.FloatingRobot,262,"Floating Robot",[[s.b.I,[6,7]]]),S(w.FloatingBlueLight,263,"Floating Blue Light",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject1,264,"Self Destructing Object 1",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject2,265,"Self Destructing Object 2",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject3,266,"Self Destructing Object 3",[[s.b.I,[6,7]]]),S(w.SparkMachine,267,"Spark Machine",[[s.b.I,[6,7]]]),S(w.MinesLargeFlashingCrate,268,"Mines Large Flashing Crate",[[s.b.I,[6,7]]]),S(w.RuinsSeal,304,"Ruins Seal",[[s.b.I,[13]]]),S(w.RuinsTeleporter,320,"Ruins Teleporter",[[s.b.I,[8,9,10]]]),S(w.RuinsWarpSiteToSite,321,"Ruins Warp (Site to site)",[[s.b.I,[8,9,10]]]),S(w.RuinsSwitch,322,"Ruins Switch",[[s.b.I,[8,9,10]]]),S(w.FloorPanel4,323,"Floor Panel 4",[[s.b.I,[8,9,10]]]),S(w.Ruins1Door,324,"Ruins 1 Door",[[s.b.I,[8]]]),S(w.Ruins3Door,325,"Ruins 3 Door",[[s.b.I,[10]]]),S(w.Ruins2Door,326,"Ruins 2 Door",[[s.b.I,[9]]]),S(w.Ruins11ButtonDoor,327,"Ruins 1-1 Button Door",[[s.b.I,[8]]]),S(w.Ruins21ButtonDoor,328,"Ruins 2-1 Button Door",[[s.b.I,[9]]]),S(w.Ruins31ButtonDoor,329,"Ruins 3-1 Button Door",[[s.b.I,[10]]]),S(w.Ruins4ButtonDoor,330,"Ruins 4-Button Door",[[s.b.I,[8,9,10]]]),S(w.Ruins2ButtonDoor,331,"Ruins 2-Button Door",[[s.b.I,[8,9,10]]]),S(w.RuinsSensor,332,"Ruins Sensor",[[s.b.I,[8,9,10]]]),S(w.RuinsFenceSwitch,333,"Ruins Fence Switch",[[s.b.I,[8,9,10]]]),S(w.RuinsLaserFence4x2,334,"Ruins Laser Fence 4x2",[[s.b.I,[8,9,10]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence6x2,335,"Ruins Laser Fence 6x2",[[s.b.I,[8,9,10]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence4x4,336,"Ruins Laser Fence 4x4",[[s.b.I,[8,9,10]]]),S(w.RuinsLaserFence6x4,337,"Ruins Laser Fence 6x4",[[s.b.I,[8,9,10]]]),S(w.RuinsPoisonBlob,338,"Ruins poison Blob",[[s.b.I,[8,9,10]],[s.b.II,[5,6,7,8,9]],[s.b.IV,[6,7,8]]]),S(w.RuinsPillarTrap,339,"Ruins Pillar Trap",[[s.b.I,[8,9,10]],[s.b.II,[1,2,3,4]]]),S(w.PopupTrapNoTech,340,"Popup Trap (No Tech)",[[s.b.I,[8,9,10]]]),S(w.RuinsCrystal,341,"Ruins Crystal",[[s.b.I,[8,9,10]]]),S(w.Monument,342,"Monument",[[s.b.I,[2,4,7]]]),S(w.RuinsRock1,345,"Ruins Rock 1",[[s.b.I,[8,9,10]]]),S(w.RuinsRock2,346,"Ruins Rock 2",[[s.b.I,[8,9,10]]]),S(w.RuinsRock3,347,"Ruins Rock 3",[[s.b.I,[8,9,10]]]),S(w.RuinsRock4,348,"Ruins Rock 4",[[s.b.I,[8,9,10]]]),S(w.RuinsRock5,349,"Ruins Rock 5",[[s.b.I,[8,9,10]]]),S(w.RuinsRock6,350,"Ruins Rock 6",[[s.b.I,[8,9,10]]]),S(w.RuinsRock7,351,"Ruins Rock 7",[[s.b.I,[8,9,10]]]),S(w.Poison,352,"Poison",[[s.b.I,[8,9,10,13]],[s.b.II,[3,4,10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedBoxTypeRuins,353,"Fixed Box Type (Ruins)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4,14,15]]]),S(w.RandomBoxTypeRuins,354,"Random Box Type (Ruins)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4,14,15]]]),S(w.EnemyTypeBoxYellow,355,"Enemy Type Box (Yellow)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.EnemyTypeBoxBlue,356,"Enemy Type Box (Blue)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.EmptyTypeBoxBlue,357,"Empty Type Box (Blue)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.DestructableRock,358,"Destructable Rock",[[s.b.I,[8,9,10]]]),S(w.PopupTrapsTechs,359,"Popup Traps (techs)",[[s.b.I,[6,7,8,9,10]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]]]),S(w.FlyingWhiteBird,368,"Flying White Bird",[[s.b.I,[14,16]],[s.b.II,[3,4]]]),S(w.Tower,369,"Tower",[[s.b.I,[14]]]),S(w.FloatingRocks,370,"Floating Rocks",[[s.b.I,[14]]]),S(w.FloatingSoul,371,"Floating Soul",[[s.b.I,[14]]]),S(w.Butterfly,372,"Butterfly",[[s.b.I,[14]]]),S(w.LobbyGameMenu,384,"Lobby Game menu",[[s.b.I,[15]]]),S(w.LobbyWarpObject,385,"Lobby Warp Object",[[s.b.I,[15]]]),S(w.Lobby1EventObjectDefaultTree,386,"Lobby 1 Event Object (Default Tree)",[[s.b.I,[15]]]),S(w.UnknownItem387,387,"Unknown Item (387)",[[s.b.I,[15]]]),S(w.UnknownItem388,388,"Unknown Item (388)",[[s.b.I,[15]]]),S(w.UnknownItem389,389,"Unknown Item (389)",[[s.b.I,[15]]]),S(w.LobbyEventObjectStaticPumpkin,390,"Lobby Event Object (Static Pumpkin)",[[s.b.I,[15]]]),S(w.LobbyEventObject3ChristmasWindows,391,"Lobby Event Object (3 Christmas Windows)",[[s.b.I,[15]]]),S(w.LobbyEventObjectRedAndWhiteCurtain,392,"Lobby Event Object (Red and White Curtain)",[[s.b.I,[15]]]),S(w.UnknownItem393,393,"Unknown Item (393)",[[s.b.I,[15]]]),S(w.UnknownItem394,394,"Unknown Item (394)",[[s.b.I,[15]]]),S(w.LobbyFishTank,395,"Lobby Fish Tank",[[s.b.I,[15]]]),S(w.LobbyEventObjectButterflies,396,"Lobby Event Object (Butterflies)",[[s.b.I,[15]]]),S(w.UnknownItem400,400,"Unknown Item (400)",[[s.b.I,[16]],[s.b.II,[3,4]]]),S(w.GreyWallLow,401,"grey wall low",[[s.b.I,[16]],[s.b.II,[3,4,17]]]),S(w.SpaceshipDoor,402,"Spaceship Door",[[s.b.I,[16]],[s.b.II,[3,4]]]),S(w.GreyWallHigh,403,"grey wall high",[[s.b.I,[16]],[s.b.II,[3,4,17]]]),S(w.TempleNormalDoor,416,"Temple Normal Door",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BreakableWallWallButUnbreakable,417,'"breakable wall wall, but unbreakable"',[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BrokenCylinderAndRubble,418,"Broken cylinder and rubble",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.ThreeBrokenWallPiecesOnFloor,419,"3 broken wall pieces on floor",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.HighBrickCylinder,420,"high brick cylinder",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.LyingCylinder,421,"lying cylinder",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BrickConeWithFlatTop,422,"brick cone with flat top",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BreakableTempleWall,423,"breakable temple wall",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.TempleMapDetect,424,"Temple Map Detect",[[s.b.I,[17]],[s.b.II,[1,2,14]],[s.b.IV,[1,2,3,4,5]]]),S(w.SmallBrownBrickRisingBridge,425,"small brown brick rising bridge",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.LongRisingBridgeWithPinkHighEdges,426,"long rising bridge (with pink high edges)",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.FourSwitchTempleDoor,427,"4 switch temple door",[[s.b.II,[1,2]]]),S(w.FourButtonSpaceshipDoor,448,"4 button spaceship door",[[s.b.II,[3,4]]]),S(w.ItemBoxCca,512,"item box cca",[[s.b.II,[5,6,7,8,9,12,16,17]],[s.b.IV,[5]]]),S(w.TeleporterEp2,513,"Teleporter (Ep 2)",[[s.b.II,[5,6,7,8,9,10,11,12,13,16,17]]]),S(w.CCADoor,514,"CCA Door",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.SpecialBoxCCA,515,"Special Box CCA",[[s.b.II,[5,6,7,8,9,12,16,17]],[s.b.IV,[1,2,3,4,5]]]),S(w.BigCCADoor,516,"Big CCA Door",[[s.b.II,[5]]]),S(w.BigCCADoorSwitch,517,"Big CCA Door Switch",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.LittleRock,518,"Little Rock",[[s.b.II,[5,6,7,8,9,16]]]),S(w.Little3StoneWall,519,"Little 3 Stone Wall",[[s.b.II,[5,6,7,8,9,16]]]),S(w.Medium3StoneWall,520,"Medium 3 stone wall",[[s.b.II,[5,6,7,8,9,16]]]),S(w.SpiderPlant,521,"Spider Plant",[[s.b.II,[5,6,7,8,9,16]]]),S(w.CCAAreaTeleporter,522,"CCA Area Teleporter",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.UnknownItem523,523,"Unknown Item (523)",[[s.b.II,[5,12]]]),S(w.WhiteBird,524,"White Bird",[[s.b.II,[6,7,9,16,17]],[s.b.IV,[6,7,8]]]),S(w.OrangeBird,525,"Orange Bird",[[s.b.II,[6,7,9,17]]]),S(w.Saw,527,"Saw",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.LaserDetect,528,"Laser Detect",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.UnknownItem529,529,"Unknown Item (529)",[[s.b.II,[5,6,7]],[s.b.IV,[6,7,8]]]),S(w.UnknownItem530,530,"Unknown Item (530)",[[s.b.II,[5,6,7,8,9,17]]]),S(w.Seagull,531,"Seagull",[[s.b.II,[6,7,8,9,16]],[s.b.IV,[6,7,8]]]),S(w.Fish,544,"Fish",[[s.b.I,[15]],[s.b.II,[6,9,10,11,16]]]),S(w.SeabedDoorWithBlueEdges,545,"Seabed Door (with blue edges)",[[s.b.II,[10,11]]]),S(w.SeabedDoorAlwaysOpenNonTriggerable,546,"Seabed door (always open, non-triggerable)",[[s.b.II,[10,11]]]),S(w.LittleCryotube,547,"Little Cryotube",[[s.b.II,[10,11,17]]]),S(w.WideGlassWallBreakable,548,"Wide Glass Wall (breakable)",[[s.b.II,[10,11]]]),S(w.BlueFloatingRobot,549,"Blue floating robot",[[s.b.II,[10,11]]]),S(w.RedFloatingRobot,550,"Red floating robot",[[s.b.II,[10,11]]]),S(w.Dolphin,551,"Dolphin",[[s.b.II,[10,11]]]),S(w.CaptureTrap,552,"Capture Trap",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.VRLink,553,"VR link",[[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]]]),S(w.UnknownItem576,576,"Unknown Item (576)",[[s.b.II,[12]]]),S(w.WarpInBarbaRayRoom,640,"Warp in Barba Ray Room",[[s.b.II,[14]]]),S(w.UnknownItem672,672,"Unknown Item (672)",[[s.b.II,[15]]]),S(w.GeeNest,688,"Gee Nest",[[s.b.I,[8,9,10]],[s.b.II,[5,6,7,8,9,16,17]],[s.b.IV,[6,7,8]]]),S(w.LabComputerConsole,689,"Lab Computer Console",[[s.b.II,[0]]]),S(w.LabComputerConsoleGreenScreen,690,"Lab Computer Console (Green Screen)",[[s.b.II,[0]]]),S(w.ChairYellowPillow,691,"Chair, Yellow Pillow",[[s.b.II,[0]]]),S(w.OrangeWallWithHoleInMiddle,692,"orange wall with hole in middle",[[s.b.II,[0]]]),S(w.GreyWallWithHoleInMiddle,693,"grey wall with hole in middle",[[s.b.II,[0]]]),S(w.LongTable,694,"long table",[[s.b.II,[0]]]),S(w.GBAStation,695,"GBA Station",[]),S(w.TalkLinkToSupport,696,"Talk (link to support)",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.InstaWarp,697,"insta-warp",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LabInvisibleObject,698,"Lab Invisible Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.LabGlassWindowDoor,699,"Lab Glass window Door",[[s.b.II,[0]]]),S(w.UnknownItem700,700,"Unknown Item (700)",[[s.b.II,[13]]]),S(w.LabCeilingWarp,701,"Lab Ceiling Warp",[[s.b.II,[0]]]),S(w.Ep4LightSource,768,"Ep4 Light Source",[[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Cacti,769,"cacti",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BigBrownRock,770,"Big Brown Rock",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BreakableBrownRock,771,"Breakable Brown Rock",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem832,832,"Unknown Item (832)",[]),S(w.UnknownItem833,833,"Unknown Item (833)",[]),S(w.PoisonPlant,896,"Poison Plant",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem897,897,"Unknown Item (897)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem898,898,"Unknown Item (898)",[[s.b.IV,[6,7,8]]]),S(w.OozingDesertPlant,899,"Oozing Desert Plant",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem901,901,"Unknown Item (901)",[[s.b.IV,[6,7,8]]]),S(w.BigBlackRocks,902,"big black rocks",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem903,903,"Unknown Item (903)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem904,904,"Unknown Item (904)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem905,905,"Unknown Item (905)",[]),S(w.UnknownItem906,906,"Unknown Item (906)",[]),S(w.FallingRock,907,"Falling Rock",[[s.b.IV,[6,7,8]]]),S(w.DesertPlantHasCollision,908,"Desert Plant (has collision)",[[s.b.IV,[6,7,8]]]),S(w.DesertFixedTypeBoxBreakableCrystals,909,"Desert Fixed Type Box (Breakable Crystals)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem910,910,"Unknown Item (910)",[]),S(w.BeeHive,911,"Bee Hive",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem912,912,"Unknown Item (912)",[[s.b.IV,[6,7,8]]]),S(w.Heat,913,"Heat",[[s.b.IV,[6,7,8]]]),S(w.TopOfSaintMillionEgg,960,"Top of saint million egg",[[s.b.IV,[9]]]),S(w.UnknownItem961,961,"Unknown Item (961)",[[s.b.IV,[9]]]),Object.freeze(j),Object.freeze(x),function(e){e[e.Normal=0]="Normal",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected"}(P||(P={}));const D=[];D[P.Normal]=16776960,D[P.Hovered]=16768831,D[P.Selected]=16755200;const B=[];function E(e,t,i){const o=new y.MeshLambertMaterial({color:O(e)?B[P.Normal]:D[P.Normal],side:y.DoubleSide}),n=Object(R.a)(t,i.length?i.map(t=>new y.MeshBasicMaterial({map:t,side:y.DoubleSide,transparent:e!==I.c.PofuillySlime&&e!==I.c.PouillySlime,alphaTest:.01})):o,o);return n.name=C(e),n}B[P.Normal]=16711680,B[P.Hovered]=16727903,B[P.Selected]=16711764;var M=i("ouMO");const W=180/Math.PI,q=1/W;function F(e){return e*W}function V(e){return e*q}function z(e,t){return(e%t+t)%t}var U=i("wtpc");function N(e,t,i){return new y.Euler(e,t,i,"ZXY")}function $(e){return(new y.Euler).setFromQuaternion(e,"ZXY")}const A=new y.Quaternion,H=new y.Quaternion;class G{constructor(e,t,i,o,n){this._section=Object(M.e)(void 0),Object(U.f)(e,"type"),Object(U.l)(t,"area_id"),Object(U.l)(i,"section_id"),Object(U.f)(o,"position"),Object(U.f)(n,"rotation"),this.type=e,this.area_id=t,this.section=this._section,this._section_id=Object(M.e)(i),this.section_id=this._section_id,this._position=Object(M.e)(o),this.position=this._position,this._world_position=Object(M.e)(o),this.world_position=this._world_position,this._rotation=Object(M.e)(n),this.rotation=this._rotation,this._world_rotation=Object(M.e)(n),this.world_rotation=this._world_rotation}set_section(e){if(e.area_variant.area.id!==this.area_id)throw new Error("Quest entities can't be moved across areas.");return this._section.val=e,this._section_id.val=e.id,this.set_position(this.position.val),this.set_rotation(this.rotation.val),this}set_position(e){this._position.val=e;const t=this.section.val;return this._world_position.val=t?e.clone().applyEuler(t.rotation).add(t.position):e,this}set_world_position(e){this._world_position.val=e;const t=this.section.val;return this._position.val=t?e.clone().sub(t.position).applyEuler(t.inverse_rotation):e,this}set_rotation(e){K(e),this._rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),this._world_rotation.val=K($(A.multiply(H)))):this._world_rotation.val=e,this}set_world_rotation(e){K(e),this._world_rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),H.inverse(),this._rotation.val=K($(A.multiply(H)))):this._rotation.val=e,this}}function K(e){return e.set(z(e.x,2*Math.PI),z(e.y,2*Math.PI),z(e.z,2*Math.PI))}class Y extends G{constructor(e,t,i,o,n,s,r,a,d,c,l,_,u){var v,h,p,g,b,f;Object(U.l)(t,"pso_type_id"),Object(U.k)(i,"npc_id"),Object(U.m)(n,"pso_wave2"),Object(U.l)(s,"script_label"),Object(U.l)(r,"pso_roaming"),Object(U.f)(_,"scale"),Object(U.f)(u,"unknown"),Object(U.d)(2===u.length,()=>`unknown should be of length 2, was ${u.length}.`),Object(U.d)(10===u[0].length,()=>`unknown[0] should be of length 10, was ${u[0].length}`),Object(U.d)(4===u[1].length,()=>`unknown[1] should be of length 4, was ${u[1].length}`),super(e,a,d,c,l),this.pso_type_id=t,this.npc_id=i,this._wave=Object(M.e)(o),this.wave=this._wave;const m=null===(h=null===(v=o)||void 0===v?void 0:v.id)||void 0===h?void 0:h.val,w=null===(g=null===(p=o)||void 0===p?void 0:p.section_id)||void 0===g?void 0:g.val,k=null===(f=null===(b=o)||void 0===b?void 0:b.area_id)||void 0===f?void 0:f.val;this._pso_wave2=n,this.pso_wave2=this.wave.flat_map(e=>null==e?Object(M.e)(null==m?this._pso_wave2:0):m===e.id.val&&w===e.section_id.val&&k===e.area_id.val?e.id.map(e=>m===e?this._pso_wave2:e):e.id),this.script_label=s,this.pso_roaming=r,this.unknown=u,this.scale=_}set_wave(e){return this._wave.val=e,this}}class Q extends k.a{constructor(e,t){super(e),this._collision_geometry=new y.Object3D,this._render_geometry=new y.Object3D,this._entity_models=new y.Object3D,this.disposer=new a.a,this.entity_to_mesh=new Map,this.camera=new y.PerspectiveCamera(60,1,10,1e4),this.disposer.add(t(this))}get debug(){return super.debug}set debug(e){this.debug!==e&&(super.debug=e,this._render_geometry.visible=e,this.schedule_render())}get collision_geometry(){return this._collision_geometry}set collision_geometry(e){this.scene.remove(this.collision_geometry),this._collision_geometry=e,this.scene.add(e)}set render_geometry(e){this.scene.remove(this._render_geometry),this._render_geometry=e,e.visible=this.debug,this.scene.add(e)}get entity_models(){return this._entity_models}init_camera_controls(){super.init_camera_controls()}dispose(){super.dispose(),this.disposer.dispose()}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}reset_entity_models(){this.scene.remove(this._entity_models),this._entity_models=new y.Group,this.scene.add(this._entity_models),this.entity_to_mesh.clear(),this.schedule_render()}add_entity_model(e){const t=e.userData.entity;this._entity_models.add(e),this.entity_to_mesh.set(t,e),t===this.selected_entity&&this.mark_selected(e),this.schedule_render()}remove_entity_model(e){const t=this.entity_to_mesh.get(e);t&&(this.entity_to_mesh.delete(e),this._entity_models.remove(t),this.schedule_render())}get_entity_mesh(e){return this.entity_to_mesh.get(e)}mark_selected(e){e===this.hovered_mesh&&(this.hovered_mesh=void 0),e!==this.selected_mesh&&(this.selected_mesh&&Z(this.selected_mesh,P.Normal),Z(e,P.Selected),this.schedule_render()),this.selected_mesh=e}mark_hovered(e){this.selected_mesh&&e===this.selected_mesh||(e!==this.hovered_mesh&&(this.hovered_mesh&&Z(this.hovered_mesh,P.Normal),e&&Z(e,P.Hovered),this.schedule_render()),this.hovered_mesh=e)}unmark_selected(){this.selected_mesh&&(Z(this.selected_mesh,P.Normal),this.schedule_render()),this.selected_mesh=void 0}}function Z(e,t){const i=e.userData.entity instanceof Y?B[t]:D[t];if(e)if(Array.isArray(e.material))for(const o of e.material)t===P.Normal&&o.map?o.color.set(16777215):o.color.set(i);else e.material.color.set(i)}var J=i("oxtq"),X=i("rwco"),ee=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const te=X.c.get("quest_editor/rendering/QuestModelManager"),ie=Object.freeze(new y.Vector3(0,800,700)),oe=Object.freeze(new y.Vector3(0,0,0)),ne=new y.Object3D;class se{constructor(e,t,i,o){this.renderer=t,this.area_asset_loader=i,this.entity_asset_loader=o,this.disposer=new a.a,this.quest_disposer=this.disposer.add(new a.a),this.area_variant_changed=()=>ee(this,void 0,void 0,(function*(){const{episode:e,area_variant:t,npcs:i,objects:o}=this.get_area_variant_details();yield this.area_model_manager.load(e,t),this.quest_disposer.dispose_all(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models(),this.quest_disposer.add_all(i.observe_list(this.npcs_changed,{call_now:!0}),o.observe_list(this.objects_changed,{call_now:!0}))})),this.npcs_changed=e=>{e.type===J.a.ListChange&&(this.npc_model_manager.remove(e.removed),this.npc_model_manager.add(e.inserted))},this.objects_changed=e=>{e.type===J.a.ListChange&&(this.object_model_manager.remove(e.removed),this.object_model_manager.add(e.inserted))},this.area_model_manager=new re(this.renderer,i),this.npc_model_manager=new ae(e,this.renderer,o),this.object_model_manager=new ae(e,this.renderer,o)}dispose(){this.disposer.dispose(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models()}}class re{constructor(e,t){this.renderer=e,this.area_asset_loader=t,this.raycaster=new y.Raycaster,this.origin=new y.Vector3,this.down=Object.freeze(new y.Vector3(0,-1,0)),this.up=Object.freeze(new y.Vector3(0,1,0))}load(e,t){return ee(this,void 0,void 0,(function*(){if(this.area_variant=t,null==e||null==t)return this.renderer.collision_geometry=ne,void(this.renderer.render_geometry=ne);try{const i=yield this.area_asset_loader.load_collision_geometry(e,t);if(this.should_cancel(t))return;const o=yield this.area_asset_loader.load_render_geometry(e,t);if(this.should_cancel(t))return;this.add_sections_to_collision_geometry(i,o),this.renderer.collision_geometry=i,this.renderer.render_geometry=o,this.renderer.reset_camera(ie,oe)}catch(e){te.error(`Couldn't load models for area ${t.area.id}, variant ${t.id}.`,e),this.renderer.collision_geometry=ne,this.renderer.render_geometry=ne}}))}should_cancel(e){return this.area_variant!==e}add_sections_to_collision_geometry(e,t){for(const i of e.children){i.geometry.boundingBox.getCenter(this.origin),this.raycaster.set(this.origin,this.down);const e=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);this.raycaster.set(this.origin,this.up);const o=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);let n;if(n=e&&o?e.distance<=o.distance?e:o:e||o,n){const e=i.userData,t=n.object.userData;e.section=t.section}}}}class ae{constructor(e,t,i){this.current_wave=e,this.renderer=t,this.entity_asset_loader=i,this.queue=[],this.loaded_entities=[],this.loading=!1}add(e){return ee(this,void 0,void 0,(function*(){if(this.queue.push(...e),!this.loading)try{for(this.loading=!0;this.queue.length;){const e=this.queue[0];try{yield this.load(e)}catch(t){te.error(`Couldn't load model for entity ${C(e.type)}.`,t)}finally{const t=this.queue.indexOf(e);-1!==t&&this.queue.splice(t,1)}}}finally{this.loading=!1}}))}remove(e){for(const t of e){const e=this.queue.indexOf(t);-1!==e&&this.queue.splice(e,1);const i=this.loaded_entities.findIndex(e=>e.entity===t);if(-1!==i){const e=this.loaded_entities.splice(i,1)[0];this.renderer.remove_entity_model(e.entity),e.disposer.dispose()}}}remove_all(){for(const{disposer:e}of this.loaded_entities)e.dispose();this.loaded_entities.splice(0,1/0),this.queue.splice(0,1/0)}load(e){return ee(this,void 0,void 0,(function*(){const t=yield this.entity_asset_loader.load_geometry(e.type);if(!this.queue.includes(e))return;const i=yield this.entity_asset_loader.load_textures(e.type);if(!this.queue.includes(e))return;const o=function(e,t,i){const o=E(e.type,t,i);return o.userData.entity=e,o.position.copy(e.world_position.val),o.rotation.copy(e.world_rotation.val),o}(e,t,i);this.update_entity_geometry(e,o)}))}update_entity_geometry(e,t){this.renderer.add_entity_model(t);const i=new a.a(e.world_position.observe(({value:e})=>{t.position.copy(e),this.renderer.schedule_render()}),e.world_rotation.observe(({value:e})=>{t.rotation.copy(e),this.renderer.schedule_render()}));e instanceof Y&&i.add(Object(M.d)((e,t)=>null==e||e===t,this.current_wave,e.wave).observe(({value:e})=>{t.visible=e,this.renderer.schedule_render()},{call_now:!0})),this.loaded_entities.push({entity:e,disposer:i})}}class de extends se{constructor(e,t,i,o,n,s){super(i,o,n,s),this.current_quest=e,this.current_area=t,this.disposer.add_all(e.observe(this.area_variant_changed),t.observe(this.area_variant_changed))}get_area_variant_details(){var e;const t=this.current_quest.val,i=this.current_area.val;let o,n,s;return t&&i?(o=t.area_variants.val.find(e=>e.area.id===i.id)||i.area_variants[0],n=t.npcs.filtered(e=>e.area_id===i.id),s=t.objects.filtered(e=>e.area_id===i.id)):(n=Object(M.c)(),s=Object(M.c)()),{episode:null===(e=t)||void 0===e?void 0:e.episode,area_variant:o,npcs:n,objects:s}}}var ce=i("KUR2");class le extends b.a{constructor(e,t,i){super(),this.element=Object(u.h)({className:t,tabIndex:-1}),this.renderer=i,this.renderer_view=this.add(new ce.a(this.renderer)),this.element.append(this.renderer_view.element),this.disposables(e.debug.observe(({value:e})=>this.renderer.debug=e)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer_view.resize(e,t),this}}let _e=void 0;const ue=new Map,ve=new y.Vector2(0,0);let he=0;function pe(e,t,i){function o(e){_e&&i(Object.assign(Object.assign({},_e),{event:e}))}ue.set(i,o),e.addEventListener(t,o)}function ge(e,t,i){const o=ue.get(i);o&&(ue.delete(i),e.removeEventListener(t,o))}function be(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"),_e&&(_e.drag_element.style.transform=`translate(${e.clientX-ve.x}px, ${e.clientY-ve.y}px)`)}function fe(){_e&&(_e.drag_element.remove(),_e=void 0)}class me extends G{constructor(e,t,i,o,n,s,r,a,d){super(e,o,n,s,r),this.id=t,this.group_id=i,this.properties=a,this.unknown=d}}class we{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Create ${L(i.type).name}`}undo(){this.quest.remove_entity(this.entity)}redo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}}class ke{constructor(e,t,i,o,n){this.quest_editor_store=e,this.entity=t,this.old_rotation=i,this.new_rotation=o,this.world=n,this.description=`Rotate ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.old_rotation):this.entity.set_rotation(this.old_rotation)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.new_rotation):this.entity.set_rotation(this.new_rotation)}}class ye{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Delete ${L(i.type).name}`,this.redo()}undo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}redo(){this.quest.remove_entity(this.entity)}}class Re{constructor(e,t,i,o,n,s,r){this.quest_editor_store=e,this.entity=t,this.old_section=i,this.new_section=o,this.old_position=n,this.new_position=s,this.world=r,this.description=`Move ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.old_section&&this.entity.set_section(this.old_section),this.world?this.entity.set_world_position(this.old_position):this.entity.set_position(this.old_position)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.new_section&&this.entity.set_section(this.new_section),this.world?this.entity.set_world_position(this.new_position):this.entity.set_position(this.new_position)}}const Ie=Object.freeze(new y.Vector3(0,0,0)),je=Object.freeze(new y.Vector3(0,1,0)),Te=Object.freeze(new y.Vector3(0,-1,0)),xe=2*Math.PI,Se=new y.Raycaster;class Ce{constructor(e,t){this.quest_editor_store=e,this.renderer=t,this.disposer=new a.a,this.pointer_position=new y.Vector2(0,0),this.pointer_device_position=new y.Vector2(0,0),this.last_pointer_position=new y.Vector2(0,0),this.moved_since_last_pointer_down=!1,this._enabled=!0,this.dispose=()=>{this.renderer.canvas_element.removeEventListener("keydown",this.keydown),this.renderer.canvas_element.removeEventListener("mousedown",this.mousedown),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup),this.renderer.canvas_element.removeEventListener("mouseleave",this.mouseleave),ge(this.renderer.canvas_element,"dragenter",this.dragenter),ge(this.renderer.canvas_element,"dragover",this.dragover),ge(this.renderer.canvas_element,"dragleave",this.dragleave),ge(this.renderer.canvas_element,"drop",this.drop),this.disposer.dispose()},this.selected_entity_changed=({value:e})=>{if(this.state.cancel(),e){const t=this.renderer.get_entity_mesh(e);t?this.renderer.mark_selected(t):this.renderer.unmark_selected()}else this.renderer.unmark_selected()},this.keydown=e=>{this.state=this.state.process_event({type:Oe.KeyDown,key:e.key})},this.mousedown=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseDown,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.addEventListener("mousemove",this.mousemove),document.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseMove,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.mouseup=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseUp,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.addEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup)},this.mouseleave=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseLeave,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.dragenter=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragEnter,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragover=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragOver,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragleave=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragLeave,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.drop=e=>{this.process_mouse_event(e.event),this.renderer.canvas_element.focus(),this.state=this.state.process_event({type:Oe.EntityDrop})},this.mark_hovered=e=>{this.renderer.mark_hovered(e)},this.disposer.add(e.selected_entity.observe(this.selected_entity_changed)),t.canvas_element.addEventListener("keydown",this.keydown),t.canvas_element.addEventListener("mousedown",this.mousedown),t.canvas_element.addEventListener("mousemove",this.mousemove),t.canvas_element.addEventListener("mouseleave",this.mouseleave),pe(t.canvas_element,"dragenter",this.dragenter),pe(t.canvas_element,"dragover",this.dragover),pe(t.canvas_element,"dragleave",this.dragleave),pe(t.canvas_element,"drop",this.drop),this.state=new Le(this.quest_editor_store,t,this._enabled)}set enabled(e){this._enabled=e,this.state.cancel(),this.state=new Le(this.quest_editor_store,this.renderer,this._enabled)}process_mouse_event(e){const{left:t,top:i}=this.renderer.canvas_element.getBoundingClientRect();this.pointer_position.set(e.clientX-t,e.clientY-i),this.pointer_device_position.copy(this.pointer_position),this.renderer.pointer_pos_to_device_coords(this.pointer_device_position),"mousedown"===e.type?this.moved_since_last_pointer_down=!1:"mousemove"!==e.type&&"mouseup"!==e.type||this.pointer_position.equals(this.last_pointer_position)||(this.moved_since_last_pointer_down=!0),this.last_pointer_position.copy(this.pointer_position)}}var Oe;!function(e){e[e.KeyDown=0]="KeyDown",e[e.MouseDown=1]="MouseDown",e[e.MouseMove=2]="MouseMove",e[e.MouseUp=3]="MouseUp",e[e.MouseLeave=4]="MouseLeave",e[e.EntityDragEnter=5]="EntityDragEnter",e[e.EntityDragOver=6]="EntityDragOver",e[e.EntityDragLeave=7]="EntityDragLeave",e[e.EntityDrop=8]="EntityDrop"}(Oe||(Oe={}));class Le{constructor(e,t,i){this.quest_editor_store=e,this.renderer=t,this.enabled=i}process_event(e){switch(e.type){case Oe.KeyDown:if(this.enabled){const t=this.quest_editor_store.selected_entity.val;if(t&&"Delete"===e.key){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new ye(this.quest_editor_store,e,t))}}return this;case Oe.MouseDown:{const t=this.pick_entity(e.pointer_device_position);if(t)if(1===e.buttons){if(this.quest_editor_store.set_selected_entity(t.entity),this.enabled)return new Pe(this.quest_editor_store,this.renderer,t.entity,t.drag_adjust,t.grab_offset)}else if(2===e.buttons&&(this.quest_editor_store.set_selected_entity(t.entity),this.enabled))return new De(this.quest_editor_store,this.renderer,t.entity,t.mesh,t.grab_offset);return this}case Oe.MouseMove:{const t=this.pick_entity(e.pointer_device_position);return e.mark_hovered(t&&t.mesh),this}case Oe.MouseUp:return e.moved_since_last_pointer_down||this.pick_entity(e.pointer_device_position)||this.quest_editor_store.set_selected_entity(void 0),this;case Oe.MouseLeave:return e.mark_hovered(void 0),this;case Oe.EntityDragEnter:if(this.enabled){const t=this.quest_editor_store.current_area.val,i=this.quest_editor_store.current_quest.val;return t&&i?new Be(this.quest_editor_store,this.renderer,e,i,t):this}return this;default:return this}}cancel(){}pick_entity(e){Se.setFromCamera(e,this.renderer.camera);const[t]=Se.intersectObjects(this.renderer.entity_models.children);if(!t)return;const i=t.object.userData.entity,o=t.object.position.clone().sub(t.point),n=o.clone();Se.set(t.object.position,Te);const[s]=Se.intersectObjects(this.renderer.collision_geometry.children,!0);return s&&(n.y-=s.distance),{mesh:t.object,entity:i,grab_offset:o,drag_adjust:n}}}class Pe{constructor(e,t,i,o,n){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.drag_adjust=o,this.grab_offset=n,this.cancelled=!1,this.initial_section=i.section.val,this.initial_position=i.world_position.val,this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Oe.MouseMove:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&Ee(this.renderer,this.entity,this.drag_adjust,this.grab_offset,e.pointer_device_position,e.shift_key),this);case Oe.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new Re(this.quest_editor_store,this.entity,this.initial_section,this.entity.section.val,this.initial_position,this.entity.world_position.val,!0)).redo(),new Le(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.initial_section&&this.entity.set_section(this.initial_section),this.entity.set_world_position(this.initial_position)}}class De{constructor(e,t,i,o,n){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.mesh=o,this.cancelled=!1,this.initial_rotation=i.world_rotation.val,this.grab_point=i.world_position.val.clone().sub(n),this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Oe.MouseMove:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&qe(this.renderer,this.entity,this.mesh.quaternion,this.initial_rotation,this.grab_point,e.pointer_device_position),this);case Oe.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new ke(this.quest_editor_store,this.entity,this.initial_rotation,this.entity.world_rotation.val,!0)),new Le(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.entity.set_world_rotation(this.initial_rotation)}}class Be{constructor(e,t,i,o,n){if(this.quest_editor_store=e,this.drag_adjust=new y.Vector3(0,0,0),this.cancelled=!1,this.renderer=t,i.drag_element.style.display="none",i.data_transfer&&(i.data_transfer.dropEffect="copy"),O(i.entity_type)){const t=Object(I.d)(i.entity_type);this.entity=new Y(i.entity_type,t.pso_type_id,0,e.selected_wave.val,0,0,t.pso_roaming,n.id,0,new y.Vector3(0,0,0),N(0,0,0),new y.Vector3(1,1,1),[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0]])}else this.entity=new me(i.entity_type,0,0,n.id,0,new y.Vector3(0,0,0),N(0,0,0),new Map,[[0,0,0,0,0,0],[0,0]]);Me(this.renderer,this.entity,this.drag_adjust,Ie,i.pointer_device_position),o.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}process_event(e){switch(e.type){case Oe.EntityDragOver:return this.cancelled?(e.drag_element.style.display="flex",e.data_transfer&&(e.data_transfer.dropEffect="none"),new Le(this.quest_editor_store,this.renderer,!0)):(e.stop_propagation(),e.prevent_default(),e.data_transfer&&(e.data_transfer.dropEffect="copy"),Ee(this.renderer,this.entity,this.drag_adjust,Ie,e.pointer_device_position,e.shift_key),this);case Oe.EntityDragLeave:{e.drag_element.style.display="flex";const t=this.quest_editor_store.current_quest.val;return t&&t.remove_entity(this.entity),new Le(this.quest_editor_store,this.renderer,!0)}case Oe.EntityDrop:if(!this.cancelled){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new we(this.quest_editor_store,e,this.entity))}return new Le(this.quest_editor_store,this.renderer,!0);default:return this}}cancel(){this.cancelled=!0;const e=this.quest_editor_store.current_quest.val;e&&e.remove_entity(this.entity)}}function Ee(e,t,i,o,n,s){s?We(e,t,i,o,n):Me(e,t,i,o,n)}const Me=(()=>{const e=new y.Plane,t=new y.Vector3;return(i,o,n,s,r)=>{const{intersection:a,section:d}=function(e,t,i){Se.setFromCamera(t,e.camera),Se.ray.origin.add(i);const o=Se.intersectObjects(e.collision_geometry.children,!0);for(const e of o)if(e.face.normal.y>.75)return{intersection:e,section:e.object.userData.section};return{}}(i,r,n);if(a){if(d){const e=o.world_rotation.val;o.set_section(d),o.set_world_rotation(e)}o.set_world_position(new y.Vector3(a.point.x,a.point.y+s.y-n.y,a.point.z))}else Se.setFromCamera(r,i.camera),e.set(je,-o.world_position.val.y+s.y),Se.ray.intersectPlane(e,t)&&o.set_world_position(new y.Vector3(t.x+s.x,o.world_position.val.y,t.z+s.z))}})(),We=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3;return(n,s,r,a,d)=>{if(Se.setFromCamera(d,n.camera),n.camera.getWorldDirection(e),e.negate(),e.y=0,e.normalize(),o.set(s.world_position.val.x,s.world_position.val.y,s.world_position.val.z),o.sub(a),t.setFromNormalAndCoplanarPoint(e,o),Se.ray.intersectPlane(t,i)){const e=i.y+a.y,t=e-s.world_position.val.y;r.y-=t,s.set_world_position(new y.Vector3(s.world_position.val.x,e,s.world_position.val.z))}}})(),qe=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3,n=new y.Vector3,s=new y.Vector3;return(r,a,d,c,l,_)=>{if(e.copy(je),e.applyQuaternion(d),t.setFromNormalAndCoplanarPoint(e,l),Se.setFromCamera(_,r.camera),Se.ray.intersectPlane(t,i)){t.projectPoint(a.world_position.val,o),n.subVectors(o,l),s.subVectors(o,i);const r=n.dot(s),d=e.dot(n.cross(s)),_=Math.atan2(d,r);a.set_world_rotation(new y.Euler(c.x,(c.y+_)%xe,c.z,"ZXY"))}}})();class Fe extends le{constructor(e,t,i,o){super(e,"quest_editor_QuestEditorRendererView",new Q(o,o=>new de(e.current_quest,e.current_area,e.selected_wave,o,t,i))),this.element.addEventListener("focus",()=>e.undo.make_current(),!0),this.entity_controls=this.disposable(new Ce(e,this.renderer)),this.disposables(e.selected_entity.observe(({value:e})=>this.renderer.selected_entity=e),e.quest_runner.running.observe(({value:e})=>this.entity_controls.enabled=!e,{call_now:!0})),this.renderer.init_camera_controls(),this.finalize_construction()}}var Ve=i("wsa1"),ze=i("w6HN"),Ue=i("oyid");class Ne extends ze.a{constructor(e){const t=new Ue.a(!0,{label:"Inline args mode",tooltip:e.has_issues.map(e=>{let t="Transform arg_push* opcodes to be inline with the opcode the arguments are given to.";return e&&(t+="\nThis mode cannot be toggled because there are issues in the script."),t})});super(t),this.disposables(t.checked.bind_to(e.inline_args_mode),t.checked.observe(({value:t})=>e.set_inline_args_mode(t)),t.enabled.bind_to(e.has_issues.map(e=>!e))),this.finalize_construction()}}var $e=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))},Ae=Ve.editor.ScrollType;class He{constructor(e){this.editor=e,this.history=[],this.history_index=-1,this.capture_history=!0,this.disposer=new a.a,this.did_change_cursor_position=e=>{this.capture_history&&(this.history.splice(this.history_index+1,1/0),"api"===e.source||-1===this.history_index||Math.abs(e.position.lineNumber-this.history[this.history_index].lineNumber)>=10?(this.history.push(e.position),this.history_index++):this.history[this.history_index]=e.position)},this.back=()=>$e(this,void 0,void 0,(function*(){this.history_index>0&&this.set_position(this.history[--this.history_index])})),this.forward=()=>$e(this,void 0,void 0,(function*(){this.history_index+1{this.capture_history=!1,this.editor.setPosition(e),this.editor.revealPositionInCenterIfOutsideViewport(e,Ae.Immediate),this.capture_history=!0},this.mouse_up=e=>{const t=e.event.browserEvent.button,i=e.event.browserEvent.buttons;3===t?(0===i&&(e.event.preventDefault(),this.back()),this.editor.focus()):4===t&&(0===i&&(e.event.preventDefault(),this.forward()),this.editor.focus())},this.disposer.add_all(this.editor.onDidChangeCursorPosition(this.did_change_cursor_position),this.editor.addAction({id:"phantasmal.action.back",label:"Back",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.LeftArrow],run:this.back}),this.editor.addAction({id:"phantasmal.action.forward",label:"Forward",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.RightArrow],run:this.forward}),this.editor.onMouseUp(this.mouse_up))}dispose(){this.disposer.dispose()}reset(){this.history.splice(0,1/0),this.history_index=-1}}i("/NSH");Ve.editor.defineTheme("phantasmal-world",{base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"e0e0e0",background:"#181818"},{token:"tag",foreground:"99bbff"},{token:"keyword",foreground:"d0a0ff",fontStyle:"bold"},{token:"predefined",foreground:"bbffbb"},{token:"number",foreground:"ffffaa"},{token:"number.hex",foreground:"ffffaa"},{token:"string",foreground:"88ffff"},{token:"string.escape",foreground:"8888ff"}],colors:{"editor.background":"#181818","editor.lineHighlightBackground":"#202020"}});const Ge=Ve.editor.createModel("","psoasm");class Ke extends b.a{constructor(e,t,i){super(),this.asm_editor_store=i,this.breakpoint_decoration_ids=[],this.element=Object(u.h)(),this.tool_bar_view=this.add(new Ne(i)),this.element.append(this.tool_bar_view.element),this.editor=this.disposable(Ve.editor.create(this.element,{theme:"phantasmal-world",scrollBeyondLastLine:!1,autoIndent:"full",fontSize:13,wordWrap:"on",wrappingIndent:"indent",renderIndentGuides:!1,folding:!1,glyphMargin:e.feature_active("vm")})),this.history=this.disposable(new He(this.editor)),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyCode.KEY_Z,()=>{}),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_Z,()=>{});const o=this.editor.getAction("editor.action.quickCommand");this.disposables(this.editor.addAction({id:"editor.action.quickCommand",label:"Command Palette",keybindings:[Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_P],run:()=>o.run()})),this.disposables(i.did_undo.observe(({value:e})=>{this.editor.trigger(e,"undo",void 0)}),i.did_redo.observe(({value:e})=>{this.editor.trigger(e,"redo",void 0)}),i.model.observe(({value:e})=>{this.editor.updateOptions({readOnly:!this.enabled.val||!e}),this.editor.setModel(e||Ge),this.history.reset(),this.breakpoint_decoration_ids=[],this.execloc_decoration_id="",t.clear_breakpoints()},{call_now:!0}),i.breakpoints.observe_list(e=>{var t;if(e.type===J.a.ListChange){for(const t of e.removed){const e=this.editor.getLineDecorations(t.line_no);if(e)for(const t of e){const e=this.breakpoint_decoration_ids.indexOf(t.id);if(e>-1){this.editor.deltaDecorations([t.id],[]),this.breakpoint_decoration_ids.splice(e,1);break}}}for(const i of e.inserted){(null===(t=this.editor.getLineDecorations(i.line_no))||void 0===t?void 0:t.some(e=>this.breakpoint_decoration_ids.includes(e.id)))||this.breakpoint_decoration_ids.push(this.editor.deltaDecorations([],[{range:new Ve.Range(i.line_no,0,i.line_no,0),options:{glyphMarginClassName:"quest_editor_AsmEditorView_breakpoint-enabled",glyphMarginHoverMessage:{value:"Breakpoint"}}}])[0])}}}),i.pause_location.observe(e=>{const t=this.old_pause_location,i=e.value;if(this.old_pause_location=i,void 0!==t&&void 0!==this.execloc_decoration_id){this.editor.getLineDecorations(t)&&this.editor.deltaDecorations([this.execloc_decoration_id],[])}void 0!==i&&(this.execloc_decoration_id=this.editor.deltaDecorations([],[{range:new Ve.Range(i,0,i,0),options:{className:"quest_editor_AsmEditorView_execution-location",isWholeLine:!0}}])[0],this.editor.revealLineInCenterIfOutsideViewport(i))}),this.editor.onDidFocusEditorWidget(()=>i.undo.make_current()),this.editor.onMouseDown(e=>{switch(e.target.type){case Ve.editor.MouseTargetType.GUTTER_GLYPH_MARGIN:{const i=e.target.position;if(!i)return;t.toggle_breakpoint(i.lineNumber)}}}),this.enabled.bind_to(t.running.map(e=>!e))),this.finalize_construction()}focus(){this.editor.focus()}resize(e,t){const i=Math.max(0,t-this.tool_bar_view.height);return this.editor.layout({width:e,height:i}),this}set_enabled(e){super.set_enabled(e),this.tool_bar_view.enabled.val=e,this.editor.updateOptions({readOnly:!e||!this.asm_editor_store.model.val})}}i("egRq");class Ye extends b.a{constructor(e){super(),this.ctrl=e,this.element=Object(u.h)({className:"quest_editor_EntityInfoView",tabIndex:-1}),this.no_entity_view=new g("No entity selected."),this.table_element=Object(u.r)(),this.pos_x_element=this.add(new r.a(0,{round_to:3})),this.pos_y_element=this.add(new r.a(0,{round_to:3})),this.pos_z_element=this.add(new r.a(0,{round_to:3})),this.rot_x_element=this.add(new r.a(0,{round_to:3})),this.rot_y_element=this.add(new r.a(0,{round_to:3})),this.rot_z_element=this.add(new r.a(0,{round_to:3}));const t="quest_editor_EntityInfoView_coord";this.table_element.append(Object(u.y)(Object(u.w)("Type:"),this.type_element=Object(u.t)()),Object(u.y)(Object(u.w)("Name:"),this.name_element=Object(u.t)()),Object(u.y)(Object(u.w)("Section:"),this.section_id_element=Object(u.t)()),this.wave_row_element=Object(u.y)(Object(u.w)("Wave:"),this.wave_element=Object(u.t)()),Object(u.y)(Object(u.w)({colSpan:2},"Position:")),Object(u.y)(Object(u.w)({className:t},"X:"),Object(u.t)(this.pos_x_element.element)),Object(u.y)(Object(u.w)({className:t},"Y:"),Object(u.t)(this.pos_y_element.element)),Object(u.y)(Object(u.w)({className:t},"Z:"),Object(u.t)(this.pos_z_element.element)),Object(u.y)(Object(u.w)({colSpan:2},"Rotation:")),Object(u.y)(Object(u.w)({className:t},"X:"),Object(u.t)(this.rot_x_element.element)),Object(u.y)(Object(u.w)({className:t},"Y:"),Object(u.t)(this.rot_y_element.element)),Object(u.y)(Object(u.w)({className:t},"Z:"),Object(u.t)(this.rot_z_element.element))),this.element.append(this.table_element,this.no_entity_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(Object(u.c)(this.table_element,"hidden",e.unavailable),this.no_entity_view.visible.bind_to(e.unavailable),Object(u.c)(this.type_element,"textContent",e.type),Object(u.c)(this.name_element,"textContent",e.name),Object(u.c)(this.section_id_element,"textContent",e.section_id),Object(u.c)(this.wave_element,"textContent",e.wave),Object(u.c)(this.wave_row_element,"hidden",e.wave_hidden),e.position.observe(({value:{x:e,y:t,z:i}})=>{this.pos_x_element.value.val=e,this.pos_y_element.value.val=t,this.pos_z_element.value.val=i},{call_now:!0}),e.rotation.observe(({value:{x:e,y:t,z:i}})=>{this.rot_x_element.value.val=F(e),this.rot_y_element.value.val=F(t),this.rot_z_element.value.val=F(i)},{call_now:!0}),this.pos_x_element.value.observe(({value:t})=>e.set_pos_x(t)),this.pos_y_element.value.observe(({value:t})=>e.set_pos_y(t)),this.pos_z_element.value.observe(({value:t})=>e.set_pos_z(t)),this.rot_x_element.value.observe(({value:t})=>e.set_rot_x(t)),this.rot_y_element.value.observe(({value:t})=>e.set_rot_y(t)),this.rot_z_element.value.observe(({value:t})=>e.set_rot_z(t)),this.enabled.bind_to(e.enabled)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.pos_x_element.enabled.val=e,this.pos_y_element.enabled.val=e,this.pos_z_element.enabled.val=e,this.rot_x_element.enabled.val=e,this.rot_y_element.enabled.val=e,this.rot_z_element.enabled.val=e}}var Qe=i("4SjJ");i("ZZ0G");class Ze extends b.a{constructor(e,t,i){super(),this.entity_image_renderer=t,this.entities=Object(M.c)(),this.create_entity_element=(e,t)=>{const i=Object(u.h)({className:"quest_editor_EntityListView_entity",data:{index:t.toString()}});i.draggable=!0;const o=Object(u.k)({width:100,height:100});o.style.visibility="hidden",o.style.pointerEvents="none",i.append(o),this.entity_image_renderer.render(e).then(e=>{o.src=e,o.style.visibility="visible"});const n=Object(u.q)(L(e).name);return i.append(n),i};const o=Object(u.h)({className:"quest_editor_EntityListView_entity_list"});this.element=Object(u.h)({className:`${i} quest_editor_EntityListView`,tabIndex:-1},o),this.disposables(Object(u.d)(o,this.entities,this.create_entity_element),function(e,t){function i(e){if(e.target instanceof HTMLElement){const i=t(e.target);i?(ve.set(e.offsetX,e.offsetY),_e={drag_element:i[0],entity_type:i[1]},_e.drag_element.style.position="fixed",_e.drag_element.style.pointerEvents="none",_e.drag_element.style.zIndex="500",_e.drag_element.style.top="0",_e.drag_element.style.left="0",_e.drag_element.style.transform=`translate(${e.clientX-ve.x}px, ${e.clientY-ve.y}px)`,document.body.append(_e.drag_element),e.dataTransfer&&(e.dataTransfer.effectAllowed="copy",e.dataTransfer.setDragImage(Object(u.h)(),0,0),e.dataTransfer.setData("phantasmal-entity",L(_e.entity_type).name))):e.preventDefault()}}return e.addEventListener("dragstart",i),1==++he&&(document.addEventListener("dragover",be),document.addEventListener("dragend",fe)),{dispose(){e.removeEventListener("dragstart",i),0==--he&&(document.removeEventListener("dragover",be),document.removeEventListener("dragend",fe))}}}(o,e=>{if(!this.enabled.val)return;let t=e;do{const i=e.dataset.index;if(null!=i)return[t.querySelector("img").cloneNode(!0),this.entities.get(parseInt(i,10))];t=t.parentElement}while(t&&t!==o)}),this.enabled.bind_to(e.quest_runner.running.map(e=>!e)))}}class Je extends Ze{constructor(e,t){super(e,t,"quest_editor_NpcListView"),this.quest_editor_store=e,this.filter_npcs=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:s.b.I,o=t?t.id:0;this.entities.val=I.b.filter(e=>{const t=Object(I.d)(e);return(null==t.episode||t.episode===i)&&t.area_ids.includes(o)})},this.disposables(e.current_quest.observe(this.filter_npcs),e.current_area.observe(this.filter_npcs)),this.filter_npcs(),this.finalize_construction()}}class Xe extends Ze{constructor(e,t){super(e,t,"quest_editor_ObjectListView"),this.quest_editor_store=e,this.filter_objects=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:s.b.I,o=t?t.id:0;this.entities.val=j.filter(e=>{const t=T(e);if(null==t.area_ids)return!0;const n=t.area_ids[i];return n&&n.includes(o)})},this.disposables(e.current_quest.observe(this.filter_objects),e.current_area.observe(this.filter_objects)),this.filter_objects(),this.finalize_construction()}}i("RL+K");var et,tt=i("KVVN");!function(e){e[e.NodeAdded=0]="NodeAdded",e[e.NodeRemoved=1]="NodeRemoved",e[e.EdgeAdded=2]="EdgeAdded",e[e.EdgeRemoved=3]="EdgeRemoved"}(et||(et={}));class it{constructor(e){this.area_id=e,this._connected_sub_graphs=Object(M.c)(),this.meta=new Map,this.emitter=Object(M.a)(),this.events=[],this.connected_sub_graphs=this._connected_sub_graphs,Object(U.m)(e,"area_id")}observe(e){return this.emitter.observe(e)}get_index(e){return this.meta.get(e).index}get_sub_graph(e){return this.meta.get(e).sub_graph}get_children(e){return this.meta.get(e).children}get_parents(e){return this.meta.get(e).parents}add_event(e,t,i){this.remove_event(e);const o=this.events.length,n=Object(M.c)(void 0,e);this.meta.set(e,{index:o,sub_graph:n,children:[],parents:[]}),this.events.push(e),this._connected_sub_graphs.push(n);for(const i of t)this.add_edge(i,e);for(const t of i)this.add_edge(e,t);this.emit({type:et.NodeAdded,event:e})}insert_event(e,t,i,o){this.remove_event(t);const n=Object(M.c)(void 0,t);this.meta.set(t,{index:e,sub_graph:n,parents:[],children:[]}),this.events.splice(e,0,t);for(let t=e+1;ti.index);)e++;i.sub_graph=n,n.splice(e,0,t),e++}this._connected_sub_graphs.remove(s),s.clear()}this.emit({type:et.EdgeAdded,parent:e,child:t})}remove_edge(e,t){this.internal_remove_edge(e,this.meta.get(e),t,this.meta.get(t))}internal_remove_edge(e,t,i,o){if(t&&o){const n=t.children.indexOf(i);-1!==n&&t.children.splice(n,1);const s=o.parents.indexOf(e);-1!==s&&o.parents.splice(s,1);const r=new Set;if(!this.connected(e,i,r)){const e=Object(M.c)(void 0,...r);e.sort((e,t)=>this.meta.get(e).index-this.meta.get(t).index);for(const i of e)t.sub_graph.remove(i);this.insert_sub_graph(this.meta.get(e.get(0)).index,e),o.sub_graph=e}this.emit({type:et.EdgeRemoved,parent:e,child:i})}}connected(e,t,i){if(e===t)return!0;if(i.has(t))return!1;i.add(t);const o=this.meta.get(t);if(o){for(const t of o.children)if(this.connected(e,t,i))return!0;for(const t of o.parents)if(this.connected(e,t,i))return!0}return!1}insert_sub_graph(e,t){let i=0;for(;ie)break;i++}this._connected_sub_graphs.splice(i,0,t)}emit(e){this.emitter.emit({value:e})}}i("xqR9");var ot,nt=i("uiJh");!function(e){e[e.SpawnNpcs=0]="SpawnNpcs",e[e.Unlock=1]="Unlock",e[e.Lock=2]="Lock"}(ot||(ot={}));const st=Object(nt.a)(ot);class rt{constructor(e,t){this.type=ot.SpawnNpcs,Object(U.m)(e,"section_id"),Object(U.m)(t,"appear_flag"),this.section_id=e,this.appear_flag=t}}class at{constructor(e){this.type=ot.Unlock,Object(U.m)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.m)(e,"door_id"),this._door_id.val=e}}class dt{constructor(e){this.type=ot.Lock,Object(U.m)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.m)(e,"door_id"),this._door_id.val=e}}i("CCCE");var ct=i("LSoc"),lt=i("QmPX");class _t extends lt.a{constructor(e){super(e),this.element=Object(u.h)({className:"core_DropDown"}),this.button_mousedown=()=>{this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next())},this.button=this.disposable(new tt.a({text:e.text,icon_left:e&&e.icon_left,icon_right:u.a.TriangleDown})),this.menu=this.disposable(new ct.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._chosen=Object(M.a)(),this.chosen=this._chosen,this.just_opened=!1,this.disposables(Object(u.g)(this.button.element,"mousedown",this.button_mousedown,{capture:!0}),this.button.mouseup.observe(this.button_mouseup),this.button.keydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{void 0!==e&&(this._chosen.emit({value:e}),this.menu.selected.val=void 0)})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}}class ut extends p.a{constructor(e,t){super(),this.ctrl=e,this.event=t,this.inputs_enabled=Object(M.e)(!0),this.create_action_element=e=>{const t=new a.a;let i,o;if(e.type===ot.SpawnNpcs)i="Spawn:",o=Object(u.h)(Object(u.h)(t.add(new r.a(e.section_id,{min:0,step:1,enabled:!1})).element),Object(u.h)(t.add(new r.a(e.appear_flag,{min:0,step:1,enabled:!1})).element));else{i=e.type===ot.Unlock?"Unlock:":"Lock:";const n=t.add(new r.a(e.door_id.val,{min:0,step:1,enabled:this.inputs_enabled}));o=n.element,t.add_all(n.value.bind_to(e.door_id),n.value.observe(({value:t})=>e.set_door_id(t)))}const n=t.add(new tt.a({icon_left:u.a.Remove}));return t.add_all(n.click.observe(()=>this.ctrl.remove_action(this.event,e))),[Object(u.y)(Object(u.w)(i),Object(u.t)(o),Object(u.t)(n.element)),t]};const i=document.createTextNode(t.wave.id.val.toString());this.delay_input=this.add(new r.a(t.delay.val,{min:0,step:1,enabled:this.inputs_enabled}));const o=Object(u.r)({className:"quest_editor_EventView_actions"}),n=this.add(new _t({text:"Add action",items:st,to_label(e){switch(e){case ot.SpawnNpcs:return"Spawn NPCs";case ot.Unlock:return"Unlock door";case ot.Lock:return"Lock door"}}}));this.element=Object(u.h)({tabIndex:0},Object(u.r)(Object(u.y)(Object(u.w)("ID:"),Object(u.t)(t.id.toString())),Object(u.y)(Object(u.w)("Section:"),Object(u.t)(t.section_id.toString())),Object(u.y)(Object(u.w)("Wave:"),Object(u.t)(i)),Object(u.y)(Object(u.w)("Delay:"),Object(u.t)(this.delay_input.element)),Object(u.y)(Object(u.w)({colSpan:2},"Actions:")),Object(u.y)(Object(u.t)({colSpan:2},o)),Object(u.y)(Object(u.t)({colSpan:2},n.element)))),this.disposables(Object(u.c)(this.element,"className",e.is_selected(t).map(e=>`quest_editor_EventView ${e?"selected":""}`)),t.wave.id.observe(({value:e})=>i.data=e.toString()),Object(u.g)(this.element,"focus",()=>{e.set_selected_wave(t.wave)}),Object(u.g)(this.element,"click",i=>{i.stopPropagation(),e.set_selected_wave(t.wave)}),Object(u.g)(this.element,"keyup",i=>{"Delete"===i.key&&e.remove_event(t)}),this.delay_input.value.bind_to(t.delay),this.delay_input.value.observe(i=>e.set_delay(t,i.value)),Object(u.d)(o,t.actions,this.create_action_element),n.chosen.observe(({value:i})=>e.add_action(t,i))),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.inputs_enabled.val=e}}i("CGbB");const vt=X.c.get("quest_editor/gui/EventSubGraphView"),ht=8,pt=20;class gt extends p.a{constructor(e,t,i,o){super(),this.ctrl=e,this.dag=t,this.sub_graph=i,this.max_edge_depth=o,this.event_gui_data=new Map,this.event_container_element=Object(u.h)({className:"quest_editor_EventSubGraphView_event_container"}),this.edge_container_element=Object(u.h)({className:"quest_editor_EventSubGraphView_edge_container"}),this.element=Object(u.h)({className:"quest_editor_EventSubGraphView"},this.edge_container_element,this.event_container_element),this.update_edges=()=>{if(this.edge_container_element.innerHTML="",0===this.sub_graph.length.val)return;const e=Array(this.sub_graph.length.val-1);for(let t=0;tn,h=Math.min(n,a),p=Math.max(n,a);e:for(;;){for(let t=v?h:Math.max(0,h-1);t{const i=new a.a,o=i.add(new ut(this.ctrl,e));return this.event_gui_data.set(e,{event_view:o,position:t}),i.add({dispose:()=>this.event_gui_data.delete(e)}),[o.element,i]},this.after_events_changed=e=>{e.type===J.a.ListChange&&(this.sub_graph.val.forEach((e,t)=>{this.event_gui_data.get(e).position=t}),this.update_edges())},this.disposables(o.observe(({value:e})=>{this.element.style.marginLeft=`${ht*e}px`},{call_now:!0}),Object(u.d)(this.event_container_element,i,this.create_event_element,{after:this.after_events_changed}),t.observe(({value:e})=>{e.type!==et.EdgeAdded&&e.type!==et.EdgeRemoved||this.update_edges()})),this.finalize_construction()}set_enabled(e){super.set_enabled(e);for(const{event_view:t}of this.event_gui_data.values())t.enabled.val=e}}class bt extends b.a{constructor(e){super(),this.ctrl=e,this.sub_graph_views=new Map,this.unavailable_view=new g("No quest loaded."),this.max_edge_depth=Object(M.e)(0),this.create_sub_graph_element=e=>{let t=this.sub_graph_views.get(e);return t||(t=new gt(this.ctrl,this.ctrl.event_dag.val,e,this.max_edge_depth),this.sub_graph_views.set(e,t)),t.element},this.update_edges=()=>{for(const e of this.sub_graph_views.values())e.element.parentNode&&e.update_edges()},this.after_event_dags_changed=e=>{var t;if(e.type===J.a.ListChange)for(const i of e.inserted)null===(t=this.sub_graph_views.get(i))||void 0===t||t.update_edges()},this.element=Object(u.h)({className:"quest_editor_EventsView",tabIndex:-1},this.container_element=Object(u.h)({className:"quest_editor_EventsView_container"},this.add(new ze.a(this.add_event_button=new tt.a({text:"Add event"}))).element,this.dag_container_element=Object(u.h)({className:"quest_editor_EventsView_sub_graph_container"})),this.unavailable_view.element),this.disposables(Object(u.c)(this.container_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),this.enabled.bind_to(e.enabled),this.add_event_button.click.observe(e.add_event),Object(u.d)(this.dag_container_element,e.event_sub_graphs,this.create_sub_graph_element,{after:this.after_event_dags_changed}),Object(u.g)(this.element,"focus",()=>{e.focused()}),Object(u.g)(this.element,"click",()=>{e.set_selected_wave(void 0)})),this.finalize_construction()}dispose(){super.dispose();for(const e of this.sub_graph_views.values())e.dispose();this.sub_graph_views.clear()}resize(e,t){return super.resize(e,t),this.update_edges(),this}focus(){super.focus(),this.update_edges()}set_enabled(e){super.set_enabled(e);for(const t of this.sub_graph_views.values())t.element.parentNode&&(t.enabled.val=e)}}var ft;!function(e){e[e.Any=0]="Any",e[e.Byte=1]="Byte",e[e.Word=2]="Word",e[e.DWord=3]="DWord",e[e.Float=4]="Float",e[e.Label=5]="Label",e[e.ILabel=6]="ILabel",e[e.DLabel=7]="DLabel",e[e.SLabel=8]="SLabel",e[e.String=9]="String",e[e.ILabelVar=10]="ILabelVar",e[e.RegRef=11]="RegRef",e[e.RegTupRef=12]="RegTupRef",e[e.RegRefVar=13]="RegRefVar",e[e.Pointer=14]="Pointer"}(ft||(ft={}));const mt={kind:ft.Any},wt={kind:ft.Byte},kt={kind:ft.Word},yt={kind:ft.DWord},Rt={kind:ft.Float},It={kind:ft.Label},jt={kind:ft.ILabel},Tt={kind:ft.DLabel},xt={kind:ft.SLabel},St={kind:ft.String},Ct={kind:ft.ILabelVar},Ot={kind:ft.RegRef},Lt={kind:ft.RegRefVar},Pt={kind:ft.Pointer},Dt=-Math.pow(2,31),Bt=Math.pow(2,31)-1;Math.pow(2,32);var Et,Mt;function Wt(e,t,i){return{type:e,doc:t,access:i}}!function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Et||(Et={})),function(e){e[e.Push=0]="Push",e[e.Pop=1]="Pop"}(Mt||(Mt={}));const qt=[],Ft=new Map;function Vt(e,t,i,o,n){return{code:e,mnemonic:t,doc:i,size:e<256?1:2,params:o,stack:n}}const zt=qt[0]=Vt(0,"nop","No operation, does nothing.",[],void 0),Ut=qt[1]=Vt(1,"ret","Returns control to caller.",[],void 0),Nt=qt[2]=Vt(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),$t=qt[3]=Vt(3,"exit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),At=qt[4]=Vt(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[Wt(jt,void 0,void 0)],void 0),Ht=qt[5]=Vt(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),Gt=qt[6]=Vt(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),Kt=qt[7]=Vt(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[Wt(jt,void 0,void 0)],void 0),Yt=qt[8]=Vt(8,"let","Sets the first register's value to second one's value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),Qt=qt[9]=Vt(9,"leti","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),Zt=qt[10]=Vt(10,"letb","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(wt,void 0,void 0)],void 0),Jt=qt[11]=Vt(11,"letw","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0),Wt(kt,void 0,void 0)],void 0),Xt=qt[12]=Vt(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),ei=(qt[13]=Vt(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt(It,void 0,void 0)],void 0),qt[14]=Vt(14,"unknown_0e",void 0,[],void 0),qt[15]=Vt(15,"unknown_0f",void 0,[],void 0),qt[16]=Vt(16,"set","Sets a register to 1.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ti=qt[17]=Vt(17,"clear","Sets a register to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),ii=qt[18]=Vt(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.ReadWrite)]},void 0,void 0)],void 0),oi=(qt[19]=Vt(19,"gset",void 0,[Wt(kt,void 0,void 0)],void 0),qt[20]=Vt(20,"gclear",void 0,[Wt(kt,void 0,void 0)],void 0),qt[21]=Vt(21,"grev",void 0,[Wt(kt,void 0,void 0)],void 0),qt[22]=Vt(22,"glet",void 0,[Wt(kt,void 0,void 0)],void 0),qt[23]=Vt(23,"gget","Sets a register to value of the given flag.",[Wt(kt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[24]=Vt(24,"add",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),ni=qt[25]=Vt(25,"addi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),si=qt[26]=Vt(26,"sub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ri=qt[27]=Vt(27,"subi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ai=qt[28]=Vt(28,"mul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),di=qt[29]=Vt(29,"muli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ci=qt[30]=Vt(30,"div",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),li=qt[31]=Vt(31,"divi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),_i=qt[32]=Vt(32,"and",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ui=qt[33]=Vt(33,"andi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),vi=qt[34]=Vt(34,"or",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),hi=qt[35]=Vt(35,"ori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),pi=qt[36]=Vt(36,"xor",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),gi=qt[37]=Vt(37,"xori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),bi=qt[38]=Vt(38,"mod",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),fi=qt[39]=Vt(39,"modi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),mi=qt[40]=Vt(40,"jmp",void 0,[Wt(jt,void 0,void 0)],void 0),wi=qt[41]=Vt(41,"call",void 0,[Wt(jt,void 0,void 0)],void 0),ki=qt[42]=Vt(42,"jmp_on",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),yi=qt[43]=Vt(43,"jmp_off",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),Ri=qt[44]=Vt(44,"jmp_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ii=qt[45]=Vt(45,"jmpi_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),ji=qt[46]=Vt(46,"jmp_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ti=qt[47]=Vt(47,"jmpi_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),xi=qt[48]=Vt(48,"ujmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Si=qt[49]=Vt(49,"ujmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ci=qt[50]=Vt(50,"jmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Oi=qt[51]=Vt(51,"jmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Li=qt[52]=Vt(52,"ujmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Pi=qt[53]=Vt(53,"ujmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Di=qt[54]=Vt(54,"jmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Bi=qt[55]=Vt(55,"jmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ei=qt[56]=Vt(56,"ujmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Mi=qt[57]=Vt(57,"ujmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Wi=qt[58]=Vt(58,"jmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),qi=qt[59]=Vt(59,"jmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Fi=qt[60]=Vt(60,"ujmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Vi=qt[61]=Vt(61,"ujmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),zi=qt[62]=Vt(62,"jmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ui=qt[63]=Vt(63,"jmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ni=qt[64]=Vt(64,"switch_jmp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),$i=qt[65]=Vt(65,"switch_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ai=qt[66]=Vt(66,"stack_push",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),Hi=qt[67]=Vt(67,"stack_pop",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),Gi=qt[68]=Vt(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[Wt(Ot,void 0,Et.Read),Wt(yt,void 0,void 0)],void 0),Ki=qt[69]=Vt(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[Wt(Ot,void 0,Et.Write),Wt(yt,void 0,void 0)],void 0),Yi=(qt[70]=Vt(70,"unknown_46",void 0,[],void 0),qt[71]=Vt(71,"unknown_47",void 0,[],void 0),qt[72]=Vt(72,"arg_pushr","Pushes the value of the given register onto the stack.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push)),Qi=qt[73]=Vt(73,"arg_pushl","Pushes the given value onto the stack.",[Wt(yt,void 0,void 0)],Mt.Push),Zi=qt[74]=Vt(74,"arg_pushb","Pushes the given value onto the stack.",[Wt(wt,void 0,void 0)],Mt.Push),Ji=qt[75]=Vt(75,"arg_pushw","Pushes the given value onto the stack.",[Wt(kt,void 0,void 0)],Mt.Push),Xi=qt[76]=Vt(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push),eo=qt[77]=Vt(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[Wt(It,void 0,void 0)],Mt.Push),to=qt[78]=Vt(78,"arg_pushs","Pushes the given value onto the stack.",[Wt(St,void 0,void 0)],Mt.Push),io=(qt[79]=Vt(79,"unknown_4f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[80]=Vt(80,"message",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[81]=Vt(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop)),oo=(qt[82]=Vt(82,"fadein",void 0,[],void 0),qt[83]=Vt(83,"fadeout",void 0,[],void 0),qt[84]=Vt(84,"se",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[85]=Vt(85,"bgm",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[86]=Vt(86,"unknown_56",void 0,[],void 0),qt[87]=Vt(87,"unknown_57",void 0,[],void 0),qt[88]=Vt(88,"enable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[89]=Vt(89,"disable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[90]=Vt(90,"window_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop)),no=qt[91]=Vt(91,"add_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),so=(qt[92]=Vt(92,"mesend",void 0,[],void 0),qt[93]=Vt(93,"gettime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ro=qt[94]=Vt(94,"winend",void 0,[],void 0),ao=(qt[95]=Vt(95,"unknown_5f",void 0,[],void 0),qt[96]=Vt(96,"npc_crt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[97]=Vt(97,"npc_stop",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[98]=Vt(98,"npc_play",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[99]=Vt(99,"npc_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[100]=Vt(100,"npc_nont",void 0,[],void 0),qt[101]=Vt(101,"npc_talk",void 0,[],void 0),qt[102]=Vt(102,"npc_crp_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(jt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[103]=Vt(103,"unknown_67",void 0,[],void 0),qt[104]=Vt(104,"create_pipe",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[105]=Vt(105,"p_hpstat_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[106]=Vt(106,"p_dead_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0)],Mt.Pop)),co=(qt[107]=Vt(107,"p_disablewarp",void 0,[],void 0),qt[108]=Vt(108,"p_enablewarp",void 0,[],void 0),qt[109]=Vt(109,"p_move_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[110]=Vt(110,"p_look",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[111]=Vt(111,"unknown_6f",void 0,[],void 0),qt[112]=Vt(112,"p_action_disable",void 0,[],void 0),qt[113]=Vt(113,"p_action_enable",void 0,[],void 0),qt[114]=Vt(114,"disable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[115]=Vt(115,"enable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[116]=Vt(116,"p_noncol",void 0,[],void 0),qt[117]=Vt(117,"p_col",void 0,[],void 0),qt[118]=Vt(118,"p_setpos","Sets a player's position.",[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Y-axis rotation.",Et.Read)]},void 0,void 0)],Mt.Pop),qt[119]=Vt(119,"p_return_guild",void 0,[],void 0),qt[120]=Vt(120,"p_talk_guild",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[121]=Vt(121,"npc_talk_pl_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[122]=Vt(122,"npc_talk_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[123]=Vt(123,"npc_crtpk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[124]=Vt(124,"npc_crppk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[125]=Vt(125,"npc_crptalk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[126]=Vt(126,"p_look_at_v1",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[127]=Vt(127,"npc_crp_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[128]=Vt(128,"cam_quake",void 0,[],void 0),qt[129]=Vt(129,"cam_adj",void 0,[],void 0),qt[130]=Vt(130,"cam_zmin",void 0,[],void 0),qt[131]=Vt(131,"cam_zmout",void 0,[],void 0),qt[132]=Vt(132,"cam_pan_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[133]=Vt(133,"game_lev_super",void 0,[],void 0),qt[134]=Vt(134,"game_lev_reset",void 0,[],void 0),qt[135]=Vt(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[136]=Vt(136,"if_zone_clear",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),lo=(qt[137]=Vt(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[138]=Vt(138,"unhide_obj",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[139]=Vt(139,"unhide_ene",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[140]=Vt(140,"at_coords_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[141]=Vt(141,"at_coords_talk",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[142]=Vt(142,"col_npcin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[143]=Vt(143,"col_npcinr",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[144]=Vt(144,"switch_on",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[145]=Vt(145,"switch_off",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[146]=Vt(146,"playbgm_epi",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[147]=Vt(147,"set_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[148]=Vt(148,"set_obj_param","Creates a targetable object.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Collision radius.",Et.Read),Wt(jt,"Function label.",Et.Read),Wt(yt,"Vertical position of the cursor.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},"Object handle.",void 0)],void 0),qt[149]=Vt(149,"set_floor_handler",void 0,[Wt(yt,"Floor number.",void 0),Wt(jt,"Handler function label.",void 0)],Mt.Pop)),_o=(qt[150]=Vt(150,"clr_floor_handler",void 0,[Wt(yt,"Floor number.",void 0)],Mt.Pop),qt[151]=Vt(151,"col_plinaw",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[152]=Vt(152,"hud_hide",void 0,[],void 0),qt[153]=Vt(153,"hud_show",void 0,[],void 0),qt[154]=Vt(154,"cine_enable",void 0,[],void 0),qt[155]=Vt(155,"cine_disable",void 0,[],void 0),qt[156]=Vt(156,"unknown_9c",void 0,[],void 0),qt[157]=Vt(157,"unknown_9d",void 0,[],void 0),qt[158]=Vt(158,"unknown_9e",void 0,[],void 0),qt[159]=Vt(159,"unknown_9f",void 0,[],void 0),qt[160]=Vt(160,"unknown_a0",void 0,[],void 0),qt[161]=Vt(161,"set_qt_failure",void 0,[Wt(jt,void 0,void 0)],void 0),qt[162]=Vt(162,"set_qt_success",void 0,[Wt(jt,void 0,void 0)],void 0),qt[163]=Vt(163,"clr_qt_failure",void 0,[],void 0),qt[164]=Vt(164,"clr_qt_success",void 0,[],void 0),qt[165]=Vt(165,"set_qt_cancel",void 0,[Wt(jt,void 0,void 0)],void 0),qt[166]=Vt(166,"clr_qt_cancel",void 0,[],void 0),qt[167]=Vt(167,"unknown_a7",void 0,[],void 0),qt[168]=Vt(168,"pl_walk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[169]=Vt(169,"unknown_a9",void 0,[],void 0),qt[170]=Vt(170,"unknown_aa",void 0,[],void 0),qt[171]=Vt(171,"unknown_ab",void 0,[],void 0),qt[172]=Vt(172,"unknown_ac",void 0,[],void 0),qt[173]=Vt(173,"unknown_ad",void 0,[],void 0),qt[174]=Vt(174,"unknown_ae",void 0,[],void 0),qt[175]=Vt(175,"unknown_af",void 0,[],void 0),qt[176]=Vt(176,"pl_add_meseta",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[177]=Vt(177,"thread_stg",void 0,[Wt(jt,void 0,void 0)],void 0)),uo=(qt[178]=Vt(178,"del_obj_param",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},"Object handle.",void 0)],void 0),qt[179]=Vt(179,"item_create",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[180]=Vt(180,"item_create2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[181]=Vt(181,"item_delete",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[182]=Vt(182,"item_delete2","Deletes an item from the player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[183]=Vt(183,"item_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[184]=Vt(184,"setevt",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[185]=Vt(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),vo=(qt[186]=Vt(186,"set_qt_exit",void 0,[Wt(jt,void 0,void 0)],void 0),qt[187]=Vt(187,"clr_qt_exit",void 0,[],void 0),qt[188]=Vt(188,"unknown_bc",void 0,[],void 0),qt[189]=Vt(189,"unknown_bd",void 0,[],void 0),qt[190]=Vt(190,"unknown_be",void 0,[],void 0),qt[191]=Vt(191,"unknown_bf",void 0,[],void 0),qt[192]=Vt(192,"particle_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[193]=Vt(193,"npc_text",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[194]=Vt(194,"npc_chkwarp",void 0,[],void 0),qt[195]=Vt(195,"pl_pkoff",void 0,[],void 0),qt[196]=Vt(196,"map_designate",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0)),ho=(qt[197]=Vt(197,"masterkey_on",void 0,[],void 0),qt[198]=Vt(198,"masterkey_off",void 0,[],void 0),qt[199]=Vt(199,"window_time",void 0,[],void 0),qt[200]=Vt(200,"winend_time",void 0,[],void 0),qt[201]=Vt(201,"winset_time",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[202]=Vt(202,"getmtime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[203]=Vt(203,"set_quest_board_handler",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[204]=Vt(204,"clear_quest_board_handler",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[205]=Vt(205,"particle_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[206]=Vt(206,"npc_crptalk_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[207]=Vt(207,"npc_lang_clean",void 0,[],void 0),qt[208]=Vt(208,"pl_pkon",void 0,[],void 0),qt[209]=Vt(209,"pl_chk_item2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[210]=Vt(210,"enable_mainmenu",void 0,[],void 0),qt[211]=Vt(211,"disable_mainmenu",void 0,[],void 0),qt[212]=Vt(212,"start_battlebgm",void 0,[],void 0),qt[213]=Vt(213,"end_battlebgm",void 0,[],void 0),qt[214]=Vt(214,"disp_msg_qb",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[215]=Vt(215,"close_msg_qb",void 0,[],void 0),qt[216]=Vt(216,"set_eventflag_v3",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[217]=Vt(217,"sync_leti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0)),po=(qt[218]=Vt(218,"set_returnhunter",void 0,[],void 0),qt[219]=Vt(219,"set_returncity",void 0,[],void 0),qt[220]=Vt(220,"load_pvr",void 0,[],void 0),qt[221]=Vt(221,"load_midi",void 0,[],void 0),qt[222]=Vt(222,"unknown_de",void 0,[],void 0),qt[223]=Vt(223,"npc_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[224]=Vt(224,"pad_dragon",void 0,[],void 0),qt[225]=Vt(225,"clear_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[226]=Vt(226,"pcam_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[227]=Vt(227,"start_setevt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[228]=Vt(228,"warp_on",void 0,[],void 0),qt[229]=Vt(229,"warp_off",void 0,[],void 0),qt[230]=Vt(230,"get_slotnumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),go=(qt[231]=Vt(231,"get_servernumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[232]=Vt(232,"set_eventflag2",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[233]=Vt(233,"res",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[234]=Vt(234,"unknown_ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),qt[235]=Vt(235,"enable_bgmctrl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[236]=Vt(236,"sw_send",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[237]=Vt(237,"create_bgmctrl",void 0,[],void 0),qt[238]=Vt(238,"pl_add_meseta2",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[239]=Vt(239,"sync_register",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[240]=Vt(240,"send_regwork",void 0,[],void 0),qt[241]=Vt(241,"leti_fixed_camera_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[242]=Vt(242,"default_camera_pos1",void 0,[],void 0),qt[243]=Vt(243,"unknown_f3",void 0,[],void 0),qt[244]=Vt(244,"unknown_f4",void 0,[],void 0),qt[245]=Vt(245,"unknown_f5",void 0,[],void 0),qt[246]=Vt(246,"unknown_f6",void 0,[],void 0),qt[247]=Vt(247,"unknown_f7",void 0,[],void 0),qt[248]=Vt(248,"unknown_f8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[249]=Vt(249,"unknown_f9",void 0,[],void 0),qt[250]=Vt(250,"get_gc_number",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[251]=Vt(251,"unknown_fb",void 0,[Wt(kt,void 0,void 0)],void 0),qt[252]=Vt(252,"unknown_fc",void 0,[],void 0),qt[253]=Vt(253,"unknown_fd",void 0,[],void 0),qt[254]=Vt(254,"unknown_fe",void 0,[],void 0),qt[255]=Vt(255,"unknown_ff",void 0,[],void 0),qt[63488]=Vt(63488,"unknown_f800",void 0,[],void 0),qt[63489]=Vt(63489,"set_chat_callback",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63490]=Vt(63490,"unknown_f802",void 0,[],void 0),qt[63491]=Vt(63491,"unknown_f803",void 0,[],void 0),qt[63492]=Vt(63492,"unknown_f804",void 0,[],void 0),qt[63493]=Vt(63493,"unknown_f805",void 0,[],void 0),qt[63494]=Vt(63494,"unknown_f806",void 0,[],void 0),qt[63495]=Vt(63495,"unknown_f807",void 0,[],void 0),qt[63496]=Vt(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63497]=Vt(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63498]=Vt(63498,"get_coord_of_player","Retrieves a player's position.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Write),Wt(yt,"Y coordinate.",Et.Write),Wt(yt,"Z coordinate.",Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63499]=Vt(63499,"enable_map",void 0,[],void 0),qt[63500]=Vt(63500,"disable_map",void 0,[],void 0),qt[63501]=Vt(63501,"map_designate_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),bo=(qt[63502]=Vt(63502,"unknown_f80e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63503]=Vt(63503,"unknown_f80f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63504]=Vt(63504,"ba_initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63505]=Vt(63505,"set_ba_rules",void 0,[],void 0),qt[63506]=Vt(63506,"unknown_f812",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63507]=Vt(63507,"unknown_f813",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63508]=Vt(63508,"unknown_f814",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63509]=Vt(63509,"unknown_f815",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63510]=Vt(63510,"unknown_f816",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63511]=Vt(63511,"unknown_f817",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63512]=Vt(63512,"unknown_f818",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63513]=Vt(63513,"unknown_f819",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63514]=Vt(63514,"unknown_f81a",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63515]=Vt(63515,"unknown_f81b",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63516]=Vt(63516,"ba_disp_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63517]=Vt(63517,"death_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63518]=Vt(63518,"death_tech_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63519]=Vt(63519,"unknown_f81f",void 0,[],void 0),qt[63520]=Vt(63520,"cmode_stage",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63521]=Vt(63521,"unknown_f821",void 0,[],void 0),qt[63522]=Vt(63522,"unknown_f822",void 0,[],void 0),qt[63523]=Vt(63523,"unknown_f823",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63524]=Vt(63524,"unknown_f824",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63525]=Vt(63525,"exp_multiplication",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63526]=Vt(63526,"exp_division",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63527]=Vt(63527,"get_user_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63528]=Vt(63528,"go_floor","Sends a player to the given floor.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read)]},void 0,void 0)],void 0),qt[63529]=Vt(63529,"unknown_f829",void 0,[],void 0),qt[63530]=Vt(63530,"unknown_f82a",void 0,[],void 0),qt[63531]=Vt(63531,"unlock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63532]=Vt(63532,"lock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63533]=Vt(63533,"if_switch_not_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63534]=Vt(63534,"if_switch_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read),Wt(yt,"Switch ID.",Et.Read),Wt(yt,"Will be set to 1 if the switch is pressed, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63535]=Vt(63535,"unknown_f82f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63536]=Vt(63536,"control_dragon",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63537]=Vt(63537,"release_dragon",void 0,[],void 0),qt[63538]=Vt(63538,"unknown_f832",void 0,[],void 0),qt[63539]=Vt(63539,"unknown_f833",void 0,[],void 0),qt[63540]=Vt(63540,"unknown_f834",void 0,[],void 0),qt[63541]=Vt(63541,"unknown_f835",void 0,[],void 0),qt[63542]=Vt(63542,"unknown_f836",void 0,[],void 0),qt[63543]=Vt(63543,"unknown_f837",void 0,[],void 0),qt[63544]=Vt(63544,"shrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63545]=Vt(63545,"unshrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63546]=Vt(63546,"unknown_f83a",void 0,[],void 0),qt[63547]=Vt(63547,"unknown_f83b",void 0,[],void 0),qt[63548]=Vt(63548,"display_clock2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63549]=Vt(63549,"unknown_f83d",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63550]=Vt(63550,"delete_area_title",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63551]=Vt(63551,"unknown_f83f",void 0,[],void 0),qt[63552]=Vt(63552,"load_npc_data",void 0,[],void 0),qt[63553]=Vt(63553,"get_npc_data",void 0,[Wt(Tt,void 0,void 0)],void 0),qt[63554]=Vt(63554,"unknown_f842",void 0,[],void 0),qt[63555]=Vt(63555,"unknown_f843",void 0,[],void 0),qt[63556]=Vt(63556,"unknown_f844",void 0,[],void 0),qt[63557]=Vt(63557,"unknown_f845",void 0,[],void 0),qt[63558]=Vt(63558,"unknown_f846",void 0,[],void 0),qt[63559]=Vt(63559,"unknown_f847",void 0,[],void 0),qt[63560]=Vt(63560,"give_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63561]=Vt(63561,"take_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63562]=Vt(63562,"unk_score_f84a",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63563]=Vt(63563,"unk_score_f84b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63564]=Vt(63564,"kill_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63565]=Vt(63565,"death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63566]=Vt(63566,"unk_score_f84e",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63567]=Vt(63567,"enemy_death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63568]=Vt(63568,"meseta_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63569]=Vt(63569,"unknown_f851",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63570]=Vt(63570,"unknown_f852",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63571]=Vt(63571,"reverse_warps",void 0,[],void 0),qt[63572]=Vt(63572,"unreverse_warps",void 0,[],void 0),qt[63573]=Vt(63573,"set_ult_map",void 0,[],void 0),qt[63574]=Vt(63574,"unset_ult_map",void 0,[],void 0),qt[63575]=Vt(63575,"set_area_title",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63576]=Vt(63576,"unknown_f858",void 0,[],void 0),qt[63577]=Vt(63577,"unknown_f859",void 0,[],void 0),qt[63578]=Vt(63578,"equip_item",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63579]=Vt(63579,"unequip_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63580]=Vt(63580,"unknown_f85c",void 0,[],void 0),qt[63581]=Vt(63581,"unknown_f85d",void 0,[],void 0),qt[63582]=Vt(63582,"unknown_f85e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63583]=Vt(63583,"unknown_f85f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63584]=Vt(63584,"unknown_f860",void 0,[],void 0),qt[63585]=Vt(63585,"unknown_f861",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63586]=Vt(63586,"unknown_f862",void 0,[],void 0),qt[63587]=Vt(63587,"unknown_f863",void 0,[],void 0),qt[63588]=Vt(63588,"cmode_rank",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63589]=Vt(63589,"award_item_name",void 0,[],void 0),qt[63590]=Vt(63590,"award_item_select",void 0,[],void 0),qt[63591]=Vt(63591,"award_item_give_to",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63592]=Vt(63592,"unknown_f868",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63593]=Vt(63593,"unknown_f869",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63594]=Vt(63594,"item_create_cmode",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63595]=Vt(63595,"unknown_f86b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63596]=Vt(63596,"award_item_ok",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63597]=Vt(63597,"unknown_f86d",void 0,[],void 0),qt[63598]=Vt(63598,"unknown_f86e",void 0,[],void 0),qt[63599]=Vt(63599,"ba_set_lives",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63600]=Vt(63600,"ba_set_tech_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63601]=Vt(63601,"ba_set_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63602]=Vt(63602,"ba_set_time_limit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63603]=Vt(63603,"boss_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63604]=Vt(63604,"unknown_f874",void 0,[],void 0),qt[63605]=Vt(63605,"unknown_f875",void 0,[],void 0),qt[63606]=Vt(63606,"unknown_f876",void 0,[],void 0),qt[63607]=Vt(63607,"enable_techs","Enables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63608]=Vt(63608,"disable_techs","Disables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63609]=Vt(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player gender.",Et.Write)]},void 0,void 0)],void 0),qt[63610]=Vt(63610,"get_chara_class","Retrieves the player's race and character class.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player race. 0 If human, 1 if newman, 2 if cast.",Et.Write),Wt(yt,"Player class. 0 If hunter, 1 if ranger, 2 if force.",Et.Write)]},void 0,void 0)],void 0),qt[63611]=Vt(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,"Amount of meseta to take.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Will be set to 1 if the meseta was taken, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63612]=Vt(63612,"unknown_f87c",void 0,[],void 0),qt[63613]=Vt(63613,"unknown_f87d",void 0,[],void 0),qt[63614]=Vt(63614,"unknown_f87e",void 0,[],void 0),qt[63615]=Vt(63615,"read_guildcard_flag",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63616]=Vt(63616,"unknown_f880",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63617]=Vt(63617,"get_pl_name","Sets the value of to the given player's name.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63618]=Vt(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63619]=Vt(63619,"unknown_f883",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63620]=Vt(63620,"unknown_f884",void 0,[],void 0),qt[63621]=Vt(63621,"unknown_f885",void 0,[],void 0),qt[63622]=Vt(63622,"unknown_f886",void 0,[],void 0),qt[63623]=Vt(63623,"unknown_f887",void 0,[],void 0),qt[63624]=Vt(63624,"unknown_f888",void 0,[],void 0),qt[63625]=Vt(63625,"unknown_f889",void 0,[],void 0),qt[63626]=Vt(63626,"get_player_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63627]=Vt(63627,"send_mail",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63628]=Vt(63628,"online_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63629]=Vt(63629,"chl_set_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63630]=Vt(63630,"chl_get_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63631]=Vt(63631,"unknown_f88f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63632]=Vt(63632,"unknown_f890",void 0,[],void 0),qt[63633]=Vt(63633,"load_enemy_data",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63634]=Vt(63634,"get_physical_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63635]=Vt(63635,"get_attack_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63636]=Vt(63636,"get_resist_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63637]=Vt(63637,"get_movement_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63638]=Vt(63638,"unknown_f896",void 0,[],void 0),qt[63639]=Vt(63639,"unknown_f897",void 0,[],void 0),qt[63640]=Vt(63640,"shift_left",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),fo=qt[63641]=Vt(63641,"shift_right",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),mo=qt[63642]=Vt(63642,"get_random",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),wo=(qt[63643]=Vt(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),qt[63644]=Vt(63644,"disp_chl_retry_menu",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63645]=Vt(63645,"chl_reverser",void 0,[],void 0),qt[63646]=Vt(63646,"unknown_f89e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63647]=Vt(63647,"unknown_f89f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63648]=Vt(63648,"unknown_f8a0",void 0,[],void 0),qt[63649]=Vt(63649,"unknown_f8a1",void 0,[],void 0),qt[63650]=Vt(63650,"unknown_f8a2",void 0,[],void 0),qt[63651]=Vt(63651,"unknown_f8a3",void 0,[],void 0),qt[63652]=Vt(63652,"unknown_f8a4",void 0,[],void 0),qt[63653]=Vt(63653,"unknown_f8a5",void 0,[],void 0),qt[63654]=Vt(63654,"unknown_f8a6",void 0,[],void 0),qt[63655]=Vt(63655,"unknown_f8a7",void 0,[],void 0),qt[63656]=Vt(63656,"unknown_f8a8",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63657]=Vt(63657,"unknown_f8a9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63658]=Vt(63658,"unknown_f8aa",void 0,[],void 0),qt[63659]=Vt(63659,"unknown_f8ab",void 0,[],void 0),qt[63660]=Vt(63660,"unknown_f8ac",void 0,[],void 0),qt[63661]=Vt(63661,"get_number_of_player2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63662]=Vt(63662,"unknown_f8ae",void 0,[],void 0),qt[63663]=Vt(63663,"unknown_f8af",void 0,[],void 0),qt[63664]=Vt(63664,"unknown_f8b0",void 0,[],void 0),qt[63665]=Vt(63665,"unknown_f8b1",void 0,[],void 0),qt[63666]=Vt(63666,"unknown_f8b2",void 0,[],void 0),qt[63667]=Vt(63667,"unknown_f8b3",void 0,[],void 0),qt[63668]=Vt(63668,"unknown_f8b4",void 0,[],void 0),qt[63669]=Vt(63669,"unknown_f8b5",void 0,[],void 0),qt[63670]=Vt(63670,"unknown_f8b6",void 0,[],void 0),qt[63671]=Vt(63671,"unknown_f8b7",void 0,[],void 0),qt[63672]=Vt(63672,"unknown_f8b8",void 0,[],void 0),qt[63673]=Vt(63673,"chl_recovery",void 0,[],void 0),qt[63674]=Vt(63674,"unknown_f8ba",void 0,[],void 0),qt[63675]=Vt(63675,"unknown_f8bb",void 0,[],void 0),qt[63676]=Vt(63676,"set_episode",void 0,[Wt(yt,void 0,void 0)],void 0)),ko=(qt[63677]=Vt(63677,"unknown_f8bd",void 0,[],void 0),qt[63678]=Vt(63678,"unknown_f8be",void 0,[],void 0),qt[63679]=Vt(63679,"unknown_f8bf",void 0,[],void 0),qt[63680]=Vt(63680,"file_dl_req",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63681]=Vt(63681,"get_dl_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63682]=Vt(63682,"gba_unknown4",void 0,[],void 0),qt[63683]=Vt(63683,"get_gba_state",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63684]=Vt(63684,"unknown_f8c4",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63685]=Vt(63685,"unknown_f8c5",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63686]=Vt(63686,"qexit",void 0,[],void 0),qt[63687]=Vt(63687,"use_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Animation ID.",Et.Read),Wt(yt,"Animation duration in number of frames.",Et.Read)]},void 0,void 0)],void 0),qt[63688]=Vt(63688,"stop_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63689]=Vt(63689,"run_to_coord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63690]=Vt(63690,"set_slot_invincible",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63691]=Vt(63691,"unknown_f8cb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63692]=Vt(63692,"set_slot_poison",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63693]=Vt(63693,"set_slot_paralyze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63694]=Vt(63694,"set_slot_shock",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63695]=Vt(63695,"set_slot_freeze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63696]=Vt(63696,"set_slot_slow",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63697]=Vt(63697,"set_slot_confuse",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63698]=Vt(63698,"set_slot_shifta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63699]=Vt(63699,"set_slot_deband",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63700]=Vt(63700,"set_slot_jellen",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63701]=Vt(63701,"set_slot_zalure",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63702]=Vt(63702,"fleti_fixed_camera",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63703]=Vt(63703,"fleti_locked_camera",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63704]=Vt(63704,"default_camera_pos2",void 0,[],void 0),qt[63705]=Vt(63705,"set_motion_blur",void 0,[],void 0),qt[63706]=Vt(63706,"set_screen_bw",void 0,[],void 0),qt[63707]=Vt(63707,"unknown_f8db",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63708]=Vt(63708,"npc_action_string",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(xt,void 0,void 0)],void 0),qt[63709]=Vt(63709,"get_pad_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63710]=Vt(63710,"get_button_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63711]=Vt(63711,"freeze_enemies",void 0,[],void 0),qt[63712]=Vt(63712,"unfreeze_enemies",void 0,[],void 0),qt[63713]=Vt(63713,"freeze_everything",void 0,[],void 0),qt[63714]=Vt(63714,"unfreeze_everything",void 0,[],void 0),qt[63715]=Vt(63715,"restore_hp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63716]=Vt(63716,"restore_tp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63717]=Vt(63717,"close_chat_bubble",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63718]=Vt(63718,"move_coords_object",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63719]=Vt(63719,"at_coords_call_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63720]=Vt(63720,"unknown_f8e8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63721]=Vt(63721,"unknown_f8e9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63722]=Vt(63722,"unknown_f8ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63723]=Vt(63723,"unknown_f8eb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63724]=Vt(63724,"unknown_f8ec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63725]=Vt(63725,"animation_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63726]=Vt(63726,"call_image_data",void 0,[Wt(yt,void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63727]=Vt(63727,"unknown_f8ef",void 0,[],void 0),qt[63728]=Vt(63728,"turn_off_bgm_p2",void 0,[],void 0),qt[63729]=Vt(63729,"turn_on_bgm_p2",void 0,[],void 0),qt[63730]=Vt(63730,"load_unk_data",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(Tt,void 0,void 0)],Mt.Pop),qt[63731]=Vt(63731,"particle2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63732]=Vt(63732,"unknown_f8f4",void 0,[],void 0),qt[63733]=Vt(63733,"unknown_f8f5",void 0,[],void 0),qt[63734]=Vt(63734,"unknown_f8f6",void 0,[],void 0),qt[63735]=Vt(63735,"unknown_f8f7",void 0,[],void 0),qt[63736]=Vt(63736,"unknown_f8f8",void 0,[],void 0),qt[63737]=Vt(63737,"unknown_f8f9",void 0,[],void 0),qt[63738]=Vt(63738,"unknown_f8fa",void 0,[],void 0),qt[63739]=Vt(63739,"unknown_f8fb",void 0,[],void 0),qt[63740]=Vt(63740,"unknown_f8fc",void 0,[],void 0),qt[63741]=Vt(63741,"unknown_f8fd",void 0,[],void 0),qt[63742]=Vt(63742,"unknown_f8fe",void 0,[],void 0),qt[63743]=Vt(63743,"unknown_f8ff",void 0,[],void 0),qt[63744]=Vt(63744,"unknown_f900",void 0,[],void 0),qt[63745]=Vt(63745,"dec2float",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63746]=Vt(63746,"float2dec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63747]=Vt(63747,"flet",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),yo=qt[63748]=Vt(63748,"fleti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Ro=(qt[63749]=Vt(63749,"unknown_f905",void 0,[],void 0),qt[63750]=Vt(63750,"unknown_f906",void 0,[],void 0),qt[63751]=Vt(63751,"unknown_f907",void 0,[],void 0),qt[63752]=Vt(63752,"fadd",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),Io=qt[63753]=Vt(63753,"faddi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),jo=qt[63754]=Vt(63754,"fsub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),To=qt[63755]=Vt(63755,"fsubi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),xo=qt[63756]=Vt(63756,"fmul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),So=qt[63757]=Vt(63757,"fmuli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Co=qt[63758]=Vt(63758,"fdiv",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),Oo=qt[63759]=Vt(63759,"fdivi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Lo=(qt[63760]=Vt(63760,"get_unknown_count",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63761]=Vt(63761,"get_stackable_item_count",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63762]=Vt(63762,"freeze_and_hide_equip",void 0,[],void 0),qt[63763]=Vt(63763,"thaw_and_show_equip",void 0,[],void 0),qt[63764]=Vt(63764,"set_palettex_callback",void 0,[Wt(yt,"Player slot.",void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63765]=Vt(63765,"activate_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63766]=Vt(63766,"enable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63767]=Vt(63767,"restore_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63768]=Vt(63768,"disable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63769]=Vt(63769,"get_palettex_activated",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63770]=Vt(63770,"get_unknown_palettex_status",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63771]=Vt(63771,"disable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63772]=Vt(63772,"enable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63773]=Vt(63773,"get_time_played",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63774]=Vt(63774,"get_guildcard_total",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63775]=Vt(63775,"get_slot_meseta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63776]=Vt(63776,"get_player_level",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63777]=Vt(63777,"get_section_id",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63778]=Vt(63778,"get_player_hp",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Maximum HP.",Et.Write),Wt(yt,"Current HP.",Et.Write),Wt(yt,"Maximum TP.",Et.Write),Wt(yt,"Current TP.",Et.Write)]},void 0,void 0)],Mt.Pop),qt[63779]=Vt(63779,"get_floor_number",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63780]=Vt(63780,"get_coord_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63781]=Vt(63781,"read_global_flag",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63782]=Vt(63782,"write_global_flag",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63783]=Vt(63783,"unknown_f927",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63784]=Vt(63784,"floor_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63785]=Vt(63785,"read_disk_file",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63786]=Vt(63786,"open_pack_select",void 0,[],void 0),qt[63787]=Vt(63787,"item_select",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63788]=Vt(63788,"get_item_id",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63789]=Vt(63789,"color_change",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63790]=Vt(63790,"send_statistic",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63791]=Vt(63791,"unknown_f92f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63792]=Vt(63792,"chat_box",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63793]=Vt(63793,"chat_bubble",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63794]=Vt(63794,"unknown_f932",void 0,[],void 0),qt[63795]=Vt(63795,"unknown_f933",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63796]=Vt(63796,"scroll_text",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63797]=Vt(63797,"gba_unknown1",void 0,[],void 0),qt[63798]=Vt(63798,"gba_unknown2",void 0,[],void 0),qt[63799]=Vt(63799,"gba_unknown3",void 0,[],void 0),qt[63800]=Vt(63800,"add_damage_to",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63801]=Vt(63801,"item_delete3",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63802]=Vt(63802,"get_item_info",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63803]=Vt(63803,"item_packing1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63804]=Vt(63804,"item_packing2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63805]=Vt(63805,"get_lang_setting",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63806]=Vt(63806,"prepare_statistic",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63807]=Vt(63807,"keyword_detect",void 0,[],void 0),qt[63808]=Vt(63808,"keyword",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63809]=Vt(63809,"get_guildcard_num",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63810]=Vt(63810,"unknown_f942",void 0,[],void 0),qt[63811]=Vt(63811,"unknown_f943",void 0,[],void 0),qt[63812]=Vt(63812,"get_wrap_status",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63813]=Vt(63813,"initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63814]=Vt(63814,"sin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63815]=Vt(63815,"cos",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63816]=Vt(63816,"unknown_f948",void 0,[],void 0),qt[63817]=Vt(63817,"unknown_f949",void 0,[],void 0),qt[63818]=Vt(63818,"boss_is_dead2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63819]=Vt(63819,"unknown_f94b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63820]=Vt(63820,"unknown_f94c",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63821]=Vt(63821,"is_there_cardbattle",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63822]=Vt(63822,"unknown_f94e",void 0,[],void 0),qt[63823]=Vt(63823,"unknown_f94f",void 0,[],void 0),qt[63824]=Vt(63824,"bb_p2_menu",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63825]=Vt(63825,"bb_map_designate",void 0,[Wt(wt,void 0,void 0),Wt(kt,void 0,void 0),Wt(wt,void 0,void 0),Wt(wt,void 0,void 0)],void 0));qt[63826]=Vt(63826,"bb_get_number_in_pack",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63827]=Vt(63827,"bb_swap_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63828]=Vt(63828,"bb_check_wrap",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63829]=Vt(63829,"bb_exchange_pd_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63830]=Vt(63830,"bb_exchange_pd_srank",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63831]=Vt(63831,"bb_exchange_pd_special",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63832]=Vt(63832,"bb_exchange_pd_percent",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63833]=Vt(63833,"unknown_f959",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63834]=Vt(63834,"unknown_f95a",void 0,[],void 0),qt[63835]=Vt(63835,"unknown_f95b",void 0,[],void 0),qt[63836]=Vt(63836,"bb_exchange_slt",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63837]=Vt(63837,"bb_exchange_pc",void 0,[],void 0),qt[63838]=Vt(63838,"bb_box_create_bp",void 0,[Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63839]=Vt(63839,"bb_exchange_pt",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63840]=Vt(63840,"unknown_f960",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63841]=Vt(63841,"unknown_f961",void 0,[],void 0),qt[63842]=Vt(63842,"unknown_f962",void 0,[],void 0),qt[63843]=Vt(63843,"unknown_f963",void 0,[],void 0),qt[63844]=Vt(63844,"unknown_f964",void 0,[],void 0),qt[63845]=Vt(63845,"unknown_f965",void 0,[],void 0),qt[63846]=Vt(63846,"unknown_f966",void 0,[],void 0),qt[63847]=Vt(63847,"unknown_f967",void 0,[],void 0),qt[63848]=Vt(63848,"unknown_f968",void 0,[],void 0),qt[63849]=Vt(63849,"unknown_f969",void 0,[],void 0),qt[63850]=Vt(63850,"unknown_f96a",void 0,[],void 0),qt[63851]=Vt(63851,"unknown_f96b",void 0,[],void 0),qt[63852]=Vt(63852,"unknown_f96c",void 0,[],void 0),qt[63853]=Vt(63853,"unknown_f96d",void 0,[],void 0),qt[63854]=Vt(63854,"unknown_f96e",void 0,[],void 0),qt[63855]=Vt(63855,"unknown_f96f",void 0,[],void 0),qt[63856]=Vt(63856,"unknown_f970",void 0,[],void 0),qt[63857]=Vt(63857,"unknown_f971",void 0,[],void 0),qt[63858]=Vt(63858,"unknown_f972",void 0,[],void 0),qt[63859]=Vt(63859,"unknown_f973",void 0,[],void 0),qt[63860]=Vt(63860,"unknown_f974",void 0,[],void 0),qt[63861]=Vt(63861,"unknown_f975",void 0,[],void 0),qt[63862]=Vt(63862,"unknown_f976",void 0,[],void 0),qt[63863]=Vt(63863,"unknown_f977",void 0,[],void 0),qt[63864]=Vt(63864,"unknown_f978",void 0,[],void 0),qt[63865]=Vt(63865,"unknown_f979",void 0,[],void 0),qt[63866]=Vt(63866,"unknown_f97a",void 0,[],void 0),qt[63867]=Vt(63867,"unknown_f97b",void 0,[],void 0),qt[63868]=Vt(63868,"unknown_f97c",void 0,[],void 0),qt[63869]=Vt(63869,"unknown_f97d",void 0,[],void 0),qt[63870]=Vt(63870,"unknown_f97e",void 0,[],void 0),qt[63871]=Vt(63871,"unknown_f97f",void 0,[],void 0),qt[63872]=Vt(63872,"unknown_f980",void 0,[],void 0),qt[63873]=Vt(63873,"unknown_f981",void 0,[],void 0),qt[63874]=Vt(63874,"unknown_f982",void 0,[],void 0),qt[63875]=Vt(63875,"unknown_f983",void 0,[],void 0),qt[63876]=Vt(63876,"unknown_f984",void 0,[],void 0),qt[63877]=Vt(63877,"unknown_f985",void 0,[],void 0),qt[63878]=Vt(63878,"unknown_f986",void 0,[],void 0),qt[63879]=Vt(63879,"unknown_f987",void 0,[],void 0),qt[63880]=Vt(63880,"unknown_f988",void 0,[],void 0),qt[63881]=Vt(63881,"unknown_f989",void 0,[],void 0),qt[63882]=Vt(63882,"unknown_f98a",void 0,[],void 0),qt[63883]=Vt(63883,"unknown_f98b",void 0,[],void 0),qt[63884]=Vt(63884,"unknown_f98c",void 0,[],void 0),qt[63885]=Vt(63885,"unknown_f98d",void 0,[],void 0),qt[63886]=Vt(63886,"unknown_f98e",void 0,[],void 0),qt[63887]=Vt(63887,"unknown_f98f",void 0,[],void 0),qt[63888]=Vt(63888,"unknown_f990",void 0,[],void 0),qt[63889]=Vt(63889,"unknown_f991",void 0,[],void 0),qt[63890]=Vt(63890,"unknown_f992",void 0,[],void 0),qt[63891]=Vt(63891,"unknown_f993",void 0,[],void 0),qt[63892]=Vt(63892,"unknown_f994",void 0,[],void 0),qt[63893]=Vt(63893,"unknown_f995",void 0,[],void 0),qt[63894]=Vt(63894,"unknown_f996",void 0,[],void 0),qt[63895]=Vt(63895,"unknown_f997",void 0,[],void 0),qt[63896]=Vt(63896,"unknown_f998",void 0,[],void 0),qt[63897]=Vt(63897,"unknown_f999",void 0,[],void 0),qt[63898]=Vt(63898,"unknown_f99a",void 0,[],void 0),qt[63899]=Vt(63899,"unknown_f99b",void 0,[],void 0),qt[63900]=Vt(63900,"unknown_f99c",void 0,[],void 0),qt[63901]=Vt(63901,"unknown_f99d",void 0,[],void 0),qt[63902]=Vt(63902,"unknown_f99e",void 0,[],void 0),qt[63903]=Vt(63903,"unknown_f99f",void 0,[],void 0),qt[63904]=Vt(63904,"unknown_f9a0",void 0,[],void 0),qt[63905]=Vt(63905,"unknown_f9a1",void 0,[],void 0),qt[63906]=Vt(63906,"unknown_f9a2",void 0,[],void 0),qt[63907]=Vt(63907,"unknown_f9a3",void 0,[],void 0),qt[63908]=Vt(63908,"unknown_f9a4",void 0,[],void 0),qt[63909]=Vt(63909,"unknown_f9a5",void 0,[],void 0),qt[63910]=Vt(63910,"unknown_f9a6",void 0,[],void 0),qt[63911]=Vt(63911,"unknown_f9a7",void 0,[],void 0),qt[63912]=Vt(63912,"unknown_f9a8",void 0,[],void 0),qt[63913]=Vt(63913,"unknown_f9a9",void 0,[],void 0),qt[63914]=Vt(63914,"unknown_f9aa",void 0,[],void 0),qt[63915]=Vt(63915,"unknown_f9ab",void 0,[],void 0),qt[63916]=Vt(63916,"unknown_f9ac",void 0,[],void 0),qt[63917]=Vt(63917,"unknown_f9ad",void 0,[],void 0),qt[63918]=Vt(63918,"unknown_f9ae",void 0,[],void 0),qt[63919]=Vt(63919,"unknown_f9af",void 0,[],void 0),qt[63920]=Vt(63920,"unknown_f9b0",void 0,[],void 0),qt[63921]=Vt(63921,"unknown_f9b1",void 0,[],void 0),qt[63922]=Vt(63922,"unknown_f9b2",void 0,[],void 0),qt[63923]=Vt(63923,"unknown_f9b3",void 0,[],void 0),qt[63924]=Vt(63924,"unknown_f9b4",void 0,[],void 0),qt[63925]=Vt(63925,"unknown_f9b5",void 0,[],void 0),qt[63926]=Vt(63926,"unknown_f9b6",void 0,[],void 0),qt[63927]=Vt(63927,"unknown_f9b7",void 0,[],void 0),qt[63928]=Vt(63928,"unknown_f9b8",void 0,[],void 0),qt[63929]=Vt(63929,"unknown_f9b9",void 0,[],void 0),qt[63930]=Vt(63930,"unknown_f9ba",void 0,[],void 0),qt[63931]=Vt(63931,"unknown_f9bb",void 0,[],void 0),qt[63932]=Vt(63932,"unknown_f9bc",void 0,[],void 0),qt[63933]=Vt(63933,"unknown_f9bd",void 0,[],void 0),qt[63934]=Vt(63934,"unknown_f9be",void 0,[],void 0),qt[63935]=Vt(63935,"unknown_f9bf",void 0,[],void 0),qt[63936]=Vt(63936,"unknown_f9c0",void 0,[],void 0),qt[63937]=Vt(63937,"unknown_f9c1",void 0,[],void 0),qt[63938]=Vt(63938,"unknown_f9c2",void 0,[],void 0),qt[63939]=Vt(63939,"unknown_f9c3",void 0,[],void 0),qt[63940]=Vt(63940,"unknown_f9c4",void 0,[],void 0),qt[63941]=Vt(63941,"unknown_f9c5",void 0,[],void 0),qt[63942]=Vt(63942,"unknown_f9c6",void 0,[],void 0),qt[63943]=Vt(63943,"unknown_f9c7",void 0,[],void 0),qt[63944]=Vt(63944,"unknown_f9c8",void 0,[],void 0),qt[63945]=Vt(63945,"unknown_f9c9",void 0,[],void 0),qt[63946]=Vt(63946,"unknown_f9ca",void 0,[],void 0),qt[63947]=Vt(63947,"unknown_f9cb",void 0,[],void 0),qt[63948]=Vt(63948,"unknown_f9cc",void 0,[],void 0),qt[63949]=Vt(63949,"unknown_f9cd",void 0,[],void 0),qt[63950]=Vt(63950,"unknown_f9ce",void 0,[],void 0),qt[63951]=Vt(63951,"unknown_f9cf",void 0,[],void 0),qt[63952]=Vt(63952,"unknown_f9d0",void 0,[],void 0),qt[63953]=Vt(63953,"unknown_f9d1",void 0,[],void 0),qt[63954]=Vt(63954,"unknown_f9d2",void 0,[],void 0),qt[63955]=Vt(63955,"unknown_f9d3",void 0,[],void 0),qt[63956]=Vt(63956,"unknown_f9d4",void 0,[],void 0),qt[63957]=Vt(63957,"unknown_f9d5",void 0,[],void 0),qt[63958]=Vt(63958,"unknown_f9d6",void 0,[],void 0),qt[63959]=Vt(63959,"unknown_f9d7",void 0,[],void 0),qt[63960]=Vt(63960,"unknown_f9d8",void 0,[],void 0),qt[63961]=Vt(63961,"unknown_f9d9",void 0,[],void 0),qt[63962]=Vt(63962,"unknown_f9da",void 0,[],void 0),qt[63963]=Vt(63963,"unknown_f9db",void 0,[],void 0),qt[63964]=Vt(63964,"unknown_f9dc",void 0,[],void 0),qt[63965]=Vt(63965,"unknown_f9dd",void 0,[],void 0),qt[63966]=Vt(63966,"unknown_f9de",void 0,[],void 0),qt[63967]=Vt(63967,"unknown_f9df",void 0,[],void 0),qt[63968]=Vt(63968,"unknown_f9e0",void 0,[],void 0),qt[63969]=Vt(63969,"unknown_f9e1",void 0,[],void 0),qt[63970]=Vt(63970,"unknown_f9e2",void 0,[],void 0),qt[63971]=Vt(63971,"unknown_f9e3",void 0,[],void 0),qt[63972]=Vt(63972,"unknown_f9e4",void 0,[],void 0),qt[63973]=Vt(63973,"unknown_f9e5",void 0,[],void 0),qt[63974]=Vt(63974,"unknown_f9e6",void 0,[],void 0),qt[63975]=Vt(63975,"unknown_f9e7",void 0,[],void 0),qt[63976]=Vt(63976,"unknown_f9e8",void 0,[],void 0),qt[63977]=Vt(63977,"unknown_f9e9",void 0,[],void 0),qt[63978]=Vt(63978,"unknown_f9ea",void 0,[],void 0),qt[63979]=Vt(63979,"unknown_f9eb",void 0,[],void 0),qt[63980]=Vt(63980,"unknown_f9ec",void 0,[],void 0),qt[63981]=Vt(63981,"unknown_f9ed",void 0,[],void 0),qt[63982]=Vt(63982,"unknown_f9ee",void 0,[],void 0),qt[63983]=Vt(63983,"unknown_f9ef",void 0,[],void 0),qt[63984]=Vt(63984,"unknown_f9f0",void 0,[],void 0),qt[63985]=Vt(63985,"unknown_f9f1",void 0,[],void 0),qt[63986]=Vt(63986,"unknown_f9f2",void 0,[],void 0),qt[63987]=Vt(63987,"unknown_f9f3",void 0,[],void 0),qt[63988]=Vt(63988,"unknown_f9f4",void 0,[],void 0),qt[63989]=Vt(63989,"unknown_f9f5",void 0,[],void 0),qt[63990]=Vt(63990,"unknown_f9f6",void 0,[],void 0),qt[63991]=Vt(63991,"unknown_f9f7",void 0,[],void 0),qt[63992]=Vt(63992,"unknown_f9f8",void 0,[],void 0),qt[63993]=Vt(63993,"unknown_f9f9",void 0,[],void 0),qt[63994]=Vt(63994,"unknown_f9fa",void 0,[],void 0),qt[63995]=Vt(63995,"unknown_f9fb",void 0,[],void 0),qt[63996]=Vt(63996,"unknown_f9fc",void 0,[],void 0),qt[63997]=Vt(63997,"unknown_f9fd",void 0,[],void 0),qt[63998]=Vt(63998,"unknown_f9fe",void 0,[],void 0),qt[63999]=Vt(63999,"unknown_f9ff",void 0,[],void 0);function Po(e,t,i){const o=Math.min(e.params.length,t.length),n=[];let s=0;for(let i=0;iObject.assign({},e))};switch(e.type){case Bo.Instructions:return{type:Bo.Instructions,labels:t,instructions:e.instructions.map(e=>(function(e){return{opcode:e.opcode,args:e.args.map(e=>Object.assign({},e)),arg_size:e.arg_size,size:e.size,param_to_args:e.param_to_args.map(e=>e.map(e=>Object.assign({},e))),asm:e.asm}})(e)),asm:i};case Bo.Data:return{type:Bo.Data,labels:t,data:e.data.slice(0),asm:i};case Bo.String:return{type:Bo.String,labels:t,value:e.value,asm:i}}}qt.forEach(e=>{Ft.set(e.mnemonic,e)}),function(e){e[e.Instructions=0]="Instructions",e[e.Data=1]="Data",e[e.String=2]="String"}(Bo||(Bo={}));const Mo={add:(e,t)=>e+t,sub:(e,t)=>e-t,mul:(e,t)=>e*t,div:(e,t)=>e/t,idiv:(e,t)=>Math.floor(e/t),mod:(e,t)=>e%t,and:(e,t)=>e&t,or:(e,t)=>e|t,xor:(e,t)=>e^t,shl:(e,t)=>e<e>>>t};function Wo(e,t,i){if(e(t,i))return i}function qo(e){return e.slice(1)}const Fo=X.c.get("quest_editor/scripting/vm/io");class Vo{map_designate(e,t){Fo.warn(`bb_map_designate(${e}, ${t})`)}set_floor_handler(e,t){Fo.warn(`set_floor_handler(${e}, ${t})`)}window_msg(e){Fo.warn(`window_msg("${e}")`)}message(e){Fo.warn(`message("${e}")`)}add_msg(e){Fo.warn(`add_msg("${e}")`)}winend(){Fo.warn("winend")}p_dead_v3(e){return Fo.warn(`p_dead_v3(${e})`),!1}mesend(){Fo.warn("mesend")}list(e){Fo.warn(`list([${e.map(e=>`"${e}"`).join(", ")}])`)}warning(e,t){var i;Fo.warn(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}error(e,t){var i;Fo.error(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}srcloc_to_string(e){return e?` [${e.line_no}:${e.col}]`:" "}}var zo=i("bcBH");class Uo{constructor(e=Math.floor(performance.now())){this.holdrand=e}next(){const e=214013*this.holdrand+2531011>>>0;return this.holdrand=e,e>>>16&32767}}var No=i("NRxM");class $o extends No.a{constructor(e,t){super(new ArrayBuffer(e),t)}zero(){new Uint32Array(this.backing_buffer).fill(0)}}class Ao{constructor(e,t,i){Object(U.d)(e>=0,"seg_idx should be greater or equal to 0."),Object(U.d)(e=0,"inst_idx should be greater or equal to 0."),Object(U.d)(t=Go)throw new Error("Argument stack: Stack overflow");this.arg_stack.write_u32_at(this.arg_stack_counter*Ho,e),this.arg_stack_types[this.arg_stack_counter]=t,this.arg_stack_counter++}fetch_args(e){const t=e.instruction;if(t.opcode.stack!==Mt.Pop)return[];const i=[];t.opcode.params.length!==this.arg_stack_counter&&this.io.warning("Argument stack: Argument count mismatch.",e);for(let o=0;o0&&i.push(this.arg_stack.u8_at(s));break;default:throw new Error(`Argument stack: Unhandled parameter kind: ${ft[n.type.kind]}.`)}}return this.arg_stack_counter=0,i}check_arg_type(e,t,i){let o;switch(e){case ft.Any:o=!0;break;case ft.Byte:case ft.Word:case ft.DWord:case ft.Float:case ft.String:case ft.Pointer:o=t===e;break;case ft.Label:case ft.ILabel:case ft.ILabelVar:case ft.DLabel:case ft.SLabel:o=t===ft.Word;break;case ft.RegRef:case ft.RegTupRef:case ft.RegRefVar:o=t===ft.Byte}o||this.io.warning(`Argument stack: Argument type mismatch, expected ${ft[e]} but received ${ft[t]}.`,i)}}Qo.next_id=0;const Zo=256,Jo=4,Xo=16,en=11085568,tn=1024,on=0,nn="\n",sn=X.c.get("quest_editor/scripting/vm/VirtualMachine");var rn;!function(e){e[e.Suspended=0]="Suspended",e[e.Paused=1]="Paused",e[e.WaitingVsync=2]="WaitingVsync",e[e.WaitingInput=3]="WaitingInput",e[e.WaitingSelection=4]="WaitingSelection",e[e.Halted=5]="Halted"}(rn||(rn={}));class an{constructor(e=new Vo,t=new Uo){this.io=e,this.random=t,this.episode=s.b.I,this._object_code=[],this.label_to_seg_idx=new Map,this.registers=new $o(Zo*Jo,zo.a.Little),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.breakpoints=[],this.paused=!1,this.unsupported_opcodes_logged=new Set}get object_code(){return this._object_code}get halted(){return this._halted}set step_mode(e){if(null!=e){const t=this.current_thread();t&&(t.step_mode=e)}}load_object_code(e,t){this.halt(),sn.debug("Starting."),this._object_code=e,this.episode=t,this.label_to_seg_idx.clear();let i=0;for(const e of this._object_code){for(const t of e.labels)this.label_to_seg_idx.set(t,i);i++}this._halted=!1}start_thread(e,t){const i=this.get_segment_index_by_label(e),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${e} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);this.threads.push(new Qo(this.io,new Ao(i,0,this.object_code),t))}execute(){var e,t,i;if(this._halted)return rn.Halted;let o;try{let n=0;for(;n++<1e4;){if(this.threads.length>=1&&this.thread_idx>=this.threads.length)return rn.WaitingVsync;const n=this.current_thread();if(!n)return rn.Suspended;const s=n.current_stack_frame();o=s.instruction_pointer;const r=o.instruction;if(!this.paused)switch(n.step_mode){case Ko.BreakPoint:if(-1!==this.breakpoints.findIndex(e=>e.equals(o)))return this.paused=!0,rn.Paused;break;case Ko.Over:if(n.step_frame&&s.idx<=n.step_frame.idx&&(null===(e=r.asm)||void 0===e?void 0:e.mnemonic))return this.paused=!0,rn.Paused;break;case Ko.In:if(null===(t=r.asm)||void 0===t?void 0:t.mnemonic)return this.paused=!0,rn.Paused;break;case Ko.Out:if(n.step_frame&&s.idx=this.threads.length&&(this.thread_idx=0)}halt(){this._halted||(sn.debug("Halting."),this.registers.zero(),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.paused=!1,this.breakpoints.splice(0,1/0),this.unsupported_opcodes_logged.clear())}get_current_stack_frame(){var e;return null===(e=this.current_thread())||void 0===e?void 0:e.current_stack_frame()}get_instruction_pointer(){var e;return null===(e=this.get_current_stack_frame())||void 0===e?void 0:e.instruction_pointer}get_segment_index_by_label(e){if(!this.label_to_seg_idx.has(e))throw new Error(`Invalid argument: No such label ${e}.`);return this.label_to_seg_idx.get(e)}list_select(e){if(!this.list_open)throw new Error("list_select may not be called if there is no list open");this.set_register_unsigned(this.selection_reg,e)}set_breakpoint(e){-1===this.breakpoints.findIndex(t=>t.equals(e))&&this.breakpoints.push(e)}remove_breakpoint(e){const t=this.breakpoints.findIndex(t=>t.equals(e));-1!==t&&this.breakpoints.splice(t,1)}current_thread(){return this.threads[this.thread_idx]}terminate_thread(e){this.threads.splice(e,1),this.thread_idx>=e&&this.thread_idx>0&&this.thread_idx--}advance(e){const t=e.current_stack_frame();if(!t)return;const i=t.instruction_pointer.next();i?e.set_current_instruction_pointer(i):(e.pop_call_stack(),this.terminate_thread(this.thread_idx))}execute_instruction(e,t){const i=t.instruction;let o=void 0,n=!0;const r=i.args.map(e=>e.value),[a,d,c]=r;this.list_open&&(this.list_open=!1);const l=e.fetch_args(t);switch(i.opcode.code){case zt.code:break;case Ut.code:this.pop_call_stack(this.thread_idx);break;case Nt.code:o=rn.WaitingVsync,this.advance(e),this.thread_idx++,n=!1;break;case $t.code:this.halt();break;case At.code:this.start_thread(a);break;case Yt.code:this.set_register_signed(a,this.get_register_signed(d));break;case Qt.code:this.set_register_signed(a,d);break;case Zt.code:this.set_register_byte(a,d);break;case Jt.code:this.set_register_word(a,d);break;case Xt.code:this.set_register_unsigned(a,this.get_register_address(a));break;case ko.code:this.set_register_float(a,this.get_register_float(d));break;case yo.code:this.set_register_float(a,d);break;case ei.code:this.set_register_signed(a,1);break;case ti.code:this.set_register_signed(a,0);break;case ii.code:this.set_register_signed(a,0===this.get_register_signed(a)?1:0);break;case wi.code:this.push_call_stack(e,a),n=!1;break;case mi.code:this.jump_to_label(e,a),n=!1;break;case Yi.code:e.push_arg(this.get_register_signed(a),ft.DWord);break;case Qi.code:e.push_arg(i.args[0].value,ft.DWord);break;case Zi.code:e.push_arg(i.args[0].value,ft.Byte);break;case Ji.code:e.push_arg(i.args[0].value,ft.Word);break;case Xi.code:e.push_arg(this.get_register_address(i.args[0].value),ft.DWord);break;case to.code:if("string"==typeof a){const t=this.parse_template_string(a);this.string_arg_store=t.slice(0,tn/2),e.push_arg(en,ft.String)}break;case oi.code:this.do_integer_op_with_register(a,d,Mo.add);break;case ni.code:this.do_integer_op_with_literal(a,d,Mo.add);break;case si.code:this.do_integer_op_with_register(a,d,Mo.sub);break;case ri.code:this.do_integer_op_with_literal(a,d,Mo.sub);break;case ai.code:this.do_integer_op_with_register(a,d,Mo.mul);break;case di.code:this.do_integer_op_with_literal(a,d,Mo.mul);break;case ci.code:this.do_integer_op_with_register(a,d,Mo.idiv);break;case li.code:this.do_integer_op_with_literal(a,d,Mo.idiv);break;case bi.code:this.do_integer_op_with_register(a,d,Mo.mod);break;case fi.code:this.do_integer_op_with_literal(a,d,Mo.mod);break;case Ro.code:this.do_float_op_with_register(a,d,Mo.add);break;case Io.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.add);break;case jo.code:this.do_float_op_with_register(a,d,Mo.sub);break;case To.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.sub);break;case xo.code:this.do_float_op_with_register(a,d,Mo.mul);break;case So.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.mul);break;case Co.code:this.do_float_op_with_register(a,d,Mo.div);break;case Oo.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.div);break;case _i.code:this.do_integer_op_with_register(a,d,Mo.and);break;case ui.code:this.do_integer_op_with_literal(a,d,Mo.and);break;case vi.code:this.do_integer_op_with_register(a,d,Mo.or);break;case hi.code:this.do_integer_op_with_literal(a,d,Mo.or);break;case pi.code:this.do_integer_op_with_register(a,d,Mo.xor);break;case gi.code:this.do_integer_op_with_literal(a,d,Mo.xor);break;case bo.code:this.do_integer_op_with_register(a,d,Mo.shl);break;case fo.code:this.do_integer_op_with_register(a,d,Mo.shr);break;case ki.code:this.conditional_jump(e,a,(e,t)=>e===t,1,...qo(r).map(e=>this.get_register_signed(e))),n=!1;break;case yi.code:this.conditional_jump(e,a,(e,t)=>e===t,0,...qo(r).map(e=>this.get_register_signed(e))),n=!1;break;case Ri.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e===t,a,d),n=!1;break;case Ii.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e===t,a,d),n=!1;break;case ji.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e!==t,a,d),n=!1;break;case Ti.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e!==t,a,d),n=!1;break;case xi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),n=!1;break;case Si.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),n=!1;break;case Ci.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),n=!1;break;case Oi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),n=!1;break;case Li.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>eeeee>=t,a,d),n=!1;break;case Mi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),n=!1;break;case Wi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>=t,a,d),n=!1;break;case qi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),n=!1;break;case Fi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Vi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),n=!1;break;case zi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Ui.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Ai.code:this.push_variable_stack(e,a,1);break;case Hi.code:this.pop_variable_stack(e,a,1);break;case Gi.code:this.push_variable_stack(e,a,d);break;case Ki.code:this.pop_variable_stack(e,a,d);break;case io.code:if(!this.window_msg_open){const e=this.deref_string(l[1]).split(nn);o=rn.WaitingSelection,this.list_open=!0,this.selection_reg=l[0],this.io.list(e)}break;case oo.code:if(!this.window_msg_open){const e=this.deref_string(l[0]);o=rn.WaitingInput,this.window_msg_open=!0,this.io.window_msg(e)}break;case no.code:if(this.window_msg_open){const e=this.deref_string(l[0]);o=rn.WaitingInput,this.io.add_msg(e)}break;case so.code:this.set_register_unsigned(a,Math.floor(Date.now()/1e3));break;case ro.code:this.window_msg_open&&(this.window_msg_open=!1,this.io.winend());break;case ao.code:this.set_register_signed(l[0],this.io.p_dead_v3(l[1])?1:0);break;case lo.code:this.io.set_floor_handler(l[0],l[1]);break;case _o.code:this.start_thread(a);break;case vo.code:this.io.map_designate(this.get_register_signed(a),this.get_register_signed(a+2));break;case go.code:this.io.map_designate(this.get_register_signed(a),this.get_register_signed(a+3));break;case mo.code:{const e=this.get_register_signed(a),t=this.get_register_signed(a+1),i=this.random.next();let o=Math.floor(Math.fround(i/32768)*t);e>=o&&(o=e),this.set_register_signed(d,o)}break;case wo.code:if(this.set_episode_called){this.io.warning("Calling set_episode more than once is not supported.",t);break}if(this.set_episode_called=!0,!this._object_code[t.seg_idx].labels.includes(on)){this.io.warning(`Calling set_episode outside of segment ${on} is not supported.`,t);break}if(function(e){switch(e){case s.b.I:return 0;case s.b.II:return 1;case s.b.IV:return 2}}(this.episode)!==a){this.io.warning("Calling set_episode with an argument that does notmatch the quest's designated episode is not supported.",t);break}break;case Lo.code:this.io.map_designate(a,c);break;default:this.unsupported_opcodes_logged.has(i.opcode.code)||(this.unsupported_opcodes_logged.add(i.opcode.code),this.io.warning("Unsupported instruction.",t))}return n&&this.advance(e),o}get_register_signed(e){return this.registers.i32_at(Jo*e)}set_register_signed(e,t){this.registers.write_i32_at(Jo*e,t)}get_register_unsigned(e){return this.registers.u32_at(Jo*e)}set_register_unsigned(e,t){this.registers.write_u32_at(Jo*e,t)}get_register_word(e){return this.registers.u16_at(Jo*e)}set_register_word(e,t){this.registers.write_u16_at(Jo*e,t)}get_register_byte(e){return this.registers.u8_at(Jo*e)}set_register_byte(e,t){this.registers.write_u8_at(Jo*e,t)}get_register_float(e){return this.registers.f32_at(Jo*e)}set_register_float(e,t){this.registers.write_f32_at(Jo*e,t)}do_integer_op_with_register(e,t,i){this.do_integer_op_with_literal(e,this.get_register_signed(t),i)}do_integer_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_signed(e,i(this.get_register_signed(e),t))}do_float_op_with_register(e,t,i){this.do_float_op_with_literal(e,this.get_register_float(t),i)}do_float_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_float(e,i(this.get_register_float(e),t))}push_call_stack(e,t){const i=this.get_segment_index_by_label(t),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${t} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);e.push_frame(new Ao(i,0,this.object_code))}pop_call_stack(e){this.threads[e].pop_call_stack(),0===this.threads[e].call_stack.length&&this.terminate_thread(e)}jump_to_label(e,t){e.set_current_instruction_pointer(new Ao(this.get_segment_index_by_label(t),0,this.object_code))}signed_cond_jump_with_register(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_signed(o),this.get_register_signed(n))}signed_cond_jump_with_literal(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_signed(o),n)}unsigned_cond_jump_with_register(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_unsigned(o),this.get_register_unsigned(n))}unsigned_cond_jump_with_literal(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_unsigned(o),n)}conditional_jump(e,t,i,...o){const n=Wo.bind(null,i);var s;void 0!==function(e,t,i){let o=t;for(const t of i){const i=e(o,t);if(void 0===i)return;o=i}return o}(n,(s=o)[0],s.slice(1))?this.jump_to_label(e,t):this.advance(e)}push_variable_stack(e,t,i){const o=t+i;if(o>Zo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length+i>Xo)throw new Error("Variable stack: Stack overflow");for(let i=t;iZo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length=t;i--)this.set_register_unsigned(i,e.variable_stack.pop())}get_register_address(e){return e*Jo}deref_string(e){if(e===en)return this.string_arg_store;if(e>0&&e``],[/^r([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_unsigned(t).toString()}],[/^f([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_float(t).toFixed(6)}]];let o=!1,n=-1,s=0,r=e.length;for(;s"===a){o=!1;const a=s,d=e.slice(n+1,a);let c=void 0;for(const[e,t]of i){const i=e.exec(d);if(i&&void 0!==i[1]){c=t(i[1]);break}}if(void 0===c&&(c=t[d]),void 0===c)c="";else if("function"==typeof c){const e=c();t[d]=e,c=e}e=e.slice(0,n)+c+e.slice(a+1);const l=c.length-(d.length+2);s+=l,r+=l}else"<"===a&&(o=!0,n=s);s++}return o&&(e=e.slice(0,n)),e}}i("PNEq");var dn,cn=i("sv1z");!function(e){e[e.Signed=0]="Signed",e[e.Unsigned=1]="Unsigned",e[e.Word=2]="Word",e[e.Byte=3]="Byte",e[e.Float=4]="Float"}(dn||(dn={}));class ln extends b.a{constructor(e){super(),this.quest_runner=e,this.type_select=this.add(new cn.a({label:"Display type:",tooltip:"Select which data type register values should be displayed as.",items:[dn.Signed,dn.Unsigned,dn.Word,dn.Byte,dn.Float],to_label:e=>dn[e]})),this.register_getter=this.get_register_getter(dn.Signed),this.hex_checkbox=this.add(new Ue.a(!1,{label:"Hex",tooltip:"Display register values in hexadecimal."})),this.settings_bar=this.add(new ze.a(this.type_select,this.hex_checkbox)),this.list_element=Object(u.h)({className:"quest_editor_RegistersView_list"}),this.container_element=Object(u.h)({className:"quest_editor_RegistersView_container"},this.list_element),this.element=Object(u.h)({className:"quest_editor_RegistersView"},this.settings_bar.element,this.container_element),this.type_select.selected.val=dn.Signed;const t=Array(Zo);for(let e=0;e!this.quest_runner.paused.val||!this.quest_runner.running.val;this.update(i(),this.hex_checkbox.checked.val),this.disposables(this.quest_runner.running.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.quest_runner.paused.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.type_select.selected.observe(({value:e})=>{null!=e&&(this.register_getter=this.get_register_getter(e),this.update(i(),this.hex_checkbox.checked.val))}),this.hex_checkbox.checked.observe(e=>this.update(i(),e.value))),this.finalize_construction()}get_register_getter(e){let t;switch(e){case dn.Signed:t=this.quest_runner.vm.get_register_signed;break;case dn.Unsigned:t=this.quest_runner.vm.get_register_unsigned;break;case dn.Word:t=this.quest_runner.vm.get_register_word;break;case dn.Byte:t=this.quest_runner.vm.get_register_byte;break;case dn.Float:t=this.quest_runner.vm.get_register_float}return t.bind(this.quest_runner.vm)}update(e,t){if(e){const e="??";for(let t=0;t{this.buffer_log_entry(e,t)},this.level=this._level,this.log=this._log.filtered(this.level.map(e=>t=>t.level>=e))}get_logger(e){const t=X.c.get(e);return t.handler=this.handler,t}dispose(){this.disposer.dispose()}set_level(e){this._level.val=e}buffer_log_entry(e,t){this.log_buffer.push(e),this.logger_name_buffer.push(t),this.add_buffered_log_entries()}add_buffered_log_entries(){null==this.adding_log_entries&&(this.adding_log_entries=requestAnimationFrame(()=>{if(this.log_buffer.length>500){const e=this.log_buffer.length-500;this.log_buffer.splice(250,e,{time:new Date,message:`...dropped ${e} messages...`,level:X.a.Warn,logger:_n}),this.logger_name_buffer.splice(250,e,"quest_editor/stores/LogStore")}const e=Math.min(200,this.log_buffer.length),t=this.log_buffer.splice(0,e),i=this.logger_name_buffer.splice(0,e);this._log.push(...t);for(let o=0;o2e3&&this._log.splice(0,1e3),this.adding_log_entries=void 0,this.log_buffer.length&&this.add_buffered_log_entries()}))}},vn=5;class hn extends b.a{constructor(){super(),this.element=Object(u.h)({className:"quest_editor_LogView",tabIndex:-1}),this.should_scroll_to_bottom=!0,this.scrolled=()=>{this.should_scroll_to_bottom=this.list_container.scrollTop>=this.list_container.scrollHeight-this.list_container.offsetHeight-vn},this.scroll_to_bottom=()=>{this.should_scroll_to_bottom&&this.list_container.scrollTo({top:this.list_container.scrollHeight,left:0,behavior:"auto"})},this.create_message_element=({time:e,level:t,message:i})=>Object(u.h)({className:["quest_editor_LogView_message","quest_editor_LogView_"+X.a[t]+"_message"].join(" ")},Object(u.h)({className:"quest_editor_LogView_message_timestamp"},Object(X.d)(e)),Object(u.h)({className:"quest_editor_LogView_message_level"},"["+X.a[t]+"]"),Object(u.h)({className:"quest_editor_LogView_message_contents"},i)),this.list_container=Object(u.h)({className:"quest_editor_LogView_list_container"}),this.list_element=Object(u.h)({className:"quest_editor_LogView_message_list"}),this.level_filter=this.add(new cn.a({class:"quest_editor_LogView_level_filter",label:"Level:",items:X.b,to_label:e=>X.a[e]})),this.settings_bar=this.add(new ze.a({class:"quest_editor_LogView_settings"},this.level_filter)),this.list_container.addEventListener("scroll",this.scrolled),this.disposables(Object(u.d)(this.list_element,un.log,this.create_message_element,{after:this.scroll_to_bottom}),this.level_filter.selected.observe(({value:e})=>null!=e&&un.set_level(e)),un.level.observe(({value:e})=>{this.level_filter.selected.val=e},{call_now:!0})),this.list_container.appendChild(this.list_element),this.element.appendChild(this.settings_bar.element),this.element.appendChild(this.list_container),this.finalize_construction()}}class pn extends se{constructor(e,t,i,o){super(Object(M.e)(void 0),t,i,o),this.quest_runner=e,this.disposer.add_all(this.quest_runner.game_state.current_area_variant.observe(this.area_variant_changed,{call_now:!0}))}get_area_variant_details(){const e=this.quest_runner.game_state;return{episode:e.episode,area_variant:e.current_area_variant.val,npcs:e.npcs,objects:e.objects}}}class gn extends le{constructor(e,t,i,o){super(e,"quest_editor_QuestRunnerRendererView",new Q(o,o=>new pn(e.quest_runner,o,t,i))),this.renderer.init_camera_controls(),this.finalize_construction()}}var bn=i("nN8q");i("cl9q");class fn extends bn.a{constructor(e){super(),this.element=Object(u.h)({className:"core_ErrorWidget"}),this.children=[],this.label=this.disposable(new h.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}var mn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const wn=X.c.get("quest_editor/gui/QuestEditorView"),kn={settings:{showPopoutIcon:!1,showMaximiseIcon:!0,showCloseIcon:!0},dimensions:{headerHeight:24},labels:{close:"Close",maximise:"Maximise",minimise:"Minimise",popout:"Open in new window"}};class yn extends b.a{constructor(e,t,i,o,n,s,r,a,d,c,l,_,v,h){super(),this.gui_store=e,this.quest_editor_ui_persister=i,this.tool_bar=o,this.element=Object(u.h)({className:"quest_editor_QuestEditorView"}),this.layout_element=Object(u.h)({className:"quest_editor_gl_container"}),this.sub_views=new Map,this.view_map=new Map([[f,{name:"quest_info",create:n}],[m,{name:"npc_counts",create:s}],[Fe,{name:"quest_renderer",create:r}],[Ke,{name:"asm_editor",create:a}],[Ye,{name:"entity_info",create:d}],[Je,{name:"npc_list_view",create:c}],[Xe,{name:"object_list_view",create:l}],[bt,{name:"events_view",create:_}]]),e.feature_active("vm")&&(this.view_map.set(gn,{name:"quest_runner",create:v}),this.view_map.set(hn,{name:"log_view",create:()=>new hn}),this.view_map.set(ln,{name:"registers_view",create:h})),this.element.append(this.tool_bar.element,this.layout_element),this.layout=this.init_golden_layout(),this.layout.then(e=>this.loaded_layout=e),this.disposables(e.on_global_keydown(Qe.b.QuestEditor,"Ctrl-Alt-D",()=>t.debug.val=!t.debug.val),t.quest_runner.running.observe(({value:e})=>mn(this,void 0,void 0,(function*(){const i=yield this.layout;if(t.quest_runner.running.val===e){const t=i.root.getItemsById(this.view_map.get(gn).name);if(e){if(0===t.length){i.root.getItemsById(this.view_map.get(Fe).name)[0].parent.addChild({id:this.view_map.get(gn).name,title:"Debug 3D View",type:"component",componentName:this.view_map.get(gn).name,isClosable:!1})}}else for(const e of t)e.remove()}})))),this.finalize_construction()}activate(){super.activate();for(const e of this.sub_views.values())e.activate()}deactivate(){for(const e of this.sub_views.values())e.deactivate();super.deactivate()}resize(e,t){super.resize(e,t);const i=Math.max(0,t-this.tool_bar.height);return this.layout_element.style.width=`${e}px`,this.layout_element.style.height=`${i}px`,this.layout.then(t=>t.updateSize(e,i)),this}dispose(){super.dispose(),this.layout.then(e=>e.destroy());for(const e of this.sub_views.values())e.dispose();this.sub_views.clear()}init_golden_layout(){return mn(this,void 0,void 0,(function*(){const e=this.get_default_layout_content();try{const t=yield this.quest_editor_ui_persister.load_layout_config(e);if(t){const e=this.attempt_gl_init(Object.assign(Object.assign({},kn),{content:t}));return wn.info("Instantiated golden layout with persisted layout."),e}}catch(e){wn.warn("Couldn't instantiate golden layout with persisted layout.",e)}return wn.info("Instantiating golden layout with default layout."),this.attempt_gl_init(Object.assign(Object.assign({},kn),{content:e}))}))}attempt_gl_init(e){const t=new n.a(e,this.layout_element),i=this;try{for(const{name:e,create:o}of this.view_map.values())t.registerComponent(e,(function(t){let n;try{n=o(),i.active&&n.activate()}catch(t){wn.error(`Couldn't instantiate "${e}".`,t),n=new fn("Something went wrong while creating this window.")}t.on("close",()=>n.dispose()),t.on("resize",()=>n.resize(t.width,t.height-4)),n.resize(t.width,t.height),i.sub_views.set(e,n),t.getElement().append(n.element)}));return t.on("stateChanged",()=>{this.quest_editor_ui_persister.persist_layout_config(t.toConfig().content)}),t.on("stackCreated",e=>{e.on("activeContentItemChanged",e=>{if("componentName"in e.config){const t=this.sub_views.get(e.config.componentName);t&&t.focus()}})}),t.init(),t}catch(e){throw t.destroy(),e}}get_default_layout_content(){return[{type:"row",content:[{type:"column",width:2,content:[{type:"stack",content:[{title:"Info",type:"component",componentName:this.view_map.get(f).name,isClosable:!1},{title:"NPC Counts",type:"component",componentName:this.view_map.get(m).name,isClosable:!1}]},{title:"Entity",type:"component",componentName:this.view_map.get(Ye).name,isClosable:!1}]},{type:"stack",width:9,content:[{id:this.view_map.get(Fe).name,title:"3D View",type:"component",componentName:this.view_map.get(Fe).name,isClosable:!1},{title:"Script",type:"component",componentName:this.view_map.get(Ke).name,isClosable:!1},...this.gui_store.feature_active("vm")?[{title:"Debug Log",type:"component",componentName:this.view_map.get(hn).name,isClosable:!1},{title:"Registers",type:"component",componentName:this.view_map.get(ln).name,isClosable:!1}]:[]]},{type:"stack",width:2,content:[{title:"NPCs",type:"component",componentName:this.view_map.get(Je).name,isClosable:!1},{title:"Objects",type:"component",componentName:this.view_map.get(Xe).name,isClosable:!1},{title:"Events",type:"component",componentName:this.view_map.get(bt).name,isClosable:!1}]}]}]}}const Rn={can_redo:Object(M.e)(!1),can_undo:Object(M.e)(!1),first_redo:Object(M.e)(void 0),first_undo:Object(M.e)(void 0),make_current(){In.current.val=this},redo:()=>!1,reset(){},undo:()=>!1};const In=new class{constructor(){this.current=Object(M.e)(Rn),this.can_undo=this.current.flat_map(e=>e.can_undo),this.can_redo=this.current.flat_map(e=>e.can_redo),this.first_undo=this.current.flat_map(e=>e.first_undo),this.first_redo=this.current.flat_map(e=>e.first_redo)}undo(){return this.current.val.undo()}redo(){return this.current.val.redo()}make_noop_current(){In.current.val=Rn}},jn=X.c.get("core/undo/UndoStack");class Tn{constructor(){this.stack=Object(M.c)(),this.index=Object(M.e)(0),this.can_undo=this.index.map(e=>e>0),this.can_redo=Object(M.d)((e,t)=>te?this.stack.get(this.index.val-1):void 0),this.first_redo=this.can_redo.map(e=>e?this.stack.get(this.index.val):void 0),this.undoing_or_redoing=!1}make_current(){In.current.val=this}push(e){return this.undoing_or_redoing||(this.stack.splice(this.index.val,1/0,e),this.index.update(e=>e+1)),e}pop(){return this.index.update(e=>e-1),this.stack.splice(this.index.val,1)[0]}undo(){if(this.can_undo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.index.update(e=>e-1),this.stack.get(this.index.val).undo()}catch(e){jn.warn("Error while undoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}redo(){if(this.can_redo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.stack.get(this.index.val).redo(),this.index.update(e=>e+1)}catch(e){jn.warn("Error while redoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}reset(){this.stack.clear(),this.index.val=0}}class xn{constructor(e){this._breakpoints=[],this.breakpoints=this._breakpoints,this.vm=e}resume(){this.vm.step_mode=Ko.BreakPoint}step_over(){this.vm.step_mode=Ko.Over}step_in(){this.vm.step_mode=Ko.In}step_out(){this.vm.step_mode=Ko.Out}set_breakpoint(e){return-1===this._breakpoints.findIndex(t=>t.line_no===e)&&(this._breakpoints.push(new Sn(e,void 0,this.vm)),!0)}remove_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);return-1!=t&&(this._breakpoints.splice(t,1)[0].deactivate(),!0)}toggle_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);-1==t?this._breakpoints.push(new Sn(e,void 0,this.vm)):this._breakpoints.splice(t,1)[0].deactivate()}clear_breakpoints(){for(const e of this._breakpoints.splice(0,1/0))e.deactivate()}activate_breakpoints(){for(const e of this._breakpoints)e.activate()}deactivate_breakpoints(){for(const e of this._breakpoints)e.deactivate()}}class Sn{constructor(e,t,i){this.line_no=e,this.ptr=t,this.vm=i,null==t?this.activate():this.vm.set_breakpoint(t)}get active(){return null!=this.ptr}activate(){this.ptr=this.line_no_to_inst_pointer(this.line_no),this.ptr&&this.vm.set_breakpoint(this.ptr)}deactivate(){this.ptr&&this.vm.remove_breakpoint(this.ptr)}line_no_to_inst_pointer(e){var t,i;if(!this.vm.halted)for(let o=0;oe!==Cn.Stopped),this.paused=this._state.map(e=>e===Cn.Paused),this.breakpoints=this._breakpoints,this.pause_location=this._pause_location,this.execution_loop=()=>{var e,t;let i;switch(this.animation_frame=void 0,this.vm.vsync(),this.vm.execute()){case rn.Suspended:this._state.val=Cn.Running;break;case rn.Paused:this._state.val=Cn.Paused,i=null===(t=null===(e=this.vm.get_instruction_pointer())||void 0===e?void 0:e.source_location)||void 0===t?void 0:t.line_no;break;case rn.WaitingVsync:case rn.WaitingInput:this._state.val=Cn.Running,this.schedule_frame();break;case rn.WaitingSelection:this.vm.list_select(0),this._state.val=Cn.Running,this.schedule_frame();break;case rn.Halted:this.stop()}this._pause_location.val=i,this.startup&&this._state.val===Cn.Running&&(this.startup=!1,this.run_floor_handler(this._game_state.area_variants.get(this.initial_area_id)||this.area_store.get_variant(this._game_state.episode,this.initial_area_id,0)))},this.create_vm_io=()=>{function e(e,t){const i=[e];if(t){const{instruction:e,source_location:o}=t;i.push(` [${e.opcode.mnemonic}`),o&&i.push(` ${o.line_no}:${o.col}`),i.push("]")}return i.join("")}return{map_designate:(e,t)=>{this._game_state.area_variants.set(e,this.area_store.get_variant(this._game_state.episode,e,t))},set_floor_handler:(e,t)=>{this._game_state.floor_handlers.set(e,t)},window_msg:e=>{this.logger.info(`window_msg "${e}"`)},message:e=>{this.logger.info(`message "${e}"`)},add_msg:e=>{this.logger.info(`add_msg "${e}"`)},winend:()=>{},p_dead_v3:()=>!1,mesend:()=>{},list:e=>{this.logger.info(`list "[${e}]"`)},warning:(t,i)=>{this.logger.warn(e(t,i))},error:(t,i)=>{this.logger.error(e(t.message,i))}}},this.vm=new an(this.create_vm_io()),this.debugger=new xn(this.vm)}get game_state(){return this._game_state}run(e){this.stop(),this.logger.info("Starting debugger."),this.startup=!0,this.initial_area_id=0,this.npcs.splice(0,this.npcs.length,...e.npcs.val),this.objects.splice(0,this.objects.length,...e.objects.val),this._game_state=new On(e.episode),this.vm.load_object_code(e.object_code.map(Eo),this.game_state.episode),this.vm.start_thread(0),this.debugger.activate_breakpoints(),this._state.val=Cn.Running,this.schedule_frame()}resume(){this.debugger.resume(),this.schedule_frame()}step_over(){this.debugger.step_over(),this.schedule_frame()}step_into(){this.debugger.step_in(),this.schedule_frame()}step_out(){this.debugger.step_out(),this.schedule_frame()}stop(){this.running.val&&(this.logger.info("Stopping debugger."),null!=this.animation_frame&&(cancelAnimationFrame(this.animation_frame),this.animation_frame=void 0),this.vm.halt(),this.debugger.deactivate_breakpoints(),this._state.val=Cn.Stopped,this._pause_location.val=void 0,this.npcs.splice(0,this.npcs.length),this.objects.splice(0,this.objects.length),this._game_state=new On(s.b.I))}set_breakpoint(e){const t=this.debugger.set_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}remove_breakpoint(e){const t=this.debugger.remove_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}toggle_breakpoint(e){this.debugger.toggle_breakpoint(e),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}clear_breakpoints(){this.debugger.clear_breakpoints(),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}schedule_frame(){null==this.animation_frame&&(this.animation_frame=requestAnimationFrame(this.execution_loop))}run_floor_handler(e){const t=e.area.id;this._game_state.current_area_variant.val=e,this._game_state.objects.push(...this.objects.filter(e=>e.area_id===t));const i=this._game_state.floor_handlers.get(t);null==i?this.logger.debug(`No floor handler registered for floor ${t}.`):(this.vm.start_thread(i),this.schedule_frame())}}var Pn=i("kcKQ"),Dn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Bn=X.c.get("quest_editor/gui/QuestEditorStore");class En extends Pn.a{constructor(e,t){super(),this.area_store=t,this._current_quest=Object(M.e)(void 0),this._current_area=Object(M.e)(void 0),this._selected_wave=Object(M.e)(void 0),this._selected_entity=Object(M.e)(void 0),this.debug=Object(M.e)(!1),this.undo=new Tn,this.current_quest=this._current_quest,this.current_area=this._current_area,this.selected_wave=this._selected_wave,this.selected_entity=this._selected_entity,this.set_current_area=e=>{var t,i;e&&e.id!==(null===(i=null===(t=this.selected_wave.val)||void 0===t?void 0:t.area_id)||void 0===i?void 0:i.val)&&this.set_selected_wave(void 0),this._selected_entity.val=void 0,this._current_area.val=e},this.set_selected_wave=e=>{if(e){const t=this.selected_entity.val;t&&t instanceof Y&&t.wave.val!==e&&this.set_selected_entity(void 0)}this._selected_wave.val=e},this.set_selected_entity=e=>{e&&this.current_quest.val&&(this._current_area.val=this.area_store.get_area(this.current_quest.val.episode,e.area_id)),this._selected_entity.val=e},this.set_section_on_quest_entity=(e,t)=>{const i=t.find(t=>t.id===e.section_id.val);i?e.set_section(i):Bn.warn(`Section ${e.section_id.val} not found.`)},this.quest_runner=new Ln(t),this.disposables(e.tool.observe(({value:e})=>{e===Qe.b.QuestEditor&&this.undo.make_current()},{call_now:!0}),this.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof Y&&!e.includes(t)&&this.set_selected_entity(void 0)}),this.current_quest.flat_map(e=>e?e.objects:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof me&&!e.includes(t)&&this.set_selected_entity(void 0)}),Object(u.g)(window,"beforeunload",e=>{this.quest_runner.stop(),this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}dispose(){this.quest_runner.stop(),super.dispose()}set_current_quest(e){return Dn(this,void 0,void 0,(function*(){if(this.undo.reset(),this.quest_runner.stop(),this._current_area.val=void 0,this._selected_entity.val=void 0,this._current_quest.val=e,e){this._current_area.val=this.area_store.get_area(e.episode,0);for(const t of e.area_variants.val){const i=yield this.area_store.get_area_sections(e.episode,t);t.set_sections(i);for(const o of e.objects.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Bn.error(e)}for(const o of e.npcs.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Bn.error(e)}}}}))}}var Mn,Wn,qn=i("NUmZ"),Fn=i.n(qn);!function(e){e[e.NewAssembly=0]="NewAssembly",e[e.AssemblyChange=1]="AssemblyChange",e[e.SignatureHelp=2]="SignatureHelp",e[e.Definition=3]="Definition",e[e.SettingsChange=4]="SettingsChange"}(Mn||(Mn={})),function(e){e[e.NewObjectCode=0]="NewObjectCode",e[e.SignatureHelp=1]="SignatureHelp",e[e.Definition=2]="Definition"}(Wn||(Wn={}));const Vn=new DataView(new ArrayBuffer(4));function zn(e){return Vn.setInt32(0,e),Vn.getFloat32(0)}function Un(e){return Vn.setFloat32(0,e),Vn.getInt32(0)}const Nn=X.c.get("quest_editor/scripting/disassembly");function $n(e,t){const i=[],o=Math.min(e.length,t.length);for(let n=0;nnull!=e).map(e=>({label:e.mnemonic,kind:Gn.Function,insertText:e.mnemonic})),Yn=[{label:".code",kind:Gn.Keyword,insertText:"code"},{label:".data",kind:Gn.Keyword,insertText:"data"},{label:".string",kind:Gn.Keyword,insertText:"string"}];class Qn{constructor(e,t,i){this.can_undo=Object(M.e)(!1),this.can_redo=Object(M.e)(!1),this.action=Object(M.e)({description:e,undo:t,redo:i}),this.first_undo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_undo),this.first_redo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_redo)}make_current(){In.current.val=this}undo(){return!!this.can_undo&&(this.action.val.undo(),!0)}redo(){return!!this.can_redo&&(this.action.val.redo(),!0)}reset(){this.can_undo.val=!1,this.can_redo.val=!1}}var Zn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Jn=new class{constructor(){this._issues=Object(M.e)({warnings:[],errors:[]}),this.issues=this._issues,this.worker=new Fn.a,this.promises=new Map,this.message_id=0,this.process_worker_message=e=>{const t=e.data;switch(t.type){case Wn.NewObjectCode:this.quest&&(this.quest.object_code.splice(0,this.quest.object_code.length,...t.object_code),this.quest.set_map_designations(t.map_designations),this._issues.val={warnings:t.warnings,errors:t.errors});break;case Wn.SignatureHelp:{const e=this.promises.get(t.id);if(e)if(this.promises.delete(t.id),t.opcode){let i=t.opcode.mnemonic+" ";const o=[];let n=!0;for(const e of t.opcode.params){let t;switch(n?n=!1:i+=", ",e.type.kind){case ft.ILabel:t="FuncLabel";break;case ft.DLabel:t="DataLabel";break;case ft.SLabel:t="StringLabel";break;case ft.ILabelVar:t="...FuncLabel";break;case ft.RegRef:case ft.RegTupRef:t="Register";break;case ft.RegRefVar:t="...Register";break;default:t=ft[e.type.kind]}o.push({label:[i.length,i.length+t.length],documentation:e.doc}),i+=t}const s={signatures:[{label:i,documentation:t.opcode.doc,parameters:o}],activeSignature:0,activeParameter:t.active_param};e.resolve(s)}else e.resolve(void 0)}break;case Wn.Definition:{const e=this.promises.get(t.id);if(e){this.promises.delete(t.id);const i=[];null!=t.line_no&&i.push({uri:e.uri,range:{startLineNumber:t.line_no,startColumn:t.col,endLineNumber:t.line_no,endColumn:t.col+t.len}}),e.resolve(i)}}}},this.worker.onmessage=this.process_worker_message}disassemble(e,t){this.quest=e;const i=function(e,t=!1){Nn.trace("disassemble start");const i=[],o=[];let n=void 0;for(const r of e){let e;switch(r.type){case Bo.Instructions:e=".code";break;case Bo.Data:e=".data";break;case Bo.String:e=".string"}n!==r.type&&(n=r.type,i.length&&i.push(""),i.push(e,""));for(const e of r.labels)i.push(`${e}:`);if(r.type===Bo.Data){const e=new Uint8Array(r.data);let t=" ";for(let o=0;o4&&i.push(t)}else if(r.type===Bo.String)i.push(" "+(s=r.value,JSON.stringify(s.replace(//g,"\n"))));else{let e=!1;for(const n of r.instructions)if(n.opcode.code===Ht.code?e=!0:n.opcode.code===Gt.code&&(e=!1),t||e||n.opcode.stack!==Mt.Push){let e=[];n.opcode.stack===Mt.Pop?t||(e=An(n.opcode.params,o.splice(Math.max(0,o.length-n.opcode.params.length),n.opcode.params.length),!0)):e=An(n.opcode.params,$n(n.opcode.params,n.args),!1),i.push(" "+n.opcode.mnemonic+(e.length?" "+e.join(", "):""))}else o.push(...$n(n.opcode.params,n.args))}}var s;return i.length&&i.push(""),Nn.trace(`disassemble end, line count: ${i.length}`),i}(e.object_code,t),o={type:Mn.NewAssembly,assembly:i};return this.worker.postMessage(o),i}update_assembly(e){const t={type:Mn.AssemblyChange,changes:e.map(e=>({start_line_no:e.range.startLineNumber,start_col:e.range.startColumn,end_line_no:e.range.endLineNumber,end_col:e.range.endColumn,new_text:e.text}))};this.worker.postMessage(t)}provide_completion_items(e){return{suggestions:/^\s*([a-z][a-z0-9_=<>!]*)?$/.test(e)?Kn:/^\s*\.[a-z]+$/.test(e)?Yn:[],incomplete:!1}}provide_signature_help(e,t,i){return Hn(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Signature help provision",e,e=>({type:Mn.SignatureHelp,id:e,line_no:t,col:i}))}))}provide_definition(e,t,i){return Hn(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Definition provision",e,e=>({type:Mn.Definition,id:e,line_no:t,col:i}))}))}update_settings(e){const t={type:Mn.SettingsChange,settings:e};this.worker.postMessage(t)}dispose(){this.worker.terminate()}send_and_await_response(e,t,i){return Hn(this,void 0,void 0,(function*(){const o=this.message_id++;return new Promise((n,s)=>{this.promises.set(o,{uri:t,resolve:n,reject:s});const r=i(o);this.worker.postMessage(r),setTimeout(()=>{this.promises.delete(o)&&s(new Error(`${e} timed out.`))},5e3)})}))}};Ve.languages.register({id:"psoasm"}),Ve.languages.setMonarchTokensProvider("psoasm",{defaultToken:"invalid",tokenizer:{root:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/r\d+/,"predefined"],[/[^\s]+:/,"tag"],[/0x[0-9a-fA-F]+/,"number.hex"],[/-?\d+(\.\d+)?(e-?\d+)?/,"number.float"],[/-?[0-9]+/,"number"],[/\.[^\s]+/,"keyword"],[/[a-z][a-z0-9_=<>!]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\/\/.*$/,"comment"],[/,/,"delimiter"]],string:[[/[^\\"]+/,"string"],[/\\(?:[n\\"])/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}}),Ve.languages.registerCompletionItemProvider("psoasm",{provideCompletionItems(e,t){const i=e.getValueInRange({startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:1,endColumn:t.column});return Jn.provide_completion_items(i)}}),Ve.languages.registerSignatureHelpProvider("psoasm",{signatureHelpTriggerCharacters:[" ",","],signatureHelpRetriggerCharacters:[", "],provideSignatureHelp(e,t){return Zn(this,void 0,void 0,(function*(){const i=yield Jn.provide_signature_help(e.uri,t.lineNumber,t.column);return i&&{value:i,dispose(){}}}))}}),Ve.languages.setLanguageConfiguration("psoasm",{indentationRules:{increaseIndentPattern:/^\s*\d+:/,decreaseIndentPattern:/^\s*(\d+|\.)/},autoClosingPairs:[{open:'"',close:'"'}],surroundingPairs:[{open:'"',close:'"'}],comments:{lineComment:"//"}}),Ve.languages.registerDefinitionProvider("psoasm",{provideDefinition:(e,t)=>Jn.provide_definition(e.uri,t.lineNumber,t.column)});class Xn extends Pn.a{constructor(e){super(),this.quest_editor_store=e,this.model_disposer=this.disposable(new a.a),this._model=Object(M.e)(void 0),this._did_undo=Object(M.a)(),this._did_redo=Object(M.a)(),this._inline_args_mode=Object(M.e)(!0),this.model=this._model,this.did_undo=this._did_undo,this.did_redo=this._did_redo,this.undo=new Qn("Text edits",()=>this._did_undo.emit({value:"asm undo"}),()=>this._did_redo.emit({value:"asm undo"})),this.inline_args_mode=this._inline_args_mode,this.has_issues=Jn.issues.map(e=>e.warnings.length+e.errors.length>0),this.set_inline_args_mode=e=>{this.has_issues.val||(this._inline_args_mode.val=e,Jn.update_settings({manual_stack:!this.inline_args_mode.val}),this.update_model())},this.quest_changed=()=>{this.update_model()},this.breakpoints=e.quest_runner.breakpoints,this.pause_location=e.quest_runner.pause_location,this.disposables(e.current_quest.observe(this.quest_changed,{call_now:!0}),Jn.issues.observe(({value:e})=>this.update_model_markers(e),{call_now:!0}),Object(u.g)(window,"beforeunload",e=>{this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}setup_editor_model_features(e){const t=e.getAlternativeVersionId();let i=t,o=t;this.model_disposer.add(e.onDidChangeContent(n=>{const s=e.getAlternativeVersionId();so&&(o=i)),this.undo.can_undo.val=!0),i=s,Jn.update_assembly(n.changes),this.update_breakpoints(n.changes)}))}update_model_markers({warnings:e,errors:t}){const i=this.model.val;i&&Ve.editor.setModelMarkers(i,"psoasm",e.map(e=>({severity:Ve.MarkerSeverity.Hint,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length,tags:[Ve.MarkerTag.Unnecessary]})).concat(t.map(e=>({severity:Ve.MarkerSeverity.Error,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length}))))}update_model(){this.undo.reset(),this.model_disposer.dispose_all();const e=this.quest_editor_store.current_quest.val;if(e){const t=!this.inline_args_mode.val,i=Jn.disassemble(e,t),o=this.model_disposer.add(Ve.editor.createModel(i.join("\n"),"psoasm"));this.setup_editor_model_features(o),this._model.val=o}else this._model.val=void 0}update_breakpoints(e){for(const t of e){const e=[];if(""===t.text){const i=t.range.endLineNumber-t.range.startLineNumber;if(i>0){for(let o=t.range.startLineNumber+1;o<=t.range.endLineNumber;o++){const t=Math.max(o-i,1);this.quest_editor_store.quest_runner.remove_breakpoint(o)&&e.push(t)}for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no-i))}}else{const i=t.text.split("\n").length-1;if(i>0)for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no+i))}for(const t of e)this.quest_editor_store.quest_runner.set_breakpoint(t)}}}class es{constructor(e,t,i,o){if(!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);if(!t)throw new Error("name is required.");if(!o)throw new Error("area_variants is required.");this.id=e,this.name=t,this.order=i,this.area_variants=o}}class ts{constructor(e,t){if(this._sections=Object(M.c)(),this.sections=this._sections,!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);this.id=e,this.area=t}set_sections(e){return this._sections.val=e,this}}function is(e){return os[e]}const os=[];function ns(e,t,i,o){const n={id:e,name:t,order:i,area_variants:[]};for(let e=0;ethis.areas[e],this.get_area=(e,t)=>{const i=this.areas[e].find(e=>e.id===t);if(!i)throw new Error(`Area id ${t} for episode ${e} is invalid.`);return i},this.get_variant=(e,t,i)=>{const o=this.get_area(e,t).area_variants[i];if(!o)throw new Error(`Area variant id ${i} for area ${t} of episode ${s.b[e]} is invalid.`);return o},this.get_area_sections=(e,t)=>this.area_asset_loader.load_sections(e,t);for(const e of s.a)this.areas[e]=is(e).map(e=>{const t=new es(e.id,e.name,e.order,[]);for(const i of e.area_variants)t.area_variants.push(new ts(i.id,t));return t})}}function as(e,t){e.seek_end(32);const i=e.u32(),o=e.u32();e.seek(8);const n=e.u32();return e.seek_start(i),{data_offset:n,index:t?function(e,t){const i=e.u16_array(t),o=[];let n=0;for(const t of i){n+=4*t,e.seek_start(n-4);const i=e.u32(),s=e.u32();o.push({offset:s,size:i})}return o}(e,o):[]}}var ds=i("kwt4");function cs(e,t,i){const o=[];for(let n=0;n=0){const e=new vs(s.id,Object(hs.a)(s.position),N(s.rotation.x,s.rotation.y,s.rotation.z),t);i.push(e),r.userData.section=e}}return[i,o]}class fs{constructor(e){this.http_client=e,this.disposer=new a.a,this.render_object_cache=this.disposer.add(new ls),this.collision_object_cache=this.disposer.add(new ls),this.area_sections_cache=this.disposer.add(new ls)}dispose(){this.disposer.dispose()}load_sections(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.area_sections_cache.get_or_set(i,()=>this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>bs(e,t)[0]))}load_render_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>bs(e,t)[1])}load_collision_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.collision_object_cache.get_or_set(i,()=>this.get_area_asset(e,t,"collision").then(e=>(function(e){const{data_offset:t}=as(e,!1);e.seek_start(t);const i=e.u32();e.seek_start(i);const o={meshes:[]};for(;e.bytes_left;){const t=e.position,i=e.u32();if(0===i)break;const n={vertices:[],triangles:[]};o.meshes.push(n),e.seek_start(i);const s=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();e.seek_start(r);for(let t=0;t(function(e){const t=new y.Group;for(const i of e.meshes){const e=new y.Geometry;for(const{x:t,y:o,z:n}of i.vertices)e.vertices.push(new y.Vector3(t,o,n));for(const{indices:t,flags:o,normal:n}of i.triangles){const i=16&o,s=1&o,r=64&o?3:i?2:s?1:0;0!==r&&e.faces.push(new y.Face3(t[0],t[1],t[2],new y.Vector3(n.x,n.y,n.z),void 0,r))}if(e.faces.length){e.computeBoundingBox(),e.computeBoundingSphere();const i=new y.Mesh(e,ps);i.renderOrder=1,t.add(i);const o=new y.Mesh(e,gs);o.renderOrder=2,t.add(o)}}return t})(e))}load_render_object(e,t){return this.get_area_asset(e,t,"render").then(e=>(function(e){const t=[];e.seek_end(16);const{data_offset:i}=as(e,!1);e.seek_start(i),e.seek(8);const o=e.u32();e.seek(4);const n=e.u32();for(let i=0;it.push({args:i,resolve:e,reject:o}));return 1===t.length&&function(){ws(this,void 0,void 0,(function*(){for(;t.length;){const{args:i,resolve:o,reject:n}=t[0];try{o(yield e(...i))}catch(e){n(e)}finally{t.shift()}}}))}(),o}}var ys=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Rs=new y.HemisphereLight(16777215,5263440,1.2),Is=new y.Scene,js=new y.PerspectiveCamera(30,1,10,1e3),Ts=new y.Vector3(1,1,2).normalize(),xs=1.3/Math.tan(js.fov/180*Math.PI/2);class Ss{constructor(e,t){this.entity_asset_loader=e,this.cache=new ls,this.render_to_image=ks(e=>this.entity_asset_loader.load_geometry(e).then(t=>this.entity_asset_loader.load_textures(e).then(i=>{Is.remove(...Is.children),Is.add(Rs);const o=E(e,t,i);Is.add(o);const n=o.geometry.boundingSphere;return js.position.copy(Ts),js.position.multiplyScalar(n.radius*xs),js.lookAt(n.center),this.renderer.render(Is,js),this.renderer.domElement.toDataURL()}))),this.renderer=t(),this.renderer.setSize(100,100)}dispose(){this.renderer.dispose(),this.cache.dispose()}render(e){return ys(this,void 0,void 0,(function*(){return this.cache.get_or_set(e,()=>this.render_to_image(e))}))}}var Cs=i("yub1"),Os=i("iR5r"),Ls=i("4eU9");const Ps=X.c.get("quest_editor/loading/EntityAssetLoader"),Ds=new y.CylinderBufferGeometry(3,3,20);Ds.translate(0,10,0),Ds.computeBoundingBox(),Ds.computeBoundingSphere();const Bs=Ls.a.resolve(Ds),Es=[],Ms=Ls.a.resolve(Es);class Ws{constructor(e){this.http_client=e,this.disposer=new a.a,this.geom_cache=this.disposer.add(new ls),this.tex_cache=this.disposer.add(new ls),this.warm_up_caches()}dispose(){this.disposer.dispose()}load_geometry(e){return this.geom_cache.get_or_set(e,()=>this.load_data(e,qs.Geometry).then(({url:t,data:i})=>{const o=new No.a(i,zo.a.Little),n=t.endsWith(".nj")?Object(ds.c)(o):Object(ds.d)(o);return n.length?Object(us.a)(n[0]):(Ps.warn(`Couldn't parse ${t} for ${C(e)}.`),Ds)}).catch(t=>(Ps.warn(`Couldn't load geometry file for ${C(e)}.`,t),Ds)))}load_textures(e){return this.tex_cache.get_or_set(e,()=>this.load_data(e,qs.Texture).then(({data:e})=>{const t=new No.a(e,zo.a.Little),i=Object(Cs.a)(t);return Object(Os.a)(i)}).catch(t=>(Ps.warn(`Couldn't load texture file for ${C(e)}.`,t),Es)))}load_data(e,t){const i=function e(t,i){if(O(t))switch(t){case I.c.Dubswitch:return`/npcs/${I.c[t]}.${i===qs.Geometry?"xj":"xvm"}`;case I.c.Hildebear2:return e(I.c.Hildebear,i);case I.c.Hildeblue2:return e(I.c.Hildeblue,i);case I.c.RagRappy2:return e(I.c.RagRappy,i);case I.c.Monest2:return e(I.c.Monest,i);case I.c.Mothmant2:return e(I.c.Mothmant,i);case I.c.PoisonLily2:return e(I.c.PoisonLily,i);case I.c.NarLily2:return e(I.c.NarLily,i);case I.c.GrassAssassin2:return e(I.c.GrassAssassin,i);case I.c.Dimenian2:return e(I.c.Dimenian,i);case I.c.LaDimenian2:return e(I.c.LaDimenian,i);case I.c.SoDimenian2:return e(I.c.SoDimenian,i);case I.c.DarkBelra2:return e(I.c.DarkBelra,i);case I.c.SavageWolf2:return e(I.c.SavageWolf,i);case I.c.BarbarousWolf2:return e(I.c.BarbarousWolf,i);case I.c.PanArms2:return e(I.c.PanArms,i);case I.c.Dubchic2:return e(I.c.Dubchic,i);case I.c.Gilchic2:return e(I.c.Gilchic,i);case I.c.Garanz2:return e(I.c.Garanz,i);case I.c.Dubswitch2:return e(I.c.Dubswitch,i);case I.c.Delsaber2:return e(I.c.Delsaber,i);case I.c.ChaosSorcerer2:return e(I.c.ChaosSorcerer,i);default:return`/npcs/${I.c[t]}.${i===qs.Geometry?"nj":"xvm"}`}else{if(i!==qs.Geometry)return`/objects/${T(t).pso_id}.xvm`;switch(t){case w.EasterEgg:case w.ChristmasTree:case w.ChristmasWreath:case w.TwentyFirstCentury:case w.Sonic:case w.WelcomeBoard:case w.FloatingJellyfish:case w.RuinsSeal:case w.Dolphin:case w.Cacti:case w.BigBrownRock:case w.PoisonPlant:case w.BigBlackRocks:case w.FallingRock:case w.DesertFixedTypeBoxBreakableCrystals:case w.BeeHive:return`/objects/${T(t).pso_id}.nj`;default:return`/objects/${T(t).pso_id}.xj`}}}(e,t);return this.http_client.get(i).array_buffer().then(e=>({url:i,data:e}))}warm_up_caches(){for(const e of[I.c.Unknown,I.c.Migium,I.c.Hidoom,I.c.DeathGunner,I.c.StRappy,I.c.HalloRappy,I.c.EggRappy,I.c.Migium2,I.c.Hidoom2,I.c.Recon,w.Unknown,w.PlayerSet,w.Particle,w.LightCollision,w.EnvSound,w.FogCollision,w.EventCollision,w.CharaCollision,w.ObjRoomID,w.LensFlare,w.ScriptCollision,w.MapCollision,w.ScriptCollisionA,w.ItemLight,w.RadarCollision,w.FogCollisionSW,w.ImageBoard,w.UnknownItem29,w.UnknownItem30,w.UnknownItem31,w.MenuActivation,w.BoxDetectObject,w.SymbolChatObject,w.TouchPlateObject,w.TargetableObject,w.EffectObject,w.CountDownObject,w.UnknownItem38,w.UnknownItem39,w.UnknownItem40,w.UnknownItem41,w.TelepipeLocation,w.BGMCollision,w.Pioneer2InvisibleTouchplate,w.TempleMapDetect,w.Firework,w.MainRagolTeleporterBattleInNextArea,w.Rainbow,w.FloatingBlueLight,w.PopupTrapNoTech,w.Poison,w.EnemyTypeBoxYellow,w.EnemyTypeBoxBlue,w.EmptyTypeBoxBlue,w.FloatingRocks,w.FloatingSoul,w.Butterfly,w.UnknownItem400,w.CCAAreaTeleporter,w.UnknownItem523,w.WhiteBird,w.OrangeBird,w.UnknownItem529,w.UnknownItem530,w.Seagull,w.UnknownItem576,w.WarpInBarbaRayRoom,w.UnknownItem672,w.InstaWarp,w.LabInvisibleObject,w.UnknownItem700])this.geom_cache.set(e,Bs),this.tex_cache.set(e,Ms)}}var qs;!function(e){e[e.Geometry=0]="Geometry",e[e.Texture=1]="Texture"}(qs||(qs={}));var Fs=i("I7a6"),Vs=i("LvDl"),zs=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Us="QuestEditorUiPersister.layout_config";class Ns extends Fs.a{constructor(){super(...arguments),this.persist_layout_config=Object(Vs.throttle)(e=>{this.persist(Us,this.to_persisted_item_config(e))},500,{leading:!1,trailing:!0})}load_layout_config(e){return zs(this,void 0,void 0,(function*(){const t=yield this.load(Us);if(t){const i=this.extract_components(e),o=this.sanitized_layout_config(this.from_persisted_item_config(t),i);if(o)return o}}))}sanitized_layout_config(e,t){const i=new Set,o=e.map(e=>this.sanitize_layout_child(e,t,i));if(i.size===t.size)return o.filter(e=>e)}sanitize_layout_child(e,t,i){if(!e)return;switch(e.type){case"component":{if(!("componentName"in e))return;const o=t.get(e.componentName);if(!o)return;i.add(e.componentName),e.id=o.id,e.title=o.title}break;case"stack":if(null==e.content||0===e.content.length)return}e.content&&(e.content=e.content.map(e=>this.sanitize_layout_child(e,t,i)).filter(e=>e));const o=e;return null!=o.activeItemIndex&&(null==o.content||o.activeItemIndex>=o.content.length)&&(o.activeItemIndex=void 0),e}extract_components(e,t=new Map){for(const i of e)"componentName"in i&&t.set(i.componentName,i),i.content&&this.extract_components(i.content,t);return t}to_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.to_persisted_item_config(e.content)}))}from_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.from_persisted_item_config(e.content),isClosable:"component"!==e.type&&void 0}))}}var $s=i("6cU9");class As extends ze.a{constructor(e){const t=new _t({text:"New quest",icon_left:u.a.NewFile,items:[s.b.I],to_label:e=>`Episode ${s.b[e]}`}),i=new $s.a({icon_left:u.a.File,text:"Open file...",accept:".bin, .dat, .qst",multiple:!0,tooltip:"Open a quest file (Ctrl-O)"}),o=new tt.a({text:"Save as...",icon_left:u.a.Save,tooltip:"Save this quest to new file (Ctrl-Shift-S)"}),n=new tt.a({text:"Undo",icon_left:u.a.Undo,tooltip:In.first_undo.map(e=>(e?`Undo "${e.description}"`:"Nothing to undo")+" (Ctrl-Z)")}),r=new tt.a({text:"Redo",icon_left:u.a.Redo,tooltip:In.first_redo.map(e=>(e?`Redo "${e.description}"`:"Nothing to redo")+" (Ctrl-Shift-Z)")}),a=new cn.a({items:e.areas,to_label:({label:e})=>e}),d=new tt.a({text:"Debug",icon_left:u.a.Play,tooltip:"Debug the current quest in a virtual machine (F5)"}),c=new tt.a({text:"Continue",icon_left:u.a.SquareArrowRight,tooltip:"Resume execution (F6)"}),l=new tt.a({text:"Step over",icon_left:u.a.LongArrowRight,tooltip:"Execute the next line and step over any function calls (F8)"}),_=new tt.a({text:"Step into",icon_left:u.a.LevelDown,tooltip:"Execute the next line and step inside any function calls (F7)"}),v=new tt.a({text:"Step out",icon_left:u.a.LevelUp,tooltip:"Execute until outside of current call frame (Shift-F8)"}),h=new tt.a({text:"Stop",icon_left:u.a.Stop,tooltip:"Stop execution (Shift-F5)"}),p=[t,i,o,n,r,a];e.vm_feature_active&&p.push(d,c,l,_,v,h),super(...p),this.disposables(t.chosen.observe(({value:t})=>e.create_new_quest(t)),i.files.observe(({value:t})=>e.parse_files(t)),o.click.observe(e.save_as),o.enabled.bind_to(e.can_save),n.click.observe(()=>In.undo()),n.enabled.bind_to(e.can_undo),r.click.observe(()=>In.redo()),r.enabled.bind_to(e.can_redo),a.selected.bind_to(e.current_area),a.selected.observe(({value:t})=>e.set_area(t)),a.enabled.bind_to(e.can_select_area),d.click.observe(e.debug),d.enabled.bind_to(e.can_debug),c.click.observe(e.resume),c.enabled.bind_to(e.can_step),l.click.observe(e.step_over),l.enabled.bind_to(e.can_step),_.click.observe(e.step_in),_.enabled.bind_to(e.can_step),v.click.observe(e.step_out),v.enabled.bind_to(e.can_step),h.click.observe(e.stop),h.enabled.bind_to(e.can_stop)),this.finalize_construction()}}var Hs=i("mKaR");const Gs=X.c.get("quest_editor/model/QuestModel");class Ks{constructor(e,t,i,o,n,r,a,d,c,l,_,u,v,h){this.area_store=e,this._id=Object(M.e)(0),this._language=Object(M.e)(0),this._name=Object(M.e)(""),this._short_description=Object(M.e)(""),this._long_description=Object(M.e)(""),this._area_variants=Object(M.c)(),this.id=this._id,this.language=this._language,this.name=this._name,this.short_description=this._short_description,this.long_description=this._long_description,this.area_variants=this._area_variants,this.update_area_variants=()=>{const e=new Map;for(const t of this.entities_per_area.val.keys())try{e.set(t,this.area_store.get_variant(this.episode,t,0))}catch(e){Gs.warn(e)}for(const[t,i]of this.map_designations.val)try{e.set(t,this.area_store.get_variant(this.episode,t,i))}catch(e){Gs.warn(e)}this._area_variants.val=[...e.values()]},Object(s.c)(a),Object(U.f)(d,"map_designations"),Object(U.j)(c,"objs"),Object(U.j)(l,"npcs"),Object(U.f)(_,"event_dags"),Object(U.j)(u,"dat_unknowns"),Object(U.j)(v,"object_code"),Object(U.j)(h,"shop_items"),this.set_id(t),this.set_language(i),this.set_name(o),this.set_short_description(n),this.set_long_description(r),this.episode=a,this._map_designations=Object(M.e)(d),this.map_designations=this._map_designations,this._objects=Object(M.c)(void 0,...c),this.objects=this._objects,this._npcs=Object(M.c)(void 0,...l),this.npcs=this._npcs,this.event_dags=_,this.dat_unknowns=u,this.object_code=v,this.shop_items=h,this.entities_per_area=Object(M.d)((e,t)=>{const i=new Map;for(const t of e)i.set(t.area_id,(i.get(t.area_id)||0)+1);for(const e of t)i.set(e.area_id,(i.get(e.area_id)||0)+1);return i},this.npcs,this.objects),this.entities_per_area.observe(this.update_area_variants,{call_now:!0}),this.map_designations.observe(this.update_area_variants,{call_now:!0})}set_id(e){return Object(U.d)(e>=0,`id should be greater than or equal to 0, was ${e}.`),this._id.val=e,this}set_language(e){return Object(U.d)(e>=0,`language should be greater than or equal to 0, was ${e}.`),this._language.val=e,this}set_name(e){return Object(U.d)(e.length<=32,`name can't be longer than 32 characters, got "${e}".`),this._name.val=e,this}set_short_description(e){return Object(U.d)(e.length<=128,`short_description can't be longer than 128 characters, got "${e}".`),this._short_description.val=e,this}set_long_description(e){return Object(U.d)(e.length<=288,`long_description can't be longer than 288 characters, got "${e}".`),this._long_description.val=e,this}set_map_designations(e){return this._map_designations.val=e,this}add_entity(e){if(e instanceof me)this.add_object(e);else{if(!(e instanceof Y))throw new Error(`${C(e.type)} not supported.`);this.add_npc(e)}}add_object(e){this._objects.push(e)}add_npc(e){this._npcs.push(e)}remove_entity(e){if(e instanceof me)this._objects.remove(e);else{if(!(e instanceof Y))throw new Error(`${C(e.type)} not supported.`);this._npcs.remove(e)}}insert_event(e,t,i,o){const n=t.wave.area_id.val;let s=this.event_dags.get(n);s||(s=new it(n),this.event_dags.set(n,s)),s.insert_event(e,t,i,o)}get_event_dag_or_create(e){let t=this.event_dags.get(e);return t||(t=new it(e),this.event_dags.set(e,t)),t}add_event(e,t,i){const o=e.wave.area_id.val;let n=this.event_dags.get(o);n||(n=new it(o),this.event_dags.set(o,n)),n.add_event(e,t,i)}remove_event(e,t){for(const e of this.npcs)e.wave.val===t.wave&&e.set_wave(void 0);e.remove_event(t)}}var Ys;!function(e){e[e.Int=0]="Int",e[e.Float=1]="Float",e[e.InvalidNumber=2]="InvalidNumber",e[e.Register=3]="Register",e[e.Label=4]="Label",e[e.CodeSection=5]="CodeSection",e[e.DataSection=6]="DataSection",e[e.StringSection=7]="StringSection",e[e.InvalidSection=8]="InvalidSection",e[e.String=9]="String",e[e.UnterminatedString=10]="UnterminatedString",e[e.Ident=11]="Ident",e[e.InvalidIdent=12]="InvalidIdent",e[e.ArgSeparator=13]="ArgSeparator"}(Ys||(Ys={}));class Qs{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(e){this.line=e,this.index=0,this._mark=0;const t=[];for(;this.has_next();){const e=this.peek();let i;if("/"===e){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(e)?this.skip():(/[-\d]/.test(e)?i=this.tokenize_number_or_label():","===e?(i={type:Ys.ArgSeparator,col:this.col,len:1},this.skip()):i="."===e?this.tokenize_section():'"'===e?this.tokenize_string():"r"===e?this.tokenize_register_or_ident():this.tokenize_ident(),t.push(i))}return t}has_next(){return this.index!]*$/.test(t)?Ys.Ident:Ys.InvalidIdent;return i===Ys.Ident?{type:i,col:e,len:this.marked_len(),value:t}:{type:i,col:e,len:this.marked_len()}}}const Zs=X.c.get("quest_editor/scripting/assembly");class Js{constructor(e,t){this.assembly=e,this.manual_stack=t,this.lexer=new Qs,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const e of this.assembly){if(this.tokens=this.lexer.tokenize_line(e),this.tokens.length>0){const e=this.tokens.shift();let t=!1;switch(e.type){case Ys.Label:this.parse_label(e),t=!0;break;case Ys.CodeSection:case Ys.DataSection:case Ys.StringSection:this.parse_section(e);break;case Ys.Int:this.section===Bo.Data?this.parse_bytes(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.String:this.section===Bo.String?this.parse_string(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.Ident:this.section===Bo.Instructions?this.parse_instruction(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.InvalidSection:this.add_error({col:e.col,length:e.len,message:"Invalid section type."});break;case Ys.InvalidIdent:this.add_error({col:e.col,length:e.len,message:"Invalid identifier."});break;default:this.add_error({col:e.col,length:e.len,message:"Unexpected token."})}this.prev_line_had_label=t}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(e,t,i,o,n,s){if(this.segment)this.segment.type===Bo.Instructions?this.segment.instructions.push(Po(e,t,{mnemonic:o&&{line_no:this.line_no,col:o.col,len:o.len},args:n.map(e=>({line_no:this.line_no,col:e.col,len:e.len})),stack_args:s.map((e,t)=>({line_no:this.line_no,col:e.col,len:e.len,value:i[t].value}))})):Zs.error(`Line ${this.line_no}: Expected instructions segment.`);else{const e={labels:[],type:Bo.Instructions,instructions:[],asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_bytes(e){if(this.segment)if(this.segment.type===Bo.Data){const t=new ArrayBuffer(this.segment.data.byteLength+e.length),i=new Uint8Array(t);i.set(new Uint8Array(this.segment.data)),i.set(new Uint8Array(e),this.segment.data.byteLength),this.segment.data=t}else Zs.error(`Line ${this.line_no}: Expected data segment.`);else{const t={labels:[],type:Bo.Data,data:new Uint8Array(e).buffer,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_string(e){if(this.segment)this.segment.type===Bo.String?this.segment.value+=e:Zs.error(`Line ${this.line_no}: Expected string segment.`);else{const t={labels:[],type:Bo.String,value:e,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_error({col:e,length:t,message:i}){this.errors.push({line_no:this.line_no,col:e,length:t,message:i})}add_warning({col:e,length:t,message:i}){this.warnings.push({line_no:this.line_no,col:e,length:t,message:i})}parse_label({col:e,len:t,value:i}){this.labels.has(i)&&this.add_error({col:e,length:t,message:"Duplicate label."}),this.labels.add(i);const o=this.tokens.shift(),n={line_no:this.line_no,col:e,len:t};if(this.prev_line_had_label){const e=this.object_code[this.object_code.length-1];e.labels.push(i),e.asm.labels.push(n)}switch(this.section){case Bo.Instructions:this.prev_line_had_label||(this.segment={type:Bo.Instructions,labels:[i],instructions:[],asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.Ident?this.parse_instruction(o):this.add_error({col:o.col,length:o.len,message:"Expected opcode mnemonic."}));break;case Bo.Data:this.prev_line_had_label||(this.segment={type:Bo.Data,labels:[i],data:new ArrayBuffer(0),asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.Int?this.parse_bytes(o):this.add_error({col:o.col,length:o.len,message:"Expected bytes."}));break;case Bo.String:this.prev_line_had_label||(this.segment={type:Bo.String,labels:[i],value:"",asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.String?this.parse_string(o):this.add_error({col:o.col,length:o.len,message:"Expected a string."}))}}parse_section({type:e,col:t,len:i}){let o;switch(e){case Ys.CodeSection:o=Bo.Instructions;break;case Ys.DataSection:o=Bo.Data;break;case Ys.StringSection:o=Bo.String}this.section!==o||this.first_section_marker||this.add_warning({col:t,length:i,message:"Unnecessary section marker."}),this.section=o,this.first_section_marker=!1;const n=this.tokens.shift();n&&this.add_error({col:n.col,length:n.len,message:"Unexpected token."})}parse_instruction(e){const{col:t,len:i,value:o}=e,n=Ft.get(o);if(n){const i=-1!==n.params.findIndex(e=>e.type.kind===ft.ILabelVar||e.type.kind===ft.RegRefVar),o=this.manual_stack&&n.stack===Mt.Pop?0:n.params.length;let s=0;for(const e of this.tokens)e.type!==Ys.ArgSeparator&&s++;const r=this.tokens[this.tokens.length-1],a=r?r.col+r.len-t:0,d=[],c=[];if(!i&&s!==o)return void this.add_error({col:t,length:a,message:`Expected ${o} argument${1===o?"":"s"}, got ${s}.`});if(i&&sd?this.add_error({col:n,length:s,message:`${r}-Bit integer can't be greater than ${d}.`}):i.push([{value:o,size:e},t])}parse_register(e,t){const{col:i,len:o,value:n}=e;n>255?this.add_error({col:i,length:o,message:"Invalid register reference, expected r0-r255."}):t.push([{value:n,size:1},e])}parse_bytes(e){const t=[];let i=e,o=0;for(;i.type===Ys.Int&&(i.value<0?this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be less than 0."}):i.value>255&&this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be greater than 255."}),t.push(i.value),o"))}}function Xs(e,t){if(t===s.b.II)throw new Error("Episode II not yet supported.");if(t===s.b.IV)throw new Error("Episode IV not yet supported.");return new Ks(e,0,0,"Untitled","Created with phantasmal.world.","Created with phantasmal.world.",t,(new Map).set(0,0),[new me(w.MenuActivation,16384,0,0,10,new y.Vector3(-16.313568115234375,3,-579.5118408203125),N(.0009587526218325454,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365279104]]),[[2,0,0,0,0,0],[0,0]]),new me(w.MenuActivation,16385,0,0,10,new y.Vector3(-393.07318115234375,10,-12.964752197265625),N(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279264]]),[[2,0,1,0,0,0],[0,0]]),new me(w.MenuActivation,16386,0,0,10,new y.Vector3(-458.60699462890625,10,-51.270660400390625),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365279424]]),[[2,0,2,0,0,0],[0,0]]),new me(w.MenuActivation,16387,0,0,10,new y.Vector3(-430.19696044921875,10,-24.490447998046875),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365279584]]),[[2,0,3,0,0,0],[0,0]]),new me(w.PlayerSet,16388,0,0,10,new y.Vector3(.995330810546875,0,-37.0010986328125),N(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279744]]),[[2,0,4,0,0,0],[0,0]]),new me(w.PlayerSet,16389,0,0,10,new y.Vector3(3.0009307861328125,0,-23.99688720703125),N(0,4.859725289544806,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279904]]),[[2,0,5,0,0,0],[0,0]]),new me(w.PlayerSet,16390,0,0,10,new y.Vector3(2.0015106201171875,0,-50.00386047363281),N(0,4.565196484117848,0),new Map([["property_0",2.000002384185791],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365280064]]),[[2,0,6,0,0,0],[0,0]]),new me(w.PlayerSet,16391,0,0,10,new y.Vector3(4.9973907470703125,0,-61.99664306640625),N(0,4.368843947166543,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",65536],["property_4",10],["property_5",0],["property_6",2365280224]]),[[2,0,7,0,0,0],[0,0]]),new me(w.MainRagolTeleporter,18264,0,0,10,new y.Vector3(132.00314331054688,1.000000238418579,-265.002197265625),N(0,.49088134237826325,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365227216]]),[[0,0,87,7,0,0],[0,0]]),new me(w.PrincipalWarp,16393,0,0,10,new y.Vector3(-228,0,-2020.99951171875),N(0,2.9452880542695796,0),new Map([["property_0",-10.000004768371582],["property_1",0],["property_2",-30.000030517578125],["property_3",0],["property_4",65536],["property_5",65536],["property_6",2365280688]]),[[2,0,9,0,0,0],[0,0]]),new me(w.MenuActivation,16394,0,0,10,new y.Vector3(-41.000030517578125,0,42.37322998046875),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",4],["property_4",0],["property_5",0],["property_6",2365280992]]),[[2,0,10,0,0,0],[1,0]]),new me(w.MenuActivation,16395,0,0,10,new y.Vector3(-479.21673583984375,8.781256675720215,-322.465576171875),N(6.28328118244177,.0009587526218325454,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",5],["property_4",0],["property_5",0],["property_6",2365281152]]),[[2,0,11,0,0,0],[0,0]]),new me(w.PrincipalWarp,16396,0,0,10,new y.Vector3(-228,0,-351.0015869140625),N(0,0,0),new Map([["property_0",10.000006675720215],["property_1",0],["property_2",-1760.0010986328125],["property_3",32768],["property_4",0],["property_5",0],["property_6",2365281312]]),[[2,0,12,0,0,0],[0,0]]),new me(w.TelepipeLocation,16397,0,0,10,new y.Vector3(-561.88232421875,0,-406.8829345703125),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365281616]]),[[2,0,13,0,0,0],[0,0]]),new me(w.TelepipeLocation,16398,0,0,10,new y.Vector3(-547.8557739257812,0,-444.8822326660156),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365281808]]),[[2,0,14,0,0,0],[0,0]]),new me(w.TelepipeLocation,16399,0,0,10,new y.Vector3(-486.441650390625,0,-497.4501647949219),N(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365282e3]]),[[2,0,15,0,0,0],[0,0]]),new me(w.TelepipeLocation,16400,0,0,10,new y.Vector3(-522.4052734375,0,-474.1882629394531),N(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365282192]]),[[2,0,16,0,0,0],[0,0]]),new me(w.MedicalCenterDoor,16401,0,0,10,new y.Vector3(-34.49853515625,0,-384.4951171875),N(0,5.497871034636549,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282384]]),[[2,0,17,0,0,0],[0,0]]),new me(w.ShopDoor,16402,0,0,10,new y.Vector3(-393.0031433105469,0,-143.49981689453125),N(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282640]]),[[2,0,18,0,0,0],[0,0]]),new me(w.MenuActivation,16403,0,0,10,new y.Vector3(-355.17462158203125,0,-43.15193176269531),N(0,0,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",6],["property_4",0],["property_5",0],["property_6",2365282896]]),[[2,0,19,0,0,0],[0,0]]),new me(w.HuntersGuildDoor,16404,0,0,10,new y.Vector3(-43.00239562988281,0,-118.00120544433594),N(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283056]]),[[2,0,20,0,0,0],[0,0]]),new me(w.TeleporterDoor,16405,0,0,10,new y.Vector3(26.000823974609375,0,-265.99810791015625),N(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283312]]),[[2,0,21,0,0,0],[0,0]]),new me(w.PlayerSet,16406,0,0,10,new y.Vector3(57.81005859375,0,-268.5472412109375),N(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283568]]),[[2,0,22,0,0,0],[0,0]]),new me(w.PlayerSet,16407,0,0,10,new y.Vector3(66.769287109375,0,-252.3748779296875),N(0,4.712460886831327,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283728]]),[[2,0,23,0,0,0],[0,0]]),new me(w.PlayerSet,16408,0,0,10,new y.Vector3(67.36819458007812,0,-284.9297180175781),N(0,4.712460886831327,0),new Map([["property_0",2.000000476837158],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283888]]),[[2,0,24,0,0,0],[0,0]]),new me(w.PlayerSet,16409,0,0,10,new y.Vector3(77.10488891601562,0,-269.2830505371094),N(0,4.712460886831327,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365284048]]),[[2,0,25,0,0,0],[0,0]])],[new Y(I.c.GuildLady,29,1011.0010986328125,void 0,0,850,0,0,10,new y.Vector3(-49.0010986328125,0,50.996429443359375),N(0,2.3562304434156633,0),new y.Vector3(0,0,0),[[0,0,7,86,0,0,0,0,23,87],[128,238,223,176]]),new Y(I.c.FemaleFat,4,1016.0010986328125,void 0,0,100,1,0,20,new y.Vector3(167.99769592285156,0,83.99686431884766),N(0,3.927050739026106,0),new y.Vector3(24.000009536743164,0,0),[[0,0,7,88,0,0,0,0,23,89],[128,238,232,48]]),new Y(I.c.MaleDwarf,10,1015.0010986328125,void 0,0,90,1,0,20,new y.Vector3(156.0028839111328,0,-49.99967575073242),N(0,5.497871034636549,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,89,0,0,0,0,23,90],[128,238,236,176]]),new Y(I.c.RedSoldier,26,1020.0010986328125,void 0,0,130,0,0,20,new y.Vector3(237.9988250732422,0,-14.0001220703125),N(0,5.497871034636549,0),new y.Vector3(0,0,0),[[0,0,7,90,0,0,0,0,23,91],[128,238,241,48]]),new Y(I.c.BlueSoldier,25,1019.0010986328125,void 0,0,120,0,0,20,new y.Vector3(238.00379943847656,0,63.00413513183594),N(0,3.927050739026106,0),new y.Vector3(0,0,0),[[0,0,7,91,0,0,0,0,23,92],[128,238,245,176]]),new Y(I.c.FemaleMacho,5,1014.0010986328125,void 0,0,80,1,0,20,new y.Vector3(-2.001882553100586,0,35.0036506652832),N(0,3.141640591220885,0),new y.Vector3(26.000009536743164,0,0),[[0,0,7,92,0,0,0,0,23,93],[128,238,250,48]]),new Y(I.c.Scientist,30,1013.0010986328125,void 0,0,70,1,0,20,new y.Vector3(-147.0000457763672,0,-7.996537208557129),N(0,2.577127047485882,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,93,0,0,0,0,23,94],[128,238,254,176]]),new Y(I.c.MaleOld,13,1012.0010986328125,void 0,0,60,1,0,20,new y.Vector3(-219.99710083007812,0,-100.0008316040039),N(0,0,0),new y.Vector3(30.000011444091797,0,0),[[0,0,7,94,0,0,0,0,23,95],[128,239,3,48]]),new Y(I.c.GuildLady,29,1010.0010986328125,void 0,0,840,0,0,20,new y.Vector3(-262.5099792480469,0,-24.53999900817871),N(0,1.963525369513053,0),new y.Vector3(0,0,0),[[0,0,7,95,0,0,0,0,23,106],[128,239,100,192]]),new Y(I.c.Tekker,28,1009,void 0,0,830,0,0,30,new y.Vector3(-43.70983123779297,2.5999999046325684,-52.78248596191406),N(0,.7854101478052212,0),new y.Vector3(0,0,0),[[0,0,7,97,0,0,0,0,23,98],[128,239,16,176]]),new Y(I.c.MaleMacho,12,1006,void 0,0,800,0,0,30,new y.Vector3(.33990478515625,2.5999999046325684,-84.71995544433594),N(0,0,0),new y.Vector3(0,0,0),[[0,0,7,98,0,0,0,0,23,99],[128,239,21,48]]),new Y(I.c.FemaleMacho,5,1008,void 0,0,820,0,0,30,new y.Vector3(43.87113952636719,2.5999996662139893,-74.80299377441406),new y.Euler(0,-.5645135437350027,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,99,0,0,0,0,23,100],[128,239,25,176]]),new Y(I.c.MaleFat,11,1007.0010986328125,void 0,0,810,0,0,30,new y.Vector3(75.88380432128906,2.5999996662139893,-42.69328308105469),new y.Euler(0,-1.0308508189943528,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,100,0,0,0,0,23,101],[128,239,30,48]]),new Y(I.c.FemaleTall,7,1021.0010986328125,void 0,0,140,1,0,30,new y.Vector3(16.003997802734375,0,5.995697021484375),new y.Euler(0,-1.1781152217078317,0,"ZXY"),new y.Vector3(22.000009536743164,0,0),[[0,0,7,101,0,0,0,0,23,102],[128,239,34,176]]),new Y(I.c.Nurse,31,1017,void 0,0,860,0,0,40,new y.Vector3(.3097381591796875,3,-105.3865966796875),N(0,0,0),new y.Vector3(0,0,0),[[0,0,7,102,0,0,0,0,23,103],[128,239,39,48]]),new Y(I.c.Nurse,31,1018.0010986328125,void 0,0,110,1,0,40,new y.Vector3(53.499176025390625,0,-26.496688842773438),N(0,5.497871034636549,0),new y.Vector3(18.000009536743164,0,0),[[0,0,7,103,0,0,0,0,23,104],[128,239,43,176]])],new Map,[],function(e,t=!1){Zs.trace("assemble start");const i=new Js(e,t).assemble();return Zs.trace(`assemble end with ${i.warnings.length} warnings and ${i.errors.length} errors.`),i}(".code\n\n0:\n set_episode 0\n set_floor_handler 0, 150\n bb_map_designate 0, 0, 0, 0\n ret\n150:\n leti r60, 237\n leti r61, 0\n leti r62, 333\n leti r63, -15\n p_setpos 0, r60\n leti r60, 255\n leti r61, 0\n leti r62, 338\n leti r63, -43\n p_setpos 1, r60\n leti r60, 222\n leti r61, 0\n leti r62, 322\n leti r63, 25\n p_setpos 2, r60\n leti r60, 248\n leti r61, 0\n leti r62, 323\n leti r63, -20\n p_setpos 3, r60\n ret".split("\n")).object_code,[])}var er=i("iPoI"),tr=i("9dYx");class ir extends tr.a{constructor(e,t,i=0,o=e.size-i){if(i<0||i>e.size)throw new Error(`Offset ${i} is out of bounds.`);if(o<0||i+o>e.size)throw new Error(`Size ${o} is out of bounds.`);super(t,i),this.buffer=e,this._size=o}get size(){return this._size}set size(e){e>this._size?this.ensure_size(e-this.position):this._size=e}get backing_buffer(){return this.buffer.backing_buffer}get dv(){return this.buffer.view}take(e){this.check_size("size",e,e);const t=this.offset+this.position,i=new ir(this.buffer,this.endianness,t,e);return this._position+=e,i}ensure_size(e,t=this.position){const i=t+e-this._size;i>0&&(this._size+=i,this.buffer.sizethis.capacity){let t=this.capacity||e;do{t*=2}while(t=n;t--){let n=e.position,s=t,r=0;for(;n+3=o&&(i=t,o=r,r>=255))break}o<3?t.add_u8(e.u8()):(t.copy(i-e.position,o),e.seek(o))}return t.finalize()}class sr{constructor(e,t){this.flags=0,this.flag_bits_left=0,this.flag_offset=0,this.output=new ir(new or(e),t)}add_u8(e){this.write_control_bit(1),this.write_u8(e)}copy(e,t){e>-256&&t<=5?this.short_copy(e,t):this.long_copy(e,t)}finalize(){this.write_control_bit(0),this.write_control_bit(1),this.flags>>>=this.flag_bits_left;const e=this.output.position;return this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e),this.write_u8(0),this.write_u8(0),this.output.seek_start(0)}write_control_bit(e){if(0==this.flag_bits_left--){const e=this.output.position;this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e).write_u8(0),this.flag_offset=e,this.flag_bits_left=7}this.flags>>>=1,e&&(this.flags|=128)}write_u8(e){this.output.write_u8(e)}short_copy(e,t){t-=2,this.write_control_bit(0),this.write_control_bit(0),this.write_control_bit(t>>>1&1),this.write_control_bit(1&t),this.write_u8(255&e)}long_copy(e,t){t<=9?(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248|t-2&7),this.write_u8(e>>5&255)):(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248),this.write_u8(e>>5&255),this.write_u8(t-1))}}const rr=X.c.get("core/data_formats/compression/prs/decompress");function ar(e){const t=new dr(e);for(;;)if(1===t.read_flag_bit())t.copy_u8();else{let e,i;if(0===t.read_flag_bit())e=t.read_flag_bit()<<1,e|=t.read_flag_bit(),e+=2,i=t.read_u8()-256;else{if(i=t.read_u16(),0===i)break;e=7&i,i>>>=3,0===e?(e=t.read_u8(),e+=1):e+=2,i-=8192}t.offset_copy(i,e)}return t.dst.seek_start(0)}class dr{constructor(e){this.src=e,this.dst=new ir(new or(Math.floor(1.5*e.size)),e.endianness),this.flags=0,this.flag_bits_left=0}read_flag_bit(){0===this.flag_bits_left&&(this.flags=this.read_u8(),this.flag_bits_left=8);const e=1&this.flags;return this.flags>>>=1,this.flag_bits_left-=1,e}copy_u8(){this.dst.write_u8(this.read_u8())}read_u8(){return this.src.u8()}read_u16(){return this.src.u16()}offset_copy(e,t){(e<-8192||e>0)&&rr.error(`offset was ${e}, should be between -8192 and 0.`),(t<1||t>256)&&rr.error(`length was ${t}, should be between 1 and 256.`);const i=Math.min(-e,t);this.dst.seek(e);const o=this.dst.take(i);this.dst.seek(-e-i);for(let e=0;ee+t.total_size,0)),s=new ir(n,zo.a.Little);!function(e,t){const i=Object(Vs.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],n=o.length*_r;e.write_u32(1),e.write_u32(n+16),e.write_u32(t),e.write_u32(n);for(const t of o)Object(U.d)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.d)(6===t.unknown[0].length,()=>`unknown[0] should be of length 6, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.id),e.write_u16(t.group_id),e.write_u16(t.section_id),Object(U.d)(2===t.unknown[1].length,()=>`unknown[1] should be of length 2, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1]),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),Object(U.d)(7===t.properties.length,()=>`properties should be of length 7, was ${t.properties.length}`),e.write_f32(t.properties[0]),e.write_f32(t.properties[1]),e.write_f32(t.properties[2]),e.write_u32(t.properties[3]),e.write_u32(t.properties[4]),e.write_u32(t.properties[5]),e.write_u32(t.properties[6])}}(s,e),function(e,t){const i=Object(Vs.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],n=o.length*ur;e.write_u32(2),e.write_u32(n+16),e.write_u32(t),e.write_u32(n);for(const t of o)Object(U.d)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.d)(10===t.unknown[0].length,()=>`unknown[0] should be of length 10, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u32(t.wave2),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),e.write_vec3_f32(t.scale),e.write_f32(t.npc_id),e.write_f32(t.script_label),e.write_u32(t.roaming),Object(U.d)(4===t.unknown[1].length,()=>`unknown[1] should be of length 4, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1])}}(s,t),function(e,t){const i=Object(Vs.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t];e.write_u32(3);const n=e.position;e.write_u32(0),e.write_u32(t);const s=e.position;e.write_u32(0);const r=e.position,a=r+16+20*o.length;e.size=Math.max(a,e.size),e.write_u32(a-r),e.write_u32(16),e.write_u32(o.length),e.write_u32(0);let d=0;for(const t of o){e.write_u32(t.id),e.write_u32(65536),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u16(t.delay),e.write_u16(t.unknown),e.write_u32(d);const i=e.position;e.seek_start(a+d);for(const i of t.actions)switch(e.write_u8(i.type),i.type){case vr.SpawnNpcs:e.write_u16(i.section_id),e.write_u16(i.appear_flag);break;case vr.Unlock:case vr.Lock:e.write_u16(i.door_id);break;case vr.TriggerEvent:e.write_u32(i.event_id);break;default:throw new Error(`Unknown event action type ${i.type}.`)}e.write_u8(1),d=e.position-a,e.seek_start(i)}for(e.seek_start(a+d);(e.position-a)%4!=0;)e.write_u8(255);const c=e.position;e.seek_start(n),e.write_u32(c-r+16),e.seek_start(s),e.write_u32(c-r),e.seek_start(c)}}(s,i);for(const e of o)s.write_u32(e.entity_type),s.write_u32(e.total_size),s.write_u32(e.area_id),s.write_u32(e.entities_size),s.write_u8_array(e.data);return s.write_u32(0),s.write_u32(0),s.write_u32(0),s.write_u32(0),n}function gr(e,t,i){const o=Math.floor(e.size/_r);for(let n=0;n=l;){const r=e.position;let a;switch(t){case hr.DC:case hr.GC:e.seek(1),a=e.u8(),e.seek(2);break;case hr.PC:e.seek(3),a=e.u8();break;case hr.BB:e.seek(4),a=e.u32()}const d=e.string_ascii(16,!0,!0);let u=c.get(d);if(!u){const e=i.get(d);u={name:d,expected_size:null===(o=e)||void 0===o?void 0:o.size,cursor:new ir(new or((s=null===(n=e)||void 0===n?void 0:n.size,null!=s?s:10240)),zo.a.Little),chunk_nos:new Set},c.set(d,u)}u.chunk_nos.has(a)?wr.warn(`File chunk number ${a} of file ${d} was already encountered, overwriting previous chunk.`):u.chunk_nos.add(a);let v=e.seek(jr).u32();e.seek(-jr-4),v>jr&&(wr.warn(`Data segment size of ${v} is larger than expected maximum size, reading just ${jr} bytes.`),v=jr);const h=e.take(v),p=a*jr;if(u.cursor.size=Math.max(p+v,u.cursor.size),u.cursor.seek_start(p).write_cursor(h),e.seek(jr+_-h.size),e.position!==r+l)throw new Error(`Read ${e.position-r} file chunk message bytes instead of expected ${l}.`)}e.bytes_left&&wr.warn(`${e.bytes_left} Bytes left in file.`);for(const e of c.values()){e.cursor.seek_start(0),e.chunk_nos=new Set(Array.from(e.chunk_nos.values()).sort((e,t)=>e-t)),null!=e.expected_size&&e.cursor.size!==e.expected_size&&wr.warn(`File ${e.name} has an actual size of ${e.cursor.size} instead of the expected size ${e.expected_size}.`);const t=Math.max(e.cursor.size,null!=(r=e.expected_size)?r:0),i=Math.ceil(t/jr);for(let t=0;t[e.file_name,e])))}}function xr(e){const t=e.files,i=t.map(e=>88+1056*Math.ceil(e.data.byteLength/1024)).reduce((e,t)=>e+t),o=new ArrayBuffer(i),n=new No.a(o,zo.a.Little);if(function(e,t){for(const i of t){if(i.filename.length>15)throw new Error(`File ${i.filename} has a name longer than 15 characters.`);e.write_u16(88),e.write_u16(68),e.write_u16(i.id||0);for(let t=0;t<38;++t)e.write_u8(0);let t;if(e.write_string_ascii(i.filename,16),e.write_u32(i.data.byteLength),null==i.quest_name){const e=i.filename.lastIndexOf(".");t=-1===e?i.filename+"_j":i.filename.slice(0,e)+"_j"+i.filename.slice(e)}else t=i.quest_name;if(t.length>24)throw Error(`File ${i.filename} has a file_name_2 length (${t}) longer than 24 characters.`);e.write_string_ascii(t,24)}}(n,t),function(e,t){const i=t.map(e=>({no:0,data:new No.a(e.data,zo.a.Little),name:e.filename}));let o=0;for(;o0}var Cr;!function(e){e[e.None=0]="None",e[e.Return=1]="Return",e[e.Jump=2]="Jump",e[e.ConditionalJump=3]="ConditionalJump",e[e.Call=4]="Call"}(Cr||(Cr={}));class Or{constructor(e,t,i,o,n){this.from=[],this.to=[],this.segment=e,this.start=t,this.end=i,this.branch_type=o,this.branch_labels=n}link_to(e){this.to.includes(e)||(this.to.push(e),e.from.push(this))}index_of_instruction(e){const t=this.segment.instructions.indexOf(e,this.start);return te.value);break;case wi.code:case Kt.code:a=Cr.Call,d=[r.args[0].value];break;case $i.code:a=Cr.Call,d=r.args.slice(1).map(e=>e.value);break;default:if(s===i-1){a=Cr.None,d=[];break}continue}const c=new Or(t,o,s+1,a,d);for(let t=c.start;t{let e=0,t=NaN;return{next:()=>{let i=!0;return ethis.intervals[e].end?(e++,ee+t.end-t.start+1,0)}get(e){for(const{start:t,end:i}of this.intervals){const o=i-t+1;if(ethis.intervals[o].start;)e.end=this.intervals[o].end,o++;this.intervals.splice(t+1,o-t-1),e.end=Math.max(e.end,i.end),t++;continue e}t++}this.intervals.push(i)}return this}to_array(){const e=[];for(const{start:t,end:i}of this.intervals)for(let o=t;o<=i;o++)e.push(o);return e}}const Er=X.c.get("core/data_formats/asm/data_flow_analysis/register_value"),Mr=Dt,Wr=Bt;Math.pow(2,32);function qr(e,t,i){const o=e.get_block_for_instruction(t);return o?function e(t,i,o,n,s){if(++t.iterations>100)return Er.warn("Too many iterations."),(new Br).set_interval(Mr,Wr);for(let r=n-1;r>=o.start;r--){const n=o.segment.instructions[r],a=n.args;switch(n.opcode.code){case Yt.code:if(a[0].value===s)return e(t,new Set(i),o,r,a[1].value);break;case Qt.code:case Zt.code:case Jt.code:case ho.code:if(a[0].value===s)return(new Br).set_value(a[1].value);break;case ei.code:if(a[0].value===s)return(new Br).set_value(1);break;case ti.code:if(a[0].value===s)return(new Br).set_value(0);break;case ii.code:if(a[0].value===s){const n=e(t,new Set(i),o,r,s),a=n.size();return 0===a||1===a&&0===n.get(0)?(new Br).set_value(1):n.has(0)?(new Br).set_interval(0,1):(new Br).set_value(0)}break;case ni.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_add(a[1].value)}break;case ri.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_sub(a[1].value)}break;case di.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_mul(a[1].value)}break;case li.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_div(a[1].value)}break;case co.code:if(a[0].value===s)return(new Br).set_interval(0,1);break;case uo.code:if(a[0].value===s)return(new Br).set_interval(0,2);break;case po.code:if(a[0].value===s)return(new Br).set_interval(0,3);break;case mo.code:if(a[1].value===s){const n=e(t,new Set(i),o,r,a[0].value).min()||0,s=Math.max(e(t,new Set(i),o,r,a[0].value+1).max()||0,n+1);return(new Br).set_interval(n,s-1)}break;case Gi.code:case Ki.code:{const e=a[0].value,t=a[0].value+a[1].value;if(e<=s&&s100)return Vr.warn("Too many iterations."),(new Br).set_interval(zr,Ur);for(let e=n-1;e>=o.start;e--){const i=o.segment.instructions[e];if(i.opcode.stack===Mt.Pop){s+=i.opcode.params.length;continue}const n=i.args;switch(i.opcode.code){case Yi.code:if(0===s)return qr(t.cfg,i,n[0].value);s--;break;case Qi.code:case Zi.code:case Ji.code:if(0===s)return(new Br).set_value(n[0].value);s--;break;case Xi.code:case eo.code:case to.code:if(0===s)return(new Br).set_interval(zr,Ur);s--}}const r=new Br;i.add(o);for(const n of o.from){if(i.has(n)){r.set_interval(zr,Ur);break}r.union(e(t,new Set(i),n,n.end,s))}return r}(new $r(e),new Set,o,o.index_of_instruction(t),i):new Br}class $r{constructor(e){this.cfg=e,this.iterations=0}}const Ar=X.c.get("core/data_formats/parsing/quest/object_code"),Hr=[];function Gr(e,t,i,o,n){return function(e,t,i,o,n){const s=new Map;!function(e,t,i,o,n,s){let r;do{r=o.size;for(const[r,a]of i)Yr(o,t,e,r,a,n,s);const a=[...o.entries()].filter(([,e])=>e.type===Bo.Instructions).sort(([e],[t])=>e-t).map(([,e])=>e),d=Lr.create(a);i=new Map;for(const e of a)for(const t of e.instructions)for(let e=0;er)}(e,t,i.reduce((e,t)=>e.set(t,Bo.Instructions),new Map),s,o,n);const r=[];let a=0;for(;aa){n=e.offset;break}}if(e.seek_start(a),Qr(s,e,n,o||[]),i=s.get(a),n<=a){Ar.error(`Next offset ${n} was smaller than or equal to current offset ${a}.`);break}if(!i){Ar.error(`Couldn't create segment for offset ${a}.`);break}}switch(r.push(i),i.type){case Bo.Instructions:for(const e of i.instructions)a+=e.size;break;case Bo.Data:a+=i.data.byteLength;break;case Bo.String:a+=4*Math.ceil((i.value.length+1)/2);break;default:throw new Error(`${Bo[i.type]} not implemented.`)}}for(const{label:e,offset:i}of t.labels){const t=s.get(i);t?t.labels.includes(e)||(t.labels.push(e),t.labels.sort((e,t)=>e-t)):Ar.warn(`Label ${e} with offset ${i} does not point to anything.`)}if(e.size!==a){const t=`Expected to parse ${e.size} bytes but parsed ${a} instead.`;if(!o)throw new Error(t);Ar.error(t)}return r}(new No.a(e,zo.a.Little),new Jr(t),i,o,n)}function Kr(e,t,i,o,n){if(i.opcode.stack===Mt.Pop){const s=Nr(e,i,i.opcode.params.length-o-1);if(s.size()<=10)for(const e of s){const i=t.get(e);(null==i||Hr[n]>Hr[i])&&t.set(e,n)}}else{const e=i.args[o].value,s=t.get(e);(null==s||Hr[n]>Hr[s])&&t.set(e,n)}}function Yr(e,t,i,o,n,s,r){try{const a=t.get_info(o);if(null==a)return void Ar.warn(`Label ${o} is not registered in the label table.`);const d=e.get(a.offset);let c;if(d){if(d.labels.includes(o)||(d.labels.push(o),d.labels.sort((e,t)=>e-t)),!(Hr[n]>Hr[d.type]))return;c=d.labels}else c=[o];const l=a.next?a.next.offset:i.size;switch(i.seek_start(a.offset),n){case Bo.Instructions:!function(e,t,i,o,n,s,r,a){const d=[],c={type:Bo.Instructions,labels:n,instructions:d,asm:{labels:[]}};e.set(i.position,c);for(;i.position=0;e--){const t=d[e].opcode;if(t.code===Ut.code||t.code===mi.code){o=!1;break}}o&&Yr(e,t,i,s,Bo.Instructions,r,a)}}(e,t,i,l,c,a.next&&a.next.label,s,r);break;case Bo.Data:Qr(e,i,l,c);break;case Bo.String:!function(e,t,i,o,n){const s=t.position,r={type:Bo.String,labels:o,value:n?t.string_ascii(i-s,!0,!0):t.string_utf16(i-s,!0,!0),asm:{labels:[]}};e.set(s,r)}(e,i,l,c,r);break;default:throw new Error(`Segment type ${Bo[n]} not implemented.`)}}catch(e){if(!s)throw e;Ar.error("Couldn't fully parse object code segment.",e)}}function Qr(e,t,i,o){const n=t.position,s={type:Bo.Data,labels:o,data:t.array_buffer(i-n),asm:{labels:[]}};e.set(n,s)}function Zr(e,t,i){const o=[];if(t.stack!==Mt.Pop)for(const n of t.params)switch(n.type.kind){case ft.Byte:o.push(Do(e.u8(),1));break;case ft.Word:o.push(Do(e.u16(),2));break;case ft.DWord:o.push(Do(e.i32(),4));break;case ft.Float:o.push(Do(e.f32(),4));break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:o.push(Do(e.u16(),2));break;case ft.String:{const t=e.position,n=Math.min(4096,e.bytes_left);o.push(Do(i?e.string_ascii(n,!0,!1):e.string_utf16(n,!0,!1),e.position-t))}break;case ft.ILabelVar:{const t=e.u8();o.push(...e.u16_array(t).map(e=>Do(e,2)))}break;case ft.RegRef:case ft.RegTupRef:o.push(Do(e.u8(),1));break;case ft.RegRefVar:{const t=e.u8();o.push(...e.u8_array(t).map(e=>Do(e,1)))}break;default:throw new Error(`Parameter type ${ft[n.type.kind]} not implemented.`)}return o}Hr[Bo.Instructions]=2,Hr[Bo.String]=1,Hr[Bo.Data]=0;class Jr{constructor(e){this.labels=[],this.label_map=new Map,this.offset_map=new Map;for(let t=0;te.offset-t.offset||e.label-t.label);for(let e=0;et.offset));e++)i=void 0;return{offset:t.offset,next:i}}}const Xr=X.c.get("core/data_formats/asm/data_flow_analysis/map_designations");const ea=X.c.get("core/data_formats/parsing/quest");function ta(e,t,i=!1){const o=ar(e),{bin:n,dc_gc_format:r}=function(e){const t=e.u32(),i=e.u32(),o=e.u32();e.seek(4);const n=4652!==t;let s,r;n?(r=e.u16(),s=e.u16()):(s=e.u32(),r=e.u32());const a=n?e.string_ascii(32,!0,!0):e.string_utf16(64,!0,!0),d=n?e.string_ascii(128,!0,!0):e.string_utf16(256,!0,!0),c=n?e.string_ascii(288,!0,!0):e.string_utf16(576,!0,!0);o!==e.size&&cr.warn(`Value ${o} in bin size field does not match actual size ${e.size}.`),e.seek(4);const l=e.u32_array(932),_=Math.floor((e.size-i)/4);e.seek_start(i);const u=e.i32_array(_);return{bin:{quest_id:s,language:r,quest_name:a,short_description:d,long_description:c,object_code:e.seek_start(t).array_buffer(i-t),label_offsets:u,shop_items:l},dc_gc_format:n}}(o),a=function(e){const t=[],i=[],o=[],n=[];for(;e.bytes_left;){const s=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();if(0===s)break;{if(d!==r-16)throw Error(`Malformed DAT file. Expected an entities size of ${r-16}, got ${d}.`);const c=e.take(d);1===s?gr(c,a,t):2===s?br(c,a,i):3===s?fr(c,a,o):n.push({entity_type:s,total_size:r,area_id:a,entities_size:d,data:e.u8_array(d)}),c.bytes_left&&lr.warn(`Read ${c.position} bytes instead of expected ${c.size} for entity type ${s}.`)}}return{objs:t,npcs:i,events:o,unknowns:n}}(ar(t)),d=a.objs.map(e=>{const t=function(e){switch(e){default:return w.Unknown;case 0:return w.PlayerSet;case 1:return w.Particle;case 2:return w.Teleporter;case 3:return w.Warp;case 4:return w.LightCollision;case 5:return w.Item;case 6:return w.EnvSound;case 7:return w.FogCollision;case 8:return w.EventCollision;case 9:return w.CharaCollision;case 10:return w.ElementalTrap;case 11:return w.StatusTrap;case 12:return w.HealTrap;case 13:return w.LargeElementalTrap;case 14:return w.ObjRoomID;case 15:return w.Sensor;case 16:return w.UnknownItem16;case 17:return w.LensFlare;case 18:return w.ScriptCollision;case 19:return w.HealRing;case 20:return w.MapCollision;case 21:return w.ScriptCollisionA;case 22:return w.ItemLight;case 23:return w.RadarCollision;case 24:return w.FogCollisionSW;case 25:return w.BossTeleporter;case 26:return w.ImageBoard;case 27:return w.QuestWarp;case 28:return w.Epilogue;case 29:return w.UnknownItem29;case 30:return w.UnknownItem30;case 31:return w.UnknownItem31;case 32:return w.BoxDetectObject;case 33:return w.SymbolChatObject;case 34:return w.TouchPlateObject;case 35:return w.TargetableObject;case 36:return w.EffectObject;case 37:return w.CountDownObject;case 38:return w.UnknownItem38;case 39:return w.UnknownItem39;case 40:return w.UnknownItem40;case 41:return w.UnknownItem41;case 64:return w.MenuActivation;case 65:return w.TelepipeLocation;case 66:return w.BGMCollision;case 67:return w.MainRagolTeleporter;case 68:return w.LobbyTeleporter;case 69:return w.PrincipalWarp;case 70:return w.ShopDoor;case 71:return w.HuntersGuildDoor;case 72:return w.TeleporterDoor;case 73:return w.MedicalCenterDoor;case 74:return w.Elevator;case 75:return w.EasterEgg;case 76:return w.ValentinesHeart;case 77:return w.ChristmasTree;case 78:return w.ChristmasWreath;case 79:return w.HalloweenPumpkin;case 80:return w.TwentyFirstCentury;case 81:return w.Sonic;case 82:return w.WelcomeBoard;case 83:return w.Firework;case 84:return w.LobbyScreenDoor;case 85:return w.MainRagolTeleporterBattleInNextArea;case 86:return w.LabTeleporterDoor;case 87:return w.Pioneer2InvisibleTouchplate;case 128:return w.ForestDoor;case 129:return w.ForestSwitch;case 130:return w.LaserFence;case 131:return w.LaserSquareFence;case 132:return w.ForestLaserFenceSwitch;case 133:return w.LightRays;case 134:return w.BlueButterfly;case 135:return w.Probe;case 136:return w.RandomTypeBox1;case 137:return w.ForestWeatherStation;case 138:return w.Battery;case 139:return w.ForestConsole;case 140:return w.BlackSlidingDoor;case 141:return w.RicoMessagePod;case 142:return w.EnergyBarrier;case 143:return w.ForestRisingBridge;case 144:return w.SwitchNoneDoor;case 145:return w.EnemyBoxGrey;case 146:return w.FixedTypeBox;case 147:return w.EnemyBoxBrown;case 149:return w.EmptyTypeBox;case 150:return w.LaserFenceEx;case 151:return w.LaserSquareFenceEx;case 192:return w.FloorPanel1;case 193:return w.Caves4ButtonDoor;case 194:return w.CavesNormalDoor;case 195:return w.CavesSmashingPillar;case 196:return w.CavesSign1;case 197:return w.CavesSign2;case 198:return w.CavesSign3;case 199:return w.HexagonalTank;case 200:return w.BrownPlatform;case 201:return w.WarningLightObject;case 203:return w.Rainbow;case 204:return w.FloatingJellyfish;case 205:return w.FloatingDragonfly;case 206:return w.CavesSwitchDoor;case 207:return w.RobotRechargeStation;case 208:return w.CavesCakeShop;case 209:return w.Caves1SmallRedRock;case 210:return w.Caves1MediumRedRock;case 211:return w.Caves1LargeRedRock;case 212:return w.Caves2SmallRock1;case 213:return w.Caves2MediumRock1;case 214:return w.Caves2LargeRock1;case 215:return w.Caves2SmallRock2;case 216:return w.Caves2MediumRock2;case 217:return w.Caves2LargeRock2;case 218:return w.Caves3SmallRock;case 219:return w.Caves3MediumRock;case 220:return w.Caves3LargeRock;case 222:return w.FloorPanel2;case 223:return w.DestructableRockCaves1;case 224:return w.DestructableRockCaves2;case 225:return w.DestructableRockCaves3;case 256:return w.MinesDoor;case 257:return w.FloorPanel3;case 258:return w.MinesSwitchDoor;case 259:return w.LargeCryoTube;case 260:return w.ComputerLikeCalus;case 261:return w.GreenScreenOpeningAndClosing;case 262:return w.FloatingRobot;case 263:return w.FloatingBlueLight;case 264:return w.SelfDestructingObject1;case 265:return w.SelfDestructingObject2;case 266:return w.SelfDestructingObject3;case 267:return w.SparkMachine;case 268:return w.MinesLargeFlashingCrate;case 304:return w.RuinsSeal;case 320:return w.RuinsTeleporter;case 321:return w.RuinsWarpSiteToSite;case 322:return w.RuinsSwitch;case 323:return w.FloorPanel4;case 324:return w.Ruins1Door;case 325:return w.Ruins3Door;case 326:return w.Ruins2Door;case 327:return w.Ruins11ButtonDoor;case 328:return w.Ruins21ButtonDoor;case 329:return w.Ruins31ButtonDoor;case 330:return w.Ruins4ButtonDoor;case 331:return w.Ruins2ButtonDoor;case 332:return w.RuinsSensor;case 333:return w.RuinsFenceSwitch;case 334:return w.RuinsLaserFence4x2;case 335:return w.RuinsLaserFence6x2;case 336:return w.RuinsLaserFence4x4;case 337:return w.RuinsLaserFence6x4;case 338:return w.RuinsPoisonBlob;case 339:return w.RuinsPillarTrap;case 340:return w.PopupTrapNoTech;case 341:return w.RuinsCrystal;case 342:return w.Monument;case 345:return w.RuinsRock1;case 346:return w.RuinsRock2;case 347:return w.RuinsRock3;case 348:return w.RuinsRock4;case 349:return w.RuinsRock5;case 350:return w.RuinsRock6;case 351:return w.RuinsRock7;case 352:return w.Poison;case 353:return w.FixedBoxTypeRuins;case 354:return w.RandomBoxTypeRuins;case 355:return w.EnemyTypeBoxYellow;case 356:return w.EnemyTypeBoxBlue;case 357:return w.EmptyTypeBoxBlue;case 358:return w.DestructableRock;case 359:return w.PopupTrapsTechs;case 368:return w.FlyingWhiteBird;case 369:return w.Tower;case 370:return w.FloatingRocks;case 371:return w.FloatingSoul;case 372:return w.Butterfly;case 384:return w.LobbyGameMenu;case 385:return w.LobbyWarpObject;case 386:return w.Lobby1EventObjectDefaultTree;case 387:return w.UnknownItem387;case 388:return w.UnknownItem388;case 389:return w.UnknownItem389;case 390:return w.LobbyEventObjectStaticPumpkin;case 391:return w.LobbyEventObject3ChristmasWindows;case 392:return w.LobbyEventObjectRedAndWhiteCurtain;case 393:return w.UnknownItem393;case 394:return w.UnknownItem394;case 395:return w.LobbyFishTank;case 396:return w.LobbyEventObjectButterflies;case 400:return w.UnknownItem400;case 401:return w.GreyWallLow;case 402:return w.SpaceshipDoor;case 403:return w.GreyWallHigh;case 416:return w.TempleNormalDoor;case 417:return w.BreakableWallWallButUnbreakable;case 418:return w.BrokenCylinderAndRubble;case 419:return w.ThreeBrokenWallPiecesOnFloor;case 420:return w.HighBrickCylinder;case 421:return w.LyingCylinder;case 422:return w.BrickConeWithFlatTop;case 423:return w.BreakableTempleWall;case 424:return w.TempleMapDetect;case 425:return w.SmallBrownBrickRisingBridge;case 426:return w.LongRisingBridgeWithPinkHighEdges;case 427:return w.FourSwitchTempleDoor;case 448:return w.FourButtonSpaceshipDoor;case 512:return w.ItemBoxCca;case 513:return w.TeleporterEp2;case 514:return w.CCADoor;case 515:return w.SpecialBoxCCA;case 516:return w.BigCCADoor;case 517:return w.BigCCADoorSwitch;case 518:return w.LittleRock;case 519:return w.Little3StoneWall;case 520:return w.Medium3StoneWall;case 521:return w.SpiderPlant;case 522:return w.CCAAreaTeleporter;case 523:return w.UnknownItem523;case 524:return w.WhiteBird;case 525:return w.OrangeBird;case 527:return w.Saw;case 528:return w.LaserDetect;case 529:return w.UnknownItem529;case 530:return w.UnknownItem530;case 531:return w.Seagull;case 544:return w.Fish;case 545:return w.SeabedDoorWithBlueEdges;case 546:return w.SeabedDoorAlwaysOpenNonTriggerable;case 547:return w.LittleCryotube;case 548:return w.WideGlassWallBreakable;case 549:return w.BlueFloatingRobot;case 550:return w.RedFloatingRobot;case 551:return w.Dolphin;case 552:return w.CaptureTrap;case 553:return w.VRLink;case 576:return w.UnknownItem576;case 640:return w.WarpInBarbaRayRoom;case 672:return w.UnknownItem672;case 688:return w.GeeNest;case 689:return w.LabComputerConsole;case 690:return w.LabComputerConsoleGreenScreen;case 691:return w.ChairYellowPillow;case 692:return w.OrangeWallWithHoleInMiddle;case 693:return w.GreyWallWithHoleInMiddle;case 694:return w.LongTable;case 695:return w.GBAStation;case 696:return w.TalkLinkToSupport;case 697:return w.InstaWarp;case 698:return w.LabInvisibleObject;case 699:return w.LabGlassWindowDoor;case 700:return w.UnknownItem700;case 701:return w.LabCeilingWarp;case 768:return w.Ep4LightSource;case 769:return w.Cacti;case 770:return w.BigBrownRock;case 771:return w.BreakableBrownRock;case 832:return w.UnknownItem832;case 833:return w.UnknownItem833;case 896:return w.PoisonPlant;case 897:return w.UnknownItem897;case 898:return w.UnknownItem898;case 899:return w.OozingDesertPlant;case 901:return w.UnknownItem901;case 902:return w.BigBlackRocks;case 903:return w.UnknownItem903;case 904:return w.UnknownItem904;case 905:return w.UnknownItem905;case 906:return w.UnknownItem906;case 907:return w.FallingRock;case 908:return w.DesertPlantHasCollision;case 909:return w.DesertFixedTypeBoxBreakableCrystals;case 910:return w.UnknownItem910;case 911:return w.BeeHive;case 912:return w.UnknownItem912;case 913:return w.Heat;case 960:return w.TopOfSaintMillionEgg;case 961:return w.UnknownItem961}}(e.type_id);return{type:t,id:e.id,group_id:e.group_id,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:new Map(e.properties.map((e,i)=>3!==i||t!==w.ScriptCollision&&t!==w.ForestConsole&&t!==w.TalkLinkToSupport?4===i&&t===w.RicoMessagePod?["script_label",e]:5===i&&t===w.RicoMessagePod?["script_label_2",e]:[`property_${i}`,e]:["script_label",e])),unknown:e.unknown}});let c=s.b.I,l=new Map;const _=Gr(n.object_code,n.label_offsets,function(e,t){const i=new Set([0]);for(const t of e){const e=t.properties.get("script_label");null!=e&&i.add(e);const o=t.properties.get("script_label_2");null!=o&&i.add(o)}for(const e of t)i.add(Math.round(e.script_label));return[...i]}(d,a.npcs),i,r);if(_.length){const e=_.filter(e=>e.type===Bo.Instructions);let t;for(const i of e)if(i.labels.includes(0)){t=i;break}t?(c=function(e){const t=e.instructions.find(e=>e.opcode.code===wo.code);if(!t)return ea.debug("Function 0 has no set_episode instruction."),s.b.I;switch(t.args[0].value){default:case 0:return s.b.I;case 1:return s.b.II;case 2:return s.b.IV}}(t),l=function(e,t){const i=new Map;let o;for(const n of t.instructions)switch(n.opcode.code){case vo.code:case go.code:{o||(o=Lr.create(e));const t=qr(o,n,n.args[0].value);if(1!==t.size()){Xr.warn("Couldn't determine area ID for map_designate instruction.");continue}const s=qr(o,n,n.args[0].value+(n.opcode.code===vo.code?2:3));if(1!==s.size()){Xr.warn("Couldn't determine area variant ID for map_designate instruction.");continue}i.set(t.get(0),s.get(0))}break;case Lo.code:i.set(n.args[0].value,n.args[2].value)}return i}(e,t)):ea.warn("No instruction for label 0 found.")}else ea.warn("File contains no instruction labels.");return{id:n.quest_id,language:n.language,name:n.quest_name,short_description:n.short_description,long_description:n.long_description,episode:c,objects:d,npcs:oa(c,a.npcs),events:a.events,dat_unknowns:a.unknowns,object_code:_,shop_items:n.shop_items,map_designations:l}}function ia(e,t){const i=pr({objs:(n=e.objects,n.map(e=>({type_id:T(e.type).pso_id,id:e.id,group_id:e.group_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:[...e.properties.values()],area_id:e.area_id,unknown:e.unknown}))),npcs:(o=e.npcs,o.map(e=>{const t=Object(I.d)(e.type),i=null==t.pso_type_id?e.pso_type_id:t.pso_type_id,o=null==t.pso_roaming?e.pso_roaming:t.pso_roaming,n=null==t.pso_regular||t.pso_regular,s=zn(-8388609&Un(e.scale.y)|(n?0:8388608)),r={x:e.scale.x,y:s,z:e.scale.z};return{type_id:i,wave:e.wave,wave2:e.pso_wave2,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:r,npc_id:e.npc_id,script_label:e.script_label,roaming:o,area_id:e.area_id,unknown:e.unknown}})),events:e.events,unknowns:e.dat_unknowns});var o,n;const{object_code:s,label_offsets:r}=function(e){const t=new ir(new or(100*e.length),zo.a.Little),i=t.position,o=[];for(const n of e){for(const e of n.labels)o[e]=t.position-i;if(n.type===Bo.Instructions)for(const e of n.instructions){const i=e.opcode;if(2===i.size&&t.write_u8(i.code>>>8),t.write_u8(255&i.code),i.stack!==Mt.Pop)for(let o=0;o=0?t.write_u8(r.value):t.write_i8(r.value);break;case ft.Word:r.value>=0?t.write_u16(r.value):t.write_i16(r.value);break;case ft.DWord:r.value>=0?t.write_u32(r.value):t.write_i32(r.value);break;case ft.Float:t.write_f32(r.value);break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:t.write_u16(r.value);break;case ft.String:t.write_string_utf16(r.value,r.size);break;case ft.ILabelVar:t.write_u8(s.length),t.write_u16_array(s.map(e=>e.value));break;case ft.RegRef:case ft.RegTupRef:t.write_u8(r.value);break;case ft.RegRefVar:t.write_u8(s.length),t.write_u8_array(s.map(e=>e.value));break;default:throw new Error(`Parameter type ${ft[n.type.kind]} not implemented.`)}}}else if(n.type===Bo.String){const e=4*Math.ceil((n.value.length+1)/2);t.write_string_utf16(n.value,e)}else t.write_cursor(new No.a(n.data,t.endianness))}for(let e=0;e932)throw new Error(`shop_items can't be larger than 932, was ${e.shop_items.length}.`);o.write_u32_array(e.shop_items);for(let t=e.shop_items.length;t<932;t++)o.write_u32(0);for(;o.position<4652;)o.write_u8(0);return o.write_cursor(new No.a(e.object_code,zo.a.Little)),o.write_i32_array(e.label_offsets),Object(U.d)(o.position===t,`Expected to write ${t} bytes, but wrote ${o.position}.`),i}({quest_id:e.id,language:e.language,quest_name:e.name,short_description:e.short_description,long_description:e.long_description,object_code:s,label_offsets:r,shop_items:e.shop_items}),d=t.lastIndexOf("."),c=-1===d?t.slice(0,11):t.slice(0,Math.min(11,d));return xr({files:[{filename:c+".dat",id:e.id,data:nr(new ir(i,zo.a.Little)).array_buffer()},{filename:c+".bin",id:e.id,data:nr(new No.a(a,zo.a.Little)).array_buffer()}]})}function oa(e,t){return t.map(t=>({type:na(e,t),area_id:t.area_id,section_id:t.section_id,wave:t.wave,pso_wave2:t.wave2,position:t.position,rotation:t.rotation,scale:t.scale,unknown:t.unknown,pso_type_id:t.type_id,npc_id:t.npc_id,script_label:Math.round(t.script_label),pso_roaming:t.roaming}))}function na(e,{type_id:t,scale:i,roaming:o,area_id:n}){const s=Math.abs(i.y-1)>1e-5;switch(`${t}, ${o%3}, ${e}`){case"68, 0, 1":return I.c.Booma;case"68, 1, 1":return I.c.Gobooma;case"68, 2, 1":return I.c.Gigobooma;case"99, 0, 1":return I.c.EvilShark;case"99, 1, 1":return I.c.PalShark;case"99, 2, 1":return I.c.GuilShark;case"166, 0, 1":return I.c.Dimenian;case"166, 0, 2":return I.c.Dimenian2;case"166, 1, 1":return I.c.LaDimenian;case"166, 1, 2":return I.c.LaDimenian2;case"166, 2, 1":return I.c.SoDimenian;case"166, 2, 2":return I.c.SoDimenian2;case"214, 0, 2":return I.c.Mericarol;case"214, 1, 2":return I.c.Mericus;case"214, 2, 2":return I.c.Merikle;case"277, 0, 4":return I.c.Boota;case"277, 1, 4":return I.c.ZeBoota;case"277, 2, 4":return I.c.BaBoota;case"279, 0, 4":return I.c.Goran;case"279, 1, 4":return I.c.PyroGoran;case"279, 2, 4":return I.c.GoranDetonator}switch(`${t}, ${o%2}, ${e}`){case"64, 0, 1":return I.c.Hildebear;case"64, 0, 2":return I.c.Hildebear2;case"64, 1, 1":return I.c.Hildeblue;case"64, 1, 2":return I.c.Hildeblue2;case"65, 0, 1":return I.c.RagRappy;case"65, 0, 2":return I.c.RagRappy2;case"65, 0, 4":return I.c.SandRappy;case"65, 1, 1":return I.c.AlRappy;case"65, 1, 2":return I.c.LoveRappy;case"65, 1, 4":return I.c.DelRappy;case"128, 0, 1":return I.c.Dubchic;case"128, 0, 2":return I.c.Dubchic2;case"128, 1, 1":return I.c.Gilchic;case"128, 1, 2":return I.c.Gilchic2;case"212, 0, 2":return I.c.SinowBerill;case"212, 1, 2":return I.c.SinowSpigell;case"213, 0, 2":return I.c.Merillia;case"213, 1, 2":return I.c.Meriltas;case"215, 0, 2":return I.c.UlGibbon;case"215, 1, 2":return I.c.ZolGibbon;case"221, 0, 2":return I.c.Dolmolm;case"221, 1, 2":return I.c.Dolmdarl;case"224, 0, 2":return n>15?I.c.Epsilon:I.c.SinowZoa;case"224, 1, 2":return n>15?I.c.Epsilon:I.c.SinowZele;case"274, 0, 4":return I.c.MerissaA;case"274, 1, 4":return I.c.MerissaAA;case"276, 0, 4":return I.c.Zu;case"276, 1, 4":return I.c.Pazuzu;case"278, 0, 4":return I.c.Dorphon;case"278, 1, 4":return I.c.DorphonEclair;case"281, 0, 4":return s?I.c.SaintMilion:I.c.Kondrieu;case"281, 1, 4":return s?I.c.Shambertin:I.c.Kondrieu}switch(`${t}, ${e}`){case"66, 1":return I.c.Monest;case"66, 2":return I.c.Monest2;case"67, 1":return s?I.c.SavageWolf:I.c.BarbarousWolf;case"67, 2":return s?I.c.SavageWolf2:I.c.BarbarousWolf2;case"96, 1":return I.c.GrassAssassin;case"96, 2":return I.c.GrassAssassin2;case"97, 1":return n>15?I.c.DelLily:s?I.c.PoisonLily:I.c.NarLily;case"97, 2":return n>15?I.c.DelLily:s?I.c.PoisonLily2:I.c.NarLily2;case"98, 1":return I.c.NanoDragon;case"100, 1":return s?I.c.PofuillySlime:I.c.PouillySlime;case"101, 1":return I.c.PanArms;case"101, 2":return I.c.PanArms2;case"129, 1":return I.c.Garanz;case"129, 2":return I.c.Garanz2;case"130, 1":return s?I.c.SinowBeat:I.c.SinowGold;case"131, 1":return I.c.Canadine;case"132, 1":return I.c.Canane;case"133, 1":return I.c.Dubswitch;case"133, 2":return I.c.Dubswitch2;case"160, 1":return I.c.Delsaber;case"160, 2":return I.c.Delsaber2;case"161, 1":return I.c.ChaosSorcerer;case"161, 2":return I.c.ChaosSorcerer2;case"162, 1":return I.c.DarkGunner;case"164, 1":return I.c.ChaosBringer;case"165, 1":return I.c.DarkBelra;case"165, 2":return I.c.DarkBelra2;case"167, 1":return I.c.Bulclaw;case"168, 1":return I.c.Claw;case"192, 1":return I.c.Dragon;case"192, 2":return I.c.GalGryphon;case"193, 1":return I.c.DeRolLe;case"194, 1":return I.c.VolOptPart1;case"197, 1":return I.c.VolOptPart2;case"200, 1":return I.c.DarkFalz;case"202, 2":return I.c.OlgaFlow;case"203, 2":return I.c.BarbaRay;case"204, 2":return I.c.GolDragon;case"216, 2":return I.c.Gibbles;case"217, 2":return I.c.Gee;case"218, 2":return I.c.GiGue;case"219, 2":return I.c.Deldepth;case"220, 2":return I.c.Delbiter;case"222, 2":return I.c.Morfos;case"223, 2":return I.c.Recobox;case"225, 2":return I.c.IllGill;case"272, 4":return I.c.Astark;case"273, 4":return s?I.c.SatelliteLizard:I.c.Yowie;case"275, 4":return I.c.Girtablulu}switch(t){case 4:return I.c.FemaleFat;case 5:return I.c.FemaleMacho;case 7:return I.c.FemaleTall;case 10:return I.c.MaleDwarf;case 11:return I.c.MaleFat;case 12:return I.c.MaleMacho;case 13:return I.c.MaleOld;case 25:return I.c.BlueSoldier;case 26:return I.c.RedSoldier;case 27:return I.c.Principal;case 28:return I.c.Tekker;case 29:return I.c.GuildLady;case 30:return I.c.Scientist;case 31:return I.c.Nurse;case 32:return I.c.Irene;case 241:return I.c.ItemShop;case 254:return I.c.Nurse2}return I.c.Unknown}class sa{constructor(e,t,i,o,n){this._actions=Object(M.c)(),this.actions=this._actions,Object(U.m)(e,"id"),Object(U.m)(t,"section_id"),Object(U.f)(i,"wave"),Object(U.m)(o,"delay"),Object(U.l)(n,"unknown"),this.id=e,this.section_id=t,this.wave=i,this._delay=Object(M.e)(o),this.delay=this._delay,this.unknown=n}set_delay(e){Object(U.m)(e,"delay"),this._delay.val=e}add_action(e){this._actions.push(e)}remove_action(e){this._actions.remove(e)}}class ra{constructor(e,t,i){Object(U.m)(e,"id"),Object(U.m)(t,"area_id"),Object(U.m)(i,"section_id"),this._id=Object(M.e)(e),this.id=this._id,this._area_id=Object(M.e)(t),this.area_id=this._area_id,this._section_id=Object(M.e)(i),this.section_id=this._section_id}}const aa=X.c.get("quest_editor/stores/model_conversion");function da(e,t){const i=new Map;return new Ks(e,t.id,t.language,t.name,t.short_description,t.long_description,t.episode,t.map_designations,t.objects.map(e=>new me(e.type,e.id,e.group_id,e.area_id,e.section_id,Object(hs.a)(e.position),N(e.rotation.x,e.rotation.y,e.rotation.z),e.properties,e.unknown)),t.npcs.map(e=>(function(e,t){const i=0===t.wave?void 0:ca(e,t.area_id,t.section_id,t.wave);return new Y(t.type,t.pso_type_id,t.npc_id,i,t.pso_wave2,t.script_label,t.pso_roaming,t.area_id,t.section_id,Object(hs.a)(t.position),N(t.rotation.x,t.rotation.y,t.rotation.z),Object(hs.a)(t.scale),t.unknown)})(i,e)),function(e,t){const i=new Map;for(const o of t){const t=`${o.id}-${o.area_id}`;let n=i.get(t);if(n&&n.event){aa.warn(`Ignored duplicate event #${o.id} for area ${o.area_id}.`);continue}const s=ca(e,o.area_id,o.section_id,o.wave),r=new sa(o.id,o.section_id,s,o.delay,o.unknown);n?n.event=r:(n={event:r,area_id:o.area_id,parents:[],child_ids:[]},i.set(t,n));for(const e of o.actions)switch(e.type){case vr.SpawnNpcs:r.add_action(new rt(e.section_id,e.appear_flag));break;case vr.Unlock:r.add_action(new at(e.door_id));break;case vr.Lock:r.add_action(new dt(e.door_id));break;case vr.TriggerEvent:{n.child_ids.push(e.event_id);const t=`${e.event_id}-${o.area_id}`,s=i.get(t);s?s.parents.push(r):i.set(t,{area_id:o.area_id,parents:[r],child_ids:[]})}break;default:aa.warn(`Unknown event action type: ${e.type}.`)}}const o=new Map;for(const{area_id:e,event:t}of i.values())if(t){let i=o.get(e);i||(i=new it(e),o.set(e,i)),i.add_event(t,[],[])}for(const e of i.values())if(e.event)for(const t of e.child_ids){const n=i.get(`${t}-${e.area_id}`);n.event?o.get(e.area_id).add_edge(e.event,n.event):aa.warn(`Event ${e.event.id} calls nonexistent event ${t}.`)}return o}(i,t.events),t.dat_unknowns,t.object_code.slice(),t.shop_items)}function ca(e,t,i,o){const n=`${t}-${i}-${o}`;let s=e.get(n);return s||(s=new ra(o,t,i),e.set(n,s)),s}function la(e){const t=[];for(const i of e.values())for(const e of i.events){const o=e.actions.val.map(e=>{switch(e.type){case ot.SpawnNpcs:return{type:vr.SpawnNpcs,section_id:e.section_id,appear_flag:e.appear_flag};case ot.Unlock:return{type:vr.Unlock,door_id:e.door_id.val};case ot.Lock:return{type:vr.Lock,door_id:e.door_id.val}}});for(const t of i.get_children(e))o.push({type:vr.TriggerEvent,event_id:t.id});t.push({id:e.id,section_id:e.section_id,wave:e.wave.id.val,delay:e.delay.val,actions:o,area_id:i.area_id,unknown:e.unknown})}return t}var _a=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const ua=X.c.get("quest_editor/controllers/QuestEditorToolBarController");class va extends Hs.a{constructor(e,t,i){super(),this.area_store=t,this.quest_editor_store=i,this.create_new_quest=e=>_a(this,void 0,void 0,(function*(){return this.quest_editor_store.set_current_quest(Xs(this.area_store,e))})),this.parse_files=e=>_a(this,void 0,void 0,(function*(){try{if(0===e.length)return;let t;const i=e.find(e=>e.name.toLowerCase().endsWith(".qst"));if(i){const e=yield Object(er.b)(i);t=function(e,t=!1){const i=Tr(e);if(!i)return;let o,n;for(const e of i.files){const t=e.filename.trim().toLowerCase();t.endsWith(".dat")?o=e:t.endsWith(".bin")&&(n=e)}if(o){if(n)return ta(new No.a(n.data,zo.a.Little),new No.a(o.data,zo.a.Little),t);ea.error("File contains no BIN file.")}else ea.error("File contains no DAT file.")}(new No.a(e,zo.a.Little)),this.quest_filename=i.name,t||ua.error("Couldn't parse quest file.")}else{const i=e.find(e=>e.name.toLowerCase().endsWith(".bin")),o=e.find(e=>e.name.toLowerCase().endsWith(".dat"));if(i&&o){const e=yield Object(er.b)(i),n=yield Object(er.b)(o);t=ta(new No.a(e,zo.a.Little),new No.a(n,zo.a.Little)),this.quest_filename=i.name||o.name,t||ua.error("Couldn't parse quest file.")}}yield this.quest_editor_store.set_current_quest(t&&da(this.area_store,t))}catch(e){ua.error("Couldn't read file.",e)}})),this.set_area=({area:e})=>{this.quest_editor_store.set_current_area(e)},this.save_as=()=>{const e=this.quest_editor_store.current_quest.val;if(!e)return;const t=this.quest_filename&&Object(U.e)(this.quest_filename);let i=prompt("File name:",t);if(!i)return;const o=ia(function(e){return{id:e.id.val,language:e.language.val,name:e.name.val,short_description:e.short_description.val,long_description:e.long_description.val,episode:e.episode,objects:e.objects.val.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),unknown:e.unknown,id:e.id,group_id:e.group_id,properties:new Map(e.properties)})),npcs:e.npcs.val.map(e=>{var t,i;return{type:e.type,area_id:e.area_id,section_id:e.section_id.val,wave:(i=null===(t=e.wave.val)||void 0===t?void 0:t.id.val,null!=i?i:0),pso_wave2:e.pso_wave2.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),scale:e.scale.clone(),unknown:e.unknown,pso_type_id:e.pso_type_id,npc_id:e.npc_id,script_label:e.script_label,pso_roaming:e.pso_roaming}}),events:la(e.event_dags),dat_unknowns:e.dat_unknowns.map(e=>Object.assign({},e)),object_code:e.object_code.map(e=>Eo(e)),shop_items:e.shop_items.slice(),map_designations:new Map(e.map_designations.val)}}(e),i);i.endsWith(".qst")||(i+=".qst");const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([o],{type:"application/octet-stream"})),n.download=i,document.body.appendChild(n),n.click(),URL.revokeObjectURL(n.href),document.body.removeChild(n)},this.debug=()=>{const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.quest_runner.run(e)},this.resume=()=>{this.quest_editor_store.quest_runner.resume()},this.step_over=()=>{this.quest_editor_store.quest_runner.step_over()},this.step_in=()=>{this.quest_editor_store.quest_runner.step_into()},this.step_out=()=>{this.quest_editor_store.quest_runner.step_out()},this.stop=()=>{this.quest_editor_store.quest_runner.stop()},this.vm_feature_active=e.feature_active("vm"),this.areas=i.current_quest.flat_map(e=>{var i;return e?null===(i=e)||void 0===i?void 0:i.entities_per_area.flat_map(i=>Object(M.c)(void 0,...t.get_areas_for_episode(e.episode).map(e=>{const t=i.get(e.id);return{area:e,label:e.name+(t?` (${t})`:"")}}))):Object(M.c)()}),this.current_area=Object(M.d)((e,t)=>e.find(e=>e.area==t),this.areas,i.current_area);const o=i.current_quest.map(e=>null!=e);this.can_save=o,this.can_select_area=o,this.can_debug=o,this.can_undo=Object(M.d)((e,t)=>e&&!t,In.can_undo,i.quest_runner.running),this.can_redo=Object(M.d)((e,t)=>e&&!t,In.can_redo,i.quest_runner.running),this.can_step=i.quest_runner.paused,this.can_stop=i.quest_runner.running,this.disposables(i.current_quest.observe(()=>{this.quest_filename=void 0}),e.on_global_keydown(Qe.b.QuestEditor,"Ctrl-O",()=>_a(this,void 0,void 0,(function*(){const e=yield Object(er.a)({accept:".bin, .dat, .qst",multiple:!0});this.parse_files(e)}))),e.on_global_keydown(Qe.b.QuestEditor,"Ctrl-Shift-S",this.save_as),e.on_global_keydown(Qe.b.QuestEditor,"Ctrl-Z",()=>{In.undo()}),e.on_global_keydown(Qe.b.QuestEditor,"Ctrl-Shift-Z",()=>{In.redo()}),e.on_global_keydown(Qe.b.QuestEditor,"F5",this.debug),e.on_global_keydown(Qe.b.QuestEditor,"Shift-F5",this.stop),e.on_global_keydown(Qe.b.QuestEditor,"F6",this.resume),e.on_global_keydown(Qe.b.QuestEditor,"F8",this.step_over),e.on_global_keydown(Qe.b.QuestEditor,"F7",this.step_in),e.on_global_keydown(Qe.b.QuestEditor,"Shift-F8",this.step_out))}}class ha{constructor(e,t,i){this.quest=e,this.old=t,this.new=i}}class pa extends ha{constructor(){super(...arguments),this.description="Edit ID"}undo(){this.quest.set_id(this.old)}redo(){this.quest.set_id(this.new)}}class ga extends ha{constructor(){super(...arguments),this.description="Edit name"}undo(){this.quest.set_name(this.old)}redo(){this.quest.set_name(this.new)}}class ba extends ha{constructor(){super(...arguments),this.description="Edit short description"}undo(){this.quest.set_short_description(this.old)}redo(){this.quest.set_short_description(this.new)}}class fa extends ha{constructor(){super(...arguments),this.description="Edit long description"}undo(){this.quest.set_long_description(this.old)}redo(){this.quest.set_long_description(this.new)}}class ma extends Hs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.set_id=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new pa(t,t.id.val,e)).redo()},this.set_name=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ga(t,t.name.val,e)).redo()},this.set_short_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ba(t,t.short_description.val,e)).redo()},this.set_long_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new fa(t,t.long_description.val,e)).redo()},this.current_quest=e.current_quest,this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=this.current_quest.map(e=>null==e)}}const wa=Object.freeze(new y.Vector3),ka=Object.freeze(new y.Euler);class ya extends Hs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()};const t=e.selected_entity;this.unavailable=t.map(e=>null==e),this.enabled=e.quest_runner.running.map(e=>!e),this.type=t.map(e=>e instanceof Y?"NPC":"Object"),this.name=t.map(e=>null==e?"":L(e.type).name),this.section_id=t.flat_map(e=>null==e?Object(M.e)(""):e.section_id.map(e=>e.toString())),this.wave=t.flat_map(e=>e instanceof Y?e.wave.flat_map(e=>{var t,i,o;return null!=(o=null===(i=null===(t=e)||void 0===t?void 0:t.id)||void 0===i?void 0:i.map(e=>e.toString()))?o:Object(M.e)("None")}):Object(M.e)("")),this.wave_hidden=t.map(e=>!(e instanceof Y)),this.position=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.position)?i:Object(M.e)(wa)}),this.rotation=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.rotation)?i:Object(M.e)(ka)})}set_pos_x(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(e,i.y,i.z),!1)).redo()}}set_pos_y(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,e,i.z),!1)).redo()}}set_pos_z(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,i.y,e),!1)).redo()}}set_rot_x(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,N(V(e),i.y,i.z),!1)).redo()}}set_rot_y(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,N(i.x,V(e),i.z),!1)).redo()}}set_rot_z(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,N(i.x,i.y,V(e)),!1)).redo()}}}class Ra extends Hs.a{constructor(e){super(),this.unavailable=e.current_quest.map(e=>null==e),this.npc_counts=e.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).map(this.update_view)}update_view(e){const t=new Map;for(const i of e)if(i.type!==I.c.VolOptPart2){const e=t.get(i.type)||0;t.set(i.type,e+1)}const i=8*(t.get(I.c.Canane)||0);return[...t].sort((e,t)=>e[0]-t[0]).map(([e,t])=>{const o=e===I.c.Canadine?i:0;return{name:Object(I.d)(e).name,count:t+o}})}}class Ia{constructor(e,t,i){this.event=e,this.old_delay=t,this.new_delay=i,this.description=`Edit delay of event ${e.id}`}undo(){this.event.set_delay(this.old_delay)}redo(){this.event.set_delay(this.new_delay)}}class ja{constructor(e,t,i,o){this.store=e,this.quest=t,this.event_dag=i,this.event=o,this.new_edges=[],this.description=`Delete event ${o.id}`,this.parents=i.get_parents(o).slice(),this.children=i.get_children(o).slice();for(const e of this.parents){const t=i.get_children(e);for(const i of this.children)t.includes(i)||this.new_edges.push({parent:e,child:i})}this.npcs=t.npcs.val.filter(e=>e.wave.val===o.wave),this.event_index=i.get_index(o)}undo(){this.quest.insert_event(this.event_index,this.event,this.parents,this.children);for(const{parent:e,child:t}of this.new_edges)this.event_dag.remove_edge(e,t);for(const e of this.npcs)e.set_wave(this.event.wave)}redo(){this.store.selected_wave.val===this.event.wave&&this.store.set_selected_wave(void 0);for(const{parent:e,child:t}of this.new_edges)this.event_dag.add_edge(e,t);this.quest.remove_event(this.event_dag,this.event)}}class Ta{constructor(e,t,i,o){this.quest=e,this.event_dag=t,this.event=i,this.parent_event=o,this.description=`Add event ${i.id}`}undo(){this.quest.remove_event(this.event_dag,this.event)}redo(){this.quest.add_event(this.event,this.parent_event?[this.parent_event]:[],[])}}class xa extends Hs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.add_event=()=>{var e,t,i,o,n;const s=this.store.current_quest.val,r=this.store.current_area.val;if(s&&r){const a=s.get_event_dag_or_create(r.id),d=a.events.find(e=>e.wave===this.store.selected_wave.val),c=null!=(n=null!=(t=null===(e=d)||void 0===e?void 0:e.section_id)?t:null===(o=null===(i=this.store.selected_entity.val)||void 0===i?void 0:i.section_id)||void 0===o?void 0:o.val)?n:1,l=[],_=[];for(const e of a.events)l.push(e.id),e.wave.section_id.val===c&&_.push(e.wave.id.val);l.sort((e,t)=>e-t),_.sort((e,t)=>e-t);let u,v=0;for(const e of _)if(++v!==e)break;if(v===_.length&&v++,d){let e=d;for(;;){const[t]=a.get_parents(e);if(!t)break;e=t}const t=a.get_sub_graph(e).length.val;u=`${e.id}${t}`}else u=`${c}${v}`;let h=parseInt(u,10),p=0;for(;p=l.indexOf(h,p),-1!==p;)h++;this.store.undo.push(new Ta(s,a,new sa(h,c,new ra(v,r.id,c),30,0),d)).redo()}},this.remove_event=e=>{const t=this.store.current_quest.val,i=this.event_dag.val;t&&i&&this.store.undo.push(new ja(this.store,t,i,e)).redo()},this.set_selected_wave=e=>{this.store.set_selected_wave(e)},this.set_delay=(e,t)=>{this.store.undo.push(new Ia(e,e.delay.val,t)).redo()},this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=e.current_quest.map(e=>null==e),this.event_dag=Object(M.d)((e,t)=>e&&t?e.event_dags.get(t.id):void 0,e.current_quest,e.current_area),this.event_sub_graphs=Object(M.b)(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.connected_sub_graphs)?i:Object(M.c)()},this.event_dag)}is_selected(e){return this.store.selected_wave.map(t=>e.wave===t)}add_action(e,t){let i;switch(t){case ot.SpawnNpcs:i=new rt(0,0);break;case ot.Unlock:i=new at(0);break;case ot.Lock:i=new dt(0)}e.add_action(i)}remove_action(e,t){e.remove_action(t)}}function Sa(e,t,i){const o=new a.a,n=o.add(new fs(e)),s=o.add(new Ws(e)),r=o.add(new rs(n)),d=o.add(new En(t,r)),c=o.add(new Xn(d)),l=new Ns,_=o.add(new Ss(s,i));return{view:o.add(new yn(t,d,l,o.add(new As(o.add(new va(t,r,d)))),()=>new f(o.add(new ma(d))),()=>new m(o.add(new Ra(d))),()=>new Fe(d,n,s,i()),()=>new Ke(t,d.quest_runner,c),()=>new Ye(o.add(new ya(d))),()=>new Je(d,_),()=>new Xe(d,_),()=>new bt(o.add(new xa(d))),()=>new gn(d,n,s,i()),()=>new ln(d.quest_runner))),dispose(){o.dispose()}}}i.d(t,"initialize_quest_editor",(function(){return Sa}))},I7a6:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("nsCy"),n=i("rwco"),s=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const r=n.c.get("core/persistence/Persister");class a{persist_for_server(e,t,i){this.persist(this.server_key(e,t),i)}persist(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(t){r.error(`Couldn't persist ${e}.`,t)}}load_for_server(e,t){return s(this,void 0,void 0,(function*(){return this.load(this.server_key(e,t))}))}load(e){return s(this,void 0,void 0,(function*(){try{const t=localStorage.getItem(e);return t&&JSON.parse(t)}catch(t){return void r.error(`Couldn't load ${e}.`,t)}}))}server_key(e,t){let i=t+".";switch(e){case o.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${o.g[e]} not supported.`)}return i}}},KUR2:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=i("nN8q"),n=i("FXpb");class s extends o.a{constructor(e){super(),this.renderer=e,this.element=Object(n.h)({className:"core_RendererWidget"}),this.children=[],this.element.append(e.canvas_element),this.disposable(e),this.finalize_construction()}start_rendering(){this.renderer.start_rendering()}stop_rendering(){this.renderer.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer.set_size(e,t),this}}},NUmZ:function(e,t,i){e.exports=function(){return new Worker(i.p+"a4d592df6dd06fe18358.worker.js")}}}]); \ No newline at end of file diff --git a/7.e42840da74990ac175d2.js b/7.e42840da74990ac175d2.js new file mode 100644 index 00000000..9a924106 --- /dev/null +++ b/7.e42840da74990ac175d2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"4aaK":function(e,t,i){"use strict";i.r(t);var o=i("xGNL"),n=i.n(o),s=i("xs7i"),r=i("PE7g"),a=i("Tpfs"),d=i("0Xme");class c extends d.a{constructor(e="",t){if(super(e,"core_TextInput","text","core_TextInput_inner",t),this.preferred_label_position="left",t){const{max_length:e}=t;this.set_attr("maxLength",e)}this.set_value(e),this.finalize_construction()}get_value(){return this.input_element.value}set_value(e){this.input_element.value=e}}var l=i("sDu+"),_=(i("C5oP"),i("4VsB")),u=i("FXpb");class v extends l.a{constructor(e="",t){super(t),this.element=Object(u.h)({className:"core_TextArea"}),this.preferred_label_position="left",this.text_element=Object(u.w)({className:"core_TextArea_inner"}),this._value=new _.a(this,"",this.set_value),t&&(null!=t.max_length&&(this.text_element.maxLength=t.max_length),null!=t.font_family&&(this.text_element.style.fontFamily=t.font_family),null!=t.rows&&(this.text_element.rows=t.rows),null!=t.cols&&(this.text_element.cols=t.cols)),this.value=this._value,this.set_value(e),this.text_element.onchange=()=>this._value.set_val(this.text_element.value,{silent:!1}),this.element.append(this.text_element),this.finalize_construction()}set_value(e){this.text_element.value=e}}i("ObFr");var h=i("7ZX1"),p=(i("7YJZ"),i("6Fug"));class g extends p.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_UnavailableView"}),this.label=this.disposable(new h.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}var b=i("zsIO");class f extends b.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_QuestInfoView",tabIndex:-1}),this.table_element=Object(u.t)(),this.id_input=this.add(new r.a(0,{min:0,step:1})),this.name_input=this.add(new c("",{max_length:32})),this.short_description_input=this.add(new v("",{max_length:128,font_family:'"Courier New", monospace',cols:25,rows:5})),this.long_description_input=this.add(new v("",{max_length:288,font_family:'"Courier New", monospace',cols:25,rows:10})),this.unavailable_view=this.add(new g("No quest loaded.")),this.quest_disposer=this.disposable(new a.a);const t=e.current_quest;this.table_element.append(Object(u.A)(Object(u.y)("Episode:"),this.episode_element=Object(u.v)()),Object(u.A)(Object(u.y)("ID:"),Object(u.v)(this.id_input.element)),Object(u.A)(Object(u.y)("Name:"),Object(u.v)(this.name_input.element)),Object(u.A)(Object(u.y)({colSpan:2},"Short description:")),Object(u.A)(Object(u.v)({colSpan:2},this.short_description_input.element)),Object(u.A)(Object(u.y)({colSpan:2},"Long description:")),Object(u.A)(Object(u.v)({colSpan:2},this.long_description_input.element))),this.element.append(this.table_element,this.unavailable_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(this.unavailable_view.visible.bind_to(e.unavailable),Object(u.c)(this.table_element,"hidden",e.unavailable),t.observe(({value:t})=>{this.quest_disposer.dispose_all(),this.episode_element.textContent=t?s.b[t.episode]:"",t&&this.quest_disposer.add_all(this.id_input.value.bind_to(t.id),this.id_input.value.observe(({value:t})=>e.set_id(t)),this.name_input.value.bind_to(t.name),this.name_input.value.observe(({value:t})=>e.set_name(t)),this.short_description_input.value.bind_to(t.short_description),this.short_description_input.value.observe(({value:t})=>e.set_short_description(t)),this.long_description_input.value.bind_to(t.long_description),this.long_description_input.value.observe(({value:t})=>e.set_long_description(t)),this.enabled.bind_to(e.enabled))})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.id_input.enabled.val=e,this.name_input.enabled.val=e,this.short_description_input.enabled.val=e,this.long_description_input.enabled.val=e}}i("88+i"),i("UrNz"),i("5sDa");class m extends b.a{constructor(e){super(),this.element=Object(u.h)({className:"quest_editor_NpcCountsView"}),this.table_element=Object(u.t)(),this.unavailable_view=this.add(new g("No quest loaded.")),this.element.append(this.table_element,this.unavailable_view.element),this.disposables(Object(u.c)(this.table_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),e.npc_counts.observe(({value:e})=>this.update_view(e),{call_now:!0})),this.finalize_construction()}update_view(e){const t=document.createDocumentFragment();for(const{name:i,count:o}of e)t.append(Object(u.A)(Object(u.y)(i+":"),Object(u.v)(String(o))));this.table_element.innerHTML="",this.table_element.append(t)}}var w,k=i("Ftn7"),y=i("Womt"),R=i("Eqai"),I=i("sZ1+");!function(e){e[e.Unknown=1e3]="Unknown",e[e.PlayerSet=1001]="PlayerSet",e[e.Particle=1002]="Particle",e[e.Teleporter=1003]="Teleporter",e[e.Warp=1004]="Warp",e[e.LightCollision=1005]="LightCollision",e[e.Item=1006]="Item",e[e.EnvSound=1007]="EnvSound",e[e.FogCollision=1008]="FogCollision",e[e.EventCollision=1009]="EventCollision",e[e.CharaCollision=1010]="CharaCollision",e[e.ElementalTrap=1011]="ElementalTrap",e[e.StatusTrap=1012]="StatusTrap",e[e.HealTrap=1013]="HealTrap",e[e.LargeElementalTrap=1014]="LargeElementalTrap",e[e.ObjRoomID=1015]="ObjRoomID",e[e.Sensor=1016]="Sensor",e[e.UnknownItem16=1017]="UnknownItem16",e[e.LensFlare=1018]="LensFlare",e[e.ScriptCollision=1019]="ScriptCollision",e[e.HealRing=1020]="HealRing",e[e.MapCollision=1021]="MapCollision",e[e.ScriptCollisionA=1022]="ScriptCollisionA",e[e.ItemLight=1023]="ItemLight",e[e.RadarCollision=1024]="RadarCollision",e[e.FogCollisionSW=1025]="FogCollisionSW",e[e.BossTeleporter=1026]="BossTeleporter",e[e.ImageBoard=1027]="ImageBoard",e[e.QuestWarp=1028]="QuestWarp",e[e.Epilogue=1029]="Epilogue",e[e.UnknownItem29=1030]="UnknownItem29",e[e.UnknownItem30=1031]="UnknownItem30",e[e.UnknownItem31=1032]="UnknownItem31",e[e.BoxDetectObject=1033]="BoxDetectObject",e[e.SymbolChatObject=1034]="SymbolChatObject",e[e.TouchPlateObject=1035]="TouchPlateObject",e[e.TargetableObject=1036]="TargetableObject",e[e.EffectObject=1037]="EffectObject",e[e.CountDownObject=1038]="CountDownObject",e[e.UnknownItem38=1039]="UnknownItem38",e[e.UnknownItem39=1040]="UnknownItem39",e[e.UnknownItem40=1041]="UnknownItem40",e[e.UnknownItem41=1042]="UnknownItem41",e[e.MenuActivation=1043]="MenuActivation",e[e.TelepipeLocation=1044]="TelepipeLocation",e[e.BGMCollision=1045]="BGMCollision",e[e.MainRagolTeleporter=1046]="MainRagolTeleporter",e[e.LobbyTeleporter=1047]="LobbyTeleporter",e[e.PrincipalWarp=1048]="PrincipalWarp",e[e.ShopDoor=1049]="ShopDoor",e[e.HuntersGuildDoor=1050]="HuntersGuildDoor",e[e.TeleporterDoor=1051]="TeleporterDoor",e[e.MedicalCenterDoor=1052]="MedicalCenterDoor",e[e.Elevator=1053]="Elevator",e[e.EasterEgg=1054]="EasterEgg",e[e.ValentinesHeart=1055]="ValentinesHeart",e[e.ChristmasTree=1056]="ChristmasTree",e[e.ChristmasWreath=1057]="ChristmasWreath",e[e.HalloweenPumpkin=1058]="HalloweenPumpkin",e[e.TwentyFirstCentury=1059]="TwentyFirstCentury",e[e.Sonic=1060]="Sonic",e[e.WelcomeBoard=1061]="WelcomeBoard",e[e.Firework=1062]="Firework",e[e.LobbyScreenDoor=1063]="LobbyScreenDoor",e[e.MainRagolTeleporterBattleInNextArea=1064]="MainRagolTeleporterBattleInNextArea",e[e.LabTeleporterDoor=1065]="LabTeleporterDoor",e[e.Pioneer2InvisibleTouchplate=1066]="Pioneer2InvisibleTouchplate",e[e.ForestDoor=1067]="ForestDoor",e[e.ForestSwitch=1068]="ForestSwitch",e[e.LaserFence=1069]="LaserFence",e[e.LaserSquareFence=1070]="LaserSquareFence",e[e.ForestLaserFenceSwitch=1071]="ForestLaserFenceSwitch",e[e.LightRays=1072]="LightRays",e[e.BlueButterfly=1073]="BlueButterfly",e[e.Probe=1074]="Probe",e[e.RandomTypeBox1=1075]="RandomTypeBox1",e[e.ForestWeatherStation=1076]="ForestWeatherStation",e[e.Battery=1077]="Battery",e[e.ForestConsole=1078]="ForestConsole",e[e.BlackSlidingDoor=1079]="BlackSlidingDoor",e[e.RicoMessagePod=1080]="RicoMessagePod",e[e.EnergyBarrier=1081]="EnergyBarrier",e[e.ForestRisingBridge=1082]="ForestRisingBridge",e[e.SwitchNoneDoor=1083]="SwitchNoneDoor",e[e.EnemyBoxGrey=1084]="EnemyBoxGrey",e[e.FixedTypeBox=1085]="FixedTypeBox",e[e.EnemyBoxBrown=1086]="EnemyBoxBrown",e[e.EmptyTypeBox=1087]="EmptyTypeBox",e[e.LaserFenceEx=1088]="LaserFenceEx",e[e.LaserSquareFenceEx=1089]="LaserSquareFenceEx",e[e.FloorPanel1=1090]="FloorPanel1",e[e.Caves4ButtonDoor=1091]="Caves4ButtonDoor",e[e.CavesNormalDoor=1092]="CavesNormalDoor",e[e.CavesSmashingPillar=1093]="CavesSmashingPillar",e[e.CavesSign1=1094]="CavesSign1",e[e.CavesSign2=1095]="CavesSign2",e[e.CavesSign3=1096]="CavesSign3",e[e.HexagonalTank=1097]="HexagonalTank",e[e.BrownPlatform=1098]="BrownPlatform",e[e.WarningLightObject=1099]="WarningLightObject",e[e.Rainbow=1100]="Rainbow",e[e.FloatingJellyfish=1101]="FloatingJellyfish",e[e.FloatingDragonfly=1102]="FloatingDragonfly",e[e.CavesSwitchDoor=1103]="CavesSwitchDoor",e[e.RobotRechargeStation=1104]="RobotRechargeStation",e[e.CavesCakeShop=1105]="CavesCakeShop",e[e.Caves1SmallRedRock=1106]="Caves1SmallRedRock",e[e.Caves1MediumRedRock=1107]="Caves1MediumRedRock",e[e.Caves1LargeRedRock=1108]="Caves1LargeRedRock",e[e.Caves2SmallRock1=1109]="Caves2SmallRock1",e[e.Caves2MediumRock1=1110]="Caves2MediumRock1",e[e.Caves2LargeRock1=1111]="Caves2LargeRock1",e[e.Caves2SmallRock2=1112]="Caves2SmallRock2",e[e.Caves2MediumRock2=1113]="Caves2MediumRock2",e[e.Caves2LargeRock2=1114]="Caves2LargeRock2",e[e.Caves3SmallRock=1115]="Caves3SmallRock",e[e.Caves3MediumRock=1116]="Caves3MediumRock",e[e.Caves3LargeRock=1117]="Caves3LargeRock",e[e.FloorPanel2=1118]="FloorPanel2",e[e.DestructableRockCaves1=1119]="DestructableRockCaves1",e[e.DestructableRockCaves2=1120]="DestructableRockCaves2",e[e.DestructableRockCaves3=1121]="DestructableRockCaves3",e[e.MinesDoor=1122]="MinesDoor",e[e.FloorPanel3=1123]="FloorPanel3",e[e.MinesSwitchDoor=1124]="MinesSwitchDoor",e[e.LargeCryoTube=1125]="LargeCryoTube",e[e.ComputerLikeCalus=1126]="ComputerLikeCalus",e[e.GreenScreenOpeningAndClosing=1127]="GreenScreenOpeningAndClosing",e[e.FloatingRobot=1128]="FloatingRobot",e[e.FloatingBlueLight=1129]="FloatingBlueLight",e[e.SelfDestructingObject1=1130]="SelfDestructingObject1",e[e.SelfDestructingObject2=1131]="SelfDestructingObject2",e[e.SelfDestructingObject3=1132]="SelfDestructingObject3",e[e.SparkMachine=1133]="SparkMachine",e[e.MinesLargeFlashingCrate=1134]="MinesLargeFlashingCrate",e[e.RuinsSeal=1135]="RuinsSeal",e[e.RuinsTeleporter=1136]="RuinsTeleporter",e[e.RuinsWarpSiteToSite=1137]="RuinsWarpSiteToSite",e[e.RuinsSwitch=1138]="RuinsSwitch",e[e.FloorPanel4=1139]="FloorPanel4",e[e.Ruins1Door=1140]="Ruins1Door",e[e.Ruins3Door=1141]="Ruins3Door",e[e.Ruins2Door=1142]="Ruins2Door",e[e.Ruins11ButtonDoor=1143]="Ruins11ButtonDoor",e[e.Ruins21ButtonDoor=1144]="Ruins21ButtonDoor",e[e.Ruins31ButtonDoor=1145]="Ruins31ButtonDoor",e[e.Ruins4ButtonDoor=1146]="Ruins4ButtonDoor",e[e.Ruins2ButtonDoor=1147]="Ruins2ButtonDoor",e[e.RuinsSensor=1148]="RuinsSensor",e[e.RuinsFenceSwitch=1149]="RuinsFenceSwitch",e[e.RuinsLaserFence4x2=1150]="RuinsLaserFence4x2",e[e.RuinsLaserFence6x2=1151]="RuinsLaserFence6x2",e[e.RuinsLaserFence4x4=1152]="RuinsLaserFence4x4",e[e.RuinsLaserFence6x4=1153]="RuinsLaserFence6x4",e[e.RuinsPoisonBlob=1154]="RuinsPoisonBlob",e[e.RuinsPillarTrap=1155]="RuinsPillarTrap",e[e.PopupTrapNoTech=1156]="PopupTrapNoTech",e[e.RuinsCrystal=1157]="RuinsCrystal",e[e.Monument=1158]="Monument",e[e.RuinsRock1=1159]="RuinsRock1",e[e.RuinsRock2=1160]="RuinsRock2",e[e.RuinsRock3=1161]="RuinsRock3",e[e.RuinsRock4=1162]="RuinsRock4",e[e.RuinsRock5=1163]="RuinsRock5",e[e.RuinsRock6=1164]="RuinsRock6",e[e.RuinsRock7=1165]="RuinsRock7",e[e.Poison=1166]="Poison",e[e.FixedBoxTypeRuins=1167]="FixedBoxTypeRuins",e[e.RandomBoxTypeRuins=1168]="RandomBoxTypeRuins",e[e.EnemyTypeBoxYellow=1169]="EnemyTypeBoxYellow",e[e.EnemyTypeBoxBlue=1170]="EnemyTypeBoxBlue",e[e.EmptyTypeBoxBlue=1171]="EmptyTypeBoxBlue",e[e.DestructableRock=1172]="DestructableRock",e[e.PopupTrapsTechs=1173]="PopupTrapsTechs",e[e.FlyingWhiteBird=1174]="FlyingWhiteBird",e[e.Tower=1175]="Tower",e[e.FloatingRocks=1176]="FloatingRocks",e[e.FloatingSoul=1177]="FloatingSoul",e[e.Butterfly=1178]="Butterfly",e[e.LobbyGameMenu=1179]="LobbyGameMenu",e[e.LobbyWarpObject=1180]="LobbyWarpObject",e[e.Lobby1EventObjectDefaultTree=1181]="Lobby1EventObjectDefaultTree",e[e.UnknownItem387=1182]="UnknownItem387",e[e.UnknownItem388=1183]="UnknownItem388",e[e.UnknownItem389=1184]="UnknownItem389",e[e.LobbyEventObjectStaticPumpkin=1185]="LobbyEventObjectStaticPumpkin",e[e.LobbyEventObject3ChristmasWindows=1186]="LobbyEventObject3ChristmasWindows",e[e.LobbyEventObjectRedAndWhiteCurtain=1187]="LobbyEventObjectRedAndWhiteCurtain",e[e.UnknownItem393=1188]="UnknownItem393",e[e.UnknownItem394=1189]="UnknownItem394",e[e.LobbyFishTank=1190]="LobbyFishTank",e[e.LobbyEventObjectButterflies=1191]="LobbyEventObjectButterflies",e[e.UnknownItem400=1192]="UnknownItem400",e[e.GreyWallLow=1193]="GreyWallLow",e[e.SpaceshipDoor=1194]="SpaceshipDoor",e[e.GreyWallHigh=1195]="GreyWallHigh",e[e.TempleNormalDoor=1196]="TempleNormalDoor",e[e.BreakableWallWallButUnbreakable=1197]="BreakableWallWallButUnbreakable",e[e.BrokenCylinderAndRubble=1198]="BrokenCylinderAndRubble",e[e.ThreeBrokenWallPiecesOnFloor=1199]="ThreeBrokenWallPiecesOnFloor",e[e.HighBrickCylinder=1200]="HighBrickCylinder",e[e.LyingCylinder=1201]="LyingCylinder",e[e.BrickConeWithFlatTop=1202]="BrickConeWithFlatTop",e[e.BreakableTempleWall=1203]="BreakableTempleWall",e[e.TempleMapDetect=1204]="TempleMapDetect",e[e.SmallBrownBrickRisingBridge=1205]="SmallBrownBrickRisingBridge",e[e.LongRisingBridgeWithPinkHighEdges=1206]="LongRisingBridgeWithPinkHighEdges",e[e.FourSwitchTempleDoor=1207]="FourSwitchTempleDoor",e[e.FourButtonSpaceshipDoor=1208]="FourButtonSpaceshipDoor",e[e.ItemBoxCca=1209]="ItemBoxCca",e[e.TeleporterEp2=1210]="TeleporterEp2",e[e.CCADoor=1211]="CCADoor",e[e.SpecialBoxCCA=1212]="SpecialBoxCCA",e[e.BigCCADoor=1213]="BigCCADoor",e[e.BigCCADoorSwitch=1214]="BigCCADoorSwitch",e[e.LittleRock=1215]="LittleRock",e[e.Little3StoneWall=1216]="Little3StoneWall",e[e.Medium3StoneWall=1217]="Medium3StoneWall",e[e.SpiderPlant=1218]="SpiderPlant",e[e.CCAAreaTeleporter=1219]="CCAAreaTeleporter",e[e.UnknownItem523=1220]="UnknownItem523",e[e.WhiteBird=1221]="WhiteBird",e[e.OrangeBird=1222]="OrangeBird",e[e.Saw=1223]="Saw",e[e.LaserDetect=1224]="LaserDetect",e[e.UnknownItem529=1225]="UnknownItem529",e[e.UnknownItem530=1226]="UnknownItem530",e[e.Seagull=1227]="Seagull",e[e.Fish=1228]="Fish",e[e.SeabedDoorWithBlueEdges=1229]="SeabedDoorWithBlueEdges",e[e.SeabedDoorAlwaysOpenNonTriggerable=1230]="SeabedDoorAlwaysOpenNonTriggerable",e[e.LittleCryotube=1231]="LittleCryotube",e[e.WideGlassWallBreakable=1232]="WideGlassWallBreakable",e[e.BlueFloatingRobot=1233]="BlueFloatingRobot",e[e.RedFloatingRobot=1234]="RedFloatingRobot",e[e.Dolphin=1235]="Dolphin",e[e.CaptureTrap=1236]="CaptureTrap",e[e.VRLink=1237]="VRLink",e[e.UnknownItem576=1238]="UnknownItem576",e[e.WarpInBarbaRayRoom=1239]="WarpInBarbaRayRoom",e[e.UnknownItem672=1240]="UnknownItem672",e[e.GeeNest=1241]="GeeNest",e[e.LabComputerConsole=1242]="LabComputerConsole",e[e.LabComputerConsoleGreenScreen=1243]="LabComputerConsoleGreenScreen",e[e.ChairYellowPillow=1244]="ChairYellowPillow",e[e.OrangeWallWithHoleInMiddle=1245]="OrangeWallWithHoleInMiddle",e[e.GreyWallWithHoleInMiddle=1246]="GreyWallWithHoleInMiddle",e[e.LongTable=1247]="LongTable",e[e.GBAStation=1248]="GBAStation",e[e.TalkLinkToSupport=1249]="TalkLinkToSupport",e[e.InstaWarp=1250]="InstaWarp",e[e.LabInvisibleObject=1251]="LabInvisibleObject",e[e.LabGlassWindowDoor=1252]="LabGlassWindowDoor",e[e.UnknownItem700=1253]="UnknownItem700",e[e.LabCeilingWarp=1254]="LabCeilingWarp",e[e.Ep4LightSource=1255]="Ep4LightSource",e[e.Cacti=1256]="Cacti",e[e.BigBrownRock=1257]="BigBrownRock",e[e.BreakableBrownRock=1258]="BreakableBrownRock",e[e.UnknownItem832=1259]="UnknownItem832",e[e.UnknownItem833=1260]="UnknownItem833",e[e.PoisonPlant=1261]="PoisonPlant",e[e.UnknownItem897=1262]="UnknownItem897",e[e.UnknownItem898=1263]="UnknownItem898",e[e.OozingDesertPlant=1264]="OozingDesertPlant",e[e.UnknownItem901=1265]="UnknownItem901",e[e.BigBlackRocks=1266]="BigBlackRocks",e[e.UnknownItem903=1267]="UnknownItem903",e[e.UnknownItem904=1268]="UnknownItem904",e[e.UnknownItem905=1269]="UnknownItem905",e[e.UnknownItem906=1270]="UnknownItem906",e[e.FallingRock=1271]="FallingRock",e[e.DesertPlantHasCollision=1272]="DesertPlantHasCollision",e[e.DesertFixedTypeBoxBreakableCrystals=1273]="DesertFixedTypeBoxBreakableCrystals",e[e.UnknownItem910=1274]="UnknownItem910",e[e.BeeHive=1275]="BeeHive",e[e.UnknownItem912=1276]="UnknownItem912",e[e.Heat=1277]="Heat",e[e.TopOfSaintMillionEgg=1278]="TopOfSaintMillionEgg",e[e.UnknownItem961=1279]="UnknownItem961"}(w||(w={}));const j=[];function T(e){return x[e]}const x=[];function S(e,t,i,o){j.push(e);const n=[];for(const[e,t]of o)n[e]=t;x[e]=Object.freeze({name:i,area_ids:n,pso_id:t})}function C(e){var t;return null!=(t=I.c[e])?t:w[e]}function O(e){return null!=I.c[e]}function L(e){var t;return null!=(t=Object(I.d)(e))?t:T(e)}var P;S(w.Unknown,void 0,"Unknown",[]),S(w.PlayerSet,0,"Player Set",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Particle,1,"Particle",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Teleporter,2,"Teleporter",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14]],[s.b.II,[0,1,2,3,4,12,13,14,15]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Warp,3,"Warp",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LightCollision,4,"Light Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,15,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Item,5,"Item",[]),S(w.EnvSound,6,"Env Sound",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.FogCollision,7,"Fog Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.EventCollision,8,"Event Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.CharaCollision,9,"Chara Collision",[[s.b.I,[0,1,2,3,4,5,8,9,10]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ElementalTrap,10,"Elemental Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.StatusTrap,11,"Status Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.HealTrap,12,"Heal Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.LargeElementalTrap,13,"Large Elemental Trap",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.ObjRoomID,14,"Obj Room ID",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Sensor,15,"Sensor",[[s.b.I,[1,2,4,5,6,7]]]),S(w.UnknownItem16,16,"Unknown Item (16)",[]),S(w.LensFlare,17,"Lens Flare",[[s.b.I,[1,2,3,4,8,14]]]),S(w.ScriptCollision,18,"Script Collision",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.HealRing,19,"Heal Ring",[[s.b.I,[1,2,3,4,5,6,7,8,9,10]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MapCollision,20,"Map Collision",[[s.b.I,[0,1,2,3,4,5,8,9,10,16,17]],[s.b.II,[0,5,6,7,8,9,10,11,16,17]],[s.b.IV,[0]]]),S(w.ScriptCollisionA,21,"Script Collision A",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.ItemLight,22,"Item Light",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.RadarCollision,23,"Radar Collision",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FogCollisionSW,24,"Fog Collision SW",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BossTeleporter,25,"Boss Teleporter",[[s.b.I,[0,2,5,7,10]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[5,6,7,8,0]]]),S(w.ImageBoard,26,"Image Board",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.QuestWarp,27,"Quest Warp",[[s.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[s.b.IV,[9]]]),S(w.Epilogue,28,"Epilogue",[[s.b.I,[14]],[s.b.II,[13]],[s.b.IV,[9]]]),S(w.UnknownItem29,29,"Unknown Item (29)",[[s.b.I,[1]]]),S(w.UnknownItem30,30,"Unknown Item (30)",[[s.b.I,[1,2,17]],[s.b.II,[1,2,14]],[s.b.IV,[1,2,3,4,5]]]),S(w.UnknownItem31,31,"Unknown Item (31)",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BoxDetectObject,32,"Box Detect Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.SymbolChatObject,33,"Symbol Chat Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.TouchPlateObject,34,"Touch plate Object",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.TargetableObject,35,"Targetable Object",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EffectObject,36,"Effect object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[0]]]),S(w.CountDownObject,37,"Count Down Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem38,38,"Unknown Item (38)",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem39,39,"Unknown Item (39)",[[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem40,40,"Unknown Item (40)",[[s.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem41,41,"Unknown Item (41)",[[s.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.MenuActivation,64,"Menu activation",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.TelepipeLocation,65,"Telepipe Location",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.BGMCollision,66,"BGM Collision",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.MainRagolTeleporter,67,"Main Ragol Teleporter",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.LobbyTeleporter,68,"Lobby Teleporter",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.PrincipalWarp,69,"Principal warp",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ShopDoor,70,"Shop Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.HuntersGuildDoor,71,"Hunter's Guild Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.TeleporterDoor,72,"Teleporter Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.MedicalCenterDoor,73,"Medical Center Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.Elevator,74,"Elevator",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.EasterEgg,75,"Easter Egg",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ValentinesHeart,76,"Valentines Heart",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ChristmasTree,77,"Christmas Tree",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ChristmasWreath,78,"Christmas Wreath",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.HalloweenPumpkin,79,"Halloween Pumpkin",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.TwentyFirstCentury,80,"21st Century",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.Sonic,81,"Sonic",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.WelcomeBoard,82,"Welcome Board",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.Firework,83,"Firework",[[s.b.I,[0]],[s.b.II,[0,16]],[s.b.IV,[0]]]),S(w.LobbyScreenDoor,84,"Lobby Screen Door",[[s.b.I,[0]],[s.b.IV,[0]]]),S(w.MainRagolTeleporterBattleInNextArea,85,"Main Ragol Teleporter (Battle in next area?)",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.LabTeleporterDoor,86,"Lab Teleporter Door",[[s.b.II,[0]]]),S(w.Pioneer2InvisibleTouchplate,87,"Pioneer 2 Invisible Touchplate",[[s.b.I,[0]],[s.b.II,[0]],[s.b.IV,[0]]]),S(w.ForestDoor,128,"Forest Door",[[s.b.I,[1,2]]]),S(w.ForestSwitch,129,"Forest Switch",[[s.b.I,[1,2,3,4,5]],[s.b.II,[1,2,3,4]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFence,130,"Laser Fence",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFence,131,"Laser Square Fence",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestLaserFenceSwitch,132,"Forest Laser Fence Switch",[[s.b.I,[1,2,3,4,5,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LightRays,133,"Light rays",[[s.b.I,[1,2]],[s.b.II,[5,6,7,8,9]],[s.b.IV,[6,7,8]]]),S(w.BlueButterfly,134,"Blue Butterfly",[[s.b.I,[1,2]],[s.b.IV,[6,7,8]]]),S(w.Probe,135,"Probe",[[s.b.I,[1,2]]]),S(w.RandomTypeBox1,136,"Random Type Box 1",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11,13]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestWeatherStation,137,"Forest Weather Station",[[s.b.I,[1,2]]]),S(w.Battery,138,"Battery",[]),S(w.ForestConsole,139,"Forest Console",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BlackSlidingDoor,140,"Black Sliding Door",[[s.b.I,[1,2,3]]]),S(w.RicoMessagePod,141,"Rico Message Pod",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,13]]]),S(w.EnergyBarrier,142,"Energy Barrier",[[s.b.I,[1,2,4,5,6,7]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestRisingBridge,143,"Forest Rising Bridge",[[s.b.I,[1,2]]]),S(w.SwitchNoneDoor,144,"Switch (none door)",[[s.b.I,[1,2,6,7,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EnemyBoxGrey,145,"Enemy Box (Grey)",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedTypeBox,146,"Fixed Type Box",[[s.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[s.b.II,[10,11,13]],[s.b.IV,[1,2,3,4,6,7,8,9]]]),S(w.EnemyBoxBrown,147,"Enemy Box (Brown)",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.II,[10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EmptyTypeBox,149,"Empty Type Box",[[s.b.I,[1,2,3,4,5,6,7]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFenceEx,150,"Laser Fence Ex",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFenceEx,151,"Laser Square Fence Ex",[]),S(w.FloorPanel1,192,"Floor Panel 1",[[s.b.I,[3,4,5,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves4ButtonDoor,193,"Caves 4 Button door",[[s.b.I,[3,4,5]]]),S(w.CavesNormalDoor,194,"Caves Normal door",[[s.b.I,[3,4,5]]]),S(w.CavesSmashingPillar,195,"Caves Smashing Pillar",[[s.b.I,[3,4,5]],[s.b.II,[1,2,3,4,17]]]),S(w.CavesSign1,196,"Caves Sign 1",[[s.b.I,[4,5]]]),S(w.CavesSign2,197,"Caves Sign 2",[[s.b.I,[4,5]]]),S(w.CavesSign3,198,"Caves Sign 3",[[s.b.I,[4,5]]]),S(w.HexagonalTank,199,"Hexagonal Tank",[[s.b.I,[4,5]]]),S(w.BrownPlatform,200,"Brown Platform",[[s.b.I,[4,5]]]),S(w.WarningLightObject,201,"Warning Light Object",[[s.b.I,[4,5]],[s.b.IV,[5]]]),S(w.Rainbow,203,"Rainbow",[[s.b.I,[4]]]),S(w.FloatingJellyfish,204,"Floating Jellyfish",[[s.b.I,[4]],[s.b.II,[10,11]]]),S(w.FloatingDragonfly,205,"Floating Dragonfly",[[s.b.I,[4,16]],[s.b.II,[3,4]],[s.b.IV,[6,7,8]]]),S(w.CavesSwitchDoor,206,"Caves Switch Door",[[s.b.I,[3,4,5]]]),S(w.RobotRechargeStation,207,"Robot Recharge Station",[[s.b.I,[3,4,5,6,7]],[s.b.II,[17]]]),S(w.CavesCakeShop,208,"Caves Cake Shop",[[s.b.I,[5]]]),S(w.Caves1SmallRedRock,209,"Caves 1 Small Red Rock",[[s.b.I,[3]]]),S(w.Caves1MediumRedRock,210,"Caves 1 Medium Red Rock",[[s.b.I,[3]]]),S(w.Caves1LargeRedRock,211,"Caves 1 Large Red Rock",[[s.b.I,[3]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves2SmallRock1,212,"Caves 2 Small Rock 1",[[s.b.I,[4]]]),S(w.Caves2MediumRock1,213,"Caves 2 Medium Rock 1",[[s.b.I,[4]]]),S(w.Caves2LargeRock1,214,"Caves 2 Large Rock 1",[[s.b.I,[4]]]),S(w.Caves2SmallRock2,215,"Caves 2 Small Rock 2",[[s.b.I,[4]]]),S(w.Caves2MediumRock2,216,"Caves 2 Medium Rock 2",[[s.b.I,[4]]]),S(w.Caves2LargeRock2,217,"Caves 2 Large Rock 2",[[s.b.I,[4]]]),S(w.Caves3SmallRock,218,"Caves 3 Small Rock",[[s.b.I,[5]]]),S(w.Caves3MediumRock,219,"Caves 3 Medium Rock",[[s.b.I,[5]]]),S(w.Caves3LargeRock,220,"Caves 3 Large Rock",[[s.b.I,[5]]]),S(w.FloorPanel2,222,"Floor Panel 2",[[s.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.DestructableRockCaves1,223,"Destructable Rock (Caves 1)",[[s.b.I,[3]]]),S(w.DestructableRockCaves2,224,"Destructable Rock (Caves 2)",[[s.b.I,[4]]]),S(w.DestructableRockCaves3,225,"Destructable Rock (Caves 3)",[[s.b.I,[5]]]),S(w.MinesDoor,256,"Mines Door",[[s.b.I,[6,7]]]),S(w.FloorPanel3,257,"Floor Panel 3",[[s.b.I,[1,2,6,7,16,17]],[s.b.II,[1,2,3,4]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MinesSwitchDoor,258,"Mines Switch Door",[[s.b.I,[6,7]],[s.b.IV,[6,7,8]]]),S(w.LargeCryoTube,259,"Large Cryo-Tube",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.ComputerLikeCalus,260,"Computer (like calus)",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.GreenScreenOpeningAndClosing,261,"Green Screen opening and closing",[[s.b.I,[6,7]],[s.b.II,[17]]]),S(w.FloatingRobot,262,"Floating Robot",[[s.b.I,[6,7]]]),S(w.FloatingBlueLight,263,"Floating Blue Light",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject1,264,"Self Destructing Object 1",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject2,265,"Self Destructing Object 2",[[s.b.I,[6,7]]]),S(w.SelfDestructingObject3,266,"Self Destructing Object 3",[[s.b.I,[6,7]]]),S(w.SparkMachine,267,"Spark Machine",[[s.b.I,[6,7]]]),S(w.MinesLargeFlashingCrate,268,"Mines Large Flashing Crate",[[s.b.I,[6,7]]]),S(w.RuinsSeal,304,"Ruins Seal",[[s.b.I,[13]]]),S(w.RuinsTeleporter,320,"Ruins Teleporter",[[s.b.I,[8,9,10]]]),S(w.RuinsWarpSiteToSite,321,"Ruins Warp (Site to site)",[[s.b.I,[8,9,10]]]),S(w.RuinsSwitch,322,"Ruins Switch",[[s.b.I,[8,9,10]]]),S(w.FloorPanel4,323,"Floor Panel 4",[[s.b.I,[8,9,10]]]),S(w.Ruins1Door,324,"Ruins 1 Door",[[s.b.I,[8]]]),S(w.Ruins3Door,325,"Ruins 3 Door",[[s.b.I,[10]]]),S(w.Ruins2Door,326,"Ruins 2 Door",[[s.b.I,[9]]]),S(w.Ruins11ButtonDoor,327,"Ruins 1-1 Button Door",[[s.b.I,[8]]]),S(w.Ruins21ButtonDoor,328,"Ruins 2-1 Button Door",[[s.b.I,[9]]]),S(w.Ruins31ButtonDoor,329,"Ruins 3-1 Button Door",[[s.b.I,[10]]]),S(w.Ruins4ButtonDoor,330,"Ruins 4-Button Door",[[s.b.I,[8,9,10]]]),S(w.Ruins2ButtonDoor,331,"Ruins 2-Button Door",[[s.b.I,[8,9,10]]]),S(w.RuinsSensor,332,"Ruins Sensor",[[s.b.I,[8,9,10]]]),S(w.RuinsFenceSwitch,333,"Ruins Fence Switch",[[s.b.I,[8,9,10]]]),S(w.RuinsLaserFence4x2,334,"Ruins Laser Fence 4x2",[[s.b.I,[8,9,10]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence6x2,335,"Ruins Laser Fence 6x2",[[s.b.I,[8,9,10]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence4x4,336,"Ruins Laser Fence 4x4",[[s.b.I,[8,9,10]]]),S(w.RuinsLaserFence6x4,337,"Ruins Laser Fence 6x4",[[s.b.I,[8,9,10]]]),S(w.RuinsPoisonBlob,338,"Ruins poison Blob",[[s.b.I,[8,9,10]],[s.b.II,[5,6,7,8,9]],[s.b.IV,[6,7,8]]]),S(w.RuinsPillarTrap,339,"Ruins Pillar Trap",[[s.b.I,[8,9,10]],[s.b.II,[1,2,3,4]]]),S(w.PopupTrapNoTech,340,"Popup Trap (No Tech)",[[s.b.I,[8,9,10]]]),S(w.RuinsCrystal,341,"Ruins Crystal",[[s.b.I,[8,9,10]]]),S(w.Monument,342,"Monument",[[s.b.I,[2,4,7]]]),S(w.RuinsRock1,345,"Ruins Rock 1",[[s.b.I,[8,9,10]]]),S(w.RuinsRock2,346,"Ruins Rock 2",[[s.b.I,[8,9,10]]]),S(w.RuinsRock3,347,"Ruins Rock 3",[[s.b.I,[8,9,10]]]),S(w.RuinsRock4,348,"Ruins Rock 4",[[s.b.I,[8,9,10]]]),S(w.RuinsRock5,349,"Ruins Rock 5",[[s.b.I,[8,9,10]]]),S(w.RuinsRock6,350,"Ruins Rock 6",[[s.b.I,[8,9,10]]]),S(w.RuinsRock7,351,"Ruins Rock 7",[[s.b.I,[8,9,10]]]),S(w.Poison,352,"Poison",[[s.b.I,[8,9,10,13]],[s.b.II,[3,4,10,11]],[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedBoxTypeRuins,353,"Fixed Box Type (Ruins)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4,14,15]]]),S(w.RandomBoxTypeRuins,354,"Random Box Type (Ruins)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4,14,15]]]),S(w.EnemyTypeBoxYellow,355,"Enemy Type Box (Yellow)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.EnemyTypeBoxBlue,356,"Enemy Type Box (Blue)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.EmptyTypeBoxBlue,357,"Empty Type Box (Blue)",[[s.b.I,[8,9,10,16,17]],[s.b.II,[1,2,3,4]]]),S(w.DestructableRock,358,"Destructable Rock",[[s.b.I,[8,9,10]]]),S(w.PopupTrapsTechs,359,"Popup Traps (techs)",[[s.b.I,[6,7,8,9,10]],[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]]]),S(w.FlyingWhiteBird,368,"Flying White Bird",[[s.b.I,[14,16]],[s.b.II,[3,4]]]),S(w.Tower,369,"Tower",[[s.b.I,[14]]]),S(w.FloatingRocks,370,"Floating Rocks",[[s.b.I,[14]]]),S(w.FloatingSoul,371,"Floating Soul",[[s.b.I,[14]]]),S(w.Butterfly,372,"Butterfly",[[s.b.I,[14]]]),S(w.LobbyGameMenu,384,"Lobby Game menu",[[s.b.I,[15]]]),S(w.LobbyWarpObject,385,"Lobby Warp Object",[[s.b.I,[15]]]),S(w.Lobby1EventObjectDefaultTree,386,"Lobby 1 Event Object (Default Tree)",[[s.b.I,[15]]]),S(w.UnknownItem387,387,"Unknown Item (387)",[[s.b.I,[15]]]),S(w.UnknownItem388,388,"Unknown Item (388)",[[s.b.I,[15]]]),S(w.UnknownItem389,389,"Unknown Item (389)",[[s.b.I,[15]]]),S(w.LobbyEventObjectStaticPumpkin,390,"Lobby Event Object (Static Pumpkin)",[[s.b.I,[15]]]),S(w.LobbyEventObject3ChristmasWindows,391,"Lobby Event Object (3 Christmas Windows)",[[s.b.I,[15]]]),S(w.LobbyEventObjectRedAndWhiteCurtain,392,"Lobby Event Object (Red and White Curtain)",[[s.b.I,[15]]]),S(w.UnknownItem393,393,"Unknown Item (393)",[[s.b.I,[15]]]),S(w.UnknownItem394,394,"Unknown Item (394)",[[s.b.I,[15]]]),S(w.LobbyFishTank,395,"Lobby Fish Tank",[[s.b.I,[15]]]),S(w.LobbyEventObjectButterflies,396,"Lobby Event Object (Butterflies)",[[s.b.I,[15]]]),S(w.UnknownItem400,400,"Unknown Item (400)",[[s.b.I,[16]],[s.b.II,[3,4]]]),S(w.GreyWallLow,401,"grey wall low",[[s.b.I,[16]],[s.b.II,[3,4,17]]]),S(w.SpaceshipDoor,402,"Spaceship Door",[[s.b.I,[16]],[s.b.II,[3,4]]]),S(w.GreyWallHigh,403,"grey wall high",[[s.b.I,[16]],[s.b.II,[3,4,17]]]),S(w.TempleNormalDoor,416,"Temple Normal Door",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BreakableWallWallButUnbreakable,417,'"breakable wall wall, but unbreakable"',[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BrokenCylinderAndRubble,418,"Broken cylinder and rubble",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.ThreeBrokenWallPiecesOnFloor,419,"3 broken wall pieces on floor",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.HighBrickCylinder,420,"high brick cylinder",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.LyingCylinder,421,"lying cylinder",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BrickConeWithFlatTop,422,"brick cone with flat top",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.BreakableTempleWall,423,"breakable temple wall",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.TempleMapDetect,424,"Temple Map Detect",[[s.b.I,[17]],[s.b.II,[1,2,14]],[s.b.IV,[1,2,3,4,5]]]),S(w.SmallBrownBrickRisingBridge,425,"small brown brick rising bridge",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.LongRisingBridgeWithPinkHighEdges,426,"long rising bridge (with pink high edges)",[[s.b.I,[17]],[s.b.II,[1,2]]]),S(w.FourSwitchTempleDoor,427,"4 switch temple door",[[s.b.II,[1,2]]]),S(w.FourButtonSpaceshipDoor,448,"4 button spaceship door",[[s.b.II,[3,4]]]),S(w.ItemBoxCca,512,"item box cca",[[s.b.II,[5,6,7,8,9,12,16,17]],[s.b.IV,[5]]]),S(w.TeleporterEp2,513,"Teleporter (Ep 2)",[[s.b.II,[5,6,7,8,9,10,11,12,13,16,17]]]),S(w.CCADoor,514,"CCA Door",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.SpecialBoxCCA,515,"Special Box CCA",[[s.b.II,[5,6,7,8,9,12,16,17]],[s.b.IV,[1,2,3,4,5]]]),S(w.BigCCADoor,516,"Big CCA Door",[[s.b.II,[5]]]),S(w.BigCCADoorSwitch,517,"Big CCA Door Switch",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.LittleRock,518,"Little Rock",[[s.b.II,[5,6,7,8,9,16]]]),S(w.Little3StoneWall,519,"Little 3 Stone Wall",[[s.b.II,[5,6,7,8,9,16]]]),S(w.Medium3StoneWall,520,"Medium 3 stone wall",[[s.b.II,[5,6,7,8,9,16]]]),S(w.SpiderPlant,521,"Spider Plant",[[s.b.II,[5,6,7,8,9,16]]]),S(w.CCAAreaTeleporter,522,"CCA Area Teleporter",[[s.b.II,[5,6,7,8,9,16,17]]]),S(w.UnknownItem523,523,"Unknown Item (523)",[[s.b.II,[5,12]]]),S(w.WhiteBird,524,"White Bird",[[s.b.II,[6,7,9,16,17]],[s.b.IV,[6,7,8]]]),S(w.OrangeBird,525,"Orange Bird",[[s.b.II,[6,7,9,17]]]),S(w.Saw,527,"Saw",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.LaserDetect,528,"Laser Detect",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.UnknownItem529,529,"Unknown Item (529)",[[s.b.II,[5,6,7]],[s.b.IV,[6,7,8]]]),S(w.UnknownItem530,530,"Unknown Item (530)",[[s.b.II,[5,6,7,8,9,17]]]),S(w.Seagull,531,"Seagull",[[s.b.II,[6,7,8,9,16]],[s.b.IV,[6,7,8]]]),S(w.Fish,544,"Fish",[[s.b.I,[15]],[s.b.II,[6,9,10,11,16]]]),S(w.SeabedDoorWithBlueEdges,545,"Seabed Door (with blue edges)",[[s.b.II,[10,11]]]),S(w.SeabedDoorAlwaysOpenNonTriggerable,546,"Seabed door (always open, non-triggerable)",[[s.b.II,[10,11]]]),S(w.LittleCryotube,547,"Little Cryotube",[[s.b.II,[10,11,17]]]),S(w.WideGlassWallBreakable,548,"Wide Glass Wall (breakable)",[[s.b.II,[10,11]]]),S(w.BlueFloatingRobot,549,"Blue floating robot",[[s.b.II,[10,11]]]),S(w.RedFloatingRobot,550,"Red floating robot",[[s.b.II,[10,11]]]),S(w.Dolphin,551,"Dolphin",[[s.b.II,[10,11]]]),S(w.CaptureTrap,552,"Capture Trap",[[s.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.VRLink,553,"VR link",[[s.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]]]),S(w.UnknownItem576,576,"Unknown Item (576)",[[s.b.II,[12]]]),S(w.WarpInBarbaRayRoom,640,"Warp in Barba Ray Room",[[s.b.II,[14]]]),S(w.UnknownItem672,672,"Unknown Item (672)",[[s.b.II,[15]]]),S(w.GeeNest,688,"Gee Nest",[[s.b.I,[8,9,10]],[s.b.II,[5,6,7,8,9,16,17]],[s.b.IV,[6,7,8]]]),S(w.LabComputerConsole,689,"Lab Computer Console",[[s.b.II,[0]]]),S(w.LabComputerConsoleGreenScreen,690,"Lab Computer Console (Green Screen)",[[s.b.II,[0]]]),S(w.ChairYellowPillow,691,"Chair, Yellow Pillow",[[s.b.II,[0]]]),S(w.OrangeWallWithHoleInMiddle,692,"orange wall with hole in middle",[[s.b.II,[0]]]),S(w.GreyWallWithHoleInMiddle,693,"grey wall with hole in middle",[[s.b.II,[0]]]),S(w.LongTable,694,"long table",[[s.b.II,[0]]]),S(w.GBAStation,695,"GBA Station",[]),S(w.TalkLinkToSupport,696,"Talk (link to support)",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.InstaWarp,697,"insta-warp",[[s.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LabInvisibleObject,698,"Lab Invisible Object",[[s.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[s.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[s.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.LabGlassWindowDoor,699,"Lab Glass window Door",[[s.b.II,[0]]]),S(w.UnknownItem700,700,"Unknown Item (700)",[[s.b.II,[13]]]),S(w.LabCeilingWarp,701,"Lab Ceiling Warp",[[s.b.II,[0]]]),S(w.Ep4LightSource,768,"Ep4 Light Source",[[s.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Cacti,769,"cacti",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BigBrownRock,770,"Big Brown Rock",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BreakableBrownRock,771,"Breakable Brown Rock",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem832,832,"Unknown Item (832)",[]),S(w.UnknownItem833,833,"Unknown Item (833)",[]),S(w.PoisonPlant,896,"Poison Plant",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem897,897,"Unknown Item (897)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem898,898,"Unknown Item (898)",[[s.b.IV,[6,7,8]]]),S(w.OozingDesertPlant,899,"Oozing Desert Plant",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem901,901,"Unknown Item (901)",[[s.b.IV,[6,7,8]]]),S(w.BigBlackRocks,902,"big black rocks",[[s.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem903,903,"Unknown Item (903)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem904,904,"Unknown Item (904)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem905,905,"Unknown Item (905)",[]),S(w.UnknownItem906,906,"Unknown Item (906)",[]),S(w.FallingRock,907,"Falling Rock",[[s.b.IV,[6,7,8]]]),S(w.DesertPlantHasCollision,908,"Desert Plant (has collision)",[[s.b.IV,[6,7,8]]]),S(w.DesertFixedTypeBoxBreakableCrystals,909,"Desert Fixed Type Box (Breakable Crystals)",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem910,910,"Unknown Item (910)",[]),S(w.BeeHive,911,"Bee Hive",[[s.b.IV,[6,7,8]]]),S(w.UnknownItem912,912,"Unknown Item (912)",[[s.b.IV,[6,7,8]]]),S(w.Heat,913,"Heat",[[s.b.IV,[6,7,8]]]),S(w.TopOfSaintMillionEgg,960,"Top of saint million egg",[[s.b.IV,[9]]]),S(w.UnknownItem961,961,"Unknown Item (961)",[[s.b.IV,[9]]]),Object.freeze(j),Object.freeze(x),function(e){e[e.Normal=0]="Normal",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected"}(P||(P={}));const D=[];D[P.Normal]=16776960,D[P.Hovered]=16768831,D[P.Selected]=16755200;const B=[];function E(e,t,i){const o=new y.MeshLambertMaterial({color:O(e)?B[P.Normal]:D[P.Normal],side:y.DoubleSide}),n=Object(R.a)(t,i.length?i.map(t=>new y.MeshBasicMaterial({map:t,side:y.DoubleSide,transparent:e!==I.c.PofuillySlime&&e!==I.c.PouillySlime,alphaTest:.01})):o,o);return n.name=C(e),n}B[P.Normal]=16711680,B[P.Hovered]=16727903,B[P.Selected]=16711764;var M=i("ouMO");const W=180/Math.PI,q=1/W;function F(e){return e*W}function V(e){return e*q}function U(e,t){return(e%t+t)%t}var N=i("wtpc");function z(e,t,i){return new y.Euler(e,t,i,"ZXY")}function $(e){return(new y.Euler).setFromQuaternion(e,"ZXY")}const A=new y.Quaternion,H=new y.Quaternion;class G{constructor(e,t,i,o,n){this._section=Object(M.e)(void 0),Object(N.f)(e,"type"),Object(N.l)(t,"area_id"),Object(N.l)(i,"section_id"),Object(N.f)(o,"position"),Object(N.f)(n,"rotation"),this.type=e,this.area_id=t,this.section=this._section,this._section_id=Object(M.e)(i),this.section_id=this._section_id,this._position=Object(M.e)(o),this.position=this._position,this._world_position=Object(M.e)(o),this.world_position=this._world_position,this._rotation=Object(M.e)(n),this.rotation=this._rotation,this._world_rotation=Object(M.e)(n),this.world_rotation=this._world_rotation}set_section(e){if(e.area_variant.area.id!==this.area_id)throw new Error("Quest entities can't be moved across areas.");return this._section.val=e,this._section_id.val=e.id,this.set_position(this.position.val),this.set_rotation(this.rotation.val),this}set_position(e){this._position.val=e;const t=this.section.val;return this._world_position.val=t?e.clone().applyEuler(t.rotation).add(t.position):e,this}set_world_position(e){this._world_position.val=e;const t=this.section.val;return this._position.val=t?e.clone().sub(t.position).applyEuler(t.inverse_rotation):e,this}set_rotation(e){K(e),this._rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),this._world_rotation.val=K($(A.multiply(H)))):this._world_rotation.val=e,this}set_world_rotation(e){K(e),this._world_rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),H.inverse(),this._rotation.val=K($(A.multiply(H)))):this._rotation.val=e,this}}function K(e){return e.set(U(e.x,2*Math.PI),U(e.y,2*Math.PI),U(e.z,2*Math.PI))}class Q extends G{constructor(e,t,i,o,n,s,r,a,d,c,l,_,u){var v,h,p,g,b,f;Object(N.l)(t,"pso_type_id"),Object(N.k)(i,"npc_id"),Object(N.m)(n,"pso_wave2"),Object(N.l)(s,"script_label"),Object(N.l)(r,"pso_roaming"),Object(N.f)(_,"scale"),Object(N.f)(u,"unknown"),Object(N.d)(2===u.length,()=>`unknown should be of length 2, was ${u.length}.`),Object(N.d)(10===u[0].length,()=>`unknown[0] should be of length 10, was ${u[0].length}`),Object(N.d)(4===u[1].length,()=>`unknown[1] should be of length 4, was ${u[1].length}`),super(e,a,d,c,l),this.pso_type_id=t,this.npc_id=i,this._wave=Object(M.e)(o),this.wave=this._wave;const m=null===(h=null===(v=o)||void 0===v?void 0:v.id)||void 0===h?void 0:h.val,w=null===(g=null===(p=o)||void 0===p?void 0:p.section_id)||void 0===g?void 0:g.val,k=null===(f=null===(b=o)||void 0===b?void 0:b.area_id)||void 0===f?void 0:f.val;this._pso_wave2=n,this.pso_wave2=this.wave.flat_map(e=>null==e?Object(M.e)(null==m?this._pso_wave2:0):m===e.id.val&&w===e.section_id.val&&k===e.area_id.val?e.id.map(e=>m===e?this._pso_wave2:e):e.id),this.script_label=s,this.pso_roaming=r,this.unknown=u,this.scale=_}set_wave(e){return this._wave.val=e,this}}class Y extends k.a{constructor(e,t){super(e),this._collision_geometry=new y.Object3D,this._render_geometry=new y.Object3D,this._entity_models=new y.Object3D,this.disposer=new a.a,this.entity_to_mesh=new Map,this.camera=new y.PerspectiveCamera(60,1,10,1e4),this.disposer.add(t(this))}get debug(){return super.debug}set debug(e){this.debug!==e&&(super.debug=e,this._render_geometry.visible=e,this.schedule_render())}get collision_geometry(){return this._collision_geometry}set collision_geometry(e){this.scene.remove(this.collision_geometry),this._collision_geometry=e,this.scene.add(e)}set render_geometry(e){this.scene.remove(this._render_geometry),this._render_geometry=e,e.visible=this.debug,this.scene.add(e)}get entity_models(){return this._entity_models}init_camera_controls(){super.init_camera_controls()}dispose(){super.dispose(),this.disposer.dispose()}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}reset_entity_models(){this.scene.remove(this._entity_models),this._entity_models=new y.Group,this.scene.add(this._entity_models),this.entity_to_mesh.clear(),this.schedule_render()}add_entity_model(e){const t=e.userData.entity;this._entity_models.add(e),this.entity_to_mesh.set(t,e),t===this.selected_entity&&this.mark_selected(e),this.schedule_render()}remove_entity_model(e){const t=this.entity_to_mesh.get(e);t&&(this.entity_to_mesh.delete(e),this._entity_models.remove(t),this.schedule_render())}get_entity_mesh(e){return this.entity_to_mesh.get(e)}mark_selected(e){e===this.hovered_mesh&&(this.hovered_mesh=void 0),e!==this.selected_mesh&&(this.selected_mesh&&Z(this.selected_mesh,P.Normal),Z(e,P.Selected),this.schedule_render()),this.selected_mesh=e}mark_hovered(e){this.selected_mesh&&e===this.selected_mesh||(e!==this.hovered_mesh&&(this.hovered_mesh&&Z(this.hovered_mesh,P.Normal),e&&Z(e,P.Hovered),this.schedule_render()),this.hovered_mesh=e)}unmark_selected(){this.selected_mesh&&(Z(this.selected_mesh,P.Normal),this.schedule_render()),this.selected_mesh=void 0}}function Z(e,t){const i=e.userData.entity instanceof Q?B[t]:D[t];if(e)if(Array.isArray(e.material))for(const o of e.material)t===P.Normal&&o.map?o.color.set(16777215):o.color.set(i);else e.material.color.set(i)}var J=i("oxtq"),X=i("rwco"),ee=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const te=X.a.get("quest_editor/rendering/QuestModelManager"),ie=Object.freeze(new y.Vector3(0,800,700)),oe=Object.freeze(new y.Vector3(0,0,0)),ne=new y.Object3D;class se{constructor(e,t,i,o){this.renderer=t,this.area_asset_loader=i,this.entity_asset_loader=o,this.disposer=new a.a,this.quest_disposer=this.disposer.add(new a.a),this.area_variant_changed=()=>ee(this,void 0,void 0,(function*(){const{episode:e,area_variant:t,npcs:i,objects:o}=this.get_area_variant_details();yield this.area_model_manager.load(e,t),this.quest_disposer.dispose_all(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models(),this.quest_disposer.add_all(i.observe_list(this.npcs_changed,{call_now:!0}),o.observe_list(this.objects_changed,{call_now:!0}))})),this.npcs_changed=e=>{e.type===J.a.ListChange&&(this.npc_model_manager.remove(e.removed),this.npc_model_manager.add(e.inserted))},this.objects_changed=e=>{e.type===J.a.ListChange&&(this.object_model_manager.remove(e.removed),this.object_model_manager.add(e.inserted))},this.area_model_manager=new re(this.renderer,i),this.npc_model_manager=new ae(e,this.renderer,o),this.object_model_manager=new ae(e,this.renderer,o)}dispose(){this.disposer.dispose(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models()}}class re{constructor(e,t){this.renderer=e,this.area_asset_loader=t,this.raycaster=new y.Raycaster,this.origin=new y.Vector3,this.down=Object.freeze(new y.Vector3(0,-1,0)),this.up=Object.freeze(new y.Vector3(0,1,0))}load(e,t){return ee(this,void 0,void 0,(function*(){if(this.area_variant=t,null==e||null==t)return this.renderer.collision_geometry=ne,void(this.renderer.render_geometry=ne);try{const i=yield this.area_asset_loader.load_collision_geometry(e,t);if(this.should_cancel(t))return;const o=yield this.area_asset_loader.load_render_geometry(e,t);if(this.should_cancel(t))return;this.add_sections_to_collision_geometry(i,o),this.renderer.collision_geometry=i,this.renderer.render_geometry=o,this.renderer.reset_camera(ie,oe)}catch(e){te.error(`Couldn't load models for area ${t.area.id}, variant ${t.id}.`,e),this.renderer.collision_geometry=ne,this.renderer.render_geometry=ne}}))}should_cancel(e){return this.area_variant!==e}add_sections_to_collision_geometry(e,t){for(const i of e.children){i.geometry.boundingBox.getCenter(this.origin),this.raycaster.set(this.origin,this.down);const e=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);this.raycaster.set(this.origin,this.up);const o=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);let n;if(n=e&&o?e.distance<=o.distance?e:o:e||o,n){const e=i.userData,t=n.object.userData;e.section=t.section}}}}class ae{constructor(e,t,i){this.current_wave=e,this.renderer=t,this.entity_asset_loader=i,this.queue=[],this.loaded_entities=[],this.loading=!1}add(e){return ee(this,void 0,void 0,(function*(){if(this.queue.push(...e),!this.loading)try{for(this.loading=!0;this.queue.length;){const e=this.queue[0];try{yield this.load(e)}catch(t){te.error(`Couldn't load model for entity ${C(e.type)}.`,t)}finally{const t=this.queue.indexOf(e);-1!==t&&this.queue.splice(t,1)}}}finally{this.loading=!1}}))}remove(e){for(const t of e){const e=this.queue.indexOf(t);-1!==e&&this.queue.splice(e,1);const i=this.loaded_entities.findIndex(e=>e.entity===t);if(-1!==i){const e=this.loaded_entities.splice(i,1)[0];this.renderer.remove_entity_model(e.entity),e.disposer.dispose()}}}remove_all(){for(const{disposer:e}of this.loaded_entities)e.dispose();this.loaded_entities.splice(0,1/0),this.queue.splice(0,1/0)}load(e){return ee(this,void 0,void 0,(function*(){const t=yield this.entity_asset_loader.load_geometry(e.type);if(!this.queue.includes(e))return;const i=yield this.entity_asset_loader.load_textures(e.type);if(!this.queue.includes(e))return;const o=function(e,t,i){const o=E(e.type,t,i);return o.userData.entity=e,o.position.copy(e.world_position.val),o.rotation.copy(e.world_rotation.val),o}(e,t,i);this.update_entity_geometry(e,o)}))}update_entity_geometry(e,t){this.renderer.add_entity_model(t);const i=new a.a(e.world_position.observe(({value:e})=>{t.position.copy(e),this.renderer.schedule_render()}),e.world_rotation.observe(({value:e})=>{t.rotation.copy(e),this.renderer.schedule_render()}));e instanceof Q&&i.add(Object(M.d)((e,t)=>null==e||e===t,this.current_wave,e.wave).observe(({value:e})=>{t.visible=e,this.renderer.schedule_render()},{call_now:!0})),this.loaded_entities.push({entity:e,disposer:i})}}class de extends se{constructor(e,t,i,o,n,s){super(i,o,n,s),this.current_quest=e,this.current_area=t,this.disposer.add_all(e.observe(this.area_variant_changed),t.observe(this.area_variant_changed))}get_area_variant_details(){var e;const t=this.current_quest.val,i=this.current_area.val;let o,n,s;return t&&i?(o=t.area_variants.val.find(e=>e.area.id===i.id)||i.area_variants[0],n=t.npcs.filtered(e=>e.area_id===i.id),s=t.objects.filtered(e=>e.area_id===i.id)):(n=Object(M.c)(),s=Object(M.c)()),{episode:null===(e=t)||void 0===e?void 0:e.episode,area_variant:o,npcs:n,objects:s}}}var ce=i("KUR2");class le extends b.a{constructor(e,t,i){super(),this.element=Object(u.h)({className:t,tabIndex:-1}),this.renderer=i,this.renderer_view=this.add(new ce.a(this.renderer)),this.element.append(this.renderer_view.element),this.disposables(e.debug.observe(({value:e})=>this.renderer.debug=e)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer_view.resize(e,t),this}}let _e=void 0;const ue=new Map,ve=new y.Vector2(0,0);let he=0;function pe(e,t,i){function o(e){_e&&i(Object.assign(Object.assign({},_e),{event:e}))}ue.set(i,o),e.addEventListener(t,o)}function ge(e,t,i){const o=ue.get(i);o&&(ue.delete(i),e.removeEventListener(t,o))}function be(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"),_e&&(_e.drag_element.style.transform=`translate(${e.clientX-ve.x}px, ${e.clientY-ve.y}px)`)}function fe(){_e&&(_e.drag_element.remove(),_e=void 0)}class me extends G{constructor(e,t,i,o,n,s,r,a,d){super(e,o,n,s,r),this.id=t,this.group_id=i,this.properties=a,this.unknown=d}}class we{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Create ${L(i.type).name}`}undo(){this.quest.remove_entity(this.entity)}redo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}}class ke{constructor(e,t,i,o,n){this.quest_editor_store=e,this.entity=t,this.old_rotation=i,this.new_rotation=o,this.world=n,this.description=`Rotate ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.old_rotation):this.entity.set_rotation(this.old_rotation)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.new_rotation):this.entity.set_rotation(this.new_rotation)}}class ye{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Delete ${L(i.type).name}`,this.redo()}undo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}redo(){this.quest.remove_entity(this.entity)}}class Re{constructor(e,t,i,o,n,s,r){this.quest_editor_store=e,this.entity=t,this.old_section=i,this.new_section=o,this.old_position=n,this.new_position=s,this.world=r,this.description=`Move ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.old_section&&this.entity.set_section(this.old_section),this.world?this.entity.set_world_position(this.old_position):this.entity.set_position(this.old_position)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.new_section&&this.entity.set_section(this.new_section),this.world?this.entity.set_world_position(this.new_position):this.entity.set_position(this.new_position)}}const Ie=Object.freeze(new y.Vector3(0,0,0)),je=Object.freeze(new y.Vector3(0,1,0)),Te=Object.freeze(new y.Vector3(0,-1,0)),xe=2*Math.PI,Se=new y.Raycaster;class Ce{constructor(e,t){this.quest_editor_store=e,this.renderer=t,this.disposer=new a.a,this.pointer_position=new y.Vector2(0,0),this.pointer_device_position=new y.Vector2(0,0),this.last_pointer_position=new y.Vector2(0,0),this.moved_since_last_pointer_down=!1,this._enabled=!0,this.dispose=()=>{this.renderer.canvas_element.removeEventListener("keydown",this.keydown),this.renderer.canvas_element.removeEventListener("mousedown",this.mousedown),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup),this.renderer.canvas_element.removeEventListener("mouseleave",this.mouseleave),ge(this.renderer.canvas_element,"dragenter",this.dragenter),ge(this.renderer.canvas_element,"dragover",this.dragover),ge(this.renderer.canvas_element,"dragleave",this.dragleave),ge(this.renderer.canvas_element,"drop",this.drop),this.disposer.dispose()},this.selected_entity_changed=({value:e})=>{if(this.state.cancel(),e){const t=this.renderer.get_entity_mesh(e);t?this.renderer.mark_selected(t):this.renderer.unmark_selected()}else this.renderer.unmark_selected()},this.keydown=e=>{this.state=this.state.process_event({type:Oe.KeyDown,key:e.key})},this.mousedown=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseDown,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.addEventListener("mousemove",this.mousemove),document.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseMove,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.mouseup=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseUp,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.addEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup)},this.mouseleave=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Oe.MouseLeave,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.dragenter=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragEnter,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragover=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragOver,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragleave=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Oe.EntityDragLeave,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.drop=e=>{this.process_mouse_event(e.event),this.renderer.canvas_element.focus(),this.state=this.state.process_event({type:Oe.EntityDrop})},this.mark_hovered=e=>{this.renderer.mark_hovered(e)},this.disposer.add(e.selected_entity.observe(this.selected_entity_changed)),t.canvas_element.addEventListener("keydown",this.keydown),t.canvas_element.addEventListener("mousedown",this.mousedown),t.canvas_element.addEventListener("mousemove",this.mousemove),t.canvas_element.addEventListener("mouseleave",this.mouseleave),pe(t.canvas_element,"dragenter",this.dragenter),pe(t.canvas_element,"dragover",this.dragover),pe(t.canvas_element,"dragleave",this.dragleave),pe(t.canvas_element,"drop",this.drop),this.state=new Le(this.quest_editor_store,t,this._enabled)}set enabled(e){this._enabled=e,this.state.cancel(),this.state=new Le(this.quest_editor_store,this.renderer,this._enabled)}process_mouse_event(e){const{left:t,top:i}=this.renderer.canvas_element.getBoundingClientRect();this.pointer_position.set(e.clientX-t,e.clientY-i),this.pointer_device_position.copy(this.pointer_position),this.renderer.pointer_pos_to_device_coords(this.pointer_device_position),"mousedown"===e.type?this.moved_since_last_pointer_down=!1:"mousemove"!==e.type&&"mouseup"!==e.type||this.pointer_position.equals(this.last_pointer_position)||(this.moved_since_last_pointer_down=!0),this.last_pointer_position.copy(this.pointer_position)}}var Oe;!function(e){e[e.KeyDown=0]="KeyDown",e[e.MouseDown=1]="MouseDown",e[e.MouseMove=2]="MouseMove",e[e.MouseUp=3]="MouseUp",e[e.MouseLeave=4]="MouseLeave",e[e.EntityDragEnter=5]="EntityDragEnter",e[e.EntityDragOver=6]="EntityDragOver",e[e.EntityDragLeave=7]="EntityDragLeave",e[e.EntityDrop=8]="EntityDrop"}(Oe||(Oe={}));class Le{constructor(e,t,i){this.quest_editor_store=e,this.renderer=t,this.enabled=i}process_event(e){switch(e.type){case Oe.KeyDown:if(this.enabled){const t=this.quest_editor_store.selected_entity.val;if(t&&"Delete"===e.key){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new ye(this.quest_editor_store,e,t))}}return this;case Oe.MouseDown:{const t=this.pick_entity(e.pointer_device_position);if(t)if(1===e.buttons){if(this.quest_editor_store.set_selected_entity(t.entity),this.enabled)return new Pe(this.quest_editor_store,this.renderer,t.entity,t.drag_adjust,t.grab_offset)}else if(2===e.buttons&&(this.quest_editor_store.set_selected_entity(t.entity),this.enabled))return new De(this.quest_editor_store,this.renderer,t.entity,t.mesh,t.grab_offset);return this}case Oe.MouseMove:{const t=this.pick_entity(e.pointer_device_position);return e.mark_hovered(t&&t.mesh),this}case Oe.MouseUp:return e.moved_since_last_pointer_down||this.pick_entity(e.pointer_device_position)||this.quest_editor_store.set_selected_entity(void 0),this;case Oe.MouseLeave:return e.mark_hovered(void 0),this;case Oe.EntityDragEnter:if(this.enabled){const t=this.quest_editor_store.current_area.val,i=this.quest_editor_store.current_quest.val;return t&&i?new Be(this.quest_editor_store,this.renderer,e,i,t):this}return this;default:return this}}cancel(){}pick_entity(e){Se.setFromCamera(e,this.renderer.camera);const[t]=Se.intersectObjects(this.renderer.entity_models.children);if(!t)return;const i=t.object.userData.entity,o=t.object.position.clone().sub(t.point),n=o.clone();Se.set(t.object.position,Te);const[s]=Se.intersectObjects(this.renderer.collision_geometry.children,!0);return s&&(n.y-=s.distance),{mesh:t.object,entity:i,grab_offset:o,drag_adjust:n}}}class Pe{constructor(e,t,i,o,n){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.drag_adjust=o,this.grab_offset=n,this.cancelled=!1,this.initial_section=i.section.val,this.initial_position=i.world_position.val,this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Oe.MouseMove:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&Ee(this.renderer,this.entity,this.drag_adjust,this.grab_offset,e.pointer_device_position,e.shift_key),this);case Oe.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new Re(this.quest_editor_store,this.entity,this.initial_section,this.entity.section.val,this.initial_position,this.entity.world_position.val,!0)).redo(),new Le(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.initial_section&&this.entity.set_section(this.initial_section),this.entity.set_world_position(this.initial_position)}}class De{constructor(e,t,i,o,n){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.mesh=o,this.cancelled=!1,this.initial_rotation=i.world_rotation.val,this.grab_point=i.world_position.val.clone().sub(n),this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Oe.MouseMove:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&qe(this.renderer,this.entity,this.mesh.quaternion,this.initial_rotation,this.grab_point,e.pointer_device_position),this);case Oe.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new ke(this.quest_editor_store,this.entity,this.initial_rotation,this.entity.world_rotation.val,!0)),new Le(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Le(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.entity.set_world_rotation(this.initial_rotation)}}class Be{constructor(e,t,i,o,n){if(this.quest_editor_store=e,this.drag_adjust=new y.Vector3(0,0,0),this.cancelled=!1,this.renderer=t,i.drag_element.style.display="none",i.data_transfer&&(i.data_transfer.dropEffect="copy"),O(i.entity_type)){const t=Object(I.d)(i.entity_type);this.entity=new Q(i.entity_type,t.pso_type_id,0,e.selected_wave.val,0,0,t.pso_roaming,n.id,0,new y.Vector3(0,0,0),z(0,0,0),new y.Vector3(1,1,1),[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0]])}else this.entity=new me(i.entity_type,0,0,n.id,0,new y.Vector3(0,0,0),z(0,0,0),new Map,[[0,0,0,0,0,0],[0,0]]);Me(this.renderer,this.entity,this.drag_adjust,Ie,i.pointer_device_position),o.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}process_event(e){switch(e.type){case Oe.EntityDragOver:return this.cancelled?(e.drag_element.style.display="flex",e.data_transfer&&(e.data_transfer.dropEffect="none"),new Le(this.quest_editor_store,this.renderer,!0)):(e.stop_propagation(),e.prevent_default(),e.data_transfer&&(e.data_transfer.dropEffect="copy"),Ee(this.renderer,this.entity,this.drag_adjust,Ie,e.pointer_device_position,e.shift_key),this);case Oe.EntityDragLeave:{e.drag_element.style.display="flex";const t=this.quest_editor_store.current_quest.val;return t&&t.remove_entity(this.entity),new Le(this.quest_editor_store,this.renderer,!0)}case Oe.EntityDrop:if(!this.cancelled){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new we(this.quest_editor_store,e,this.entity))}return new Le(this.quest_editor_store,this.renderer,!0);default:return this}}cancel(){this.cancelled=!0;const e=this.quest_editor_store.current_quest.val;e&&e.remove_entity(this.entity)}}function Ee(e,t,i,o,n,s){s?We(e,t,i,o,n):Me(e,t,i,o,n)}const Me=(()=>{const e=new y.Plane,t=new y.Vector3;return(i,o,n,s,r)=>{const{intersection:a,section:d}=function(e,t,i){Se.setFromCamera(t,e.camera),Se.ray.origin.add(i);const o=Se.intersectObjects(e.collision_geometry.children,!0);for(const e of o)if(e.face.normal.y>.75)return{intersection:e,section:e.object.userData.section};return{}}(i,r,n);if(a){if(d){const e=o.world_rotation.val;o.set_section(d),o.set_world_rotation(e)}o.set_world_position(new y.Vector3(a.point.x,a.point.y+s.y-n.y,a.point.z))}else Se.setFromCamera(r,i.camera),e.set(je,-o.world_position.val.y+s.y),Se.ray.intersectPlane(e,t)&&o.set_world_position(new y.Vector3(t.x+s.x,o.world_position.val.y,t.z+s.z))}})(),We=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3;return(n,s,r,a,d)=>{if(Se.setFromCamera(d,n.camera),n.camera.getWorldDirection(e),e.negate(),e.y=0,e.normalize(),o.set(s.world_position.val.x,s.world_position.val.y,s.world_position.val.z),o.sub(a),t.setFromNormalAndCoplanarPoint(e,o),Se.ray.intersectPlane(t,i)){const e=i.y+a.y,t=e-s.world_position.val.y;r.y-=t,s.set_world_position(new y.Vector3(s.world_position.val.x,e,s.world_position.val.z))}}})(),qe=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3,n=new y.Vector3,s=new y.Vector3;return(r,a,d,c,l,_)=>{if(e.copy(je),e.applyQuaternion(d),t.setFromNormalAndCoplanarPoint(e,l),Se.setFromCamera(_,r.camera),Se.ray.intersectPlane(t,i)){t.projectPoint(a.world_position.val,o),n.subVectors(o,l),s.subVectors(o,i);const r=n.dot(s),d=e.dot(n.cross(s)),_=Math.atan2(d,r);a.set_world_rotation(new y.Euler(c.x,(c.y+_)%xe,c.z,"ZXY"))}}})();class Fe extends le{constructor(e,t,i,o){super(e,"quest_editor_QuestEditorRendererView",new Y(o,o=>new de(e.current_quest,e.current_area,e.selected_wave,o,t,i))),this.element.addEventListener("focus",()=>e.undo.make_current(),!0),this.entity_controls=this.disposable(new Ce(e,this.renderer)),this.disposables(e.selected_entity.observe(({value:e})=>this.renderer.selected_entity=e),e.quest_runner.running.observe(({value:e})=>this.entity_controls.enabled=!e,{call_now:!0})),this.renderer.init_camera_controls(),this.finalize_construction()}}var Ve=i("wsa1"),Ue=i("w6HN"),Ne=i("oyid");class ze extends Ue.a{constructor(e){const t=new Ne.a(!0,{label:"Inline args mode",tooltip:e.has_issues.map(e=>{let t="Transform arg_push* opcodes to be inline with the opcode the arguments are given to.";return e&&(t+="\nThis mode cannot be toggled because there are issues in the script."),t})});super(t),this.disposables(t.checked.bind_to(e.inline_args_mode),t.checked.observe(({value:t})=>e.set_inline_args_mode(t)),t.enabled.bind_to(e.has_issues.map(e=>!e))),this.finalize_construction()}}var $e=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))},Ae=Ve.editor.ScrollType;class He{constructor(e){this.editor=e,this.history=[],this.history_index=-1,this.capture_history=!0,this.disposer=new a.a,this.did_change_cursor_position=e=>{this.capture_history&&(this.history.splice(this.history_index+1,1/0),"api"===e.source||-1===this.history_index||Math.abs(e.position.lineNumber-this.history[this.history_index].lineNumber)>=10?(this.history.push(e.position),this.history_index++):this.history[this.history_index]=e.position)},this.back=()=>$e(this,void 0,void 0,(function*(){this.history_index>0&&this.set_position(this.history[--this.history_index])})),this.forward=()=>$e(this,void 0,void 0,(function*(){this.history_index+1{this.capture_history=!1,this.editor.setPosition(e),this.editor.revealPositionInCenterIfOutsideViewport(e,Ae.Immediate),this.capture_history=!0},this.mouse_up=e=>{const t=e.event.browserEvent.button,i=e.event.browserEvent.buttons;3===t?(0===i&&(e.event.preventDefault(),this.back()),this.editor.focus()):4===t&&(0===i&&(e.event.preventDefault(),this.forward()),this.editor.focus())},this.disposer.add_all(this.editor.onDidChangeCursorPosition(this.did_change_cursor_position),this.editor.addAction({id:"phantasmal.action.back",label:"Back",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.LeftArrow],run:this.back}),this.editor.addAction({id:"phantasmal.action.forward",label:"Forward",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.RightArrow],run:this.forward}),this.editor.onMouseUp(this.mouse_up))}dispose(){this.disposer.dispose()}reset(){this.history.splice(0,1/0),this.history_index=-1}}i("/NSH");Ve.editor.defineTheme("phantasmal-world",{base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"e0e0e0",background:"#181818"},{token:"tag",foreground:"99bbff"},{token:"keyword",foreground:"d0a0ff",fontStyle:"bold"},{token:"predefined",foreground:"bbffbb"},{token:"number",foreground:"ffffaa"},{token:"number.hex",foreground:"ffffaa"},{token:"string",foreground:"88ffff"},{token:"string.escape",foreground:"8888ff"}],colors:{"editor.background":"#181818","editor.lineHighlightBackground":"#202020"}});const Ge=Ve.editor.createModel("","psoasm");class Ke extends b.a{constructor(e,t,i){super(),this.asm_editor_store=i,this.breakpoint_decoration_ids=[],this.element=Object(u.h)(),this.tool_bar_view=this.add(new ze(i)),this.element.append(this.tool_bar_view.element),this.editor=this.disposable(Ve.editor.create(this.element,{theme:"phantasmal-world",scrollBeyondLastLine:!1,autoIndent:"full",fontSize:13,wordWrap:"on",wrappingIndent:"indent",renderIndentGuides:!1,folding:!1,glyphMargin:e.feature_active("vm")})),this.history=this.disposable(new He(this.editor)),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyCode.KEY_Z,()=>{}),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_Z,()=>{});const o=this.editor.getAction("editor.action.quickCommand");this.disposables(this.editor.addAction({id:"editor.action.quickCommand",label:"Command Palette",keybindings:[Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_P],run:()=>o.run()})),this.disposables(i.did_undo.observe(({value:e})=>{this.editor.trigger(e,"undo",void 0)}),i.did_redo.observe(({value:e})=>{this.editor.trigger(e,"redo",void 0)}),i.model.observe(({value:e})=>{this.editor.updateOptions({readOnly:!this.enabled.val||!e}),this.editor.setModel(e||Ge),this.history.reset(),this.breakpoint_decoration_ids=[],this.execloc_decoration_id="",t.clear_breakpoints()},{call_now:!0}),i.breakpoints.observe_list(e=>{var t;if(e.type===J.a.ListChange){for(const t of e.removed){const e=this.editor.getLineDecorations(t.line_no);if(e)for(const t of e){const e=this.breakpoint_decoration_ids.indexOf(t.id);if(e>-1){this.editor.deltaDecorations([t.id],[]),this.breakpoint_decoration_ids.splice(e,1);break}}}for(const i of e.inserted){(null===(t=this.editor.getLineDecorations(i.line_no))||void 0===t?void 0:t.some(e=>this.breakpoint_decoration_ids.includes(e.id)))||this.breakpoint_decoration_ids.push(this.editor.deltaDecorations([],[{range:new Ve.Range(i.line_no,0,i.line_no,0),options:{glyphMarginClassName:"quest_editor_AsmEditorView_breakpoint-enabled",glyphMarginHoverMessage:{value:"Breakpoint"}}}])[0])}}}),i.pause_location.observe(e=>{const t=this.old_pause_location,i=e.value;if(this.old_pause_location=i,void 0!==t&&void 0!==this.execloc_decoration_id){this.editor.getLineDecorations(t)&&this.editor.deltaDecorations([this.execloc_decoration_id],[])}void 0!==i&&(this.execloc_decoration_id=this.editor.deltaDecorations([],[{range:new Ve.Range(i,0,i,0),options:{className:"quest_editor_AsmEditorView_execution-location",isWholeLine:!0}}])[0],this.editor.revealLineInCenterIfOutsideViewport(i))}),this.editor.onDidFocusEditorWidget(()=>i.undo.make_current()),this.editor.onMouseDown(e=>{switch(e.target.type){case Ve.editor.MouseTargetType.GUTTER_GLYPH_MARGIN:{const i=e.target.position;if(!i)return;t.toggle_breakpoint(i.lineNumber)}}}),this.enabled.bind_to(t.running.map(e=>!e))),this.finalize_construction()}focus(){this.editor.focus()}resize(e,t){const i=Math.max(0,t-this.tool_bar_view.height);return this.editor.layout({width:e,height:i}),this}set_enabled(e){super.set_enabled(e),this.tool_bar_view.enabled.val=e,this.editor.updateOptions({readOnly:!e||!this.asm_editor_store.model.val})}}i("egRq");class Qe extends b.a{constructor(e){super(),this.ctrl=e,this.element=Object(u.h)({className:"quest_editor_EntityInfoView",tabIndex:-1}),this.no_entity_view=new g("No entity selected."),this.table_element=Object(u.t)(),this.pos_x_element=this.add(new r.a(0,{round_to:3})),this.pos_y_element=this.add(new r.a(0,{round_to:3})),this.pos_z_element=this.add(new r.a(0,{round_to:3})),this.rot_x_element=this.add(new r.a(0,{round_to:3})),this.rot_y_element=this.add(new r.a(0,{round_to:3})),this.rot_z_element=this.add(new r.a(0,{round_to:3}));const t="quest_editor_EntityInfoView_coord";this.table_element.append(Object(u.A)(Object(u.y)("Type:"),this.type_element=Object(u.v)()),Object(u.A)(Object(u.y)("Name:"),this.name_element=Object(u.v)()),Object(u.A)(Object(u.y)("Section:"),this.section_id_element=Object(u.v)()),this.wave_row_element=Object(u.A)(Object(u.y)("Wave:"),this.wave_element=Object(u.v)()),Object(u.A)(Object(u.y)({colSpan:2},"Position:")),Object(u.A)(Object(u.y)({className:t},"X:"),Object(u.v)(this.pos_x_element.element)),Object(u.A)(Object(u.y)({className:t},"Y:"),Object(u.v)(this.pos_y_element.element)),Object(u.A)(Object(u.y)({className:t},"Z:"),Object(u.v)(this.pos_z_element.element)),Object(u.A)(Object(u.y)({colSpan:2},"Rotation:")),Object(u.A)(Object(u.y)({className:t},"X:"),Object(u.v)(this.rot_x_element.element)),Object(u.A)(Object(u.y)({className:t},"Y:"),Object(u.v)(this.rot_y_element.element)),Object(u.A)(Object(u.y)({className:t},"Z:"),Object(u.v)(this.rot_z_element.element))),this.element.append(this.table_element,this.no_entity_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(Object(u.c)(this.table_element,"hidden",e.unavailable),this.no_entity_view.visible.bind_to(e.unavailable),Object(u.c)(this.type_element,"textContent",e.type),Object(u.c)(this.name_element,"textContent",e.name),Object(u.c)(this.section_id_element,"textContent",e.section_id),Object(u.c)(this.wave_element,"textContent",e.wave),Object(u.c)(this.wave_row_element,"hidden",e.wave_hidden),e.position.observe(({value:{x:e,y:t,z:i}})=>{this.pos_x_element.value.val=e,this.pos_y_element.value.val=t,this.pos_z_element.value.val=i},{call_now:!0}),e.rotation.observe(({value:{x:e,y:t,z:i}})=>{this.rot_x_element.value.val=F(e),this.rot_y_element.value.val=F(t),this.rot_z_element.value.val=F(i)},{call_now:!0}),this.pos_x_element.value.observe(({value:t})=>e.set_pos_x(t)),this.pos_y_element.value.observe(({value:t})=>e.set_pos_y(t)),this.pos_z_element.value.observe(({value:t})=>e.set_pos_z(t)),this.rot_x_element.value.observe(({value:t})=>e.set_rot_x(t)),this.rot_y_element.value.observe(({value:t})=>e.set_rot_y(t)),this.rot_z_element.value.observe(({value:t})=>e.set_rot_z(t)),this.enabled.bind_to(e.enabled)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.pos_x_element.enabled.val=e,this.pos_y_element.enabled.val=e,this.pos_z_element.enabled.val=e,this.rot_x_element.enabled.val=e,this.rot_y_element.enabled.val=e,this.rot_z_element.enabled.val=e}}var Ye=i("4SjJ");i("ZZ0G");class Ze extends b.a{constructor(e,t,i){super(),this.entity_image_renderer=t,this.entities=Object(M.c)(),this.create_entity_element=(e,t)=>{const i=Object(u.h)({className:"quest_editor_EntityListView_entity",data:{index:t.toString()}});i.draggable=!0;const o=Object(u.l)({width:100,height:100});o.style.visibility="hidden",o.style.pointerEvents="none",i.append(o),this.entity_image_renderer.render(e).then(e=>{o.src=e,o.style.visibility="visible"});const n=Object(u.s)(L(e).name);return i.append(n),i};const o=Object(u.h)({className:"quest_editor_EntityListView_entity_list"});this.element=Object(u.h)({className:`${i} quest_editor_EntityListView`,tabIndex:-1},o),this.disposables(Object(u.d)(o,this.entities,this.create_entity_element),function(e,t){function i(e){if(e.target instanceof HTMLElement){const i=t(e.target);i?(ve.set(e.offsetX,e.offsetY),_e={drag_element:i[0],entity_type:i[1]},_e.drag_element.style.position="fixed",_e.drag_element.style.pointerEvents="none",_e.drag_element.style.zIndex="500",_e.drag_element.style.top="0",_e.drag_element.style.left="0",_e.drag_element.style.transform=`translate(${e.clientX-ve.x}px, ${e.clientY-ve.y}px)`,document.body.append(_e.drag_element),e.dataTransfer&&(e.dataTransfer.effectAllowed="copy",e.dataTransfer.setDragImage(Object(u.h)(),0,0),e.dataTransfer.setData("phantasmal-entity",L(_e.entity_type).name))):e.preventDefault()}}return e.addEventListener("dragstart",i),1==++he&&(document.addEventListener("dragover",be),document.addEventListener("dragend",fe)),{dispose(){e.removeEventListener("dragstart",i),0==--he&&(document.removeEventListener("dragover",be),document.removeEventListener("dragend",fe))}}}(o,e=>{if(!this.enabled.val)return;let t=e;do{const i=e.dataset.index;if(null!=i)return[t.querySelector("img").cloneNode(!0),this.entities.get(parseInt(i,10))];t=t.parentElement}while(t&&t!==o)}),this.enabled.bind_to(e.quest_runner.running.map(e=>!e)))}}class Je extends Ze{constructor(e,t){super(e,t,"quest_editor_NpcListView"),this.quest_editor_store=e,this.filter_npcs=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:s.b.I,o=t?t.id:0;this.entities.val=I.b.filter(e=>{const t=Object(I.d)(e);return(null==t.episode||t.episode===i)&&t.area_ids.includes(o)})},this.disposables(e.current_quest.observe(this.filter_npcs),e.current_area.observe(this.filter_npcs)),this.filter_npcs(),this.finalize_construction()}}class Xe extends Ze{constructor(e,t){super(e,t,"quest_editor_ObjectListView"),this.quest_editor_store=e,this.filter_objects=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:s.b.I,o=t?t.id:0;this.entities.val=j.filter(e=>{const t=T(e);if(null==t.area_ids)return!0;const n=t.area_ids[i];return n&&n.includes(o)})},this.disposables(e.current_quest.observe(this.filter_objects),e.current_area.observe(this.filter_objects)),this.filter_objects(),this.finalize_construction()}}i("RL+K");var et,tt=i("KVVN");!function(e){e[e.NodeAdded=0]="NodeAdded",e[e.NodeRemoved=1]="NodeRemoved",e[e.EdgeAdded=2]="EdgeAdded",e[e.EdgeRemoved=3]="EdgeRemoved"}(et||(et={}));class it{constructor(e){this.area_id=e,this._connected_sub_graphs=Object(M.c)(),this.meta=new Map,this.emitter=Object(M.a)(),this.events=[],this.connected_sub_graphs=this._connected_sub_graphs,Object(N.m)(e,"area_id")}observe(e){return this.emitter.observe(e)}get_index(e){return this.meta.get(e).index}get_sub_graph(e){return this.meta.get(e).sub_graph}get_children(e){return this.meta.get(e).children}get_parents(e){return this.meta.get(e).parents}add_event(e,t,i){this.remove_event(e);const o=this.events.length,n=Object(M.c)(void 0,e);this.meta.set(e,{index:o,sub_graph:n,children:[],parents:[]}),this.events.push(e),this._connected_sub_graphs.push(n);for(const i of t)this.add_edge(i,e);for(const t of i)this.add_edge(e,t);this.emit({type:et.NodeAdded,event:e})}insert_event(e,t,i,o){this.remove_event(t);const n=Object(M.c)(void 0,t);this.meta.set(t,{index:e,sub_graph:n,parents:[],children:[]}),this.events.splice(e,0,t);for(let t=e+1;ti.index);)e++;i.sub_graph=n,n.splice(e,0,t),e++}this._connected_sub_graphs.remove(s),s.clear()}this.emit({type:et.EdgeAdded,parent:e,child:t})}remove_edge(e,t){this.internal_remove_edge(e,this.meta.get(e),t,this.meta.get(t))}internal_remove_edge(e,t,i,o){if(t&&o){const n=t.children.indexOf(i);-1!==n&&t.children.splice(n,1);const s=o.parents.indexOf(e);-1!==s&&o.parents.splice(s,1);const r=new Set;if(!this.connected(e,i,r)){const e=Object(M.c)(void 0,...r);e.sort((e,t)=>this.meta.get(e).index-this.meta.get(t).index);for(const i of e)t.sub_graph.remove(i);this.insert_sub_graph(this.meta.get(e.get(0)).index,e),o.sub_graph=e}this.emit({type:et.EdgeRemoved,parent:e,child:i})}}connected(e,t,i){if(e===t)return!0;if(i.has(t))return!1;i.add(t);const o=this.meta.get(t);if(o){for(const t of o.children)if(this.connected(e,t,i))return!0;for(const t of o.parents)if(this.connected(e,t,i))return!0}return!1}insert_sub_graph(e,t){let i=0;for(;ie)break;i++}this._connected_sub_graphs.splice(i,0,t)}emit(e){this.emitter.emit({value:e})}}i("xqR9");var ot,nt=i("uiJh");!function(e){e[e.SpawnNpcs=0]="SpawnNpcs",e[e.Unlock=1]="Unlock",e[e.Lock=2]="Lock"}(ot||(ot={}));const st=Object(nt.a)(ot);class rt{constructor(e,t){this.type=ot.SpawnNpcs,Object(N.m)(e,"section_id"),Object(N.m)(t,"appear_flag"),this.section_id=e,this.appear_flag=t}}class at{constructor(e){this.type=ot.Unlock,Object(N.m)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(N.m)(e,"door_id"),this._door_id.val=e}}class dt{constructor(e){this.type=ot.Lock,Object(N.m)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(N.m)(e,"door_id"),this._door_id.val=e}}i("CCCE");var ct=i("LSoc"),lt=i("QmPX");class _t extends lt.a{constructor(e){super(e),this.element=Object(u.h)({className:"core_DropDown"}),this.button_mousedown=()=>{this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next())},this.button=this.disposable(new tt.a({text:e.text,icon_left:e&&e.icon_left,icon_right:u.a.TriangleDown})),this.menu=this.disposable(new ct.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._chosen=Object(M.a)(),this.chosen=this._chosen,this.just_opened=!1,this.disposables(Object(u.g)(this.button.element,"mousedown",this.button_mousedown,{capture:!0}),this.button.onmouseup.observe(this.button_mouseup),this.button.onkeydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{void 0!==e&&(this._chosen.emit({value:e}),this.menu.selected.val=void 0)})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}}class ut extends p.a{constructor(e,t){super(),this.ctrl=e,this.event=t,this.inputs_enabled=Object(M.e)(!0),this.create_action_element=e=>{const t=new a.a;let i,o;if(e.type===ot.SpawnNpcs)i="Spawn:",o=Object(u.h)(Object(u.h)(t.add(new r.a(e.section_id,{min:0,step:1,enabled:!1})).element),Object(u.h)(t.add(new r.a(e.appear_flag,{min:0,step:1,enabled:!1})).element));else{i=e.type===ot.Unlock?"Unlock:":"Lock:";const n=t.add(new r.a(e.door_id.val,{min:0,step:1,enabled:this.inputs_enabled}));o=n.element,t.add_all(n.value.bind_to(e.door_id),n.value.observe(({value:t})=>e.set_door_id(t)))}const n=t.add(new tt.a({icon_left:u.a.Remove}));return t.add_all(n.onclick.observe(()=>this.ctrl.remove_action(this.event,e))),[Object(u.A)(Object(u.y)(i),Object(u.v)(o),Object(u.v)(n.element)),t]};const i=document.createTextNode(t.wave.id.val.toString());this.delay_input=this.add(new r.a(t.delay.val,{min:0,step:1,enabled:this.inputs_enabled}));const o=Object(u.t)({className:"quest_editor_EventView_actions"}),n=this.add(new _t({text:"Add action",items:st,to_label(e){switch(e){case ot.SpawnNpcs:return"Spawn NPCs";case ot.Unlock:return"Unlock door";case ot.Lock:return"Lock door"}}}));this.element=Object(u.h)({tabIndex:0},Object(u.t)(Object(u.A)(Object(u.y)("ID:"),Object(u.v)(t.id.toString())),Object(u.A)(Object(u.y)("Section:"),Object(u.v)(t.section_id.toString())),Object(u.A)(Object(u.y)("Wave:"),Object(u.v)(i)),Object(u.A)(Object(u.y)("Delay:"),Object(u.v)(this.delay_input.element)),Object(u.A)(Object(u.y)({colSpan:2},"Actions:")),Object(u.A)(Object(u.v)({colSpan:2},o)),Object(u.A)(Object(u.v)({colSpan:2},n.element)))),this.disposables(Object(u.c)(this.element,"className",e.is_selected(t).map(e=>`quest_editor_EventView ${e?"selected":""}`)),t.wave.id.observe(({value:e})=>i.data=e.toString()),Object(u.g)(this.element,"focus",()=>{e.set_selected_wave(t.wave)}),Object(u.g)(this.element,"click",i=>{i.stopPropagation(),e.set_selected_wave(t.wave)}),Object(u.g)(this.element,"keyup",i=>{"Delete"===i.key&&e.remove_event(t)}),this.delay_input.value.bind_to(t.delay),this.delay_input.value.observe(i=>e.set_delay(t,i.value)),Object(u.d)(o,t.actions,this.create_action_element),n.chosen.observe(({value:i})=>e.add_action(t,i))),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.inputs_enabled.val=e}}i("CGbB");const vt=X.a.get("quest_editor/gui/EventSubGraphView"),ht=8,pt=20;class gt extends p.a{constructor(e,t,i,o){super(),this.ctrl=e,this.dag=t,this.sub_graph=i,this.max_edge_depth=o,this.event_gui_data=new Map,this.event_container_element=Object(u.h)({className:"quest_editor_EventSubGraphView_event_container"}),this.edge_container_element=Object(u.h)({className:"quest_editor_EventSubGraphView_edge_container"}),this.element=Object(u.h)({className:"quest_editor_EventSubGraphView"},this.edge_container_element,this.event_container_element),this.update_edges=()=>{if(this.edge_container_element.innerHTML="",0===this.sub_graph.length.val)return;const e=Array(this.sub_graph.length.val-1);for(let t=0;tn,h=Math.min(n,a),p=Math.max(n,a);e:for(;;){for(let t=v?h:Math.max(0,h-1);t{const i=new a.a,o=i.add(new ut(this.ctrl,e));return this.event_gui_data.set(e,{event_view:o,position:t}),i.add({dispose:()=>this.event_gui_data.delete(e)}),[o.element,i]},this.after_events_changed=e=>{e.type===J.a.ListChange&&(this.sub_graph.val.forEach((e,t)=>{this.event_gui_data.get(e).position=t}),this.update_edges())},this.disposables(o.observe(({value:e})=>{this.element.style.marginLeft=`${ht*e}px`},{call_now:!0}),Object(u.d)(this.event_container_element,i,this.create_event_element,{after:this.after_events_changed}),t.observe(({value:e})=>{e.type!==et.EdgeAdded&&e.type!==et.EdgeRemoved||this.update_edges()})),this.finalize_construction()}set_enabled(e){super.set_enabled(e);for(const{event_view:t}of this.event_gui_data.values())t.enabled.val=e}}class bt extends b.a{constructor(e){super(),this.ctrl=e,this.sub_graph_views=new Map,this.unavailable_view=new g("No quest loaded."),this.max_edge_depth=Object(M.e)(0),this.create_sub_graph_element=e=>{let t=this.sub_graph_views.get(e);return t||(t=new gt(this.ctrl,this.ctrl.event_dag.val,e,this.max_edge_depth),this.sub_graph_views.set(e,t)),t.element},this.update_edges=()=>{for(const e of this.sub_graph_views.values())e.element.parentNode&&e.update_edges()},this.after_event_dags_changed=e=>{var t;if(e.type===J.a.ListChange)for(const i of e.inserted)null===(t=this.sub_graph_views.get(i))||void 0===t||t.update_edges()},this.element=Object(u.h)({className:"quest_editor_EventsView",tabIndex:-1},this.container_element=Object(u.h)({className:"quest_editor_EventsView_container"},this.add(new Ue.a(this.add_event_button=new tt.a({text:"Add event"}))).element,this.dag_container_element=Object(u.h)({className:"quest_editor_EventsView_sub_graph_container"})),this.unavailable_view.element),this.disposables(Object(u.c)(this.container_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),this.enabled.bind_to(e.enabled),this.add_event_button.onclick.observe(e.add_event),Object(u.d)(this.dag_container_element,e.event_sub_graphs,this.create_sub_graph_element,{after:this.after_event_dags_changed}),Object(u.g)(this.element,"focus",()=>{e.focused()}),Object(u.g)(this.element,"click",()=>{e.set_selected_wave(void 0)})),this.finalize_construction()}dispose(){super.dispose();for(const e of this.sub_graph_views.values())e.dispose();this.sub_graph_views.clear()}resize(e,t){return super.resize(e,t),this.update_edges(),this}focus(){super.focus(),this.update_edges()}set_enabled(e){super.set_enabled(e);for(const t of this.sub_graph_views.values())t.element.parentNode&&(t.enabled.val=e)}}var ft;!function(e){e[e.Any=0]="Any",e[e.Byte=1]="Byte",e[e.Word=2]="Word",e[e.DWord=3]="DWord",e[e.Float=4]="Float",e[e.Label=5]="Label",e[e.ILabel=6]="ILabel",e[e.DLabel=7]="DLabel",e[e.SLabel=8]="SLabel",e[e.String=9]="String",e[e.ILabelVar=10]="ILabelVar",e[e.RegRef=11]="RegRef",e[e.RegTupRef=12]="RegTupRef",e[e.RegRefVar=13]="RegRefVar",e[e.Pointer=14]="Pointer"}(ft||(ft={}));const mt={kind:ft.Any},wt={kind:ft.Byte},kt={kind:ft.Word},yt={kind:ft.DWord},Rt={kind:ft.Float},It={kind:ft.Label},jt={kind:ft.ILabel},Tt={kind:ft.DLabel},xt={kind:ft.SLabel},St={kind:ft.String},Ct={kind:ft.ILabelVar},Ot={kind:ft.RegRef},Lt={kind:ft.RegRefVar},Pt={kind:ft.Pointer},Dt=-Math.pow(2,31),Bt=Math.pow(2,31)-1;Math.pow(2,32);var Et,Mt;function Wt(e,t,i){return{type:e,doc:t,access:i}}!function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Et||(Et={})),function(e){e[e.Push=0]="Push",e[e.Pop=1]="Pop"}(Mt||(Mt={}));const qt=[],Ft=new Map;function Vt(e,t,i,o,n){return{code:e,mnemonic:t,doc:i,size:e<256?1:2,params:o,stack:n}}const Ut=qt[0]=Vt(0,"nop","No operation, does nothing.",[],void 0),Nt=qt[1]=Vt(1,"ret","Returns control to caller.",[],void 0),zt=qt[2]=Vt(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),$t=qt[3]=Vt(3,"exit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),At=qt[4]=Vt(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[Wt(jt,void 0,void 0)],void 0),Ht=qt[5]=Vt(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),Gt=qt[6]=Vt(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),Kt=qt[7]=Vt(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[Wt(jt,void 0,void 0)],void 0),Qt=qt[8]=Vt(8,"let","Sets the first register's value to second one's value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),Yt=qt[9]=Vt(9,"leti","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),Zt=qt[10]=Vt(10,"letb","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(wt,void 0,void 0)],void 0),Jt=qt[11]=Vt(11,"letw","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0),Wt(kt,void 0,void 0)],void 0),Xt=qt[12]=Vt(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),ei=(qt[13]=Vt(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt(It,void 0,void 0)],void 0),qt[14]=Vt(14,"unknown_0e",void 0,[],void 0),qt[15]=Vt(15,"unknown_0f",void 0,[],void 0),qt[16]=Vt(16,"set","Sets a register to 1.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ti=qt[17]=Vt(17,"clear","Sets a register to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),ii=qt[18]=Vt(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.ReadWrite)]},void 0,void 0)],void 0),oi=(qt[19]=Vt(19,"gset",void 0,[Wt(kt,void 0,void 0)],void 0),qt[20]=Vt(20,"gclear",void 0,[Wt(kt,void 0,void 0)],void 0),qt[21]=Vt(21,"grev",void 0,[Wt(kt,void 0,void 0)],void 0),qt[22]=Vt(22,"glet",void 0,[Wt(kt,void 0,void 0)],void 0),qt[23]=Vt(23,"gget","Sets a register to value of the given flag.",[Wt(kt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[24]=Vt(24,"add",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),ni=qt[25]=Vt(25,"addi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),si=qt[26]=Vt(26,"sub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ri=qt[27]=Vt(27,"subi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ai=qt[28]=Vt(28,"mul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),di=qt[29]=Vt(29,"muli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ci=qt[30]=Vt(30,"div",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),li=qt[31]=Vt(31,"divi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),_i=qt[32]=Vt(32,"and",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ui=qt[33]=Vt(33,"andi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),vi=qt[34]=Vt(34,"or",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),hi=qt[35]=Vt(35,"ori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),pi=qt[36]=Vt(36,"xor",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),gi=qt[37]=Vt(37,"xori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),bi=qt[38]=Vt(38,"mod",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),fi=qt[39]=Vt(39,"modi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),mi=qt[40]=Vt(40,"jmp",void 0,[Wt(jt,void 0,void 0)],void 0),wi=qt[41]=Vt(41,"call",void 0,[Wt(jt,void 0,void 0)],void 0),ki=qt[42]=Vt(42,"jmp_on",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),yi=qt[43]=Vt(43,"jmp_off",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),Ri=qt[44]=Vt(44,"jmp_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ii=qt[45]=Vt(45,"jmpi_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),ji=qt[46]=Vt(46,"jmp_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ti=qt[47]=Vt(47,"jmpi_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),xi=qt[48]=Vt(48,"ujmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Si=qt[49]=Vt(49,"ujmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ci=qt[50]=Vt(50,"jmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Oi=qt[51]=Vt(51,"jmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Li=qt[52]=Vt(52,"ujmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Pi=qt[53]=Vt(53,"ujmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Di=qt[54]=Vt(54,"jmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Bi=qt[55]=Vt(55,"jmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ei=qt[56]=Vt(56,"ujmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Mi=qt[57]=Vt(57,"ujmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Wi=qt[58]=Vt(58,"jmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),qi=qt[59]=Vt(59,"jmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Fi=qt[60]=Vt(60,"ujmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Vi=qt[61]=Vt(61,"ujmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ui=qt[62]=Vt(62,"jmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ni=qt[63]=Vt(63,"jmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),zi=qt[64]=Vt(64,"switch_jmp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),$i=qt[65]=Vt(65,"switch_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ai=qt[66]=Vt(66,"stack_push",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),Hi=qt[67]=Vt(67,"stack_pop",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),Gi=qt[68]=Vt(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[Wt(Ot,void 0,Et.Read),Wt(yt,void 0,void 0)],void 0),Ki=qt[69]=Vt(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[Wt(Ot,void 0,Et.Write),Wt(yt,void 0,void 0)],void 0),Qi=(qt[70]=Vt(70,"unknown_46",void 0,[],void 0),qt[71]=Vt(71,"unknown_47",void 0,[],void 0),qt[72]=Vt(72,"arg_pushr","Pushes the value of the given register onto the stack.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push)),Yi=qt[73]=Vt(73,"arg_pushl","Pushes the given value onto the stack.",[Wt(yt,void 0,void 0)],Mt.Push),Zi=qt[74]=Vt(74,"arg_pushb","Pushes the given value onto the stack.",[Wt(wt,void 0,void 0)],Mt.Push),Ji=qt[75]=Vt(75,"arg_pushw","Pushes the given value onto the stack.",[Wt(kt,void 0,void 0)],Mt.Push),Xi=qt[76]=Vt(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push),eo=qt[77]=Vt(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[Wt(It,void 0,void 0)],Mt.Push),to=qt[78]=Vt(78,"arg_pushs","Pushes the given value onto the stack.",[Wt(St,void 0,void 0)],Mt.Push),io=(qt[79]=Vt(79,"unknown_4f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[80]=Vt(80,"message",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[81]=Vt(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop)),oo=(qt[82]=Vt(82,"fadein",void 0,[],void 0),qt[83]=Vt(83,"fadeout",void 0,[],void 0),qt[84]=Vt(84,"se",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[85]=Vt(85,"bgm",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[86]=Vt(86,"unknown_56",void 0,[],void 0),qt[87]=Vt(87,"unknown_57",void 0,[],void 0),qt[88]=Vt(88,"enable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[89]=Vt(89,"disable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[90]=Vt(90,"window_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop)),no=qt[91]=Vt(91,"add_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),so=(qt[92]=Vt(92,"mesend",void 0,[],void 0),qt[93]=Vt(93,"gettime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ro=qt[94]=Vt(94,"winend",void 0,[],void 0),ao=(qt[95]=Vt(95,"unknown_5f",void 0,[],void 0),qt[96]=Vt(96,"npc_crt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[97]=Vt(97,"npc_stop",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[98]=Vt(98,"npc_play",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[99]=Vt(99,"npc_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[100]=Vt(100,"npc_nont",void 0,[],void 0),qt[101]=Vt(101,"npc_talk",void 0,[],void 0),qt[102]=Vt(102,"npc_crp_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(jt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[103]=Vt(103,"unknown_67",void 0,[],void 0),qt[104]=Vt(104,"create_pipe",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[105]=Vt(105,"p_hpstat_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[106]=Vt(106,"p_dead_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0)],Mt.Pop)),co=(qt[107]=Vt(107,"p_disablewarp",void 0,[],void 0),qt[108]=Vt(108,"p_enablewarp",void 0,[],void 0),qt[109]=Vt(109,"p_move_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[110]=Vt(110,"p_look",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[111]=Vt(111,"unknown_6f",void 0,[],void 0),qt[112]=Vt(112,"p_action_disable",void 0,[],void 0),qt[113]=Vt(113,"p_action_enable",void 0,[],void 0),qt[114]=Vt(114,"disable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[115]=Vt(115,"enable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[116]=Vt(116,"p_noncol",void 0,[],void 0),qt[117]=Vt(117,"p_col",void 0,[],void 0),qt[118]=Vt(118,"p_setpos","Sets a player's position.",[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Y-axis rotation.",Et.Read)]},void 0,void 0)],Mt.Pop),qt[119]=Vt(119,"p_return_guild",void 0,[],void 0),qt[120]=Vt(120,"p_talk_guild",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[121]=Vt(121,"npc_talk_pl_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[122]=Vt(122,"npc_talk_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[123]=Vt(123,"npc_crtpk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[124]=Vt(124,"npc_crppk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[125]=Vt(125,"npc_crptalk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[126]=Vt(126,"p_look_at_v1",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[127]=Vt(127,"npc_crp_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[128]=Vt(128,"cam_quake",void 0,[],void 0),qt[129]=Vt(129,"cam_adj",void 0,[],void 0),qt[130]=Vt(130,"cam_zmin",void 0,[],void 0),qt[131]=Vt(131,"cam_zmout",void 0,[],void 0),qt[132]=Vt(132,"cam_pan_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[133]=Vt(133,"game_lev_super",void 0,[],void 0),qt[134]=Vt(134,"game_lev_reset",void 0,[],void 0),qt[135]=Vt(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[136]=Vt(136,"if_zone_clear",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),lo=(qt[137]=Vt(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[138]=Vt(138,"unhide_obj",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[139]=Vt(139,"unhide_ene",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[140]=Vt(140,"at_coords_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[141]=Vt(141,"at_coords_talk",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[142]=Vt(142,"col_npcin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[143]=Vt(143,"col_npcinr",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[144]=Vt(144,"switch_on",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[145]=Vt(145,"switch_off",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[146]=Vt(146,"playbgm_epi",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[147]=Vt(147,"set_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[148]=Vt(148,"set_obj_param","Creates a targetable object.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Collision radius.",Et.Read),Wt(jt,"Function label.",Et.Read),Wt(yt,"Vertical position of the cursor.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},"Object handle.",void 0)],void 0),qt[149]=Vt(149,"set_floor_handler",void 0,[Wt(yt,"Floor number.",void 0),Wt(jt,"Handler function label.",void 0)],Mt.Pop)),_o=(qt[150]=Vt(150,"clr_floor_handler",void 0,[Wt(yt,"Floor number.",void 0)],Mt.Pop),qt[151]=Vt(151,"col_plinaw",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[152]=Vt(152,"hud_hide",void 0,[],void 0),qt[153]=Vt(153,"hud_show",void 0,[],void 0),qt[154]=Vt(154,"cine_enable",void 0,[],void 0),qt[155]=Vt(155,"cine_disable",void 0,[],void 0),qt[156]=Vt(156,"unknown_9c",void 0,[],void 0),qt[157]=Vt(157,"unknown_9d",void 0,[],void 0),qt[158]=Vt(158,"unknown_9e",void 0,[],void 0),qt[159]=Vt(159,"unknown_9f",void 0,[],void 0),qt[160]=Vt(160,"unknown_a0",void 0,[],void 0),qt[161]=Vt(161,"set_qt_failure",void 0,[Wt(jt,void 0,void 0)],void 0),qt[162]=Vt(162,"set_qt_success",void 0,[Wt(jt,void 0,void 0)],void 0),qt[163]=Vt(163,"clr_qt_failure",void 0,[],void 0),qt[164]=Vt(164,"clr_qt_success",void 0,[],void 0),qt[165]=Vt(165,"set_qt_cancel",void 0,[Wt(jt,void 0,void 0)],void 0),qt[166]=Vt(166,"clr_qt_cancel",void 0,[],void 0),qt[167]=Vt(167,"unknown_a7",void 0,[],void 0),qt[168]=Vt(168,"pl_walk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[169]=Vt(169,"unknown_a9",void 0,[],void 0),qt[170]=Vt(170,"unknown_aa",void 0,[],void 0),qt[171]=Vt(171,"unknown_ab",void 0,[],void 0),qt[172]=Vt(172,"unknown_ac",void 0,[],void 0),qt[173]=Vt(173,"unknown_ad",void 0,[],void 0),qt[174]=Vt(174,"unknown_ae",void 0,[],void 0),qt[175]=Vt(175,"unknown_af",void 0,[],void 0),qt[176]=Vt(176,"pl_add_meseta",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[177]=Vt(177,"thread_stg",void 0,[Wt(jt,void 0,void 0)],void 0)),uo=(qt[178]=Vt(178,"del_obj_param",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},"Object handle.",void 0)],void 0),qt[179]=Vt(179,"item_create",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[180]=Vt(180,"item_create2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[181]=Vt(181,"item_delete",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[182]=Vt(182,"item_delete2","Deletes an item from the player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[183]=Vt(183,"item_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[184]=Vt(184,"setevt",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[185]=Vt(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),vo=(qt[186]=Vt(186,"set_qt_exit",void 0,[Wt(jt,void 0,void 0)],void 0),qt[187]=Vt(187,"clr_qt_exit",void 0,[],void 0),qt[188]=Vt(188,"unknown_bc",void 0,[],void 0),qt[189]=Vt(189,"unknown_bd",void 0,[],void 0),qt[190]=Vt(190,"unknown_be",void 0,[],void 0),qt[191]=Vt(191,"unknown_bf",void 0,[],void 0),qt[192]=Vt(192,"particle_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[193]=Vt(193,"npc_text",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[194]=Vt(194,"npc_chkwarp",void 0,[],void 0),qt[195]=Vt(195,"pl_pkoff",void 0,[],void 0),qt[196]=Vt(196,"map_designate",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0)),ho=(qt[197]=Vt(197,"masterkey_on",void 0,[],void 0),qt[198]=Vt(198,"masterkey_off",void 0,[],void 0),qt[199]=Vt(199,"window_time",void 0,[],void 0),qt[200]=Vt(200,"winend_time",void 0,[],void 0),qt[201]=Vt(201,"winset_time",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[202]=Vt(202,"getmtime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[203]=Vt(203,"set_quest_board_handler",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[204]=Vt(204,"clear_quest_board_handler",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[205]=Vt(205,"particle_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[206]=Vt(206,"npc_crptalk_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[207]=Vt(207,"npc_lang_clean",void 0,[],void 0),qt[208]=Vt(208,"pl_pkon",void 0,[],void 0),qt[209]=Vt(209,"pl_chk_item2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[210]=Vt(210,"enable_mainmenu",void 0,[],void 0),qt[211]=Vt(211,"disable_mainmenu",void 0,[],void 0),qt[212]=Vt(212,"start_battlebgm",void 0,[],void 0),qt[213]=Vt(213,"end_battlebgm",void 0,[],void 0),qt[214]=Vt(214,"disp_msg_qb",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[215]=Vt(215,"close_msg_qb",void 0,[],void 0),qt[216]=Vt(216,"set_eventflag_v3",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[217]=Vt(217,"sync_leti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0)),po=(qt[218]=Vt(218,"set_returnhunter",void 0,[],void 0),qt[219]=Vt(219,"set_returncity",void 0,[],void 0),qt[220]=Vt(220,"load_pvr",void 0,[],void 0),qt[221]=Vt(221,"load_midi",void 0,[],void 0),qt[222]=Vt(222,"unknown_de",void 0,[],void 0),qt[223]=Vt(223,"npc_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[224]=Vt(224,"pad_dragon",void 0,[],void 0),qt[225]=Vt(225,"clear_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[226]=Vt(226,"pcam_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[227]=Vt(227,"start_setevt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[228]=Vt(228,"warp_on",void 0,[],void 0),qt[229]=Vt(229,"warp_off",void 0,[],void 0),qt[230]=Vt(230,"get_slotnumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),go=(qt[231]=Vt(231,"get_servernumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[232]=Vt(232,"set_eventflag2",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[233]=Vt(233,"res",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[234]=Vt(234,"unknown_ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),qt[235]=Vt(235,"enable_bgmctrl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[236]=Vt(236,"sw_send",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[237]=Vt(237,"create_bgmctrl",void 0,[],void 0),qt[238]=Vt(238,"pl_add_meseta2",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[239]=Vt(239,"sync_register",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[240]=Vt(240,"send_regwork",void 0,[],void 0),qt[241]=Vt(241,"leti_fixed_camera_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[242]=Vt(242,"default_camera_pos1",void 0,[],void 0),qt[243]=Vt(243,"unknown_f3",void 0,[],void 0),qt[244]=Vt(244,"unknown_f4",void 0,[],void 0),qt[245]=Vt(245,"unknown_f5",void 0,[],void 0),qt[246]=Vt(246,"unknown_f6",void 0,[],void 0),qt[247]=Vt(247,"unknown_f7",void 0,[],void 0),qt[248]=Vt(248,"unknown_f8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[249]=Vt(249,"unknown_f9",void 0,[],void 0),qt[250]=Vt(250,"get_gc_number",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[251]=Vt(251,"unknown_fb",void 0,[Wt(kt,void 0,void 0)],void 0),qt[252]=Vt(252,"unknown_fc",void 0,[],void 0),qt[253]=Vt(253,"unknown_fd",void 0,[],void 0),qt[254]=Vt(254,"unknown_fe",void 0,[],void 0),qt[255]=Vt(255,"unknown_ff",void 0,[],void 0),qt[63488]=Vt(63488,"unknown_f800",void 0,[],void 0),qt[63489]=Vt(63489,"set_chat_callback",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63490]=Vt(63490,"unknown_f802",void 0,[],void 0),qt[63491]=Vt(63491,"unknown_f803",void 0,[],void 0),qt[63492]=Vt(63492,"unknown_f804",void 0,[],void 0),qt[63493]=Vt(63493,"unknown_f805",void 0,[],void 0),qt[63494]=Vt(63494,"unknown_f806",void 0,[],void 0),qt[63495]=Vt(63495,"unknown_f807",void 0,[],void 0),qt[63496]=Vt(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63497]=Vt(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63498]=Vt(63498,"get_coord_of_player","Retrieves a player's position.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Write),Wt(yt,"Y coordinate.",Et.Write),Wt(yt,"Z coordinate.",Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63499]=Vt(63499,"enable_map",void 0,[],void 0),qt[63500]=Vt(63500,"disable_map",void 0,[],void 0),qt[63501]=Vt(63501,"map_designate_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),bo=(qt[63502]=Vt(63502,"unknown_f80e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63503]=Vt(63503,"unknown_f80f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63504]=Vt(63504,"ba_initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63505]=Vt(63505,"set_ba_rules",void 0,[],void 0),qt[63506]=Vt(63506,"unknown_f812",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63507]=Vt(63507,"unknown_f813",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63508]=Vt(63508,"unknown_f814",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63509]=Vt(63509,"unknown_f815",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63510]=Vt(63510,"unknown_f816",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63511]=Vt(63511,"unknown_f817",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63512]=Vt(63512,"unknown_f818",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63513]=Vt(63513,"unknown_f819",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63514]=Vt(63514,"unknown_f81a",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63515]=Vt(63515,"unknown_f81b",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63516]=Vt(63516,"ba_disp_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63517]=Vt(63517,"death_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63518]=Vt(63518,"death_tech_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63519]=Vt(63519,"unknown_f81f",void 0,[],void 0),qt[63520]=Vt(63520,"cmode_stage",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63521]=Vt(63521,"unknown_f821",void 0,[],void 0),qt[63522]=Vt(63522,"unknown_f822",void 0,[],void 0),qt[63523]=Vt(63523,"unknown_f823",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63524]=Vt(63524,"unknown_f824",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63525]=Vt(63525,"exp_multiplication",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63526]=Vt(63526,"exp_division",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63527]=Vt(63527,"get_user_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63528]=Vt(63528,"go_floor","Sends a player to the given floor.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read)]},void 0,void 0)],void 0),qt[63529]=Vt(63529,"unknown_f829",void 0,[],void 0),qt[63530]=Vt(63530,"unknown_f82a",void 0,[],void 0),qt[63531]=Vt(63531,"unlock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63532]=Vt(63532,"lock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63533]=Vt(63533,"if_switch_not_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63534]=Vt(63534,"if_switch_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read),Wt(yt,"Switch ID.",Et.Read),Wt(yt,"Will be set to 1 if the switch is pressed, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63535]=Vt(63535,"unknown_f82f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63536]=Vt(63536,"control_dragon",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63537]=Vt(63537,"release_dragon",void 0,[],void 0),qt[63538]=Vt(63538,"unknown_f832",void 0,[],void 0),qt[63539]=Vt(63539,"unknown_f833",void 0,[],void 0),qt[63540]=Vt(63540,"unknown_f834",void 0,[],void 0),qt[63541]=Vt(63541,"unknown_f835",void 0,[],void 0),qt[63542]=Vt(63542,"unknown_f836",void 0,[],void 0),qt[63543]=Vt(63543,"unknown_f837",void 0,[],void 0),qt[63544]=Vt(63544,"shrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63545]=Vt(63545,"unshrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63546]=Vt(63546,"unknown_f83a",void 0,[],void 0),qt[63547]=Vt(63547,"unknown_f83b",void 0,[],void 0),qt[63548]=Vt(63548,"display_clock2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63549]=Vt(63549,"unknown_f83d",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63550]=Vt(63550,"delete_area_title",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63551]=Vt(63551,"unknown_f83f",void 0,[],void 0),qt[63552]=Vt(63552,"load_npc_data",void 0,[],void 0),qt[63553]=Vt(63553,"get_npc_data",void 0,[Wt(Tt,void 0,void 0)],void 0),qt[63554]=Vt(63554,"unknown_f842",void 0,[],void 0),qt[63555]=Vt(63555,"unknown_f843",void 0,[],void 0),qt[63556]=Vt(63556,"unknown_f844",void 0,[],void 0),qt[63557]=Vt(63557,"unknown_f845",void 0,[],void 0),qt[63558]=Vt(63558,"unknown_f846",void 0,[],void 0),qt[63559]=Vt(63559,"unknown_f847",void 0,[],void 0),qt[63560]=Vt(63560,"give_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63561]=Vt(63561,"take_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63562]=Vt(63562,"unk_score_f84a",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63563]=Vt(63563,"unk_score_f84b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63564]=Vt(63564,"kill_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63565]=Vt(63565,"death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63566]=Vt(63566,"unk_score_f84e",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63567]=Vt(63567,"enemy_death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63568]=Vt(63568,"meseta_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63569]=Vt(63569,"unknown_f851",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63570]=Vt(63570,"unknown_f852",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63571]=Vt(63571,"reverse_warps",void 0,[],void 0),qt[63572]=Vt(63572,"unreverse_warps",void 0,[],void 0),qt[63573]=Vt(63573,"set_ult_map",void 0,[],void 0),qt[63574]=Vt(63574,"unset_ult_map",void 0,[],void 0),qt[63575]=Vt(63575,"set_area_title",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63576]=Vt(63576,"unknown_f858",void 0,[],void 0),qt[63577]=Vt(63577,"unknown_f859",void 0,[],void 0),qt[63578]=Vt(63578,"equip_item",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63579]=Vt(63579,"unequip_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63580]=Vt(63580,"unknown_f85c",void 0,[],void 0),qt[63581]=Vt(63581,"unknown_f85d",void 0,[],void 0),qt[63582]=Vt(63582,"unknown_f85e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63583]=Vt(63583,"unknown_f85f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63584]=Vt(63584,"unknown_f860",void 0,[],void 0),qt[63585]=Vt(63585,"unknown_f861",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63586]=Vt(63586,"unknown_f862",void 0,[],void 0),qt[63587]=Vt(63587,"unknown_f863",void 0,[],void 0),qt[63588]=Vt(63588,"cmode_rank",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63589]=Vt(63589,"award_item_name",void 0,[],void 0),qt[63590]=Vt(63590,"award_item_select",void 0,[],void 0),qt[63591]=Vt(63591,"award_item_give_to",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63592]=Vt(63592,"unknown_f868",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63593]=Vt(63593,"unknown_f869",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63594]=Vt(63594,"item_create_cmode",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63595]=Vt(63595,"unknown_f86b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63596]=Vt(63596,"award_item_ok",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63597]=Vt(63597,"unknown_f86d",void 0,[],void 0),qt[63598]=Vt(63598,"unknown_f86e",void 0,[],void 0),qt[63599]=Vt(63599,"ba_set_lives",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63600]=Vt(63600,"ba_set_tech_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63601]=Vt(63601,"ba_set_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63602]=Vt(63602,"ba_set_time_limit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63603]=Vt(63603,"boss_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63604]=Vt(63604,"unknown_f874",void 0,[],void 0),qt[63605]=Vt(63605,"unknown_f875",void 0,[],void 0),qt[63606]=Vt(63606,"unknown_f876",void 0,[],void 0),qt[63607]=Vt(63607,"enable_techs","Enables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63608]=Vt(63608,"disable_techs","Disables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63609]=Vt(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player gender.",Et.Write)]},void 0,void 0)],void 0),qt[63610]=Vt(63610,"get_chara_class","Retrieves the player's race and character class.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player race. 0 If human, 1 if newman, 2 if cast.",Et.Write),Wt(yt,"Player class. 0 If hunter, 1 if ranger, 2 if force.",Et.Write)]},void 0,void 0)],void 0),qt[63611]=Vt(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,"Amount of meseta to take.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Will be set to 1 if the meseta was taken, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63612]=Vt(63612,"unknown_f87c",void 0,[],void 0),qt[63613]=Vt(63613,"unknown_f87d",void 0,[],void 0),qt[63614]=Vt(63614,"unknown_f87e",void 0,[],void 0),qt[63615]=Vt(63615,"read_guildcard_flag",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63616]=Vt(63616,"unknown_f880",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63617]=Vt(63617,"get_pl_name","Sets the value of to the given player's name.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63618]=Vt(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63619]=Vt(63619,"unknown_f883",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63620]=Vt(63620,"unknown_f884",void 0,[],void 0),qt[63621]=Vt(63621,"unknown_f885",void 0,[],void 0),qt[63622]=Vt(63622,"unknown_f886",void 0,[],void 0),qt[63623]=Vt(63623,"unknown_f887",void 0,[],void 0),qt[63624]=Vt(63624,"unknown_f888",void 0,[],void 0),qt[63625]=Vt(63625,"unknown_f889",void 0,[],void 0),qt[63626]=Vt(63626,"get_player_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63627]=Vt(63627,"send_mail",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63628]=Vt(63628,"online_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63629]=Vt(63629,"chl_set_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63630]=Vt(63630,"chl_get_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63631]=Vt(63631,"unknown_f88f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63632]=Vt(63632,"unknown_f890",void 0,[],void 0),qt[63633]=Vt(63633,"load_enemy_data",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63634]=Vt(63634,"get_physical_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63635]=Vt(63635,"get_attack_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63636]=Vt(63636,"get_resist_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63637]=Vt(63637,"get_movement_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63638]=Vt(63638,"unknown_f896",void 0,[],void 0),qt[63639]=Vt(63639,"unknown_f897",void 0,[],void 0),qt[63640]=Vt(63640,"shift_left",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),fo=qt[63641]=Vt(63641,"shift_right",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),mo=qt[63642]=Vt(63642,"get_random",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),wo=(qt[63643]=Vt(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),qt[63644]=Vt(63644,"disp_chl_retry_menu",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63645]=Vt(63645,"chl_reverser",void 0,[],void 0),qt[63646]=Vt(63646,"unknown_f89e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63647]=Vt(63647,"unknown_f89f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63648]=Vt(63648,"unknown_f8a0",void 0,[],void 0),qt[63649]=Vt(63649,"unknown_f8a1",void 0,[],void 0),qt[63650]=Vt(63650,"unknown_f8a2",void 0,[],void 0),qt[63651]=Vt(63651,"unknown_f8a3",void 0,[],void 0),qt[63652]=Vt(63652,"unknown_f8a4",void 0,[],void 0),qt[63653]=Vt(63653,"unknown_f8a5",void 0,[],void 0),qt[63654]=Vt(63654,"unknown_f8a6",void 0,[],void 0),qt[63655]=Vt(63655,"unknown_f8a7",void 0,[],void 0),qt[63656]=Vt(63656,"unknown_f8a8",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63657]=Vt(63657,"unknown_f8a9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63658]=Vt(63658,"unknown_f8aa",void 0,[],void 0),qt[63659]=Vt(63659,"unknown_f8ab",void 0,[],void 0),qt[63660]=Vt(63660,"unknown_f8ac",void 0,[],void 0),qt[63661]=Vt(63661,"get_number_of_player2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63662]=Vt(63662,"unknown_f8ae",void 0,[],void 0),qt[63663]=Vt(63663,"unknown_f8af",void 0,[],void 0),qt[63664]=Vt(63664,"unknown_f8b0",void 0,[],void 0),qt[63665]=Vt(63665,"unknown_f8b1",void 0,[],void 0),qt[63666]=Vt(63666,"unknown_f8b2",void 0,[],void 0),qt[63667]=Vt(63667,"unknown_f8b3",void 0,[],void 0),qt[63668]=Vt(63668,"unknown_f8b4",void 0,[],void 0),qt[63669]=Vt(63669,"unknown_f8b5",void 0,[],void 0),qt[63670]=Vt(63670,"unknown_f8b6",void 0,[],void 0),qt[63671]=Vt(63671,"unknown_f8b7",void 0,[],void 0),qt[63672]=Vt(63672,"unknown_f8b8",void 0,[],void 0),qt[63673]=Vt(63673,"chl_recovery",void 0,[],void 0),qt[63674]=Vt(63674,"unknown_f8ba",void 0,[],void 0),qt[63675]=Vt(63675,"unknown_f8bb",void 0,[],void 0),qt[63676]=Vt(63676,"set_episode",void 0,[Wt(yt,void 0,void 0)],void 0)),ko=(qt[63677]=Vt(63677,"unknown_f8bd",void 0,[],void 0),qt[63678]=Vt(63678,"unknown_f8be",void 0,[],void 0),qt[63679]=Vt(63679,"unknown_f8bf",void 0,[],void 0),qt[63680]=Vt(63680,"file_dl_req",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63681]=Vt(63681,"get_dl_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63682]=Vt(63682,"gba_unknown4",void 0,[],void 0),qt[63683]=Vt(63683,"get_gba_state",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63684]=Vt(63684,"unknown_f8c4",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63685]=Vt(63685,"unknown_f8c5",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63686]=Vt(63686,"qexit",void 0,[],void 0),qt[63687]=Vt(63687,"use_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Animation ID.",Et.Read),Wt(yt,"Animation duration in number of frames.",Et.Read)]},void 0,void 0)],void 0),qt[63688]=Vt(63688,"stop_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63689]=Vt(63689,"run_to_coord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63690]=Vt(63690,"set_slot_invincible",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63691]=Vt(63691,"unknown_f8cb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63692]=Vt(63692,"set_slot_poison",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63693]=Vt(63693,"set_slot_paralyze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63694]=Vt(63694,"set_slot_shock",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63695]=Vt(63695,"set_slot_freeze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63696]=Vt(63696,"set_slot_slow",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63697]=Vt(63697,"set_slot_confuse",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63698]=Vt(63698,"set_slot_shifta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63699]=Vt(63699,"set_slot_deband",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63700]=Vt(63700,"set_slot_jellen",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63701]=Vt(63701,"set_slot_zalure",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63702]=Vt(63702,"fleti_fixed_camera",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63703]=Vt(63703,"fleti_locked_camera",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63704]=Vt(63704,"default_camera_pos2",void 0,[],void 0),qt[63705]=Vt(63705,"set_motion_blur",void 0,[],void 0),qt[63706]=Vt(63706,"set_screen_bw",void 0,[],void 0),qt[63707]=Vt(63707,"unknown_f8db",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63708]=Vt(63708,"npc_action_string",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(xt,void 0,void 0)],void 0),qt[63709]=Vt(63709,"get_pad_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63710]=Vt(63710,"get_button_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63711]=Vt(63711,"freeze_enemies",void 0,[],void 0),qt[63712]=Vt(63712,"unfreeze_enemies",void 0,[],void 0),qt[63713]=Vt(63713,"freeze_everything",void 0,[],void 0),qt[63714]=Vt(63714,"unfreeze_everything",void 0,[],void 0),qt[63715]=Vt(63715,"restore_hp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63716]=Vt(63716,"restore_tp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63717]=Vt(63717,"close_chat_bubble",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63718]=Vt(63718,"move_coords_object",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63719]=Vt(63719,"at_coords_call_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63720]=Vt(63720,"unknown_f8e8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63721]=Vt(63721,"unknown_f8e9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63722]=Vt(63722,"unknown_f8ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63723]=Vt(63723,"unknown_f8eb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63724]=Vt(63724,"unknown_f8ec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63725]=Vt(63725,"animation_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63726]=Vt(63726,"call_image_data",void 0,[Wt(yt,void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63727]=Vt(63727,"unknown_f8ef",void 0,[],void 0),qt[63728]=Vt(63728,"turn_off_bgm_p2",void 0,[],void 0),qt[63729]=Vt(63729,"turn_on_bgm_p2",void 0,[],void 0),qt[63730]=Vt(63730,"load_unk_data",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(Tt,void 0,void 0)],Mt.Pop),qt[63731]=Vt(63731,"particle2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63732]=Vt(63732,"unknown_f8f4",void 0,[],void 0),qt[63733]=Vt(63733,"unknown_f8f5",void 0,[],void 0),qt[63734]=Vt(63734,"unknown_f8f6",void 0,[],void 0),qt[63735]=Vt(63735,"unknown_f8f7",void 0,[],void 0),qt[63736]=Vt(63736,"unknown_f8f8",void 0,[],void 0),qt[63737]=Vt(63737,"unknown_f8f9",void 0,[],void 0),qt[63738]=Vt(63738,"unknown_f8fa",void 0,[],void 0),qt[63739]=Vt(63739,"unknown_f8fb",void 0,[],void 0),qt[63740]=Vt(63740,"unknown_f8fc",void 0,[],void 0),qt[63741]=Vt(63741,"unknown_f8fd",void 0,[],void 0),qt[63742]=Vt(63742,"unknown_f8fe",void 0,[],void 0),qt[63743]=Vt(63743,"unknown_f8ff",void 0,[],void 0),qt[63744]=Vt(63744,"unknown_f900",void 0,[],void 0),qt[63745]=Vt(63745,"dec2float",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63746]=Vt(63746,"float2dec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63747]=Vt(63747,"flet",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),yo=qt[63748]=Vt(63748,"fleti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Ro=(qt[63749]=Vt(63749,"unknown_f905",void 0,[],void 0),qt[63750]=Vt(63750,"unknown_f906",void 0,[],void 0),qt[63751]=Vt(63751,"unknown_f907",void 0,[],void 0),qt[63752]=Vt(63752,"fadd",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),Io=qt[63753]=Vt(63753,"faddi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),jo=qt[63754]=Vt(63754,"fsub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),To=qt[63755]=Vt(63755,"fsubi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),xo=qt[63756]=Vt(63756,"fmul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),So=qt[63757]=Vt(63757,"fmuli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Co=qt[63758]=Vt(63758,"fdiv",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),Oo=qt[63759]=Vt(63759,"fdivi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Lo=(qt[63760]=Vt(63760,"get_unknown_count",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63761]=Vt(63761,"get_stackable_item_count",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63762]=Vt(63762,"freeze_and_hide_equip",void 0,[],void 0),qt[63763]=Vt(63763,"thaw_and_show_equip",void 0,[],void 0),qt[63764]=Vt(63764,"set_palettex_callback",void 0,[Wt(yt,"Player slot.",void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63765]=Vt(63765,"activate_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63766]=Vt(63766,"enable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63767]=Vt(63767,"restore_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63768]=Vt(63768,"disable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63769]=Vt(63769,"get_palettex_activated",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63770]=Vt(63770,"get_unknown_palettex_status",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63771]=Vt(63771,"disable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63772]=Vt(63772,"enable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63773]=Vt(63773,"get_time_played",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63774]=Vt(63774,"get_guildcard_total",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63775]=Vt(63775,"get_slot_meseta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63776]=Vt(63776,"get_player_level",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63777]=Vt(63777,"get_section_id",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63778]=Vt(63778,"get_player_hp",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Maximum HP.",Et.Write),Wt(yt,"Current HP.",Et.Write),Wt(yt,"Maximum TP.",Et.Write),Wt(yt,"Current TP.",Et.Write)]},void 0,void 0)],Mt.Pop),qt[63779]=Vt(63779,"get_floor_number",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63780]=Vt(63780,"get_coord_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63781]=Vt(63781,"read_global_flag",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63782]=Vt(63782,"write_global_flag",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63783]=Vt(63783,"unknown_f927",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63784]=Vt(63784,"floor_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63785]=Vt(63785,"read_disk_file",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63786]=Vt(63786,"open_pack_select",void 0,[],void 0),qt[63787]=Vt(63787,"item_select",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63788]=Vt(63788,"get_item_id",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63789]=Vt(63789,"color_change",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63790]=Vt(63790,"send_statistic",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63791]=Vt(63791,"unknown_f92f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63792]=Vt(63792,"chat_box",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63793]=Vt(63793,"chat_bubble",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63794]=Vt(63794,"unknown_f932",void 0,[],void 0),qt[63795]=Vt(63795,"unknown_f933",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63796]=Vt(63796,"scroll_text",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63797]=Vt(63797,"gba_unknown1",void 0,[],void 0),qt[63798]=Vt(63798,"gba_unknown2",void 0,[],void 0),qt[63799]=Vt(63799,"gba_unknown3",void 0,[],void 0),qt[63800]=Vt(63800,"add_damage_to",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63801]=Vt(63801,"item_delete3",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63802]=Vt(63802,"get_item_info",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63803]=Vt(63803,"item_packing1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63804]=Vt(63804,"item_packing2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63805]=Vt(63805,"get_lang_setting",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63806]=Vt(63806,"prepare_statistic",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63807]=Vt(63807,"keyword_detect",void 0,[],void 0),qt[63808]=Vt(63808,"keyword",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63809]=Vt(63809,"get_guildcard_num",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63810]=Vt(63810,"unknown_f942",void 0,[],void 0),qt[63811]=Vt(63811,"unknown_f943",void 0,[],void 0),qt[63812]=Vt(63812,"get_wrap_status",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63813]=Vt(63813,"initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63814]=Vt(63814,"sin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63815]=Vt(63815,"cos",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63816]=Vt(63816,"unknown_f948",void 0,[],void 0),qt[63817]=Vt(63817,"unknown_f949",void 0,[],void 0),qt[63818]=Vt(63818,"boss_is_dead2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63819]=Vt(63819,"unknown_f94b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63820]=Vt(63820,"unknown_f94c",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63821]=Vt(63821,"is_there_cardbattle",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63822]=Vt(63822,"unknown_f94e",void 0,[],void 0),qt[63823]=Vt(63823,"unknown_f94f",void 0,[],void 0),qt[63824]=Vt(63824,"bb_p2_menu",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63825]=Vt(63825,"bb_map_designate",void 0,[Wt(wt,void 0,void 0),Wt(kt,void 0,void 0),Wt(wt,void 0,void 0),Wt(wt,void 0,void 0)],void 0));qt[63826]=Vt(63826,"bb_get_number_in_pack",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63827]=Vt(63827,"bb_swap_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63828]=Vt(63828,"bb_check_wrap",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63829]=Vt(63829,"bb_exchange_pd_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63830]=Vt(63830,"bb_exchange_pd_srank",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63831]=Vt(63831,"bb_exchange_pd_special",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63832]=Vt(63832,"bb_exchange_pd_percent",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63833]=Vt(63833,"unknown_f959",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63834]=Vt(63834,"unknown_f95a",void 0,[],void 0),qt[63835]=Vt(63835,"unknown_f95b",void 0,[],void 0),qt[63836]=Vt(63836,"bb_exchange_slt",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63837]=Vt(63837,"bb_exchange_pc",void 0,[],void 0),qt[63838]=Vt(63838,"bb_box_create_bp",void 0,[Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63839]=Vt(63839,"bb_exchange_pt",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63840]=Vt(63840,"unknown_f960",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63841]=Vt(63841,"unknown_f961",void 0,[],void 0),qt[63842]=Vt(63842,"unknown_f962",void 0,[],void 0),qt[63843]=Vt(63843,"unknown_f963",void 0,[],void 0),qt[63844]=Vt(63844,"unknown_f964",void 0,[],void 0),qt[63845]=Vt(63845,"unknown_f965",void 0,[],void 0),qt[63846]=Vt(63846,"unknown_f966",void 0,[],void 0),qt[63847]=Vt(63847,"unknown_f967",void 0,[],void 0),qt[63848]=Vt(63848,"unknown_f968",void 0,[],void 0),qt[63849]=Vt(63849,"unknown_f969",void 0,[],void 0),qt[63850]=Vt(63850,"unknown_f96a",void 0,[],void 0),qt[63851]=Vt(63851,"unknown_f96b",void 0,[],void 0),qt[63852]=Vt(63852,"unknown_f96c",void 0,[],void 0),qt[63853]=Vt(63853,"unknown_f96d",void 0,[],void 0),qt[63854]=Vt(63854,"unknown_f96e",void 0,[],void 0),qt[63855]=Vt(63855,"unknown_f96f",void 0,[],void 0),qt[63856]=Vt(63856,"unknown_f970",void 0,[],void 0),qt[63857]=Vt(63857,"unknown_f971",void 0,[],void 0),qt[63858]=Vt(63858,"unknown_f972",void 0,[],void 0),qt[63859]=Vt(63859,"unknown_f973",void 0,[],void 0),qt[63860]=Vt(63860,"unknown_f974",void 0,[],void 0),qt[63861]=Vt(63861,"unknown_f975",void 0,[],void 0),qt[63862]=Vt(63862,"unknown_f976",void 0,[],void 0),qt[63863]=Vt(63863,"unknown_f977",void 0,[],void 0),qt[63864]=Vt(63864,"unknown_f978",void 0,[],void 0),qt[63865]=Vt(63865,"unknown_f979",void 0,[],void 0),qt[63866]=Vt(63866,"unknown_f97a",void 0,[],void 0),qt[63867]=Vt(63867,"unknown_f97b",void 0,[],void 0),qt[63868]=Vt(63868,"unknown_f97c",void 0,[],void 0),qt[63869]=Vt(63869,"unknown_f97d",void 0,[],void 0),qt[63870]=Vt(63870,"unknown_f97e",void 0,[],void 0),qt[63871]=Vt(63871,"unknown_f97f",void 0,[],void 0),qt[63872]=Vt(63872,"unknown_f980",void 0,[],void 0),qt[63873]=Vt(63873,"unknown_f981",void 0,[],void 0),qt[63874]=Vt(63874,"unknown_f982",void 0,[],void 0),qt[63875]=Vt(63875,"unknown_f983",void 0,[],void 0),qt[63876]=Vt(63876,"unknown_f984",void 0,[],void 0),qt[63877]=Vt(63877,"unknown_f985",void 0,[],void 0),qt[63878]=Vt(63878,"unknown_f986",void 0,[],void 0),qt[63879]=Vt(63879,"unknown_f987",void 0,[],void 0),qt[63880]=Vt(63880,"unknown_f988",void 0,[],void 0),qt[63881]=Vt(63881,"unknown_f989",void 0,[],void 0),qt[63882]=Vt(63882,"unknown_f98a",void 0,[],void 0),qt[63883]=Vt(63883,"unknown_f98b",void 0,[],void 0),qt[63884]=Vt(63884,"unknown_f98c",void 0,[],void 0),qt[63885]=Vt(63885,"unknown_f98d",void 0,[],void 0),qt[63886]=Vt(63886,"unknown_f98e",void 0,[],void 0),qt[63887]=Vt(63887,"unknown_f98f",void 0,[],void 0),qt[63888]=Vt(63888,"unknown_f990",void 0,[],void 0),qt[63889]=Vt(63889,"unknown_f991",void 0,[],void 0),qt[63890]=Vt(63890,"unknown_f992",void 0,[],void 0),qt[63891]=Vt(63891,"unknown_f993",void 0,[],void 0),qt[63892]=Vt(63892,"unknown_f994",void 0,[],void 0),qt[63893]=Vt(63893,"unknown_f995",void 0,[],void 0),qt[63894]=Vt(63894,"unknown_f996",void 0,[],void 0),qt[63895]=Vt(63895,"unknown_f997",void 0,[],void 0),qt[63896]=Vt(63896,"unknown_f998",void 0,[],void 0),qt[63897]=Vt(63897,"unknown_f999",void 0,[],void 0),qt[63898]=Vt(63898,"unknown_f99a",void 0,[],void 0),qt[63899]=Vt(63899,"unknown_f99b",void 0,[],void 0),qt[63900]=Vt(63900,"unknown_f99c",void 0,[],void 0),qt[63901]=Vt(63901,"unknown_f99d",void 0,[],void 0),qt[63902]=Vt(63902,"unknown_f99e",void 0,[],void 0),qt[63903]=Vt(63903,"unknown_f99f",void 0,[],void 0),qt[63904]=Vt(63904,"unknown_f9a0",void 0,[],void 0),qt[63905]=Vt(63905,"unknown_f9a1",void 0,[],void 0),qt[63906]=Vt(63906,"unknown_f9a2",void 0,[],void 0),qt[63907]=Vt(63907,"unknown_f9a3",void 0,[],void 0),qt[63908]=Vt(63908,"unknown_f9a4",void 0,[],void 0),qt[63909]=Vt(63909,"unknown_f9a5",void 0,[],void 0),qt[63910]=Vt(63910,"unknown_f9a6",void 0,[],void 0),qt[63911]=Vt(63911,"unknown_f9a7",void 0,[],void 0),qt[63912]=Vt(63912,"unknown_f9a8",void 0,[],void 0),qt[63913]=Vt(63913,"unknown_f9a9",void 0,[],void 0),qt[63914]=Vt(63914,"unknown_f9aa",void 0,[],void 0),qt[63915]=Vt(63915,"unknown_f9ab",void 0,[],void 0),qt[63916]=Vt(63916,"unknown_f9ac",void 0,[],void 0),qt[63917]=Vt(63917,"unknown_f9ad",void 0,[],void 0),qt[63918]=Vt(63918,"unknown_f9ae",void 0,[],void 0),qt[63919]=Vt(63919,"unknown_f9af",void 0,[],void 0),qt[63920]=Vt(63920,"unknown_f9b0",void 0,[],void 0),qt[63921]=Vt(63921,"unknown_f9b1",void 0,[],void 0),qt[63922]=Vt(63922,"unknown_f9b2",void 0,[],void 0),qt[63923]=Vt(63923,"unknown_f9b3",void 0,[],void 0),qt[63924]=Vt(63924,"unknown_f9b4",void 0,[],void 0),qt[63925]=Vt(63925,"unknown_f9b5",void 0,[],void 0),qt[63926]=Vt(63926,"unknown_f9b6",void 0,[],void 0),qt[63927]=Vt(63927,"unknown_f9b7",void 0,[],void 0),qt[63928]=Vt(63928,"unknown_f9b8",void 0,[],void 0),qt[63929]=Vt(63929,"unknown_f9b9",void 0,[],void 0),qt[63930]=Vt(63930,"unknown_f9ba",void 0,[],void 0),qt[63931]=Vt(63931,"unknown_f9bb",void 0,[],void 0),qt[63932]=Vt(63932,"unknown_f9bc",void 0,[],void 0),qt[63933]=Vt(63933,"unknown_f9bd",void 0,[],void 0),qt[63934]=Vt(63934,"unknown_f9be",void 0,[],void 0),qt[63935]=Vt(63935,"unknown_f9bf",void 0,[],void 0),qt[63936]=Vt(63936,"unknown_f9c0",void 0,[],void 0),qt[63937]=Vt(63937,"unknown_f9c1",void 0,[],void 0),qt[63938]=Vt(63938,"unknown_f9c2",void 0,[],void 0),qt[63939]=Vt(63939,"unknown_f9c3",void 0,[],void 0),qt[63940]=Vt(63940,"unknown_f9c4",void 0,[],void 0),qt[63941]=Vt(63941,"unknown_f9c5",void 0,[],void 0),qt[63942]=Vt(63942,"unknown_f9c6",void 0,[],void 0),qt[63943]=Vt(63943,"unknown_f9c7",void 0,[],void 0),qt[63944]=Vt(63944,"unknown_f9c8",void 0,[],void 0),qt[63945]=Vt(63945,"unknown_f9c9",void 0,[],void 0),qt[63946]=Vt(63946,"unknown_f9ca",void 0,[],void 0),qt[63947]=Vt(63947,"unknown_f9cb",void 0,[],void 0),qt[63948]=Vt(63948,"unknown_f9cc",void 0,[],void 0),qt[63949]=Vt(63949,"unknown_f9cd",void 0,[],void 0),qt[63950]=Vt(63950,"unknown_f9ce",void 0,[],void 0),qt[63951]=Vt(63951,"unknown_f9cf",void 0,[],void 0),qt[63952]=Vt(63952,"unknown_f9d0",void 0,[],void 0),qt[63953]=Vt(63953,"unknown_f9d1",void 0,[],void 0),qt[63954]=Vt(63954,"unknown_f9d2",void 0,[],void 0),qt[63955]=Vt(63955,"unknown_f9d3",void 0,[],void 0),qt[63956]=Vt(63956,"unknown_f9d4",void 0,[],void 0),qt[63957]=Vt(63957,"unknown_f9d5",void 0,[],void 0),qt[63958]=Vt(63958,"unknown_f9d6",void 0,[],void 0),qt[63959]=Vt(63959,"unknown_f9d7",void 0,[],void 0),qt[63960]=Vt(63960,"unknown_f9d8",void 0,[],void 0),qt[63961]=Vt(63961,"unknown_f9d9",void 0,[],void 0),qt[63962]=Vt(63962,"unknown_f9da",void 0,[],void 0),qt[63963]=Vt(63963,"unknown_f9db",void 0,[],void 0),qt[63964]=Vt(63964,"unknown_f9dc",void 0,[],void 0),qt[63965]=Vt(63965,"unknown_f9dd",void 0,[],void 0),qt[63966]=Vt(63966,"unknown_f9de",void 0,[],void 0),qt[63967]=Vt(63967,"unknown_f9df",void 0,[],void 0),qt[63968]=Vt(63968,"unknown_f9e0",void 0,[],void 0),qt[63969]=Vt(63969,"unknown_f9e1",void 0,[],void 0),qt[63970]=Vt(63970,"unknown_f9e2",void 0,[],void 0),qt[63971]=Vt(63971,"unknown_f9e3",void 0,[],void 0),qt[63972]=Vt(63972,"unknown_f9e4",void 0,[],void 0),qt[63973]=Vt(63973,"unknown_f9e5",void 0,[],void 0),qt[63974]=Vt(63974,"unknown_f9e6",void 0,[],void 0),qt[63975]=Vt(63975,"unknown_f9e7",void 0,[],void 0),qt[63976]=Vt(63976,"unknown_f9e8",void 0,[],void 0),qt[63977]=Vt(63977,"unknown_f9e9",void 0,[],void 0),qt[63978]=Vt(63978,"unknown_f9ea",void 0,[],void 0),qt[63979]=Vt(63979,"unknown_f9eb",void 0,[],void 0),qt[63980]=Vt(63980,"unknown_f9ec",void 0,[],void 0),qt[63981]=Vt(63981,"unknown_f9ed",void 0,[],void 0),qt[63982]=Vt(63982,"unknown_f9ee",void 0,[],void 0),qt[63983]=Vt(63983,"unknown_f9ef",void 0,[],void 0),qt[63984]=Vt(63984,"unknown_f9f0",void 0,[],void 0),qt[63985]=Vt(63985,"unknown_f9f1",void 0,[],void 0),qt[63986]=Vt(63986,"unknown_f9f2",void 0,[],void 0),qt[63987]=Vt(63987,"unknown_f9f3",void 0,[],void 0),qt[63988]=Vt(63988,"unknown_f9f4",void 0,[],void 0),qt[63989]=Vt(63989,"unknown_f9f5",void 0,[],void 0),qt[63990]=Vt(63990,"unknown_f9f6",void 0,[],void 0),qt[63991]=Vt(63991,"unknown_f9f7",void 0,[],void 0),qt[63992]=Vt(63992,"unknown_f9f8",void 0,[],void 0),qt[63993]=Vt(63993,"unknown_f9f9",void 0,[],void 0),qt[63994]=Vt(63994,"unknown_f9fa",void 0,[],void 0),qt[63995]=Vt(63995,"unknown_f9fb",void 0,[],void 0),qt[63996]=Vt(63996,"unknown_f9fc",void 0,[],void 0),qt[63997]=Vt(63997,"unknown_f9fd",void 0,[],void 0),qt[63998]=Vt(63998,"unknown_f9fe",void 0,[],void 0),qt[63999]=Vt(63999,"unknown_f9ff",void 0,[],void 0);function Po(e,t,i){const o=Math.min(e.params.length,t.length),n=[];let s=0;for(let i=0;iObject.assign({},e))};switch(e.type){case Bo.Instructions:return{type:Bo.Instructions,labels:t,instructions:e.instructions.map(e=>(function(e){return{opcode:e.opcode,args:e.args.map(e=>Object.assign({},e)),arg_size:e.arg_size,size:e.size,param_to_args:e.param_to_args.map(e=>e.map(e=>Object.assign({},e))),asm:e.asm}})(e)),asm:i};case Bo.Data:return{type:Bo.Data,labels:t,data:e.data.slice(0),asm:i};case Bo.String:return{type:Bo.String,labels:t,value:e.value,asm:i}}}qt.forEach(e=>{Ft.set(e.mnemonic,e)}),function(e){e[e.Instructions=0]="Instructions",e[e.Data=1]="Data",e[e.String=2]="String"}(Bo||(Bo={}));const Mo={add:(e,t)=>e+t,sub:(e,t)=>e-t,mul:(e,t)=>e*t,div:(e,t)=>e/t,idiv:(e,t)=>Math.floor(e/t),mod:(e,t)=>e%t,and:(e,t)=>e&t,or:(e,t)=>e|t,xor:(e,t)=>e^t,shl:(e,t)=>e<e>>>t};function Wo(e,t,i){if(e(t,i))return i}function qo(e){return e.slice(1)}const Fo=X.a.get("quest_editor/scripting/vm/io");class Vo{map_designate(e,t){Fo.warning(`bb_map_designate(${e}, ${t})`)}set_floor_handler(e,t){Fo.warning(`set_floor_handler(${e}, ${t})`)}window_msg(e){Fo.warning(`window_msg("${e}")`)}message(e){Fo.warning(`message("${e}")`)}add_msg(e){Fo.warning(`add_msg("${e}")`)}winend(){Fo.warning("winend")}p_dead_v3(e){return Fo.warning(`p_dead_v3(${e})`),!1}mesend(){Fo.warning("mesend")}list(e){Fo.warning(`list([${e.map(e=>`"${e}"`).join(", ")}])`)}warning(e,t){var i;Fo.warning(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}error(e,t){var i;Fo.error(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}srcloc_to_string(e){return e?` [${e.line_no}:${e.col}]`:" "}}var Uo=i("bcBH");class No{constructor(e=Math.floor(performance.now())){this.holdrand=e}next(){const e=214013*this.holdrand+2531011>>>0;return this.holdrand=e,e>>>16&32767}}var zo=i("NRxM");class $o extends zo.a{constructor(e,t){super(new ArrayBuffer(e),t)}zero(){new Uint32Array(this.backing_buffer).fill(0)}}class Ao{constructor(e,t,i){Object(N.d)(e>=0,"seg_idx should be greater or equal to 0."),Object(N.d)(e=0,"inst_idx should be greater or equal to 0."),Object(N.d)(t=Go)throw new Error("Argument stack: Stack overflow");this.arg_stack.write_u32_at(this.arg_stack_counter*Ho,e),this.arg_stack_types[this.arg_stack_counter]=t,this.arg_stack_counter++}fetch_args(e){const t=e.instruction;if(t.opcode.stack!==Mt.Pop)return[];const i=[];t.opcode.params.length!==this.arg_stack_counter&&this.io.warning("Argument stack: Argument count mismatch.",e);for(let o=0;o0&&i.push(this.arg_stack.u8_at(s));break;default:throw new Error(`Argument stack: Unhandled parameter kind: ${ft[n.type.kind]}.`)}}return this.arg_stack_counter=0,i}check_arg_type(e,t,i){let o;switch(e){case ft.Any:o=!0;break;case ft.Byte:case ft.Word:case ft.DWord:case ft.Float:case ft.String:case ft.Pointer:o=t===e;break;case ft.Label:case ft.ILabel:case ft.ILabelVar:case ft.DLabel:case ft.SLabel:o=t===ft.Word;break;case ft.RegRef:case ft.RegTupRef:case ft.RegRefVar:o=t===ft.Byte}o||this.io.warning(`Argument stack: Argument type mismatch, expected ${ft[e]} but received ${ft[t]}.`,i)}}Yo.next_id=0;const Zo=256,Jo=4,Xo=16,en=11085568,tn=1024,on=0,nn="\n",sn=X.a.get("quest_editor/scripting/vm/VirtualMachine");var rn;!function(e){e[e.Suspended=0]="Suspended",e[e.Paused=1]="Paused",e[e.WaitingVsync=2]="WaitingVsync",e[e.WaitingInput=3]="WaitingInput",e[e.WaitingSelection=4]="WaitingSelection",e[e.Halted=5]="Halted"}(rn||(rn={}));class an{constructor(e=new Vo,t=new No){this.io=e,this.random=t,this.episode=s.b.I,this._object_code=[],this.label_to_seg_idx=new Map,this.registers=new $o(Zo*Jo,Uo.a.Little),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.breakpoints=[],this.paused=!1,this.unsupported_opcodes_logged=new Set}get object_code(){return this._object_code}get halted(){return this._halted}set step_mode(e){if(null!=e){const t=this.current_thread();t&&(t.step_mode=e)}}load_object_code(e,t){this.halt(),sn.debug("Starting."),this._object_code=e,this.episode=t,this.label_to_seg_idx.clear();let i=0;for(const e of this._object_code){for(const t of e.labels)this.label_to_seg_idx.set(t,i);i++}this._halted=!1}start_thread(e,t){const i=this.get_segment_index_by_label(e),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${e} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);this.threads.push(new Yo(this.io,new Ao(i,0,this.object_code),t))}execute(){var e,t,i;if(this._halted)return rn.Halted;let o;try{let n=0;for(;n++<1e4;){if(this.threads.length>=1&&this.thread_idx>=this.threads.length)return rn.WaitingVsync;const n=this.current_thread();if(!n)return rn.Suspended;const s=n.current_stack_frame();o=s.instruction_pointer;const r=o.instruction;if(!this.paused)switch(n.step_mode){case Ko.BreakPoint:if(-1!==this.breakpoints.findIndex(e=>e.equals(o)))return this.paused=!0,rn.Paused;break;case Ko.Over:if(n.step_frame&&s.idx<=n.step_frame.idx&&(null===(e=r.asm)||void 0===e?void 0:e.mnemonic))return this.paused=!0,rn.Paused;break;case Ko.In:if(null===(t=r.asm)||void 0===t?void 0:t.mnemonic)return this.paused=!0,rn.Paused;break;case Ko.Out:if(n.step_frame&&s.idx=this.threads.length&&(this.thread_idx=0)}halt(){this._halted||(sn.debug("Halting."),this.registers.zero(),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.paused=!1,this.breakpoints.splice(0,1/0),this.unsupported_opcodes_logged.clear())}get_current_stack_frame(){var e;return null===(e=this.current_thread())||void 0===e?void 0:e.current_stack_frame()}get_instruction_pointer(){var e;return null===(e=this.get_current_stack_frame())||void 0===e?void 0:e.instruction_pointer}get_segment_index_by_label(e){if(!this.label_to_seg_idx.has(e))throw new Error(`Invalid argument: No such label ${e}.`);return this.label_to_seg_idx.get(e)}list_select(e){if(!this.list_open)throw new Error("list_select may not be called if there is no list open");this.set_register_unsigned(this.selection_reg,e)}set_breakpoint(e){-1===this.breakpoints.findIndex(t=>t.equals(e))&&this.breakpoints.push(e)}remove_breakpoint(e){const t=this.breakpoints.findIndex(t=>t.equals(e));-1!==t&&this.breakpoints.splice(t,1)}current_thread(){return this.threads[this.thread_idx]}terminate_thread(e){this.threads.splice(e,1),this.thread_idx>=e&&this.thread_idx>0&&this.thread_idx--}advance(e){const t=e.current_stack_frame();if(!t)return;const i=t.instruction_pointer.next();i?e.set_current_instruction_pointer(i):(e.pop_call_stack(),this.terminate_thread(this.thread_idx))}execute_instruction(e,t){const i=t.instruction;let o=void 0,n=!0;const r=i.args.map(e=>e.value),[a,d,c]=r;this.list_open&&(this.list_open=!1);const l=e.fetch_args(t);switch(i.opcode.code){case Ut.code:break;case Nt.code:this.pop_call_stack(this.thread_idx);break;case zt.code:o=rn.WaitingVsync,this.advance(e),this.thread_idx++,n=!1;break;case $t.code:this.halt();break;case At.code:this.start_thread(a);break;case Qt.code:this.set_register_signed(a,this.get_register_signed(d));break;case Yt.code:this.set_register_signed(a,d);break;case Zt.code:this.set_register_byte(a,d);break;case Jt.code:this.set_register_word(a,d);break;case Xt.code:this.set_register_unsigned(a,this.get_register_address(a));break;case ko.code:this.set_register_float(a,this.get_register_float(d));break;case yo.code:this.set_register_float(a,d);break;case ei.code:this.set_register_signed(a,1);break;case ti.code:this.set_register_signed(a,0);break;case ii.code:this.set_register_signed(a,0===this.get_register_signed(a)?1:0);break;case wi.code:this.push_call_stack(e,a),n=!1;break;case mi.code:this.jump_to_label(e,a),n=!1;break;case Qi.code:e.push_arg(this.get_register_signed(a),ft.DWord);break;case Yi.code:e.push_arg(i.args[0].value,ft.DWord);break;case Zi.code:e.push_arg(i.args[0].value,ft.Byte);break;case Ji.code:e.push_arg(i.args[0].value,ft.Word);break;case Xi.code:e.push_arg(this.get_register_address(i.args[0].value),ft.DWord);break;case to.code:if("string"==typeof a){const t=this.parse_template_string(a);this.string_arg_store=t.slice(0,tn/2),e.push_arg(en,ft.String)}break;case oi.code:this.do_integer_op_with_register(a,d,Mo.add);break;case ni.code:this.do_integer_op_with_literal(a,d,Mo.add);break;case si.code:this.do_integer_op_with_register(a,d,Mo.sub);break;case ri.code:this.do_integer_op_with_literal(a,d,Mo.sub);break;case ai.code:this.do_integer_op_with_register(a,d,Mo.mul);break;case di.code:this.do_integer_op_with_literal(a,d,Mo.mul);break;case ci.code:this.do_integer_op_with_register(a,d,Mo.idiv);break;case li.code:this.do_integer_op_with_literal(a,d,Mo.idiv);break;case bi.code:this.do_integer_op_with_register(a,d,Mo.mod);break;case fi.code:this.do_integer_op_with_literal(a,d,Mo.mod);break;case Ro.code:this.do_float_op_with_register(a,d,Mo.add);break;case Io.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.add);break;case jo.code:this.do_float_op_with_register(a,d,Mo.sub);break;case To.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.sub);break;case xo.code:this.do_float_op_with_register(a,d,Mo.mul);break;case So.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.mul);break;case Co.code:this.do_float_op_with_register(a,d,Mo.div);break;case Oo.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.div);break;case _i.code:this.do_integer_op_with_register(a,d,Mo.and);break;case ui.code:this.do_integer_op_with_literal(a,d,Mo.and);break;case vi.code:this.do_integer_op_with_register(a,d,Mo.or);break;case hi.code:this.do_integer_op_with_literal(a,d,Mo.or);break;case pi.code:this.do_integer_op_with_register(a,d,Mo.xor);break;case gi.code:this.do_integer_op_with_literal(a,d,Mo.xor);break;case bo.code:this.do_integer_op_with_register(a,d,Mo.shl);break;case fo.code:this.do_integer_op_with_register(a,d,Mo.shr);break;case ki.code:this.conditional_jump(e,a,(e,t)=>e===t,1,...qo(r).map(e=>this.get_register_signed(e))),n=!1;break;case yi.code:this.conditional_jump(e,a,(e,t)=>e===t,0,...qo(r).map(e=>this.get_register_signed(e))),n=!1;break;case Ri.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e===t,a,d),n=!1;break;case Ii.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e===t,a,d),n=!1;break;case ji.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e!==t,a,d),n=!1;break;case Ti.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e!==t,a,d),n=!1;break;case xi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),n=!1;break;case Si.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),n=!1;break;case Ci.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),n=!1;break;case Oi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),n=!1;break;case Li.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>eeeee>=t,a,d),n=!1;break;case Mi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),n=!1;break;case Wi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>=t,a,d),n=!1;break;case qi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),n=!1;break;case Fi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Vi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Ui.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Ni.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),n=!1;break;case Ai.code:this.push_variable_stack(e,a,1);break;case Hi.code:this.pop_variable_stack(e,a,1);break;case Gi.code:this.push_variable_stack(e,a,d);break;case Ki.code:this.pop_variable_stack(e,a,d);break;case io.code:if(!this.window_msg_open){const e=this.deref_string(l[1]).split(nn);o=rn.WaitingSelection,this.list_open=!0,this.selection_reg=l[0],this.io.list(e)}break;case oo.code:if(!this.window_msg_open){const e=this.deref_string(l[0]);o=rn.WaitingInput,this.window_msg_open=!0,this.io.window_msg(e)}break;case no.code:if(this.window_msg_open){const e=this.deref_string(l[0]);o=rn.WaitingInput,this.io.add_msg(e)}break;case so.code:this.set_register_unsigned(a,Math.floor(Date.now()/1e3));break;case ro.code:this.window_msg_open&&(this.window_msg_open=!1,this.io.winend());break;case ao.code:this.set_register_signed(l[0],this.io.p_dead_v3(l[1])?1:0);break;case lo.code:this.io.set_floor_handler(l[0],l[1]);break;case _o.code:this.start_thread(a);break;case vo.code:this.io.map_designate(this.get_register_signed(a),this.get_register_signed(a+2));break;case go.code:this.io.map_designate(this.get_register_signed(a),this.get_register_signed(a+3));break;case mo.code:{const e=this.get_register_signed(a),t=this.get_register_signed(a+1),i=this.random.next();let o=Math.floor(Math.fround(i/32768)*t);e>=o&&(o=e),this.set_register_signed(d,o)}break;case wo.code:if(this.set_episode_called){this.io.warning("Calling set_episode more than once is not supported.",t);break}if(this.set_episode_called=!0,!this._object_code[t.seg_idx].labels.includes(on)){this.io.warning(`Calling set_episode outside of segment ${on} is not supported.`,t);break}if(function(e){switch(e){case s.b.I:return 0;case s.b.II:return 1;case s.b.IV:return 2}}(this.episode)!==a){this.io.warning("Calling set_episode with an argument that does notmatch the quest's designated episode is not supported.",t);break}break;case Lo.code:this.io.map_designate(a,c);break;default:this.unsupported_opcodes_logged.has(i.opcode.code)||(this.unsupported_opcodes_logged.add(i.opcode.code),this.io.warning("Unsupported instruction.",t))}return n&&this.advance(e),o}get_register_signed(e){return this.registers.i32_at(Jo*e)}set_register_signed(e,t){this.registers.write_i32_at(Jo*e,t)}get_register_unsigned(e){return this.registers.u32_at(Jo*e)}set_register_unsigned(e,t){this.registers.write_u32_at(Jo*e,t)}get_register_word(e){return this.registers.u16_at(Jo*e)}set_register_word(e,t){this.registers.write_u16_at(Jo*e,t)}get_register_byte(e){return this.registers.u8_at(Jo*e)}set_register_byte(e,t){this.registers.write_u8_at(Jo*e,t)}get_register_float(e){return this.registers.f32_at(Jo*e)}set_register_float(e,t){this.registers.write_f32_at(Jo*e,t)}do_integer_op_with_register(e,t,i){this.do_integer_op_with_literal(e,this.get_register_signed(t),i)}do_integer_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_signed(e,i(this.get_register_signed(e),t))}do_float_op_with_register(e,t,i){this.do_float_op_with_literal(e,this.get_register_float(t),i)}do_float_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_float(e,i(this.get_register_float(e),t))}push_call_stack(e,t){const i=this.get_segment_index_by_label(t),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${t} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);e.push_frame(new Ao(i,0,this.object_code))}pop_call_stack(e){this.threads[e].pop_call_stack(),0===this.threads[e].call_stack.length&&this.terminate_thread(e)}jump_to_label(e,t){e.set_current_instruction_pointer(new Ao(this.get_segment_index_by_label(t),0,this.object_code))}signed_cond_jump_with_register(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_signed(o),this.get_register_signed(n))}signed_cond_jump_with_literal(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_signed(o),n)}unsigned_cond_jump_with_register(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_unsigned(o),this.get_register_unsigned(n))}unsigned_cond_jump_with_literal(e,t,i,o,n){this.conditional_jump(e,t,i,this.get_register_unsigned(o),n)}conditional_jump(e,t,i,...o){const n=Wo.bind(null,i);var s;void 0!==function(e,t,i){let o=t;for(const t of i){const i=e(o,t);if(void 0===i)return;o=i}return o}(n,(s=o)[0],s.slice(1))?this.jump_to_label(e,t):this.advance(e)}push_variable_stack(e,t,i){const o=t+i;if(o>Zo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length+i>Xo)throw new Error("Variable stack: Stack overflow");for(let i=t;iZo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length=t;i--)this.set_register_unsigned(i,e.variable_stack.pop())}get_register_address(e){return e*Jo}deref_string(e){if(e===en)return this.string_arg_store;if(e>0&&e``],[/^r([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_unsigned(t).toString()}],[/^f([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_float(t).toFixed(6)}]];let o=!1,n=-1,s=0,r=e.length;for(;s"===a){o=!1;const a=s,d=e.slice(n+1,a);let c=void 0;for(const[e,t]of i){const i=e.exec(d);if(i&&void 0!==i[1]){c=t(i[1]);break}}if(void 0===c&&(c=t[d]),void 0===c)c="";else if("function"==typeof c){const e=c();t[d]=e,c=e}e=e.slice(0,n)+c+e.slice(a+1);const l=c.length-(d.length+2);s+=l,r+=l}else"<"===a&&(o=!0,n=s);s++}return o&&(e=e.slice(0,n)),e}}i("PNEq");var dn,cn=i("sv1z");!function(e){e[e.Signed=0]="Signed",e[e.Unsigned=1]="Unsigned",e[e.Word=2]="Word",e[e.Byte=3]="Byte",e[e.Float=4]="Float"}(dn||(dn={}));class ln extends b.a{constructor(e){super(),this.quest_runner=e,this.type_select=this.add(new cn.a({label:"Display type:",tooltip:"Select which data type register values should be displayed as.",items:[dn.Signed,dn.Unsigned,dn.Word,dn.Byte,dn.Float],to_label:e=>dn[e]})),this.register_getter=this.get_register_getter(dn.Signed),this.hex_checkbox=this.add(new Ne.a(!1,{label:"Hex",tooltip:"Display register values in hexadecimal."})),this.settings_bar=this.add(new Ue.a(this.type_select,this.hex_checkbox)),this.list_element=Object(u.h)({className:"quest_editor_RegistersView_list"}),this.container_element=Object(u.h)({className:"quest_editor_RegistersView_container"},this.list_element),this.element=Object(u.h)({className:"quest_editor_RegistersView"},this.settings_bar.element,this.container_element),this.type_select.selected.val=dn.Signed;const t=Array(Zo);for(let e=0;e!this.quest_runner.paused.val||!this.quest_runner.running.val;this.update(i(),this.hex_checkbox.checked.val),this.disposables(this.quest_runner.running.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.quest_runner.paused.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.type_select.selected.observe(({value:e})=>{null!=e&&(this.register_getter=this.get_register_getter(e),this.update(i(),this.hex_checkbox.checked.val))}),this.hex_checkbox.checked.observe(e=>this.update(i(),e.value))),this.finalize_construction()}get_register_getter(e){let t;switch(e){case dn.Signed:t=this.quest_runner.vm.get_register_signed;break;case dn.Unsigned:t=this.quest_runner.vm.get_register_unsigned;break;case dn.Word:t=this.quest_runner.vm.get_register_word;break;case dn.Byte:t=this.quest_runner.vm.get_register_byte;break;case dn.Float:t=this.quest_runner.vm.get_register_float}return t.bind(this.quest_runner.vm)}update(e,t){if(e){const e="??";for(let t=0;t{this.buffer_log_entry(e,t)},this.severity=this._severity,this.log=this._log.filtered(this.severity.map(e=>t=>t.severity>=e))}get_logger(e){const t=X.a.get(e);return t.handler=this.handler,t}dispose(){this.disposer.dispose()}set_severity(e){this._severity.val=e}buffer_log_entry(e,t){this.log_buffer.push(e),this.logger_name_buffer.push(t),this.add_buffered_log_entries()}add_buffered_log_entries(){null==this.adding_log_entries&&(this.adding_log_entries=requestAnimationFrame(()=>{if(this.log_buffer.length>500){const e=this.log_buffer.length-500;this.log_buffer.splice(250,e,{time:new Date,message:`...dropped ${e} messages...`,severity:_n.b.Warning,logger:un}),this.logger_name_buffer.splice(250,e,"quest_editor/stores/LogStore")}const e=Math.min(200,this.log_buffer.length),t=this.log_buffer.splice(0,e),i=this.logger_name_buffer.splice(0,e);this._log.push(...t);for(let o=0;o2e3&&this._log.splice(0,1e3),this.adding_log_entries=void 0,this.log_buffer.length&&this.add_buffered_log_entries()}))}},hn=5;class pn extends b.a{constructor(){super(),this.element=Object(u.h)({className:"quest_editor_LogView",tabIndex:-1}),this.should_scroll_to_bottom=!0,this.scrolled=()=>{this.should_scroll_to_bottom=this.list_container.scrollTop>=this.list_container.scrollHeight-this.list_container.offsetHeight-hn},this.scroll_to_bottom=()=>{this.should_scroll_to_bottom&&this.list_container.scrollTo({top:this.list_container.scrollHeight,left:0,behavior:"auto"})},this.create_message_element=({time:e,severity:t,message:i})=>Object(u.h)({className:["quest_editor_LogView_message","quest_editor_LogView_"+_n.b[t]+"_message"].join(" ")},Object(u.h)({className:"quest_editor_LogView_message_timestamp"},Object(X.b)(e)),Object(u.h)({className:"quest_editor_LogView_message_level"},"["+_n.b[t]+"]"),Object(u.h)({className:"quest_editor_LogView_message_contents"},i)),this.list_container=Object(u.h)({className:"quest_editor_LogView_list_container"}),this.list_element=Object(u.h)({className:"quest_editor_LogView_message_list"}),this.level_filter=this.add(new cn.a({class:"quest_editor_LogView_level_filter",label:"Level:",items:_n.a,to_label:e=>_n.b[e]})),this.settings_bar=this.add(new Ue.a({class:"quest_editor_LogView_settings"},this.level_filter)),this.list_container.addEventListener("scroll",this.scrolled),this.disposables(Object(u.d)(this.list_element,vn.log,this.create_message_element,{after:this.scroll_to_bottom}),this.level_filter.selected.observe(({value:e})=>null!=e&&vn.set_severity(e)),vn.severity.observe(({value:e})=>{this.level_filter.selected.val=e},{call_now:!0})),this.list_container.appendChild(this.list_element),this.element.appendChild(this.settings_bar.element),this.element.appendChild(this.list_container),this.finalize_construction()}}class gn extends se{constructor(e,t,i,o){super(Object(M.e)(void 0),t,i,o),this.quest_runner=e,this.disposer.add_all(this.quest_runner.game_state.current_area_variant.observe(this.area_variant_changed,{call_now:!0}))}get_area_variant_details(){const e=this.quest_runner.game_state;return{episode:e.episode,area_variant:e.current_area_variant.val,npcs:e.npcs,objects:e.objects}}}class bn extends le{constructor(e,t,i,o){super(e,"quest_editor_QuestRunnerRendererView",new Y(o,o=>new gn(e.quest_runner,o,t,i))),this.renderer.init_camera_controls(),this.finalize_construction()}}var fn=i("nN8q");i("cl9q");class mn extends fn.a{constructor(e){super(),this.element=Object(u.h)({className:"core_ErrorWidget"}),this.children=[],this.label=this.disposable(new h.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}var wn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const kn=X.a.get("quest_editor/gui/QuestEditorView"),yn={settings:{showPopoutIcon:!1,showMaximiseIcon:!0,showCloseIcon:!0},dimensions:{headerHeight:24},labels:{close:"Close",maximise:"Maximise",minimise:"Minimise",popout:"Open in new window"}};class Rn extends b.a{constructor(e,t,i,o,n,s,r,a,d,c,l,_,v,h){super(),this.gui_store=e,this.quest_editor_ui_persister=i,this.tool_bar=o,this.element=Object(u.h)({className:"quest_editor_QuestEditorView"}),this.layout_element=Object(u.h)({className:"quest_editor_gl_container"}),this.sub_views=new Map,this.view_map=new Map([[f,{name:"quest_info",create:n}],[m,{name:"npc_counts",create:s}],[Fe,{name:"quest_renderer",create:r}],[Ke,{name:"asm_editor",create:a}],[Qe,{name:"entity_info",create:d}],[Je,{name:"npc_list_view",create:c}],[Xe,{name:"object_list_view",create:l}],[bt,{name:"events_view",create:_}]]),e.feature_active("vm")&&(this.view_map.set(bn,{name:"quest_runner",create:v}),this.view_map.set(pn,{name:"log_view",create:()=>new pn}),this.view_map.set(ln,{name:"registers_view",create:h})),this.element.append(this.tool_bar.element,this.layout_element),this.layout=this.init_golden_layout(),this.layout.then(e=>this.loaded_layout=e),this.disposables(e.on_global_keydown(Ye.b.QuestEditor,"Ctrl-Alt-D",()=>t.debug.val=!t.debug.val),t.quest_runner.running.observe(({value:e})=>wn(this,void 0,void 0,(function*(){const i=yield this.layout;if(t.quest_runner.running.val===e){const t=i.root.getItemsById(this.view_map.get(bn).name);if(e){if(0===t.length){i.root.getItemsById(this.view_map.get(Fe).name)[0].parent.addChild({id:this.view_map.get(bn).name,title:"Debug 3D View",type:"component",componentName:this.view_map.get(bn).name,isClosable:!1})}}else for(const e of t)e.remove()}})))),this.finalize_construction()}activate(){super.activate();for(const e of this.sub_views.values())e.activate()}deactivate(){for(const e of this.sub_views.values())e.deactivate();super.deactivate()}resize(e,t){super.resize(e,t);const i=Math.max(0,t-this.tool_bar.height);return this.layout_element.style.width=`${e}px`,this.layout_element.style.height=`${i}px`,this.layout.then(t=>t.updateSize(e,i)),this}dispose(){super.dispose(),this.layout.then(e=>e.destroy());for(const e of this.sub_views.values())e.dispose();this.sub_views.clear()}init_golden_layout(){return wn(this,void 0,void 0,(function*(){const e=this.get_default_layout_content();try{const t=yield this.quest_editor_ui_persister.load_layout_config(e);if(t){const e=this.attempt_gl_init(Object.assign(Object.assign({},yn),{content:t}));return kn.info("Instantiated golden layout with persisted layout."),e}}catch(e){kn.warning("Couldn't instantiate golden layout with persisted layout.",e)}return kn.info("Instantiating golden layout with default layout."),this.attempt_gl_init(Object.assign(Object.assign({},yn),{content:e}))}))}attempt_gl_init(e){const t=new n.a(e,this.layout_element),i=this;try{for(const{name:e,create:o}of this.view_map.values())t.registerComponent(e,(function(t){let n;try{n=o(),i.active&&n.activate()}catch(t){kn.error(`Couldn't instantiate "${e}".`,t),n=new mn("Something went wrong while creating this window.")}t.on("close",()=>n.dispose()),t.on("resize",()=>n.resize(t.width,t.height-4)),n.resize(t.width,t.height),i.sub_views.set(e,n),t.getElement().append(n.element)}));return t.on("stateChanged",()=>{this.quest_editor_ui_persister.persist_layout_config(t.toConfig().content)}),t.on("stackCreated",e=>{e.on("activeContentItemChanged",e=>{if("componentName"in e.config){const t=this.sub_views.get(e.config.componentName);t&&t.focus()}})}),t.init(),t}catch(e){throw t.destroy(),e}}get_default_layout_content(){return[{type:"row",content:[{type:"column",width:2,content:[{type:"stack",content:[{title:"Info",type:"component",componentName:this.view_map.get(f).name,isClosable:!1},{title:"NPC Counts",type:"component",componentName:this.view_map.get(m).name,isClosable:!1}]},{title:"Entity",type:"component",componentName:this.view_map.get(Qe).name,isClosable:!1}]},{type:"stack",width:9,content:[{id:this.view_map.get(Fe).name,title:"3D View",type:"component",componentName:this.view_map.get(Fe).name,isClosable:!1},{title:"Script",type:"component",componentName:this.view_map.get(Ke).name,isClosable:!1},...this.gui_store.feature_active("vm")?[{title:"Debug Log",type:"component",componentName:this.view_map.get(pn).name,isClosable:!1},{title:"Registers",type:"component",componentName:this.view_map.get(ln).name,isClosable:!1}]:[]]},{type:"stack",width:2,content:[{title:"NPCs",type:"component",componentName:this.view_map.get(Je).name,isClosable:!1},{title:"Objects",type:"component",componentName:this.view_map.get(Xe).name,isClosable:!1},{title:"Events",type:"component",componentName:this.view_map.get(bt).name,isClosable:!1}]}]}]}}const In={can_redo:Object(M.e)(!1),can_undo:Object(M.e)(!1),first_redo:Object(M.e)(void 0),first_undo:Object(M.e)(void 0),make_current(){jn.current.val=this},redo:()=>!1,reset(){},undo:()=>!1};const jn=new class{constructor(){this.current=Object(M.e)(In),this.can_undo=this.current.flat_map(e=>e.can_undo),this.can_redo=this.current.flat_map(e=>e.can_redo),this.first_undo=this.current.flat_map(e=>e.first_undo),this.first_redo=this.current.flat_map(e=>e.first_redo)}undo(){return this.current.val.undo()}redo(){return this.current.val.redo()}make_noop_current(){jn.current.val=In}},Tn=X.a.get("core/undo/UndoStack");class xn{constructor(){this.stack=Object(M.c)(),this.index=Object(M.e)(0),this.can_undo=this.index.map(e=>e>0),this.can_redo=Object(M.d)((e,t)=>te?this.stack.get(this.index.val-1):void 0),this.first_redo=this.can_redo.map(e=>e?this.stack.get(this.index.val):void 0),this.undoing_or_redoing=!1}make_current(){jn.current.val=this}push(e){return this.undoing_or_redoing||(this.stack.splice(this.index.val,1/0,e),this.index.update(e=>e+1)),e}pop(){return this.index.update(e=>e-1),this.stack.splice(this.index.val,1)[0]}undo(){if(this.can_undo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.index.update(e=>e-1),this.stack.get(this.index.val).undo()}catch(e){Tn.warning("Error while undoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}redo(){if(this.can_redo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.stack.get(this.index.val).redo(),this.index.update(e=>e+1)}catch(e){Tn.warning("Error while redoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}reset(){this.stack.clear(),this.index.val=0}}class Sn{constructor(e){this._breakpoints=[],this.breakpoints=this._breakpoints,this.vm=e}resume(){this.vm.step_mode=Ko.BreakPoint}step_over(){this.vm.step_mode=Ko.Over}step_in(){this.vm.step_mode=Ko.In}step_out(){this.vm.step_mode=Ko.Out}set_breakpoint(e){return-1===this._breakpoints.findIndex(t=>t.line_no===e)&&(this._breakpoints.push(new Cn(e,void 0,this.vm)),!0)}remove_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);return-1!=t&&(this._breakpoints.splice(t,1)[0].deactivate(),!0)}toggle_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);-1==t?this._breakpoints.push(new Cn(e,void 0,this.vm)):this._breakpoints.splice(t,1)[0].deactivate()}clear_breakpoints(){for(const e of this._breakpoints.splice(0,1/0))e.deactivate()}activate_breakpoints(){for(const e of this._breakpoints)e.activate()}deactivate_breakpoints(){for(const e of this._breakpoints)e.deactivate()}}class Cn{constructor(e,t,i){this.line_no=e,this.ptr=t,this.vm=i,null==t?this.activate():this.vm.set_breakpoint(t)}get active(){return null!=this.ptr}activate(){this.ptr=this.line_no_to_inst_pointer(this.line_no),this.ptr&&this.vm.set_breakpoint(this.ptr)}deactivate(){this.ptr&&this.vm.remove_breakpoint(this.ptr)}line_no_to_inst_pointer(e){var t,i;if(!this.vm.halted)for(let o=0;oe!==On.Stopped),this.paused=this._state.map(e=>e===On.Paused),this.breakpoints=this._breakpoints,this.pause_location=this._pause_location,this.execution_loop=()=>{var e,t;let i;switch(this.animation_frame=void 0,this.vm.vsync(),this.vm.execute()){case rn.Suspended:this._state.val=On.Running;break;case rn.Paused:this._state.val=On.Paused,i=null===(t=null===(e=this.vm.get_instruction_pointer())||void 0===e?void 0:e.source_location)||void 0===t?void 0:t.line_no;break;case rn.WaitingVsync:case rn.WaitingInput:this._state.val=On.Running,this.schedule_frame();break;case rn.WaitingSelection:this.vm.list_select(0),this._state.val=On.Running,this.schedule_frame();break;case rn.Halted:this.stop()}this._pause_location.val=i,this.startup&&this._state.val===On.Running&&(this.startup=!1,this.run_floor_handler(this._game_state.area_variants.get(this.initial_area_id)||this.area_store.get_variant(this._game_state.episode,this.initial_area_id,0)))},this.create_vm_io=()=>{function e(e,t){const i=[e];if(t){const{instruction:e,source_location:o}=t;i.push(` [${e.opcode.mnemonic}`),o&&i.push(` ${o.line_no}:${o.col}`),i.push("]")}return i.join("")}return{map_designate:(e,t)=>{this._game_state.area_variants.set(e,this.area_store.get_variant(this._game_state.episode,e,t))},set_floor_handler:(e,t)=>{this._game_state.floor_handlers.set(e,t)},window_msg:e=>{this.logger.info(`window_msg "${e}"`)},message:e=>{this.logger.info(`message "${e}"`)},add_msg:e=>{this.logger.info(`add_msg "${e}"`)},winend:()=>{},p_dead_v3:()=>!1,mesend:()=>{},list:e=>{this.logger.info(`list "[${e}]"`)},warning:(t,i)=>{this.logger.warning(e(t,i))},error:(t,i)=>{this.logger.error(e(t.message,i))}}},this.vm=new an(this.create_vm_io()),this.debugger=new Sn(this.vm)}get game_state(){return this._game_state}run(e){this.stop(),this.logger.info("Starting debugger."),this.startup=!0,this.initial_area_id=0,this.npcs.splice(0,this.npcs.length,...e.npcs.val),this.objects.splice(0,this.objects.length,...e.objects.val),this._game_state=new Ln(e.episode),this.vm.load_object_code(e.object_code.map(Eo),this.game_state.episode),this.vm.start_thread(0),this.debugger.activate_breakpoints(),this._state.val=On.Running,this.schedule_frame()}resume(){this.debugger.resume(),this.schedule_frame()}step_over(){this.debugger.step_over(),this.schedule_frame()}step_into(){this.debugger.step_in(),this.schedule_frame()}step_out(){this.debugger.step_out(),this.schedule_frame()}stop(){this.running.val&&(this.logger.info("Stopping debugger."),null!=this.animation_frame&&(cancelAnimationFrame(this.animation_frame),this.animation_frame=void 0),this.vm.halt(),this.debugger.deactivate_breakpoints(),this._state.val=On.Stopped,this._pause_location.val=void 0,this.npcs.splice(0,this.npcs.length),this.objects.splice(0,this.objects.length),this._game_state=new Ln(s.b.I))}set_breakpoint(e){const t=this.debugger.set_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}remove_breakpoint(e){const t=this.debugger.remove_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}toggle_breakpoint(e){this.debugger.toggle_breakpoint(e),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}clear_breakpoints(){this.debugger.clear_breakpoints(),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}schedule_frame(){null==this.animation_frame&&(this.animation_frame=requestAnimationFrame(this.execution_loop))}run_floor_handler(e){const t=e.area.id;this._game_state.current_area_variant.val=e,this._game_state.objects.push(...this.objects.filter(e=>e.area_id===t));const i=this._game_state.floor_handlers.get(t);null==i?this.logger.debug(`No floor handler registered for floor ${t}.`):(this.vm.start_thread(i),this.schedule_frame())}}var Dn=i("kcKQ"),Bn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const En=X.a.get("quest_editor/gui/QuestEditorStore");class Mn extends Dn.a{constructor(e,t){super(),this.area_store=t,this._current_quest=Object(M.e)(void 0),this._current_area=Object(M.e)(void 0),this._selected_wave=Object(M.e)(void 0),this._selected_entity=Object(M.e)(void 0),this.debug=Object(M.e)(!1),this.undo=new xn,this.current_quest=this._current_quest,this.current_area=this._current_area,this.selected_wave=this._selected_wave,this.selected_entity=this._selected_entity,this.set_current_area=e=>{var t,i;e&&e.id!==(null===(i=null===(t=this.selected_wave.val)||void 0===t?void 0:t.area_id)||void 0===i?void 0:i.val)&&this.set_selected_wave(void 0),this._selected_entity.val=void 0,this._current_area.val=e},this.set_selected_wave=e=>{if(e){const t=this.selected_entity.val;t&&t instanceof Q&&t.wave.val!==e&&this.set_selected_entity(void 0)}this._selected_wave.val=e},this.set_selected_entity=e=>{e&&this.current_quest.val&&(this._current_area.val=this.area_store.get_area(this.current_quest.val.episode,e.area_id)),this._selected_entity.val=e},this.set_section_on_quest_entity=(e,t)=>{const i=t.find(t=>t.id===e.section_id.val);i?e.set_section(i):En.warning(`Section ${e.section_id.val} not found.`)},this.quest_runner=new Pn(t),this.disposables(e.tool.observe(({value:e})=>{e===Ye.b.QuestEditor&&this.undo.make_current()},{call_now:!0}),this.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof Q&&!e.includes(t)&&this.set_selected_entity(void 0)}),this.current_quest.flat_map(e=>e?e.objects:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof me&&!e.includes(t)&&this.set_selected_entity(void 0)}),Object(u.g)(window,"beforeunload",e=>{this.quest_runner.stop(),this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}dispose(){this.quest_runner.stop(),super.dispose()}set_current_quest(e){return Bn(this,void 0,void 0,(function*(){if(this.undo.reset(),this.quest_runner.stop(),this._current_area.val=void 0,this._selected_entity.val=void 0,this._current_quest.val=e,e){this._current_area.val=this.area_store.get_area(e.episode,0);for(const t of e.area_variants.val){const i=yield this.area_store.get_area_sections(e.episode,t);t.set_sections(i);for(const o of e.objects.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){En.error(e)}for(const o of e.npcs.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){En.error(e)}}}}))}}var Wn,qn,Fn=i("NUmZ"),Vn=i.n(Fn);!function(e){e[e.NewAssembly=0]="NewAssembly",e[e.AssemblyChange=1]="AssemblyChange",e[e.SignatureHelp=2]="SignatureHelp",e[e.Definition=3]="Definition",e[e.SettingsChange=4]="SettingsChange"}(Wn||(Wn={})),function(e){e[e.NewObjectCode=0]="NewObjectCode",e[e.SignatureHelp=1]="SignatureHelp",e[e.Definition=2]="Definition"}(qn||(qn={}));const Un=new DataView(new ArrayBuffer(4));function Nn(e){return Un.setInt32(0,e),Un.getFloat32(0)}function zn(e){return Un.setFloat32(0,e),Un.getInt32(0)}const $n=X.a.get("quest_editor/scripting/disassembly");function An(e,t){const i=[],o=Math.min(e.length,t.length);for(let n=0;nnull!=e).map(e=>({label:e.mnemonic,kind:Kn.Function,insertText:e.mnemonic})),Yn=[{label:".code",kind:Kn.Keyword,insertText:"code"},{label:".data",kind:Kn.Keyword,insertText:"data"},{label:".string",kind:Kn.Keyword,insertText:"string"}];class Zn{constructor(e,t,i){this.can_undo=Object(M.e)(!1),this.can_redo=Object(M.e)(!1),this.action=Object(M.e)({description:e,undo:t,redo:i}),this.first_undo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_undo),this.first_redo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_redo)}make_current(){jn.current.val=this}undo(){return!!this.can_undo&&(this.action.val.undo(),!0)}redo(){return!!this.can_redo&&(this.action.val.redo(),!0)}reset(){this.can_undo.val=!1,this.can_redo.val=!1}}var Jn=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Xn=new class{constructor(){this._issues=Object(M.e)({warnings:[],errors:[]}),this.issues=this._issues,this.worker=new Vn.a,this.promises=new Map,this.message_id=0,this.process_worker_message=e=>{const t=e.data;switch(t.type){case qn.NewObjectCode:this.quest&&(this.quest.object_code.splice(0,this.quest.object_code.length,...t.object_code),this.quest.set_map_designations(t.map_designations),this._issues.val={warnings:t.warnings,errors:t.errors});break;case qn.SignatureHelp:{const e=this.promises.get(t.id);if(e)if(this.promises.delete(t.id),t.opcode){let i=t.opcode.mnemonic+" ";const o=[];let n=!0;for(const e of t.opcode.params){let t;switch(n?n=!1:i+=", ",e.type.kind){case ft.ILabel:t="FuncLabel";break;case ft.DLabel:t="DataLabel";break;case ft.SLabel:t="StringLabel";break;case ft.ILabelVar:t="...FuncLabel";break;case ft.RegRef:case ft.RegTupRef:t="Register";break;case ft.RegRefVar:t="...Register";break;default:t=ft[e.type.kind]}o.push({label:[i.length,i.length+t.length],documentation:e.doc}),i+=t}const s={signatures:[{label:i,documentation:t.opcode.doc,parameters:o}],activeSignature:0,activeParameter:t.active_param};e.resolve(s)}else e.resolve(void 0)}break;case qn.Definition:{const e=this.promises.get(t.id);if(e){this.promises.delete(t.id);const i=[];null!=t.line_no&&i.push({uri:e.uri,range:{startLineNumber:t.line_no,startColumn:t.col,endLineNumber:t.line_no,endColumn:t.col+t.len}}),e.resolve(i)}}}},this.worker.onmessage=this.process_worker_message}disassemble(e,t){this.quest=e;const i=function(e,t=!1){$n.trace("disassemble start");const i=[],o=[];let n=void 0;for(const r of e){let e;switch(r.type){case Bo.Instructions:e=".code";break;case Bo.Data:e=".data";break;case Bo.String:e=".string"}n!==r.type&&(n=r.type,i.length&&i.push(""),i.push(e,""));for(const e of r.labels)i.push(`${e}:`);if(r.type===Bo.Data){const e=new Uint8Array(r.data);let t=" ";for(let o=0;o4&&i.push(t)}else if(r.type===Bo.String)i.push(" "+(s=r.value,JSON.stringify(s.replace(//g,"\n"))));else{let e=!1;for(const n of r.instructions)if(n.opcode.code===Ht.code?e=!0:n.opcode.code===Gt.code&&(e=!1),t||e||n.opcode.stack!==Mt.Push){let e=[];n.opcode.stack===Mt.Pop?t||(e=Hn(n.opcode.params,o.splice(Math.max(0,o.length-n.opcode.params.length),n.opcode.params.length),!0)):e=Hn(n.opcode.params,An(n.opcode.params,n.args),!1),i.push(" "+n.opcode.mnemonic+(e.length?" "+e.join(", "):""))}else o.push(...An(n.opcode.params,n.args))}}var s;return i.length&&i.push(""),$n.trace(`disassemble end, line count: ${i.length}`),i}(e.object_code,t),o={type:Wn.NewAssembly,assembly:i};return this.worker.postMessage(o),i}update_assembly(e){const t={type:Wn.AssemblyChange,changes:e.map(e=>({start_line_no:e.range.startLineNumber,start_col:e.range.startColumn,end_line_no:e.range.endLineNumber,end_col:e.range.endColumn,new_text:e.text}))};this.worker.postMessage(t)}provide_completion_items(e){return{suggestions:/^\s*([a-z][a-z0-9_=<>!]*)?$/.test(e)?Qn:/^\s*\.[a-z]+$/.test(e)?Yn:[],incomplete:!1}}provide_signature_help(e,t,i){return Gn(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Signature help provision",e,e=>({type:Wn.SignatureHelp,id:e,line_no:t,col:i}))}))}provide_definition(e,t,i){return Gn(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Definition provision",e,e=>({type:Wn.Definition,id:e,line_no:t,col:i}))}))}update_settings(e){const t={type:Wn.SettingsChange,settings:e};this.worker.postMessage(t)}dispose(){this.worker.terminate()}send_and_await_response(e,t,i){return Gn(this,void 0,void 0,(function*(){const o=this.message_id++;return new Promise((n,s)=>{this.promises.set(o,{uri:t,resolve:n,reject:s});const r=i(o);this.worker.postMessage(r),setTimeout(()=>{this.promises.delete(o)&&s(new Error(`${e} timed out.`))},5e3)})}))}};Ve.languages.register({id:"psoasm"}),Ve.languages.setMonarchTokensProvider("psoasm",{defaultToken:"invalid",tokenizer:{root:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/r\d+/,"predefined"],[/[^\s]+:/,"tag"],[/0x[0-9a-fA-F]+/,"number.hex"],[/-?\d+(\.\d+)?(e-?\d+)?/,"number.float"],[/-?[0-9]+/,"number"],[/\.[^\s]+/,"keyword"],[/[a-z][a-z0-9_=<>!]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\/\/.*$/,"comment"],[/,/,"delimiter"]],string:[[/[^\\"]+/,"string"],[/\\(?:[n\\"])/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}}),Ve.languages.registerCompletionItemProvider("psoasm",{provideCompletionItems(e,t){const i=e.getValueInRange({startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:1,endColumn:t.column});return Xn.provide_completion_items(i)}}),Ve.languages.registerSignatureHelpProvider("psoasm",{signatureHelpTriggerCharacters:[" ",","],signatureHelpRetriggerCharacters:[", "],provideSignatureHelp(e,t){return Jn(this,void 0,void 0,(function*(){const i=yield Xn.provide_signature_help(e.uri,t.lineNumber,t.column);return i&&{value:i,dispose(){}}}))}}),Ve.languages.setLanguageConfiguration("psoasm",{indentationRules:{increaseIndentPattern:/^\s*\d+:/,decreaseIndentPattern:/^\s*(\d+|\.)/},autoClosingPairs:[{open:'"',close:'"'}],surroundingPairs:[{open:'"',close:'"'}],comments:{lineComment:"//"}}),Ve.languages.registerDefinitionProvider("psoasm",{provideDefinition:(e,t)=>Xn.provide_definition(e.uri,t.lineNumber,t.column)});class es extends Dn.a{constructor(e){super(),this.quest_editor_store=e,this.model_disposer=this.disposable(new a.a),this._model=Object(M.e)(void 0),this._did_undo=Object(M.a)(),this._did_redo=Object(M.a)(),this._inline_args_mode=Object(M.e)(!0),this.model=this._model,this.did_undo=this._did_undo,this.did_redo=this._did_redo,this.undo=new Zn("Text edits",()=>this._did_undo.emit({value:"asm undo"}),()=>this._did_redo.emit({value:"asm undo"})),this.inline_args_mode=this._inline_args_mode,this.has_issues=Xn.issues.map(e=>e.warnings.length+e.errors.length>0),this.set_inline_args_mode=e=>{this.has_issues.val||(this._inline_args_mode.val=e,Xn.update_settings({manual_stack:!this.inline_args_mode.val}),this.update_model())},this.quest_changed=()=>{this.update_model()},this.breakpoints=e.quest_runner.breakpoints,this.pause_location=e.quest_runner.pause_location,this.disposables(e.current_quest.observe(this.quest_changed,{call_now:!0}),Xn.issues.observe(({value:e})=>this.update_model_markers(e),{call_now:!0}),Object(u.g)(window,"beforeunload",e=>{this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}setup_editor_model_features(e){const t=e.getAlternativeVersionId();let i=t,o=t;this.model_disposer.add(e.onDidChangeContent(n=>{const s=e.getAlternativeVersionId();so&&(o=i)),this.undo.can_undo.val=!0),i=s,Xn.update_assembly(n.changes),this.update_breakpoints(n.changes)}))}update_model_markers({warnings:e,errors:t}){const i=this.model.val;i&&Ve.editor.setModelMarkers(i,"psoasm",e.map(e=>({severity:Ve.MarkerSeverity.Hint,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length,tags:[Ve.MarkerTag.Unnecessary]})).concat(t.map(e=>({severity:Ve.MarkerSeverity.Error,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length}))))}update_model(){this.undo.reset(),this.model_disposer.dispose_all();const e=this.quest_editor_store.current_quest.val;if(e){const t=!this.inline_args_mode.val,i=Xn.disassemble(e,t),o=this.model_disposer.add(Ve.editor.createModel(i.join("\n"),"psoasm"));this.setup_editor_model_features(o),this._model.val=o}else this._model.val=void 0}update_breakpoints(e){for(const t of e){const e=[];if(""===t.text){const i=t.range.endLineNumber-t.range.startLineNumber;if(i>0){for(let o=t.range.startLineNumber+1;o<=t.range.endLineNumber;o++){const t=Math.max(o-i,1);this.quest_editor_store.quest_runner.remove_breakpoint(o)&&e.push(t)}for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no-i))}}else{const i=t.text.split("\n").length-1;if(i>0)for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no+i))}for(const t of e)this.quest_editor_store.quest_runner.set_breakpoint(t)}}}class ts{constructor(e,t,i,o){if(!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);if(!t)throw new Error("name is required.");if(!o)throw new Error("area_variants is required.");this.id=e,this.name=t,this.order=i,this.area_variants=o}}class is{constructor(e,t){if(this._sections=Object(M.c)(),this.sections=this._sections,!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);this.id=e,this.area=t}set_sections(e){return this._sections.val=e,this}}function os(e){return ns[e]}const ns=[];function ss(e,t,i,o){const n={id:e,name:t,order:i,area_variants:[]};for(let e=0;ethis.areas[e],this.get_area=(e,t)=>{const i=this.areas[e].find(e=>e.id===t);if(!i)throw new Error(`Area id ${t} for episode ${e} is invalid.`);return i},this.get_variant=(e,t,i)=>{const o=this.get_area(e,t).area_variants[i];if(!o)throw new Error(`Area variant id ${i} for area ${t} of episode ${s.b[e]} is invalid.`);return o},this.get_area_sections=(e,t)=>this.area_asset_loader.load_sections(e,t);for(const e of s.a)this.areas[e]=os(e).map(e=>{const t=new ts(e.id,e.name,e.order,[]);for(const i of e.area_variants)t.area_variants.push(new is(i.id,t));return t})}}function ds(e,t){e.seek_end(32);const i=e.u32(),o=e.u32();e.seek(8);const n=e.u32();return e.seek_start(i),{data_offset:n,index:t?function(e,t){const i=e.u16_array(t),o=[];let n=0;for(const t of i){n+=4*t,e.seek_start(n-4);const i=e.u32(),s=e.u32();o.push({offset:s,size:i})}return o}(e,o):[]}}var cs=i("kwt4");function ls(e,t,i){const o=[];for(let n=0;n=0){const e=new hs(s.id,Object(ps.a)(s.position),z(s.rotation.x,s.rotation.y,s.rotation.z),t);i.push(e),r.userData.section=e}}return[i,o]}class ms{constructor(e){this.http_client=e,this.disposer=new a.a,this.render_object_cache=this.disposer.add(new _s),this.collision_object_cache=this.disposer.add(new _s),this.area_sections_cache=this.disposer.add(new _s)}dispose(){this.disposer.dispose()}load_sections(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.area_sections_cache.get_or_set(i,()=>this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>fs(e,t)[0]))}load_render_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>fs(e,t)[1])}load_collision_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.collision_object_cache.get_or_set(i,()=>this.get_area_asset(e,t,"collision").then(e=>(function(e){const{data_offset:t}=ds(e,!1);e.seek_start(t);const i=e.u32();e.seek_start(i);const o={meshes:[]};for(;e.bytes_left;){const t=e.position,i=e.u32();if(0===i)break;const n={vertices:[],triangles:[]};o.meshes.push(n),e.seek_start(i);const s=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();e.seek_start(r);for(let t=0;t(function(e){const t=new y.Group;for(const i of e.meshes){const e=new y.Geometry;for(const{x:t,y:o,z:n}of i.vertices)e.vertices.push(new y.Vector3(t,o,n));for(const{indices:t,flags:o,normal:n}of i.triangles){const i=16&o,s=1&o,r=64&o?3:i?2:s?1:0;0!==r&&e.faces.push(new y.Face3(t[0],t[1],t[2],new y.Vector3(n.x,n.y,n.z),void 0,r))}if(e.faces.length){e.computeBoundingBox(),e.computeBoundingSphere();const i=new y.Mesh(e,gs);i.renderOrder=1,t.add(i);const o=new y.Mesh(e,bs);o.renderOrder=2,t.add(o)}}return t})(e))}load_render_object(e,t){return this.get_area_asset(e,t,"render").then(e=>(function(e){const t=[];e.seek_end(16);const{data_offset:i}=ds(e,!1);e.seek_start(i),e.seek(8);const o=e.u32();e.seek(4);const n=e.u32();for(let i=0;it.push({args:i,resolve:e,reject:o}));return 1===t.length&&function(){ks(this,void 0,void 0,(function*(){for(;t.length;){const{args:i,resolve:o,reject:n}=t[0];try{o(yield e(...i))}catch(e){n(e)}finally{t.shift()}}}))}(),o}}var Rs=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Is=new y.HemisphereLight(16777215,5263440,1.2),js=new y.Scene,Ts=new y.PerspectiveCamera(30,1,10,1e3),xs=new y.Vector3(1,1,2).normalize(),Ss=1.3/Math.tan(Ts.fov/180*Math.PI/2);class Cs{constructor(e,t){this.entity_asset_loader=e,this.cache=new _s,this.render_to_image=ys(e=>this.entity_asset_loader.load_geometry(e).then(t=>this.entity_asset_loader.load_textures(e).then(i=>{js.remove(...js.children),js.add(Is);const o=E(e,t,i);js.add(o);const n=o.geometry.boundingSphere;return Ts.position.copy(xs),Ts.position.multiplyScalar(n.radius*Ss),Ts.lookAt(n.center),this.renderer.render(js,Ts),this.renderer.domElement.toDataURL()}))),this.renderer=t(),this.renderer.setSize(100,100)}dispose(){this.renderer.dispose(),this.cache.dispose()}render(e){return Rs(this,void 0,void 0,(function*(){return this.cache.get_or_set(e,()=>this.render_to_image(e))}))}}var Os=i("yub1"),Ls=i("iR5r"),Ps=i("4eU9");const Ds=X.a.get("quest_editor/loading/EntityAssetLoader"),Bs=new y.CylinderBufferGeometry(3,3,20);Bs.translate(0,10,0),Bs.computeBoundingBox(),Bs.computeBoundingSphere();const Es=Ps.a.resolve(Bs),Ms=[],Ws=Ps.a.resolve(Ms);class qs{constructor(e){this.http_client=e,this.disposer=new a.a,this.geom_cache=this.disposer.add(new _s),this.tex_cache=this.disposer.add(new _s),this.warm_up_caches()}dispose(){this.disposer.dispose()}load_geometry(e){return this.geom_cache.get_or_set(e,()=>this.load_data(e,Fs.Geometry).then(({url:t,data:i})=>{const o=new zo.a(i,Uo.a.Little),n=t.endsWith(".nj")?Object(cs.c)(o):Object(cs.d)(o);return n.success&&n.value.length?Object(vs.a)(n.value[0]):(Ds.warning(`Couldn't parse ${t} for ${C(e)}.`),Bs)}).catch(t=>(Ds.warning(`Couldn't load geometry file for ${C(e)}.`,t),Bs)))}load_textures(e){return this.tex_cache.get_or_set(e,()=>this.load_data(e,Fs.Texture).then(({data:e})=>{const t=new zo.a(e,Uo.a.Little),i=Object(Os.b)(t);return i.success?Object(Ls.a)(i.value):[]}).catch(t=>(Ds.warning(`Couldn't load texture file for ${C(e)}.`,t),Ms)))}load_data(e,t){const i=function e(t,i){if(O(t))switch(t){case I.c.Dubswitch:return`/npcs/${I.c[t]}.${i===Fs.Geometry?"xj":"xvm"}`;case I.c.Hildebear2:return e(I.c.Hildebear,i);case I.c.Hildeblue2:return e(I.c.Hildeblue,i);case I.c.RagRappy2:return e(I.c.RagRappy,i);case I.c.Monest2:return e(I.c.Monest,i);case I.c.Mothmant2:return e(I.c.Mothmant,i);case I.c.PoisonLily2:return e(I.c.PoisonLily,i);case I.c.NarLily2:return e(I.c.NarLily,i);case I.c.GrassAssassin2:return e(I.c.GrassAssassin,i);case I.c.Dimenian2:return e(I.c.Dimenian,i);case I.c.LaDimenian2:return e(I.c.LaDimenian,i);case I.c.SoDimenian2:return e(I.c.SoDimenian,i);case I.c.DarkBelra2:return e(I.c.DarkBelra,i);case I.c.SavageWolf2:return e(I.c.SavageWolf,i);case I.c.BarbarousWolf2:return e(I.c.BarbarousWolf,i);case I.c.PanArms2:return e(I.c.PanArms,i);case I.c.Dubchic2:return e(I.c.Dubchic,i);case I.c.Gilchic2:return e(I.c.Gilchic,i);case I.c.Garanz2:return e(I.c.Garanz,i);case I.c.Dubswitch2:return e(I.c.Dubswitch,i);case I.c.Delsaber2:return e(I.c.Delsaber,i);case I.c.ChaosSorcerer2:return e(I.c.ChaosSorcerer,i);default:return`/npcs/${I.c[t]}.${i===Fs.Geometry?"nj":"xvm"}`}else{if(i!==Fs.Geometry)return`/objects/${T(t).pso_id}.xvm`;switch(t){case w.EasterEgg:case w.ChristmasTree:case w.ChristmasWreath:case w.TwentyFirstCentury:case w.Sonic:case w.WelcomeBoard:case w.FloatingJellyfish:case w.RuinsSeal:case w.Dolphin:case w.Cacti:case w.BigBrownRock:case w.PoisonPlant:case w.BigBlackRocks:case w.FallingRock:case w.DesertFixedTypeBoxBreakableCrystals:case w.BeeHive:return`/objects/${T(t).pso_id}.nj`;default:return`/objects/${T(t).pso_id}.xj`}}}(e,t);return this.http_client.get(i).array_buffer().then(e=>({url:i,data:e}))}warm_up_caches(){for(const e of[I.c.Unknown,I.c.Migium,I.c.Hidoom,I.c.DeathGunner,I.c.StRappy,I.c.HalloRappy,I.c.EggRappy,I.c.Migium2,I.c.Hidoom2,I.c.Recon,w.Unknown,w.PlayerSet,w.Particle,w.LightCollision,w.EnvSound,w.FogCollision,w.EventCollision,w.CharaCollision,w.ObjRoomID,w.LensFlare,w.ScriptCollision,w.MapCollision,w.ScriptCollisionA,w.ItemLight,w.RadarCollision,w.FogCollisionSW,w.ImageBoard,w.UnknownItem29,w.UnknownItem30,w.UnknownItem31,w.MenuActivation,w.BoxDetectObject,w.SymbolChatObject,w.TouchPlateObject,w.TargetableObject,w.EffectObject,w.CountDownObject,w.UnknownItem38,w.UnknownItem39,w.UnknownItem40,w.UnknownItem41,w.TelepipeLocation,w.BGMCollision,w.Pioneer2InvisibleTouchplate,w.TempleMapDetect,w.Firework,w.MainRagolTeleporterBattleInNextArea,w.Rainbow,w.FloatingBlueLight,w.PopupTrapNoTech,w.Poison,w.EnemyTypeBoxYellow,w.EnemyTypeBoxBlue,w.EmptyTypeBoxBlue,w.FloatingRocks,w.FloatingSoul,w.Butterfly,w.UnknownItem400,w.CCAAreaTeleporter,w.UnknownItem523,w.WhiteBird,w.OrangeBird,w.UnknownItem529,w.UnknownItem530,w.Seagull,w.UnknownItem576,w.WarpInBarbaRayRoom,w.UnknownItem672,w.InstaWarp,w.LabInvisibleObject,w.UnknownItem700])this.geom_cache.set(e,Es),this.tex_cache.set(e,Ws)}}var Fs;!function(e){e[e.Geometry=0]="Geometry",e[e.Texture=1]="Texture"}(Fs||(Fs={}));var Vs=i("I7a6"),Us=i("LvDl"),Ns=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const zs="QuestEditorUiPersister.layout_config";class $s extends Vs.a{constructor(){super(...arguments),this.persist_layout_config=Object(Us.throttle)(e=>{this.persist(zs,this.to_persisted_item_config(e))},500,{leading:!1,trailing:!0})}load_layout_config(e){return Ns(this,void 0,void 0,(function*(){const t=yield this.load(zs);if(t){const i=this.extract_components(e),o=this.sanitized_layout_config(this.from_persisted_item_config(t),i);if(o)return o}}))}sanitized_layout_config(e,t){const i=new Set,o=e.map(e=>this.sanitize_layout_child(e,t,i));if(i.size===t.size)return o.filter(e=>e)}sanitize_layout_child(e,t,i){if(!e)return;switch(e.type){case"component":{if(!("componentName"in e))return;const o=t.get(e.componentName);if(!o)return;i.add(e.componentName),e.id=o.id,e.title=o.title}break;case"stack":if(null==e.content||0===e.content.length)return}e.content&&(e.content=e.content.map(e=>this.sanitize_layout_child(e,t,i)).filter(e=>e));const o=e;return null!=o.activeItemIndex&&(null==o.content||o.activeItemIndex>=o.content.length)&&(o.activeItemIndex=void 0),e}extract_components(e,t=new Map){for(const i of e)"componentName"in i&&t.set(i.componentName,i),i.content&&this.extract_components(i.content,t);return t}to_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.to_persisted_item_config(e.content)}))}from_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.from_persisted_item_config(e.content),isClosable:"component"!==e.type&&void 0}))}}var As=i("6cU9");class Hs extends Ue.a{constructor(e){const t=new _t({text:"New quest",icon_left:u.a.NewFile,items:[s.b.I],to_label:e=>`Episode ${s.b[e]}`}),i=new As.a({icon_left:u.a.File,text:"Open file...",accept:".bin, .dat, .qst",multiple:!0,tooltip:"Open a quest file (Ctrl-O)"}),o=new tt.a({text:"Save as...",icon_left:u.a.Save,tooltip:"Save this quest to new file (Ctrl-Shift-S)"}),n=new tt.a({text:"Undo",icon_left:u.a.Undo,tooltip:jn.first_undo.map(e=>(e?`Undo "${e.description}"`:"Nothing to undo")+" (Ctrl-Z)")}),r=new tt.a({text:"Redo",icon_left:u.a.Redo,tooltip:jn.first_redo.map(e=>(e?`Redo "${e.description}"`:"Nothing to redo")+" (Ctrl-Shift-Z)")}),a=new cn.a({items:e.areas,to_label:({label:e})=>e}),d=new tt.a({text:"Debug",icon_left:u.a.Play,tooltip:"Debug the current quest in a virtual machine (F5)"}),c=new tt.a({text:"Continue",icon_left:u.a.SquareArrowRight,tooltip:"Resume execution (F6)"}),l=new tt.a({text:"Step over",icon_left:u.a.LongArrowRight,tooltip:"Execute the next line and step over any function calls (F8)"}),_=new tt.a({text:"Step into",icon_left:u.a.LevelDown,tooltip:"Execute the next line and step inside any function calls (F7)"}),v=new tt.a({text:"Step out",icon_left:u.a.LevelUp,tooltip:"Execute until outside of current call frame (Shift-F8)"}),h=new tt.a({text:"Stop",icon_left:u.a.Stop,tooltip:"Stop execution (Shift-F5)"}),p=[t,i,o,n,r,a];e.vm_feature_active&&p.push(d,c,l,_,v,h),super(...p),this.disposables(t.chosen.observe(({value:t})=>e.create_new_quest(t)),i.files.observe(({value:t})=>e.parse_files(t)),o.onclick.observe(e.save_as),o.enabled.bind_to(e.can_save),n.onclick.observe(()=>jn.undo()),n.enabled.bind_to(e.can_undo),r.onclick.observe(()=>jn.redo()),r.enabled.bind_to(e.can_redo),a.selected.bind_to(e.current_area),a.selected.observe(({value:t})=>e.set_area(t)),a.enabled.bind_to(e.can_select_area),d.onclick.observe(e.debug),d.enabled.bind_to(e.can_debug),c.onclick.observe(e.resume),c.enabled.bind_to(e.can_step),l.onclick.observe(e.step_over),l.enabled.bind_to(e.can_step),_.onclick.observe(e.step_in),_.enabled.bind_to(e.can_step),v.onclick.observe(e.step_out),v.enabled.bind_to(e.can_step),h.onclick.observe(e.stop),h.enabled.bind_to(e.can_stop)),this.finalize_construction()}}var Gs=i("mKaR");const Ks=X.a.get("quest_editor/model/QuestModel");class Qs{constructor(e,t,i,o,n,r,a,d,c,l,_,u,v,h){this.area_store=e,this._id=Object(M.e)(0),this._language=Object(M.e)(0),this._name=Object(M.e)(""),this._short_description=Object(M.e)(""),this._long_description=Object(M.e)(""),this._area_variants=Object(M.c)(),this.id=this._id,this.language=this._language,this.name=this._name,this.short_description=this._short_description,this.long_description=this._long_description,this.area_variants=this._area_variants,this.update_area_variants=()=>{const e=new Map;for(const t of this.entities_per_area.val.keys())try{e.set(t,this.area_store.get_variant(this.episode,t,0))}catch(e){Ks.warning(e)}for(const[t,i]of this.map_designations.val)try{e.set(t,this.area_store.get_variant(this.episode,t,i))}catch(e){Ks.warning(e)}this._area_variants.val=[...e.values()]},Object(s.c)(a),Object(N.f)(d,"map_designations"),Object(N.j)(c,"objs"),Object(N.j)(l,"npcs"),Object(N.f)(_,"event_dags"),Object(N.j)(u,"dat_unknowns"),Object(N.j)(v,"object_code"),Object(N.j)(h,"shop_items"),this.set_id(t),this.set_language(i),this.set_name(o),this.set_short_description(n),this.set_long_description(r),this.episode=a,this._map_designations=Object(M.e)(d),this.map_designations=this._map_designations,this._objects=Object(M.c)(void 0,...c),this.objects=this._objects,this._npcs=Object(M.c)(void 0,...l),this.npcs=this._npcs,this.event_dags=_,this.dat_unknowns=u,this.object_code=v,this.shop_items=h,this.entities_per_area=Object(M.d)((e,t)=>{const i=new Map;for(const t of e)i.set(t.area_id,(i.get(t.area_id)||0)+1);for(const e of t)i.set(e.area_id,(i.get(e.area_id)||0)+1);return i},this.npcs,this.objects),this.entities_per_area.observe(this.update_area_variants,{call_now:!0}),this.map_designations.observe(this.update_area_variants,{call_now:!0})}set_id(e){return Object(N.d)(e>=0,`id should be greater than or equal to 0, was ${e}.`),this._id.val=e,this}set_language(e){return Object(N.d)(e>=0,`language should be greater than or equal to 0, was ${e}.`),this._language.val=e,this}set_name(e){return Object(N.d)(e.length<=32,`name can't be longer than 32 characters, got "${e}".`),this._name.val=e,this}set_short_description(e){return Object(N.d)(e.length<=128,`short_description can't be longer than 128 characters, got "${e}".`),this._short_description.val=e,this}set_long_description(e){return Object(N.d)(e.length<=288,`long_description can't be longer than 288 characters, got "${e}".`),this._long_description.val=e,this}set_map_designations(e){return this._map_designations.val=e,this}add_entity(e){if(e instanceof me)this.add_object(e);else{if(!(e instanceof Q))throw new Error(`${C(e.type)} not supported.`);this.add_npc(e)}}add_object(e){this._objects.push(e)}add_npc(e){this._npcs.push(e)}remove_entity(e){if(e instanceof me)this._objects.remove(e);else{if(!(e instanceof Q))throw new Error(`${C(e.type)} not supported.`);this._npcs.remove(e)}}insert_event(e,t,i,o){const n=t.wave.area_id.val;let s=this.event_dags.get(n);s||(s=new it(n),this.event_dags.set(n,s)),s.insert_event(e,t,i,o)}get_event_dag_or_create(e){let t=this.event_dags.get(e);return t||(t=new it(e),this.event_dags.set(e,t)),t}add_event(e,t,i){const o=e.wave.area_id.val;let n=this.event_dags.get(o);n||(n=new it(o),this.event_dags.set(o,n)),n.add_event(e,t,i)}remove_event(e,t){for(const e of this.npcs)e.wave.val===t.wave&&e.set_wave(void 0);e.remove_event(t)}}var Ys;!function(e){e[e.Int=0]="Int",e[e.Float=1]="Float",e[e.InvalidNumber=2]="InvalidNumber",e[e.Register=3]="Register",e[e.Label=4]="Label",e[e.CodeSection=5]="CodeSection",e[e.DataSection=6]="DataSection",e[e.StringSection=7]="StringSection",e[e.InvalidSection=8]="InvalidSection",e[e.String=9]="String",e[e.UnterminatedString=10]="UnterminatedString",e[e.Ident=11]="Ident",e[e.InvalidIdent=12]="InvalidIdent",e[e.ArgSeparator=13]="ArgSeparator"}(Ys||(Ys={}));class Zs{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(e){this.line=e,this.index=0,this._mark=0;const t=[];for(;this.has_next();){const e=this.peek();let i;if("/"===e){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(e)?this.skip():(/[-\d]/.test(e)?i=this.tokenize_number_or_label():","===e?(i={type:Ys.ArgSeparator,col:this.col,len:1},this.skip()):i="."===e?this.tokenize_section():'"'===e?this.tokenize_string():"r"===e?this.tokenize_register_or_ident():this.tokenize_ident(),t.push(i))}return t}has_next(){return this.index!]*$/.test(t)?Ys.Ident:Ys.InvalidIdent;return i===Ys.Ident?{type:i,col:e,len:this.marked_len(),value:t}:{type:i,col:e,len:this.marked_len()}}}const Js=X.a.get("quest_editor/scripting/assembly");class Xs{constructor(e,t){this.assembly=e,this.manual_stack=t,this.lexer=new Zs,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const e of this.assembly){if(this.tokens=this.lexer.tokenize_line(e),this.tokens.length>0){const e=this.tokens.shift();let t=!1;switch(e.type){case Ys.Label:this.parse_label(e),t=!0;break;case Ys.CodeSection:case Ys.DataSection:case Ys.StringSection:this.parse_section(e);break;case Ys.Int:this.section===Bo.Data?this.parse_bytes(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.String:this.section===Bo.String?this.parse_string(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.Ident:this.section===Bo.Instructions?this.parse_instruction(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Ys.InvalidSection:this.add_error({col:e.col,length:e.len,message:"Invalid section type."});break;case Ys.InvalidIdent:this.add_error({col:e.col,length:e.len,message:"Invalid identifier."});break;default:this.add_error({col:e.col,length:e.len,message:"Unexpected token."})}this.prev_line_had_label=t}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(e,t,i,o,n,s){if(this.segment)this.segment.type===Bo.Instructions?this.segment.instructions.push(Po(e,t,{mnemonic:o&&{line_no:this.line_no,col:o.col,len:o.len},args:n.map(e=>({line_no:this.line_no,col:e.col,len:e.len})),stack_args:s.map((e,t)=>({line_no:this.line_no,col:e.col,len:e.len,value:i[t].value}))})):Js.error(`Line ${this.line_no}: Expected instructions segment.`);else{const e={labels:[],type:Bo.Instructions,instructions:[],asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_bytes(e){if(this.segment)if(this.segment.type===Bo.Data){const t=new ArrayBuffer(this.segment.data.byteLength+e.length),i=new Uint8Array(t);i.set(new Uint8Array(this.segment.data)),i.set(new Uint8Array(e),this.segment.data.byteLength),this.segment.data=t}else Js.error(`Line ${this.line_no}: Expected data segment.`);else{const t={labels:[],type:Bo.Data,data:new Uint8Array(e).buffer,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_string(e){if(this.segment)this.segment.type===Bo.String?this.segment.value+=e:Js.error(`Line ${this.line_no}: Expected string segment.`);else{const t={labels:[],type:Bo.String,value:e,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_error({col:e,length:t,message:i}){this.errors.push({line_no:this.line_no,col:e,length:t,message:i})}add_warning({col:e,length:t,message:i}){this.warnings.push({line_no:this.line_no,col:e,length:t,message:i})}parse_label({col:e,len:t,value:i}){this.labels.has(i)&&this.add_error({col:e,length:t,message:"Duplicate label."}),this.labels.add(i);const o=this.tokens.shift(),n={line_no:this.line_no,col:e,len:t};if(this.prev_line_had_label){const e=this.object_code[this.object_code.length-1];e.labels.push(i),e.asm.labels.push(n)}switch(this.section){case Bo.Instructions:this.prev_line_had_label||(this.segment={type:Bo.Instructions,labels:[i],instructions:[],asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.Ident?this.parse_instruction(o):this.add_error({col:o.col,length:o.len,message:"Expected opcode mnemonic."}));break;case Bo.Data:this.prev_line_had_label||(this.segment={type:Bo.Data,labels:[i],data:new ArrayBuffer(0),asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.Int?this.parse_bytes(o):this.add_error({col:o.col,length:o.len,message:"Expected bytes."}));break;case Bo.String:this.prev_line_had_label||(this.segment={type:Bo.String,labels:[i],value:"",asm:{labels:[n]}},this.object_code.push(this.segment)),o&&(o.type===Ys.String?this.parse_string(o):this.add_error({col:o.col,length:o.len,message:"Expected a string."}))}}parse_section({type:e,col:t,len:i}){let o;switch(e){case Ys.CodeSection:o=Bo.Instructions;break;case Ys.DataSection:o=Bo.Data;break;case Ys.StringSection:o=Bo.String}this.section!==o||this.first_section_marker||this.add_warning({col:t,length:i,message:"Unnecessary section marker."}),this.section=o,this.first_section_marker=!1;const n=this.tokens.shift();n&&this.add_error({col:n.col,length:n.len,message:"Unexpected token."})}parse_instruction(e){const{col:t,len:i,value:o}=e,n=Ft.get(o);if(n){const i=-1!==n.params.findIndex(e=>e.type.kind===ft.ILabelVar||e.type.kind===ft.RegRefVar),o=this.manual_stack&&n.stack===Mt.Pop?0:n.params.length;let s=0;for(const e of this.tokens)e.type!==Ys.ArgSeparator&&s++;const r=this.tokens[this.tokens.length-1],a=r?r.col+r.len-t:0,d=[],c=[];if(!i&&s!==o)return void this.add_error({col:t,length:a,message:`Expected ${o} argument${1===o?"":"s"}, got ${s}.`});if(i&&sd?this.add_error({col:n,length:s,message:`${r}-Bit integer can't be greater than ${d}.`}):i.push([{value:o,size:e},t])}parse_register(e,t){const{col:i,len:o,value:n}=e;n>255?this.add_error({col:i,length:o,message:"Invalid register reference, expected r0-r255."}):t.push([{value:n,size:1},e])}parse_bytes(e){const t=[];let i=e,o=0;for(;i.type===Ys.Int&&(i.value<0?this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be less than 0."}):i.value>255&&this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be greater than 255."}),t.push(i.value),o"))}}function er(e,t){if(t===s.b.II)throw new Error("Episode II not yet supported.");if(t===s.b.IV)throw new Error("Episode IV not yet supported.");return new Qs(e,0,0,"Untitled","Created with phantasmal.world.","Created with phantasmal.world.",t,(new Map).set(0,0),[new me(w.MenuActivation,16384,0,0,10,new y.Vector3(-16.313568115234375,3,-579.5118408203125),z(.0009587526218325454,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365279104]]),[[2,0,0,0,0,0],[0,0]]),new me(w.MenuActivation,16385,0,0,10,new y.Vector3(-393.07318115234375,10,-12.964752197265625),z(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279264]]),[[2,0,1,0,0,0],[0,0]]),new me(w.MenuActivation,16386,0,0,10,new y.Vector3(-458.60699462890625,10,-51.270660400390625),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365279424]]),[[2,0,2,0,0,0],[0,0]]),new me(w.MenuActivation,16387,0,0,10,new y.Vector3(-430.19696044921875,10,-24.490447998046875),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365279584]]),[[2,0,3,0,0,0],[0,0]]),new me(w.PlayerSet,16388,0,0,10,new y.Vector3(.995330810546875,0,-37.0010986328125),z(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279744]]),[[2,0,4,0,0,0],[0,0]]),new me(w.PlayerSet,16389,0,0,10,new y.Vector3(3.0009307861328125,0,-23.99688720703125),z(0,4.859725289544806,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279904]]),[[2,0,5,0,0,0],[0,0]]),new me(w.PlayerSet,16390,0,0,10,new y.Vector3(2.0015106201171875,0,-50.00386047363281),z(0,4.565196484117848,0),new Map([["property_0",2.000002384185791],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365280064]]),[[2,0,6,0,0,0],[0,0]]),new me(w.PlayerSet,16391,0,0,10,new y.Vector3(4.9973907470703125,0,-61.99664306640625),z(0,4.368843947166543,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",65536],["property_4",10],["property_5",0],["property_6",2365280224]]),[[2,0,7,0,0,0],[0,0]]),new me(w.MainRagolTeleporter,18264,0,0,10,new y.Vector3(132.00314331054688,1.000000238418579,-265.002197265625),z(0,.49088134237826325,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365227216]]),[[0,0,87,7,0,0],[0,0]]),new me(w.PrincipalWarp,16393,0,0,10,new y.Vector3(-228,0,-2020.99951171875),z(0,2.9452880542695796,0),new Map([["property_0",-10.000004768371582],["property_1",0],["property_2",-30.000030517578125],["property_3",0],["property_4",65536],["property_5",65536],["property_6",2365280688]]),[[2,0,9,0,0,0],[0,0]]),new me(w.MenuActivation,16394,0,0,10,new y.Vector3(-41.000030517578125,0,42.37322998046875),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",4],["property_4",0],["property_5",0],["property_6",2365280992]]),[[2,0,10,0,0,0],[1,0]]),new me(w.MenuActivation,16395,0,0,10,new y.Vector3(-479.21673583984375,8.781256675720215,-322.465576171875),z(6.28328118244177,.0009587526218325454,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",5],["property_4",0],["property_5",0],["property_6",2365281152]]),[[2,0,11,0,0,0],[0,0]]),new me(w.PrincipalWarp,16396,0,0,10,new y.Vector3(-228,0,-351.0015869140625),z(0,0,0),new Map([["property_0",10.000006675720215],["property_1",0],["property_2",-1760.0010986328125],["property_3",32768],["property_4",0],["property_5",0],["property_6",2365281312]]),[[2,0,12,0,0,0],[0,0]]),new me(w.TelepipeLocation,16397,0,0,10,new y.Vector3(-561.88232421875,0,-406.8829345703125),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365281616]]),[[2,0,13,0,0,0],[0,0]]),new me(w.TelepipeLocation,16398,0,0,10,new y.Vector3(-547.8557739257812,0,-444.8822326660156),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365281808]]),[[2,0,14,0,0,0],[0,0]]),new me(w.TelepipeLocation,16399,0,0,10,new y.Vector3(-486.441650390625,0,-497.4501647949219),z(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365282e3]]),[[2,0,15,0,0,0],[0,0]]),new me(w.TelepipeLocation,16400,0,0,10,new y.Vector3(-522.4052734375,0,-474.1882629394531),z(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365282192]]),[[2,0,16,0,0,0],[0,0]]),new me(w.MedicalCenterDoor,16401,0,0,10,new y.Vector3(-34.49853515625,0,-384.4951171875),z(0,5.497871034636549,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282384]]),[[2,0,17,0,0,0],[0,0]]),new me(w.ShopDoor,16402,0,0,10,new y.Vector3(-393.0031433105469,0,-143.49981689453125),z(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282640]]),[[2,0,18,0,0,0],[0,0]]),new me(w.MenuActivation,16403,0,0,10,new y.Vector3(-355.17462158203125,0,-43.15193176269531),z(0,0,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",6],["property_4",0],["property_5",0],["property_6",2365282896]]),[[2,0,19,0,0,0],[0,0]]),new me(w.HuntersGuildDoor,16404,0,0,10,new y.Vector3(-43.00239562988281,0,-118.00120544433594),z(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283056]]),[[2,0,20,0,0,0],[0,0]]),new me(w.TeleporterDoor,16405,0,0,10,new y.Vector3(26.000823974609375,0,-265.99810791015625),z(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283312]]),[[2,0,21,0,0,0],[0,0]]),new me(w.PlayerSet,16406,0,0,10,new y.Vector3(57.81005859375,0,-268.5472412109375),z(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283568]]),[[2,0,22,0,0,0],[0,0]]),new me(w.PlayerSet,16407,0,0,10,new y.Vector3(66.769287109375,0,-252.3748779296875),z(0,4.712460886831327,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283728]]),[[2,0,23,0,0,0],[0,0]]),new me(w.PlayerSet,16408,0,0,10,new y.Vector3(67.36819458007812,0,-284.9297180175781),z(0,4.712460886831327,0),new Map([["property_0",2.000000476837158],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283888]]),[[2,0,24,0,0,0],[0,0]]),new me(w.PlayerSet,16409,0,0,10,new y.Vector3(77.10488891601562,0,-269.2830505371094),z(0,4.712460886831327,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365284048]]),[[2,0,25,0,0,0],[0,0]])],[new Q(I.c.GuildLady,29,1011.0010986328125,void 0,0,850,0,0,10,new y.Vector3(-49.0010986328125,0,50.996429443359375),z(0,2.3562304434156633,0),new y.Vector3(0,0,0),[[0,0,7,86,0,0,0,0,23,87],[128,238,223,176]]),new Q(I.c.FemaleFat,4,1016.0010986328125,void 0,0,100,1,0,20,new y.Vector3(167.99769592285156,0,83.99686431884766),z(0,3.927050739026106,0),new y.Vector3(24.000009536743164,0,0),[[0,0,7,88,0,0,0,0,23,89],[128,238,232,48]]),new Q(I.c.MaleDwarf,10,1015.0010986328125,void 0,0,90,1,0,20,new y.Vector3(156.0028839111328,0,-49.99967575073242),z(0,5.497871034636549,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,89,0,0,0,0,23,90],[128,238,236,176]]),new Q(I.c.RedSoldier,26,1020.0010986328125,void 0,0,130,0,0,20,new y.Vector3(237.9988250732422,0,-14.0001220703125),z(0,5.497871034636549,0),new y.Vector3(0,0,0),[[0,0,7,90,0,0,0,0,23,91],[128,238,241,48]]),new Q(I.c.BlueSoldier,25,1019.0010986328125,void 0,0,120,0,0,20,new y.Vector3(238.00379943847656,0,63.00413513183594),z(0,3.927050739026106,0),new y.Vector3(0,0,0),[[0,0,7,91,0,0,0,0,23,92],[128,238,245,176]]),new Q(I.c.FemaleMacho,5,1014.0010986328125,void 0,0,80,1,0,20,new y.Vector3(-2.001882553100586,0,35.0036506652832),z(0,3.141640591220885,0),new y.Vector3(26.000009536743164,0,0),[[0,0,7,92,0,0,0,0,23,93],[128,238,250,48]]),new Q(I.c.Scientist,30,1013.0010986328125,void 0,0,70,1,0,20,new y.Vector3(-147.0000457763672,0,-7.996537208557129),z(0,2.577127047485882,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,93,0,0,0,0,23,94],[128,238,254,176]]),new Q(I.c.MaleOld,13,1012.0010986328125,void 0,0,60,1,0,20,new y.Vector3(-219.99710083007812,0,-100.0008316040039),z(0,0,0),new y.Vector3(30.000011444091797,0,0),[[0,0,7,94,0,0,0,0,23,95],[128,239,3,48]]),new Q(I.c.GuildLady,29,1010.0010986328125,void 0,0,840,0,0,20,new y.Vector3(-262.5099792480469,0,-24.53999900817871),z(0,1.963525369513053,0),new y.Vector3(0,0,0),[[0,0,7,95,0,0,0,0,23,106],[128,239,100,192]]),new Q(I.c.Tekker,28,1009,void 0,0,830,0,0,30,new y.Vector3(-43.70983123779297,2.5999999046325684,-52.78248596191406),z(0,.7854101478052212,0),new y.Vector3(0,0,0),[[0,0,7,97,0,0,0,0,23,98],[128,239,16,176]]),new Q(I.c.MaleMacho,12,1006,void 0,0,800,0,0,30,new y.Vector3(.33990478515625,2.5999999046325684,-84.71995544433594),z(0,0,0),new y.Vector3(0,0,0),[[0,0,7,98,0,0,0,0,23,99],[128,239,21,48]]),new Q(I.c.FemaleMacho,5,1008,void 0,0,820,0,0,30,new y.Vector3(43.87113952636719,2.5999996662139893,-74.80299377441406),new y.Euler(0,-.5645135437350027,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,99,0,0,0,0,23,100],[128,239,25,176]]),new Q(I.c.MaleFat,11,1007.0010986328125,void 0,0,810,0,0,30,new y.Vector3(75.88380432128906,2.5999996662139893,-42.69328308105469),new y.Euler(0,-1.0308508189943528,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,100,0,0,0,0,23,101],[128,239,30,48]]),new Q(I.c.FemaleTall,7,1021.0010986328125,void 0,0,140,1,0,30,new y.Vector3(16.003997802734375,0,5.995697021484375),new y.Euler(0,-1.1781152217078317,0,"ZXY"),new y.Vector3(22.000009536743164,0,0),[[0,0,7,101,0,0,0,0,23,102],[128,239,34,176]]),new Q(I.c.Nurse,31,1017,void 0,0,860,0,0,40,new y.Vector3(.3097381591796875,3,-105.3865966796875),z(0,0,0),new y.Vector3(0,0,0),[[0,0,7,102,0,0,0,0,23,103],[128,239,39,48]]),new Q(I.c.Nurse,31,1018.0010986328125,void 0,0,110,1,0,40,new y.Vector3(53.499176025390625,0,-26.496688842773438),z(0,5.497871034636549,0),new y.Vector3(18.000009536743164,0,0),[[0,0,7,103,0,0,0,0,23,104],[128,239,43,176]])],new Map,[],function(e,t=!1){Js.trace("assemble start");const i=new Xs(e,t).assemble();return Js.trace(`assemble end with ${i.warnings.length} warnings and ${i.errors.length} errors.`),i}(".code\n\n0:\n set_episode 0\n set_floor_handler 0, 150\n bb_map_designate 0, 0, 0, 0\n ret\n150:\n leti r60, 237\n leti r61, 0\n leti r62, 333\n leti r63, -15\n p_setpos 0, r60\n leti r60, 255\n leti r61, 0\n leti r62, 338\n leti r63, -43\n p_setpos 1, r60\n leti r60, 222\n leti r61, 0\n leti r62, 322\n leti r63, 25\n p_setpos 2, r60\n leti r60, 248\n leti r61, 0\n leti r62, 323\n leti r63, -20\n p_setpos 3, r60\n ret".split("\n")).object_code,[])}var tr=i("iPoI"),ir=i("/Wax"),or=i("tjEv");function nr(e){const t=new sr(e.size,e.endianness);for(;e.bytes_left;){let i=0,o=0;const n=Math.max(0,e.position-Math.min(2048,e.bytes_left));for(let t=e.position-255;t>=n;t--){let n=e.position,s=t,r=0;for(;n+3=o&&(i=t,o=r,r>=255))break}o<3?t.add_u8(e.u8()):(t.copy(i-e.position,o),e.seek(o))}return t.finalize()}class sr{constructor(e,t){this.flags=0,this.flag_bits_left=0,this.flag_offset=0,this.output=new ir.a(new or.a(e),t)}add_u8(e){this.write_control_bit(1),this.write_u8(e)}copy(e,t){e>-256&&t<=5?this.short_copy(e,t):this.long_copy(e,t)}finalize(){this.write_control_bit(0),this.write_control_bit(1),this.flags>>>=this.flag_bits_left;const e=this.output.position;return this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e),this.write_u8(0),this.write_u8(0),this.output.seek_start(0)}write_control_bit(e){if(0==this.flag_bits_left--){const e=this.output.position;this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e).write_u8(0),this.flag_offset=e,this.flag_bits_left=7}this.flags>>>=1,e&&(this.flags|=128)}write_u8(e){this.output.write_u8(e)}short_copy(e,t){t-=2,this.write_control_bit(0),this.write_control_bit(0),this.write_control_bit(t>>>1&1),this.write_control_bit(1&t),this.write_u8(255&e)}long_copy(e,t){t<=9?(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248|t-2&7),this.write_u8(e>>5&255)):(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248),this.write_u8(e>>5&255),this.write_u8(t-1))}}var rr=i("IMNf");const ar=X.a.get("core/data_formats/parsing/quest/bin");const dr=X.a.get("core/data_formats/parsing/quest/dat"),cr=68,lr=72;var _r,ur;function vr({objs:e,npcs:t,events:i,unknowns:o}){const n=new or.a(e.length*(16+cr)+t.length*(16+lr)+o.reduce((e,t)=>e+t.total_size,0)),s=new ir.a(n,Uo.a.Little);!function(e,t){const i=Object(Us.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],n=o.length*cr;e.write_u32(1),e.write_u32(n+16),e.write_u32(t),e.write_u32(n);for(const t of o)Object(N.d)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(N.d)(6===t.unknown[0].length,()=>`unknown[0] should be of length 6, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.id),e.write_u16(t.group_id),e.write_u16(t.section_id),Object(N.d)(2===t.unknown[1].length,()=>`unknown[1] should be of length 2, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1]),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),Object(N.d)(7===t.properties.length,()=>`properties should be of length 7, was ${t.properties.length}`),e.write_f32(t.properties[0]),e.write_f32(t.properties[1]),e.write_f32(t.properties[2]),e.write_u32(t.properties[3]),e.write_u32(t.properties[4]),e.write_u32(t.properties[5]),e.write_u32(t.properties[6])}}(s,e),function(e,t){const i=Object(Us.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],n=o.length*lr;e.write_u32(2),e.write_u32(n+16),e.write_u32(t),e.write_u32(n);for(const t of o)Object(N.d)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(N.d)(10===t.unknown[0].length,()=>`unknown[0] should be of length 10, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u32(t.wave2),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),e.write_vec3_f32(t.scale),e.write_f32(t.npc_id),e.write_f32(t.script_label),e.write_u32(t.roaming),Object(N.d)(4===t.unknown[1].length,()=>`unknown[1] should be of length 4, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1])}}(s,t),function(e,t){const i=Object(Us.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t];e.write_u32(3);const n=e.position;e.write_u32(0),e.write_u32(t);const s=e.position;e.write_u32(0);const r=e.position,a=r+16+20*o.length;e.size=Math.max(a,e.size),e.write_u32(a-r),e.write_u32(16),e.write_u32(o.length),e.write_u32(0);let d=0;for(const t of o){e.write_u32(t.id),e.write_u32(65536),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u16(t.delay),e.write_u16(t.unknown),e.write_u32(d);const i=e.position;e.seek_start(a+d);for(const i of t.actions)switch(e.write_u8(i.type),i.type){case _r.SpawnNpcs:e.write_u16(i.section_id),e.write_u16(i.appear_flag);break;case _r.Unlock:case _r.Lock:e.write_u16(i.door_id);break;case _r.TriggerEvent:e.write_u32(i.event_id);break;default:throw new Error(`Unknown event action type ${i.type}.`)}e.write_u8(1),d=e.position-a,e.seek_start(i)}for(e.seek_start(a+d);(e.position-a)%4!=0;)e.write_u8(255);const c=e.position;e.seek_start(n),e.write_u32(c-r+16),e.seek_start(s),e.write_u32(c-r),e.seek_start(c)}}(s,i);for(const e of o)s.write_u32(e.entity_type),s.write_u32(e.total_size),s.write_u32(e.area_id),s.write_u32(e.entities_size),s.write_u8_array(e.data);return s.write_u32(0),s.write_u32(0),s.write_u32(0),s.write_u32(0),n}function hr(e,t,i){const o=Math.floor(e.size/cr);for(let n=0;n=l;){const r=e.position;let a;switch(t){case ur.DC:case ur.GC:e.seek(1),a=e.u8(),e.seek(2);break;case ur.PC:e.seek(3),a=e.u8();break;case ur.BB:e.seek(4),a=e.u32()}const d=e.string_ascii(16,!0,!0);let u=c.get(d);if(!u){const e=i.get(d);u={name:d,expected_size:null===(o=e)||void 0===o?void 0:o.size,cursor:new ir.a(new or.a((s=null===(n=e)||void 0===n?void 0:n.size,null!=s?s:10240)),Uo.a.Little),chunk_nos:new Set},c.set(d,u)}u.chunk_nos.has(a)?fr.warning(`File chunk number ${a} of file ${d} was already encountered, overwriting previous chunk.`):u.chunk_nos.add(a);let v=e.seek(Rr).u32();e.seek(-Rr-4),v>Rr&&(fr.warning(`Data segment size of ${v} is larger than expected maximum size, reading just ${Rr} bytes.`),v=Rr);const h=e.take(v),p=a*Rr;if(u.cursor.size=Math.max(p+v,u.cursor.size),u.cursor.seek_start(p).write_cursor(h),e.seek(Rr+_-h.size),e.position!==r+l)throw new Error(`Read ${e.position-r} file chunk message bytes instead of expected ${l}.`)}e.bytes_left&&fr.warning(`${e.bytes_left} Bytes left in file.`);for(const e of c.values()){e.cursor.seek_start(0),e.chunk_nos=new Set(Array.from(e.chunk_nos.values()).sort((e,t)=>e-t)),null!=e.expected_size&&e.cursor.size!==e.expected_size&&fr.warning(`File ${e.name} has an actual size of ${e.cursor.size} instead of the expected size ${e.expected_size}.`);const t=Math.max(e.cursor.size,null!=(r=e.expected_size)?r:0),i=Math.ceil(t/Rr);for(let t=0;t[e.file_name,e])))}}function jr(e){const t=e.files,i=t.map(e=>88+1056*Math.ceil(e.data.byteLength/1024)).reduce((e,t)=>e+t),o=new ArrayBuffer(i),n=new zo.a(o,Uo.a.Little);if(function(e,t){for(const i of t){if(i.filename.length>15)throw new Error(`File ${i.filename} has a name longer than 15 characters.`);e.write_u16(88),e.write_u16(68),e.write_u16(i.id||0);for(let t=0;t<38;++t)e.write_u8(0);let t;if(e.write_string_ascii(i.filename,16),e.write_u32(i.data.byteLength),null==i.quest_name){const e=i.filename.lastIndexOf(".");t=-1===e?i.filename+"_j":i.filename.slice(0,e)+"_j"+i.filename.slice(e)}else t=i.quest_name;if(t.length>24)throw Error(`File ${i.filename} has a file_name_2 length (${t}) longer than 24 characters.`);e.write_string_ascii(t,24)}}(n,t),function(e,t){const i=t.map(e=>({no:0,data:new zo.a(e.data,Uo.a.Little),name:e.filename}));let o=0;for(;o0}var xr;!function(e){e[e.None=0]="None",e[e.Return=1]="Return",e[e.Jump=2]="Jump",e[e.ConditionalJump=3]="ConditionalJump",e[e.Call=4]="Call"}(xr||(xr={}));class Sr{constructor(e,t,i,o,n){this.from=[],this.to=[],this.segment=e,this.start=t,this.end=i,this.branch_type=o,this.branch_labels=n}link_to(e){this.to.includes(e)||(this.to.push(e),e.from.push(this))}index_of_instruction(e){const t=this.segment.instructions.indexOf(e,this.start);return te.value);break;case wi.code:case Kt.code:a=xr.Call,d=[r.args[0].value];break;case $i.code:a=xr.Call,d=r.args.slice(1).map(e=>e.value);break;default:if(s===i-1){a=xr.None,d=[];break}continue}const c=new Sr(t,o,s+1,a,d);for(let t=c.start;t{let e=0,t=NaN;return{next:()=>{let i=!0;return ethis.intervals[e].end?(e++,ee+t.end-t.start+1,0)}get(e){for(const{start:t,end:i}of this.intervals){const o=i-t+1;if(ethis.intervals[o].start;)e.end=this.intervals[o].end,o++;this.intervals.splice(t+1,o-t-1),e.end=Math.max(e.end,i.end),t++;continue e}t++}this.intervals.push(i)}return this}to_array(){const e=[];for(const{start:t,end:i}of this.intervals)for(let o=t;o<=i;o++)e.push(o);return e}}const Dr=X.a.get("core/data_formats/asm/data_flow_analysis/register_value"),Br=Dt,Er=Bt;Math.pow(2,32);function Mr(e,t,i){const o=e.get_block_for_instruction(t);return o?function e(t,i,o,n,s){if(++t.iterations>100)return Dr.warning("Too many iterations."),(new Pr).set_interval(Br,Er);for(let r=n-1;r>=o.start;r--){const n=o.segment.instructions[r],a=n.args;switch(n.opcode.code){case Qt.code:if(a[0].value===s)return e(t,new Set(i),o,r,a[1].value);break;case Yt.code:case Zt.code:case Jt.code:case ho.code:if(a[0].value===s)return(new Pr).set_value(a[1].value);break;case ei.code:if(a[0].value===s)return(new Pr).set_value(1);break;case ti.code:if(a[0].value===s)return(new Pr).set_value(0);break;case ii.code:if(a[0].value===s){const n=e(t,new Set(i),o,r,s),a=n.size();return 0===a||1===a&&0===n.get(0)?(new Pr).set_value(1):n.has(0)?(new Pr).set_interval(0,1):(new Pr).set_value(0)}break;case ni.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_add(a[1].value)}break;case ri.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_sub(a[1].value)}break;case di.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_mul(a[1].value)}break;case li.code:if(a[0].value===s){return e(t,new Set(i),o,r,s).scalar_div(a[1].value)}break;case co.code:if(a[0].value===s)return(new Pr).set_interval(0,1);break;case uo.code:if(a[0].value===s)return(new Pr).set_interval(0,2);break;case po.code:if(a[0].value===s)return(new Pr).set_interval(0,3);break;case mo.code:if(a[1].value===s){const n=e(t,new Set(i),o,r,a[0].value).min()||0,s=Math.max(e(t,new Set(i),o,r,a[0].value+1).max()||0,n+1);return(new Pr).set_interval(n,s-1)}break;case Gi.code:case Ki.code:{const e=a[0].value,t=a[0].value+a[1].value;if(e<=s&&s100)return qr.warning("Too many iterations."),(new Pr).set_interval(Fr,Vr);for(let e=n-1;e>=o.start;e--){const i=o.segment.instructions[e];if(i.opcode.stack===Mt.Pop){s+=i.opcode.params.length;continue}const n=i.args;switch(i.opcode.code){case Qi.code:if(0===s)return Mr(t.cfg,i,n[0].value);s--;break;case Yi.code:case Zi.code:case Ji.code:if(0===s)return(new Pr).set_value(n[0].value);s--;break;case Xi.code:case eo.code:case to.code:if(0===s)return(new Pr).set_interval(Fr,Vr);s--}}const r=new Pr;i.add(o);for(const n of o.from){if(i.has(n)){r.set_interval(Fr,Vr);break}r.union(e(t,new Set(i),n,n.end,s))}return r}(new Nr(e),new Set,o,o.index_of_instruction(t),i):new Pr}class Nr{constructor(e){this.cfg=e,this.iterations=0}}const zr=X.a.get("core/data_formats/parsing/quest/object_code"),$r=[];function Ar(e,t,i,o,n){return function(e,t,i,o,n){const s=new Map;!function(e,t,i,o,n,s){let r;do{r=o.size;for(const[r,a]of i)Gr(o,t,e,r,a,n,s);const a=[...o.entries()].filter(([,e])=>e.type===Bo.Instructions).sort(([e],[t])=>e-t).map(([,e])=>e),d=Cr.create(a);i=new Map;for(const e of a)for(const t of e.instructions)for(let e=0;er)}(e,t,i.reduce((e,t)=>e.set(t,Bo.Instructions),new Map),s,o,n);const r=[];let a=0;for(;aa){n=e.offset;break}}if(e.seek_start(a),Kr(s,e,n,o||[]),i=s.get(a),n<=a){zr.error(`Next offset ${n} was smaller than or equal to current offset ${a}.`);break}if(!i){zr.error(`Couldn't create segment for offset ${a}.`);break}}switch(r.push(i),i.type){case Bo.Instructions:for(const e of i.instructions)a+=e.size;break;case Bo.Data:a+=i.data.byteLength;break;case Bo.String:a+=4*Math.ceil((i.value.length+1)/2);break;default:throw new Error(`${Bo[i.type]} not implemented.`)}}for(const{label:e,offset:i}of t.labels){const t=s.get(i);t?t.labels.includes(e)||(t.labels.push(e),t.labels.sort((e,t)=>e-t)):zr.warning(`Label ${e} with offset ${i} does not point to anything.`)}if(e.size!==a){const t=`Expected to parse ${e.size} bytes but parsed ${a} instead.`;if(!o)throw new Error(t);zr.error(t)}return r}(new zo.a(e,Uo.a.Little),new Yr(t),i,o,n)}function Hr(e,t,i,o,n){if(i.opcode.stack===Mt.Pop){const s=Ur(e,i,i.opcode.params.length-o-1);if(s.size()<=10)for(const e of s){const i=t.get(e);(null==i||$r[n]>$r[i])&&t.set(e,n)}}else{const e=i.args[o].value,s=t.get(e);(null==s||$r[n]>$r[s])&&t.set(e,n)}}function Gr(e,t,i,o,n,s,r){try{const a=t.get_info(o);if(null==a)return void zr.warning(`Label ${o} is not registered in the label table.`);const d=e.get(a.offset);let c;if(d){if(d.labels.includes(o)||(d.labels.push(o),d.labels.sort((e,t)=>e-t)),!($r[n]>$r[d.type]))return;c=d.labels}else c=[o];const l=a.next?a.next.offset:i.size;switch(i.seek_start(a.offset),n){case Bo.Instructions:!function(e,t,i,o,n,s,r,a){const d=[],c={type:Bo.Instructions,labels:n,instructions:d,asm:{labels:[]}};e.set(i.position,c);for(;i.position=0;e--){const t=d[e].opcode;if(t.code===Nt.code||t.code===mi.code){o=!1;break}}o&&Gr(e,t,i,s,Bo.Instructions,r,a)}}(e,t,i,l,c,a.next&&a.next.label,s,r);break;case Bo.Data:Kr(e,i,l,c);break;case Bo.String:!function(e,t,i,o,n){const s=t.position,r={type:Bo.String,labels:o,value:n?t.string_ascii(i-s,!0,!0):t.string_utf16(i-s,!0,!0),asm:{labels:[]}};e.set(s,r)}(e,i,l,c,r);break;default:throw new Error(`Segment type ${Bo[n]} not implemented.`)}}catch(e){if(!s)throw e;zr.error("Couldn't fully parse object code segment.",e)}}function Kr(e,t,i,o){const n=t.position,s={type:Bo.Data,labels:o,data:t.array_buffer(i-n),asm:{labels:[]}};e.set(n,s)}function Qr(e,t,i){const o=[];if(t.stack!==Mt.Pop)for(const n of t.params)switch(n.type.kind){case ft.Byte:o.push(Do(e.u8(),1));break;case ft.Word:o.push(Do(e.u16(),2));break;case ft.DWord:o.push(Do(e.i32(),4));break;case ft.Float:o.push(Do(e.f32(),4));break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:o.push(Do(e.u16(),2));break;case ft.String:{const t=e.position,n=Math.min(4096,e.bytes_left);o.push(Do(i?e.string_ascii(n,!0,!1):e.string_utf16(n,!0,!1),e.position-t))}break;case ft.ILabelVar:{const t=e.u8();o.push(...e.u16_array(t).map(e=>Do(e,2)))}break;case ft.RegRef:case ft.RegTupRef:o.push(Do(e.u8(),1));break;case ft.RegRefVar:{const t=e.u8();o.push(...e.u8_array(t).map(e=>Do(e,1)))}break;default:throw new Error(`Parameter type ${ft[n.type.kind]} not implemented.`)}return o}$r[Bo.Instructions]=2,$r[Bo.String]=1,$r[Bo.Data]=0;class Yr{constructor(e){this.labels=[],this.label_map=new Map,this.offset_map=new Map;for(let t=0;te.offset-t.offset||e.label-t.label);for(let e=0;et.offset));e++)i=void 0;return{offset:t.offset,next:i}}}const Zr=X.a.get("core/data_formats/asm/data_flow_analysis/map_designations");const Jr=X.a.get("core/data_formats/parsing/quest");function Xr(e,t,i=!1){const o=Object(rr.a)(e),{bin:n,dc_gc_format:r}=function(e){const t=e.u32(),i=e.u32(),o=e.u32();e.seek(4);const n=4652!==t;let s,r;n?(r=e.u16(),s=e.u16()):(s=e.u32(),r=e.u32());const a=n?e.string_ascii(32,!0,!0):e.string_utf16(64,!0,!0),d=n?e.string_ascii(128,!0,!0):e.string_utf16(256,!0,!0),c=n?e.string_ascii(288,!0,!0):e.string_utf16(576,!0,!0);o!==e.size&&ar.warning(`Value ${o} in bin size field does not match actual size ${e.size}.`),e.seek(4);const l=e.u32_array(932),_=Math.floor((e.size-i)/4);e.seek_start(i);const u=e.i32_array(_);return{bin:{quest_id:s,language:r,quest_name:a,short_description:d,long_description:c,object_code:e.seek_start(t).array_buffer(i-t),label_offsets:u,shop_items:l},dc_gc_format:n}}(o),a=function(e){const t=[],i=[],o=[],n=[];for(;e.bytes_left;){const s=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();if(0===s)break;{if(d!==r-16)throw Error(`Malformed DAT file. Expected an entities size of ${r-16}, got ${d}.`);const c=e.take(d);1===s?hr(c,a,t):2===s?pr(c,a,i):3===s?gr(c,a,o):n.push({entity_type:s,total_size:r,area_id:a,entities_size:d,data:e.u8_array(d)}),c.bytes_left&&dr.warning(`Read ${c.position} bytes instead of expected ${c.size} for entity type ${s}.`)}}return{objs:t,npcs:i,events:o,unknowns:n}}(Object(rr.a)(t)),d=a.objs.map(e=>{const t=function(e){switch(e){default:return w.Unknown;case 0:return w.PlayerSet;case 1:return w.Particle;case 2:return w.Teleporter;case 3:return w.Warp;case 4:return w.LightCollision;case 5:return w.Item;case 6:return w.EnvSound;case 7:return w.FogCollision;case 8:return w.EventCollision;case 9:return w.CharaCollision;case 10:return w.ElementalTrap;case 11:return w.StatusTrap;case 12:return w.HealTrap;case 13:return w.LargeElementalTrap;case 14:return w.ObjRoomID;case 15:return w.Sensor;case 16:return w.UnknownItem16;case 17:return w.LensFlare;case 18:return w.ScriptCollision;case 19:return w.HealRing;case 20:return w.MapCollision;case 21:return w.ScriptCollisionA;case 22:return w.ItemLight;case 23:return w.RadarCollision;case 24:return w.FogCollisionSW;case 25:return w.BossTeleporter;case 26:return w.ImageBoard;case 27:return w.QuestWarp;case 28:return w.Epilogue;case 29:return w.UnknownItem29;case 30:return w.UnknownItem30;case 31:return w.UnknownItem31;case 32:return w.BoxDetectObject;case 33:return w.SymbolChatObject;case 34:return w.TouchPlateObject;case 35:return w.TargetableObject;case 36:return w.EffectObject;case 37:return w.CountDownObject;case 38:return w.UnknownItem38;case 39:return w.UnknownItem39;case 40:return w.UnknownItem40;case 41:return w.UnknownItem41;case 64:return w.MenuActivation;case 65:return w.TelepipeLocation;case 66:return w.BGMCollision;case 67:return w.MainRagolTeleporter;case 68:return w.LobbyTeleporter;case 69:return w.PrincipalWarp;case 70:return w.ShopDoor;case 71:return w.HuntersGuildDoor;case 72:return w.TeleporterDoor;case 73:return w.MedicalCenterDoor;case 74:return w.Elevator;case 75:return w.EasterEgg;case 76:return w.ValentinesHeart;case 77:return w.ChristmasTree;case 78:return w.ChristmasWreath;case 79:return w.HalloweenPumpkin;case 80:return w.TwentyFirstCentury;case 81:return w.Sonic;case 82:return w.WelcomeBoard;case 83:return w.Firework;case 84:return w.LobbyScreenDoor;case 85:return w.MainRagolTeleporterBattleInNextArea;case 86:return w.LabTeleporterDoor;case 87:return w.Pioneer2InvisibleTouchplate;case 128:return w.ForestDoor;case 129:return w.ForestSwitch;case 130:return w.LaserFence;case 131:return w.LaserSquareFence;case 132:return w.ForestLaserFenceSwitch;case 133:return w.LightRays;case 134:return w.BlueButterfly;case 135:return w.Probe;case 136:return w.RandomTypeBox1;case 137:return w.ForestWeatherStation;case 138:return w.Battery;case 139:return w.ForestConsole;case 140:return w.BlackSlidingDoor;case 141:return w.RicoMessagePod;case 142:return w.EnergyBarrier;case 143:return w.ForestRisingBridge;case 144:return w.SwitchNoneDoor;case 145:return w.EnemyBoxGrey;case 146:return w.FixedTypeBox;case 147:return w.EnemyBoxBrown;case 149:return w.EmptyTypeBox;case 150:return w.LaserFenceEx;case 151:return w.LaserSquareFenceEx;case 192:return w.FloorPanel1;case 193:return w.Caves4ButtonDoor;case 194:return w.CavesNormalDoor;case 195:return w.CavesSmashingPillar;case 196:return w.CavesSign1;case 197:return w.CavesSign2;case 198:return w.CavesSign3;case 199:return w.HexagonalTank;case 200:return w.BrownPlatform;case 201:return w.WarningLightObject;case 203:return w.Rainbow;case 204:return w.FloatingJellyfish;case 205:return w.FloatingDragonfly;case 206:return w.CavesSwitchDoor;case 207:return w.RobotRechargeStation;case 208:return w.CavesCakeShop;case 209:return w.Caves1SmallRedRock;case 210:return w.Caves1MediumRedRock;case 211:return w.Caves1LargeRedRock;case 212:return w.Caves2SmallRock1;case 213:return w.Caves2MediumRock1;case 214:return w.Caves2LargeRock1;case 215:return w.Caves2SmallRock2;case 216:return w.Caves2MediumRock2;case 217:return w.Caves2LargeRock2;case 218:return w.Caves3SmallRock;case 219:return w.Caves3MediumRock;case 220:return w.Caves3LargeRock;case 222:return w.FloorPanel2;case 223:return w.DestructableRockCaves1;case 224:return w.DestructableRockCaves2;case 225:return w.DestructableRockCaves3;case 256:return w.MinesDoor;case 257:return w.FloorPanel3;case 258:return w.MinesSwitchDoor;case 259:return w.LargeCryoTube;case 260:return w.ComputerLikeCalus;case 261:return w.GreenScreenOpeningAndClosing;case 262:return w.FloatingRobot;case 263:return w.FloatingBlueLight;case 264:return w.SelfDestructingObject1;case 265:return w.SelfDestructingObject2;case 266:return w.SelfDestructingObject3;case 267:return w.SparkMachine;case 268:return w.MinesLargeFlashingCrate;case 304:return w.RuinsSeal;case 320:return w.RuinsTeleporter;case 321:return w.RuinsWarpSiteToSite;case 322:return w.RuinsSwitch;case 323:return w.FloorPanel4;case 324:return w.Ruins1Door;case 325:return w.Ruins3Door;case 326:return w.Ruins2Door;case 327:return w.Ruins11ButtonDoor;case 328:return w.Ruins21ButtonDoor;case 329:return w.Ruins31ButtonDoor;case 330:return w.Ruins4ButtonDoor;case 331:return w.Ruins2ButtonDoor;case 332:return w.RuinsSensor;case 333:return w.RuinsFenceSwitch;case 334:return w.RuinsLaserFence4x2;case 335:return w.RuinsLaserFence6x2;case 336:return w.RuinsLaserFence4x4;case 337:return w.RuinsLaserFence6x4;case 338:return w.RuinsPoisonBlob;case 339:return w.RuinsPillarTrap;case 340:return w.PopupTrapNoTech;case 341:return w.RuinsCrystal;case 342:return w.Monument;case 345:return w.RuinsRock1;case 346:return w.RuinsRock2;case 347:return w.RuinsRock3;case 348:return w.RuinsRock4;case 349:return w.RuinsRock5;case 350:return w.RuinsRock6;case 351:return w.RuinsRock7;case 352:return w.Poison;case 353:return w.FixedBoxTypeRuins;case 354:return w.RandomBoxTypeRuins;case 355:return w.EnemyTypeBoxYellow;case 356:return w.EnemyTypeBoxBlue;case 357:return w.EmptyTypeBoxBlue;case 358:return w.DestructableRock;case 359:return w.PopupTrapsTechs;case 368:return w.FlyingWhiteBird;case 369:return w.Tower;case 370:return w.FloatingRocks;case 371:return w.FloatingSoul;case 372:return w.Butterfly;case 384:return w.LobbyGameMenu;case 385:return w.LobbyWarpObject;case 386:return w.Lobby1EventObjectDefaultTree;case 387:return w.UnknownItem387;case 388:return w.UnknownItem388;case 389:return w.UnknownItem389;case 390:return w.LobbyEventObjectStaticPumpkin;case 391:return w.LobbyEventObject3ChristmasWindows;case 392:return w.LobbyEventObjectRedAndWhiteCurtain;case 393:return w.UnknownItem393;case 394:return w.UnknownItem394;case 395:return w.LobbyFishTank;case 396:return w.LobbyEventObjectButterflies;case 400:return w.UnknownItem400;case 401:return w.GreyWallLow;case 402:return w.SpaceshipDoor;case 403:return w.GreyWallHigh;case 416:return w.TempleNormalDoor;case 417:return w.BreakableWallWallButUnbreakable;case 418:return w.BrokenCylinderAndRubble;case 419:return w.ThreeBrokenWallPiecesOnFloor;case 420:return w.HighBrickCylinder;case 421:return w.LyingCylinder;case 422:return w.BrickConeWithFlatTop;case 423:return w.BreakableTempleWall;case 424:return w.TempleMapDetect;case 425:return w.SmallBrownBrickRisingBridge;case 426:return w.LongRisingBridgeWithPinkHighEdges;case 427:return w.FourSwitchTempleDoor;case 448:return w.FourButtonSpaceshipDoor;case 512:return w.ItemBoxCca;case 513:return w.TeleporterEp2;case 514:return w.CCADoor;case 515:return w.SpecialBoxCCA;case 516:return w.BigCCADoor;case 517:return w.BigCCADoorSwitch;case 518:return w.LittleRock;case 519:return w.Little3StoneWall;case 520:return w.Medium3StoneWall;case 521:return w.SpiderPlant;case 522:return w.CCAAreaTeleporter;case 523:return w.UnknownItem523;case 524:return w.WhiteBird;case 525:return w.OrangeBird;case 527:return w.Saw;case 528:return w.LaserDetect;case 529:return w.UnknownItem529;case 530:return w.UnknownItem530;case 531:return w.Seagull;case 544:return w.Fish;case 545:return w.SeabedDoorWithBlueEdges;case 546:return w.SeabedDoorAlwaysOpenNonTriggerable;case 547:return w.LittleCryotube;case 548:return w.WideGlassWallBreakable;case 549:return w.BlueFloatingRobot;case 550:return w.RedFloatingRobot;case 551:return w.Dolphin;case 552:return w.CaptureTrap;case 553:return w.VRLink;case 576:return w.UnknownItem576;case 640:return w.WarpInBarbaRayRoom;case 672:return w.UnknownItem672;case 688:return w.GeeNest;case 689:return w.LabComputerConsole;case 690:return w.LabComputerConsoleGreenScreen;case 691:return w.ChairYellowPillow;case 692:return w.OrangeWallWithHoleInMiddle;case 693:return w.GreyWallWithHoleInMiddle;case 694:return w.LongTable;case 695:return w.GBAStation;case 696:return w.TalkLinkToSupport;case 697:return w.InstaWarp;case 698:return w.LabInvisibleObject;case 699:return w.LabGlassWindowDoor;case 700:return w.UnknownItem700;case 701:return w.LabCeilingWarp;case 768:return w.Ep4LightSource;case 769:return w.Cacti;case 770:return w.BigBrownRock;case 771:return w.BreakableBrownRock;case 832:return w.UnknownItem832;case 833:return w.UnknownItem833;case 896:return w.PoisonPlant;case 897:return w.UnknownItem897;case 898:return w.UnknownItem898;case 899:return w.OozingDesertPlant;case 901:return w.UnknownItem901;case 902:return w.BigBlackRocks;case 903:return w.UnknownItem903;case 904:return w.UnknownItem904;case 905:return w.UnknownItem905;case 906:return w.UnknownItem906;case 907:return w.FallingRock;case 908:return w.DesertPlantHasCollision;case 909:return w.DesertFixedTypeBoxBreakableCrystals;case 910:return w.UnknownItem910;case 911:return w.BeeHive;case 912:return w.UnknownItem912;case 913:return w.Heat;case 960:return w.TopOfSaintMillionEgg;case 961:return w.UnknownItem961}}(e.type_id);return{type:t,id:e.id,group_id:e.group_id,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:new Map(e.properties.map((e,i)=>3!==i||t!==w.ScriptCollision&&t!==w.ForestConsole&&t!==w.TalkLinkToSupport?4===i&&t===w.RicoMessagePod?["script_label",e]:5===i&&t===w.RicoMessagePod?["script_label_2",e]:[`property_${i}`,e]:["script_label",e])),unknown:e.unknown}});let c=s.b.I,l=new Map;const _=Ar(n.object_code,n.label_offsets,function(e,t){const i=new Set([0]);for(const t of e){const e=t.properties.get("script_label");null!=e&&i.add(e);const o=t.properties.get("script_label_2");null!=o&&i.add(o)}for(const e of t)i.add(Math.round(e.script_label));return[...i]}(d,a.npcs),i,r);if(_.length){const e=_.filter(e=>e.type===Bo.Instructions);let t;for(const i of e)if(i.labels.includes(0)){t=i;break}t?(c=function(e){const t=e.instructions.find(e=>e.opcode.code===wo.code);if(!t)return Jr.debug("Function 0 has no set_episode instruction."),s.b.I;switch(t.args[0].value){default:case 0:return s.b.I;case 1:return s.b.II;case 2:return s.b.IV}}(t),l=function(e,t){const i=new Map;let o;for(const n of t.instructions)switch(n.opcode.code){case vo.code:case go.code:{o||(o=Cr.create(e));const t=Mr(o,n,n.args[0].value);if(1!==t.size()){Zr.warning("Couldn't determine area ID for map_designate instruction.");continue}const s=Mr(o,n,n.args[0].value+(n.opcode.code===vo.code?2:3));if(1!==s.size()){Zr.warning("Couldn't determine area variant ID for map_designate instruction.");continue}i.set(t.get(0),s.get(0))}break;case Lo.code:i.set(n.args[0].value,n.args[2].value)}return i}(e,t)):Jr.warning("No instruction for label 0 found.")}else Jr.warning("File contains no instruction labels.");return{id:n.quest_id,language:n.language,name:n.quest_name,short_description:n.short_description,long_description:n.long_description,episode:c,objects:d,npcs:ta(c,a.npcs),events:a.events,dat_unknowns:a.unknowns,object_code:_,shop_items:n.shop_items,map_designations:l}}function ea(e,t){const i=vr({objs:(n=e.objects,n.map(e=>({type_id:T(e.type).pso_id,id:e.id,group_id:e.group_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:[...e.properties.values()],area_id:e.area_id,unknown:e.unknown}))),npcs:(o=e.npcs,o.map(e=>{const t=Object(I.d)(e.type),i=null==t.pso_type_id?e.pso_type_id:t.pso_type_id,o=null==t.pso_roaming?e.pso_roaming:t.pso_roaming,n=null==t.pso_regular||t.pso_regular,s=Nn(-8388609&zn(e.scale.y)|(n?0:8388608)),r={x:e.scale.x,y:s,z:e.scale.z};return{type_id:i,wave:e.wave,wave2:e.pso_wave2,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:r,npc_id:e.npc_id,script_label:e.script_label,roaming:o,area_id:e.area_id,unknown:e.unknown}})),events:e.events,unknowns:e.dat_unknowns});var o,n;const{object_code:s,label_offsets:r}=function(e){const t=new ir.a(new or.a(100*e.length),Uo.a.Little),i=t.position,o=[];for(const n of e){for(const e of n.labels)o[e]=t.position-i;if(n.type===Bo.Instructions)for(const e of n.instructions){const i=e.opcode;if(2===i.size&&t.write_u8(i.code>>>8),t.write_u8(255&i.code),i.stack!==Mt.Pop)for(let o=0;o=0?t.write_u8(r.value):t.write_i8(r.value);break;case ft.Word:r.value>=0?t.write_u16(r.value):t.write_i16(r.value);break;case ft.DWord:r.value>=0?t.write_u32(r.value):t.write_i32(r.value);break;case ft.Float:t.write_f32(r.value);break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:t.write_u16(r.value);break;case ft.String:t.write_string_utf16(r.value,r.size);break;case ft.ILabelVar:t.write_u8(s.length),t.write_u16_array(s.map(e=>e.value));break;case ft.RegRef:case ft.RegTupRef:t.write_u8(r.value);break;case ft.RegRefVar:t.write_u8(s.length),t.write_u8_array(s.map(e=>e.value));break;default:throw new Error(`Parameter type ${ft[n.type.kind]} not implemented.`)}}}else if(n.type===Bo.String){const e=4*Math.ceil((n.value.length+1)/2);t.write_string_utf16(n.value,e)}else t.write_cursor(new zo.a(n.data,t.endianness))}for(let e=0;e932)throw new Error(`shop_items can't be larger than 932, was ${e.shop_items.length}.`);o.write_u32_array(e.shop_items);for(let t=e.shop_items.length;t<932;t++)o.write_u32(0);for(;o.position<4652;)o.write_u8(0);return o.write_cursor(new zo.a(e.object_code,Uo.a.Little)),o.write_i32_array(e.label_offsets),Object(N.d)(o.position===t,`Expected to write ${t} bytes, but wrote ${o.position}.`),i}({quest_id:e.id,language:e.language,quest_name:e.name,short_description:e.short_description,long_description:e.long_description,object_code:s,label_offsets:r,shop_items:e.shop_items}),d=t.lastIndexOf("."),c=-1===d?t.slice(0,11):t.slice(0,Math.min(11,d));return jr({files:[{filename:c+".dat",id:e.id,data:nr(new ir.a(i,Uo.a.Little)).array_buffer()},{filename:c+".bin",id:e.id,data:nr(new zo.a(a,Uo.a.Little)).array_buffer()}]})}function ta(e,t){return t.map(t=>({type:ia(e,t),area_id:t.area_id,section_id:t.section_id,wave:t.wave,pso_wave2:t.wave2,position:t.position,rotation:t.rotation,scale:t.scale,unknown:t.unknown,pso_type_id:t.type_id,npc_id:t.npc_id,script_label:Math.round(t.script_label),pso_roaming:t.roaming}))}function ia(e,{type_id:t,scale:i,roaming:o,area_id:n}){const s=Math.abs(i.y-1)>1e-5;switch(`${t}, ${o%3}, ${e}`){case"68, 0, 1":return I.c.Booma;case"68, 1, 1":return I.c.Gobooma;case"68, 2, 1":return I.c.Gigobooma;case"99, 0, 1":return I.c.EvilShark;case"99, 1, 1":return I.c.PalShark;case"99, 2, 1":return I.c.GuilShark;case"166, 0, 1":return I.c.Dimenian;case"166, 0, 2":return I.c.Dimenian2;case"166, 1, 1":return I.c.LaDimenian;case"166, 1, 2":return I.c.LaDimenian2;case"166, 2, 1":return I.c.SoDimenian;case"166, 2, 2":return I.c.SoDimenian2;case"214, 0, 2":return I.c.Mericarol;case"214, 1, 2":return I.c.Mericus;case"214, 2, 2":return I.c.Merikle;case"277, 0, 4":return I.c.Boota;case"277, 1, 4":return I.c.ZeBoota;case"277, 2, 4":return I.c.BaBoota;case"279, 0, 4":return I.c.Goran;case"279, 1, 4":return I.c.PyroGoran;case"279, 2, 4":return I.c.GoranDetonator}switch(`${t}, ${o%2}, ${e}`){case"64, 0, 1":return I.c.Hildebear;case"64, 0, 2":return I.c.Hildebear2;case"64, 1, 1":return I.c.Hildeblue;case"64, 1, 2":return I.c.Hildeblue2;case"65, 0, 1":return I.c.RagRappy;case"65, 0, 2":return I.c.RagRappy2;case"65, 0, 4":return I.c.SandRappy;case"65, 1, 1":return I.c.AlRappy;case"65, 1, 2":return I.c.LoveRappy;case"65, 1, 4":return I.c.DelRappy;case"128, 0, 1":return I.c.Dubchic;case"128, 0, 2":return I.c.Dubchic2;case"128, 1, 1":return I.c.Gilchic;case"128, 1, 2":return I.c.Gilchic2;case"212, 0, 2":return I.c.SinowBerill;case"212, 1, 2":return I.c.SinowSpigell;case"213, 0, 2":return I.c.Merillia;case"213, 1, 2":return I.c.Meriltas;case"215, 0, 2":return I.c.UlGibbon;case"215, 1, 2":return I.c.ZolGibbon;case"221, 0, 2":return I.c.Dolmolm;case"221, 1, 2":return I.c.Dolmdarl;case"224, 0, 2":return n>15?I.c.Epsilon:I.c.SinowZoa;case"224, 1, 2":return n>15?I.c.Epsilon:I.c.SinowZele;case"274, 0, 4":return I.c.MerissaA;case"274, 1, 4":return I.c.MerissaAA;case"276, 0, 4":return I.c.Zu;case"276, 1, 4":return I.c.Pazuzu;case"278, 0, 4":return I.c.Dorphon;case"278, 1, 4":return I.c.DorphonEclair;case"281, 0, 4":return s?I.c.SaintMilion:I.c.Kondrieu;case"281, 1, 4":return s?I.c.Shambertin:I.c.Kondrieu}switch(`${t}, ${e}`){case"66, 1":return I.c.Monest;case"66, 2":return I.c.Monest2;case"67, 1":return s?I.c.SavageWolf:I.c.BarbarousWolf;case"67, 2":return s?I.c.SavageWolf2:I.c.BarbarousWolf2;case"96, 1":return I.c.GrassAssassin;case"96, 2":return I.c.GrassAssassin2;case"97, 1":return n>15?I.c.DelLily:s?I.c.PoisonLily:I.c.NarLily;case"97, 2":return n>15?I.c.DelLily:s?I.c.PoisonLily2:I.c.NarLily2;case"98, 1":return I.c.NanoDragon;case"100, 1":return s?I.c.PofuillySlime:I.c.PouillySlime;case"101, 1":return I.c.PanArms;case"101, 2":return I.c.PanArms2;case"129, 1":return I.c.Garanz;case"129, 2":return I.c.Garanz2;case"130, 1":return s?I.c.SinowBeat:I.c.SinowGold;case"131, 1":return I.c.Canadine;case"132, 1":return I.c.Canane;case"133, 1":return I.c.Dubswitch;case"133, 2":return I.c.Dubswitch2;case"160, 1":return I.c.Delsaber;case"160, 2":return I.c.Delsaber2;case"161, 1":return I.c.ChaosSorcerer;case"161, 2":return I.c.ChaosSorcerer2;case"162, 1":return I.c.DarkGunner;case"164, 1":return I.c.ChaosBringer;case"165, 1":return I.c.DarkBelra;case"165, 2":return I.c.DarkBelra2;case"167, 1":return I.c.Bulclaw;case"168, 1":return I.c.Claw;case"192, 1":return I.c.Dragon;case"192, 2":return I.c.GalGryphon;case"193, 1":return I.c.DeRolLe;case"194, 1":return I.c.VolOptPart1;case"197, 1":return I.c.VolOptPart2;case"200, 1":return I.c.DarkFalz;case"202, 2":return I.c.OlgaFlow;case"203, 2":return I.c.BarbaRay;case"204, 2":return I.c.GolDragon;case"216, 2":return I.c.Gibbles;case"217, 2":return I.c.Gee;case"218, 2":return I.c.GiGue;case"219, 2":return I.c.Deldepth;case"220, 2":return I.c.Delbiter;case"222, 2":return I.c.Morfos;case"223, 2":return I.c.Recobox;case"225, 2":return I.c.IllGill;case"272, 4":return I.c.Astark;case"273, 4":return s?I.c.SatelliteLizard:I.c.Yowie;case"275, 4":return I.c.Girtablulu}switch(t){case 4:return I.c.FemaleFat;case 5:return I.c.FemaleMacho;case 7:return I.c.FemaleTall;case 10:return I.c.MaleDwarf;case 11:return I.c.MaleFat;case 12:return I.c.MaleMacho;case 13:return I.c.MaleOld;case 25:return I.c.BlueSoldier;case 26:return I.c.RedSoldier;case 27:return I.c.Principal;case 28:return I.c.Tekker;case 29:return I.c.GuildLady;case 30:return I.c.Scientist;case 31:return I.c.Nurse;case 32:return I.c.Irene;case 241:return I.c.ItemShop;case 254:return I.c.Nurse2}return I.c.Unknown}class oa{constructor(e,t,i,o,n){this._actions=Object(M.c)(),this.actions=this._actions,Object(N.m)(e,"id"),Object(N.m)(t,"section_id"),Object(N.f)(i,"wave"),Object(N.m)(o,"delay"),Object(N.l)(n,"unknown"),this.id=e,this.section_id=t,this.wave=i,this._delay=Object(M.e)(o),this.delay=this._delay,this.unknown=n}set_delay(e){Object(N.m)(e,"delay"),this._delay.val=e}add_action(e){this._actions.push(e)}remove_action(e){this._actions.remove(e)}}class na{constructor(e,t,i){Object(N.m)(e,"id"),Object(N.m)(t,"area_id"),Object(N.m)(i,"section_id"),this._id=Object(M.e)(e),this.id=this._id,this._area_id=Object(M.e)(t),this.area_id=this._area_id,this._section_id=Object(M.e)(i),this.section_id=this._section_id}}const sa=X.a.get("quest_editor/stores/model_conversion");function ra(e,t){const i=new Map;return new Qs(e,t.id,t.language,t.name,t.short_description,t.long_description,t.episode,t.map_designations,t.objects.map(e=>new me(e.type,e.id,e.group_id,e.area_id,e.section_id,Object(ps.a)(e.position),z(e.rotation.x,e.rotation.y,e.rotation.z),e.properties,e.unknown)),t.npcs.map(e=>(function(e,t){const i=0===t.wave?void 0:aa(e,t.area_id,t.section_id,t.wave);return new Q(t.type,t.pso_type_id,t.npc_id,i,t.pso_wave2,t.script_label,t.pso_roaming,t.area_id,t.section_id,Object(ps.a)(t.position),z(t.rotation.x,t.rotation.y,t.rotation.z),Object(ps.a)(t.scale),t.unknown)})(i,e)),function(e,t){const i=new Map;for(const o of t){const t=`${o.id}-${o.area_id}`;let n=i.get(t);if(n&&n.event){sa.warning(`Ignored duplicate event #${o.id} for area ${o.area_id}.`);continue}const s=aa(e,o.area_id,o.section_id,o.wave),r=new oa(o.id,o.section_id,s,o.delay,o.unknown);n?n.event=r:(n={event:r,area_id:o.area_id,parents:[],child_ids:[]},i.set(t,n));for(const e of o.actions)switch(e.type){case _r.SpawnNpcs:r.add_action(new rt(e.section_id,e.appear_flag));break;case _r.Unlock:r.add_action(new at(e.door_id));break;case _r.Lock:r.add_action(new dt(e.door_id));break;case _r.TriggerEvent:{n.child_ids.push(e.event_id);const t=`${e.event_id}-${o.area_id}`,s=i.get(t);s?s.parents.push(r):i.set(t,{area_id:o.area_id,parents:[r],child_ids:[]})}break;default:sa.warning(`Unknown event action type: ${e.type}.`)}}const o=new Map;for(const{area_id:e,event:t}of i.values())if(t){let i=o.get(e);i||(i=new it(e),o.set(e,i)),i.add_event(t,[],[])}for(const e of i.values())if(e.event)for(const t of e.child_ids){const n=i.get(`${t}-${e.area_id}`);n.event?o.get(e.area_id).add_edge(e.event,n.event):sa.warning(`Event ${e.event.id} calls nonexistent event ${t}.`)}return o}(i,t.events),t.dat_unknowns,t.object_code.slice(),t.shop_items)}function aa(e,t,i,o){const n=`${t}-${i}-${o}`;let s=e.get(n);return s||(s=new na(o,t,i),e.set(n,s)),s}function da(e){const t=[];for(const i of e.values())for(const e of i.events){const o=e.actions.val.map(e=>{switch(e.type){case ot.SpawnNpcs:return{type:_r.SpawnNpcs,section_id:e.section_id,appear_flag:e.appear_flag};case ot.Unlock:return{type:_r.Unlock,door_id:e.door_id.val};case ot.Lock:return{type:_r.Lock,door_id:e.door_id.val}}});for(const t of i.get_children(e))o.push({type:_r.TriggerEvent,event_id:t.id});t.push({id:e.id,section_id:e.section_id,wave:e.wave.id.val,delay:e.delay.val,actions:o,area_id:i.area_id,unknown:e.unknown})}return t}var ca=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const la=X.a.get("quest_editor/controllers/QuestEditorToolBarController");class _a extends Gs.a{constructor(e,t,i){super(),this.area_store=t,this.quest_editor_store=i,this.create_new_quest=e=>ca(this,void 0,void 0,(function*(){return this.quest_editor_store.set_current_quest(er(this.area_store,e))})),this.parse_files=e=>ca(this,void 0,void 0,(function*(){try{if(0===e.length)return;let t;const i=e.find(e=>e.name.toLowerCase().endsWith(".qst"));if(i){const e=yield Object(tr.b)(i);t=function(e,t=!1){const i=Ir(e);if(!i)return;let o,n;for(const e of i.files){const t=e.filename.trim().toLowerCase();t.endsWith(".dat")?o=e:t.endsWith(".bin")&&(n=e)}if(o){if(n)return Xr(new zo.a(n.data,Uo.a.Little),new zo.a(o.data,Uo.a.Little),t);Jr.error("File contains no BIN file.")}else Jr.error("File contains no DAT file.")}(new zo.a(e,Uo.a.Little)),this.quest_filename=i.name,t||la.error("Couldn't parse quest file.")}else{const i=e.find(e=>e.name.toLowerCase().endsWith(".bin")),o=e.find(e=>e.name.toLowerCase().endsWith(".dat"));if(i&&o){const e=yield Object(tr.b)(i),n=yield Object(tr.b)(o);t=Xr(new zo.a(e,Uo.a.Little),new zo.a(n,Uo.a.Little)),this.quest_filename=i.name||o.name,t||la.error("Couldn't parse quest file.")}}yield this.quest_editor_store.set_current_quest(t&&ra(this.area_store,t))}catch(e){la.error("Couldn't read file.",e)}})),this.set_area=({area:e})=>{this.quest_editor_store.set_current_area(e)},this.save_as=()=>{const e=this.quest_editor_store.current_quest.val;if(!e)return;const t=this.quest_filename&&Object(N.e)(this.quest_filename);let i=prompt("File name:",t);if(!i)return;const o=ea(function(e){return{id:e.id.val,language:e.language.val,name:e.name.val,short_description:e.short_description.val,long_description:e.long_description.val,episode:e.episode,objects:e.objects.val.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),unknown:e.unknown,id:e.id,group_id:e.group_id,properties:new Map(e.properties)})),npcs:e.npcs.val.map(e=>{var t,i;return{type:e.type,area_id:e.area_id,section_id:e.section_id.val,wave:(i=null===(t=e.wave.val)||void 0===t?void 0:t.id.val,null!=i?i:0),pso_wave2:e.pso_wave2.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),scale:e.scale.clone(),unknown:e.unknown,pso_type_id:e.pso_type_id,npc_id:e.npc_id,script_label:e.script_label,pso_roaming:e.pso_roaming}}),events:da(e.event_dags),dat_unknowns:e.dat_unknowns.map(e=>Object.assign({},e)),object_code:e.object_code.map(e=>Eo(e)),shop_items:e.shop_items.slice(),map_designations:new Map(e.map_designations.val)}}(e),i);i.endsWith(".qst")||(i+=".qst");const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([o],{type:"application/octet-stream"})),n.download=i,document.body.appendChild(n),n.click(),URL.revokeObjectURL(n.href),document.body.removeChild(n)},this.debug=()=>{const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.quest_runner.run(e)},this.resume=()=>{this.quest_editor_store.quest_runner.resume()},this.step_over=()=>{this.quest_editor_store.quest_runner.step_over()},this.step_in=()=>{this.quest_editor_store.quest_runner.step_into()},this.step_out=()=>{this.quest_editor_store.quest_runner.step_out()},this.stop=()=>{this.quest_editor_store.quest_runner.stop()},this.vm_feature_active=e.feature_active("vm"),this.areas=i.current_quest.flat_map(e=>{var i;return e?null===(i=e)||void 0===i?void 0:i.entities_per_area.flat_map(i=>Object(M.c)(void 0,...t.get_areas_for_episode(e.episode).map(e=>{const t=i.get(e.id);return{area:e,label:e.name+(t?` (${t})`:"")}}))):Object(M.c)()}),this.current_area=Object(M.d)((e,t)=>e.find(e=>e.area==t),this.areas,i.current_area);const o=i.current_quest.map(e=>null!=e);this.can_save=o,this.can_select_area=o,this.can_debug=o,this.can_undo=Object(M.d)((e,t)=>e&&!t,jn.can_undo,i.quest_runner.running),this.can_redo=Object(M.d)((e,t)=>e&&!t,jn.can_redo,i.quest_runner.running),this.can_step=i.quest_runner.paused,this.can_stop=i.quest_runner.running,this.disposables(i.current_quest.observe(()=>{this.quest_filename=void 0}),e.on_global_keydown(Ye.b.QuestEditor,"Ctrl-O",()=>ca(this,void 0,void 0,(function*(){const e=yield Object(tr.a)({accept:".bin, .dat, .qst",multiple:!0});this.parse_files(e)}))),e.on_global_keydown(Ye.b.QuestEditor,"Ctrl-Shift-S",this.save_as),e.on_global_keydown(Ye.b.QuestEditor,"Ctrl-Z",()=>{jn.undo()}),e.on_global_keydown(Ye.b.QuestEditor,"Ctrl-Shift-Z",()=>{jn.redo()}),e.on_global_keydown(Ye.b.QuestEditor,"F5",this.debug),e.on_global_keydown(Ye.b.QuestEditor,"Shift-F5",this.stop),e.on_global_keydown(Ye.b.QuestEditor,"F6",this.resume),e.on_global_keydown(Ye.b.QuestEditor,"F8",this.step_over),e.on_global_keydown(Ye.b.QuestEditor,"F7",this.step_in),e.on_global_keydown(Ye.b.QuestEditor,"Shift-F8",this.step_out))}}class ua{constructor(e,t,i){this.quest=e,this.old=t,this.new=i}}class va extends ua{constructor(){super(...arguments),this.description="Edit ID"}undo(){this.quest.set_id(this.old)}redo(){this.quest.set_id(this.new)}}class ha extends ua{constructor(){super(...arguments),this.description="Edit name"}undo(){this.quest.set_name(this.old)}redo(){this.quest.set_name(this.new)}}class pa extends ua{constructor(){super(...arguments),this.description="Edit short description"}undo(){this.quest.set_short_description(this.old)}redo(){this.quest.set_short_description(this.new)}}class ga extends ua{constructor(){super(...arguments),this.description="Edit long description"}undo(){this.quest.set_long_description(this.old)}redo(){this.quest.set_long_description(this.new)}}class ba extends Gs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.set_id=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new va(t,t.id.val,e)).redo()},this.set_name=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ha(t,t.name.val,e)).redo()},this.set_short_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new pa(t,t.short_description.val,e)).redo()},this.set_long_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ga(t,t.long_description.val,e)).redo()},this.current_quest=e.current_quest,this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=this.current_quest.map(e=>null==e)}}const fa=Object.freeze(new y.Vector3),ma=Object.freeze(new y.Euler);class wa extends Gs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()};const t=e.selected_entity;this.unavailable=t.map(e=>null==e),this.enabled=e.quest_runner.running.map(e=>!e),this.type=t.map(e=>e instanceof Q?"NPC":"Object"),this.name=t.map(e=>null==e?"":L(e.type).name),this.section_id=t.flat_map(e=>null==e?Object(M.e)(""):e.section_id.map(e=>e.toString())),this.wave=t.flat_map(e=>e instanceof Q?e.wave.flat_map(e=>{var t,i,o;return null!=(o=null===(i=null===(t=e)||void 0===t?void 0:t.id)||void 0===i?void 0:i.map(e=>e.toString()))?o:Object(M.e)("None")}):Object(M.e)("")),this.wave_hidden=t.map(e=>!(e instanceof Q)),this.position=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.position)?i:Object(M.e)(fa)}),this.rotation=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.rotation)?i:Object(M.e)(ma)})}set_pos_x(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(e,i.y,i.z),!1)).redo()}}set_pos_y(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,e,i.z),!1)).redo()}}set_pos_z(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Re(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,i.y,e),!1)).redo()}}set_rot_x(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,z(V(e),i.y,i.z),!1)).redo()}}set_rot_y(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,z(i.x,V(e),i.z),!1)).redo()}}set_rot_z(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ke(this.store,t,i,z(i.x,i.y,V(e)),!1)).redo()}}}class ka extends Gs.a{constructor(e){super(),this.unavailable=e.current_quest.map(e=>null==e),this.npc_counts=e.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).map(this.update_view)}update_view(e){const t=new Map;for(const i of e)if(i.type!==I.c.VolOptPart2){const e=t.get(i.type)||0;t.set(i.type,e+1)}const i=8*(t.get(I.c.Canane)||0);return[...t].sort((e,t)=>e[0]-t[0]).map(([e,t])=>{const o=e===I.c.Canadine?i:0;return{name:Object(I.d)(e).name,count:t+o}})}}class ya{constructor(e,t,i){this.event=e,this.old_delay=t,this.new_delay=i,this.description=`Edit delay of event ${e.id}`}undo(){this.event.set_delay(this.old_delay)}redo(){this.event.set_delay(this.new_delay)}}class Ra{constructor(e,t,i,o){this.store=e,this.quest=t,this.event_dag=i,this.event=o,this.new_edges=[],this.description=`Delete event ${o.id}`,this.parents=i.get_parents(o).slice(),this.children=i.get_children(o).slice();for(const e of this.parents){const t=i.get_children(e);for(const i of this.children)t.includes(i)||this.new_edges.push({parent:e,child:i})}this.npcs=t.npcs.val.filter(e=>e.wave.val===o.wave),this.event_index=i.get_index(o)}undo(){this.quest.insert_event(this.event_index,this.event,this.parents,this.children);for(const{parent:e,child:t}of this.new_edges)this.event_dag.remove_edge(e,t);for(const e of this.npcs)e.set_wave(this.event.wave)}redo(){this.store.selected_wave.val===this.event.wave&&this.store.set_selected_wave(void 0);for(const{parent:e,child:t}of this.new_edges)this.event_dag.add_edge(e,t);this.quest.remove_event(this.event_dag,this.event)}}class Ia{constructor(e,t,i,o){this.quest=e,this.event_dag=t,this.event=i,this.parent_event=o,this.description=`Add event ${i.id}`}undo(){this.quest.remove_event(this.event_dag,this.event)}redo(){this.quest.add_event(this.event,this.parent_event?[this.parent_event]:[],[])}}class ja extends Gs.a{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.add_event=()=>{var e,t,i,o,n;const s=this.store.current_quest.val,r=this.store.current_area.val;if(s&&r){const a=s.get_event_dag_or_create(r.id),d=a.events.find(e=>e.wave===this.store.selected_wave.val),c=null!=(n=null!=(t=null===(e=d)||void 0===e?void 0:e.section_id)?t:null===(o=null===(i=this.store.selected_entity.val)||void 0===i?void 0:i.section_id)||void 0===o?void 0:o.val)?n:1,l=[],_=[];for(const e of a.events)l.push(e.id),e.wave.section_id.val===c&&_.push(e.wave.id.val);l.sort((e,t)=>e-t),_.sort((e,t)=>e-t);let u,v=0;for(const e of _)if(++v!==e)break;if(v===_.length&&v++,d){let e=d;for(;;){const[t]=a.get_parents(e);if(!t)break;e=t}const t=a.get_sub_graph(e).length.val;u=`${e.id}${t}`}else u=`${c}${v}`;let h=parseInt(u,10),p=0;for(;p=l.indexOf(h,p),-1!==p;)h++;this.store.undo.push(new Ia(s,a,new oa(h,c,new na(v,r.id,c),30,0),d)).redo()}},this.remove_event=e=>{const t=this.store.current_quest.val,i=this.event_dag.val;t&&i&&this.store.undo.push(new Ra(this.store,t,i,e)).redo()},this.set_selected_wave=e=>{this.store.set_selected_wave(e)},this.set_delay=(e,t)=>{this.store.undo.push(new ya(e,e.delay.val,t)).redo()},this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=e.current_quest.map(e=>null==e),this.event_dag=Object(M.d)((e,t)=>e&&t?e.event_dags.get(t.id):void 0,e.current_quest,e.current_area),this.event_sub_graphs=Object(M.b)(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.connected_sub_graphs)?i:Object(M.c)()},this.event_dag)}is_selected(e){return this.store.selected_wave.map(t=>e.wave===t)}add_action(e,t){let i;switch(t){case ot.SpawnNpcs:i=new rt(0,0);break;case ot.Unlock:i=new at(0);break;case ot.Lock:i=new dt(0)}e.add_action(i)}remove_action(e,t){e.remove_action(t)}}function Ta(e,t,i){const o=new a.a,n=o.add(new ms(e)),s=o.add(new qs(e)),r=o.add(new as(n)),d=o.add(new Mn(t,r)),c=o.add(new es(d)),l=new $s,_=o.add(new Cs(s,i));return{view:o.add(new Rn(t,d,l,o.add(new Hs(o.add(new _a(t,r,d)))),()=>new f(o.add(new ba(d))),()=>new m(o.add(new ka(d))),()=>new Fe(d,n,s,i()),()=>new Ke(t,d.quest_runner,c),()=>new Qe(o.add(new wa(d))),()=>new Je(d,_),()=>new Xe(d,_),()=>new bt(o.add(new ja(d))),()=>new bn(d,n,s,i()),()=>new ln(d.quest_runner))),dispose(){o.dispose()}}}i.d(t,"initialize_quest_editor",(function(){return Ta}))},I7a6:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("nsCy"),n=i("rwco"),s=function(e,t,i,o){return new(i||(i=Promise))((function(n,s){function r(e){try{d(o.next(e))}catch(e){s(e)}}function a(e){try{d(o.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const r=n.a.get("core/persistence/Persister");class a{persist_for_server(e,t,i){this.persist(this.server_key(e,t),i)}persist(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(t){r.error(`Couldn't persist ${e}.`,t)}}load_for_server(e,t){return s(this,void 0,void 0,(function*(){return this.load(this.server_key(e,t))}))}load(e){return s(this,void 0,void 0,(function*(){try{const t=localStorage.getItem(e);return t&&JSON.parse(t)}catch(t){return void r.error(`Couldn't load ${e}.`,t)}}))}server_key(e,t){let i=t+".";switch(e){case o.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${o.g[e]} not supported.`)}return i}}},KUR2:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=i("nN8q"),n=i("FXpb");class s extends o.a{constructor(e){super(),this.renderer=e,this.element=Object(n.h)({className:"core_RendererWidget"}),this.children=[],this.element.append(e.canvas_element),this.disposable(e),this.finalize_construction()}start_rendering(){this.renderer.start_rendering()}stop_rendering(){this.renderer.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer.set_size(e,t),this}}},NUmZ:function(e,t,i){e.exports=function(){return new Worker(i.p+"f44b87d30b148fb9b4ec.worker.js")}}}]); \ No newline at end of file diff --git a/8.1adc3cf2844f3d09cd0f.js b/8.3a5cee225e5403852e30.js similarity index 64% rename from 8.1adc3cf2844f3d09cd0f.js rename to 8.3a5cee225e5403852e30.js index ee029c5b..682f8fcf 100644 --- a/8.1adc3cf2844f3d09cd0f.js +++ b/8.3a5cee225e5403852e30.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"0Xme":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var s=n("sDu+"),i=n("jJhE"),o=(n("x1yY"),n("4VsB")),r=n("FXpb");class l extends s.a{constructor(e,t,n,s,i){super(i),this.element=Object(r.q)({className:`${t} core_Input`}),this._value=new o.a(this,e,this.set_value),this.value=this._value,this.input_element=Object(r.l)({className:`${s} core_Input_inner`}),this.input_element.type=n,this.input_element.addEventListener("change",()=>{this._value.set_val(this.get_value(),{silent:!1})}),i&&i.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(e){super.set_enabled(e),this.input_element.disabled=!e}set_attr(e,t,n){if(null==t)return;const s=this.input_element,o=n||(e=>e);Object(i.a)(t)?(s[e]=o(t.val),this.disposable(t.observe(({value:t})=>s[e]=o(t)))):s[e]=o(t)}}},GN66:function(e,t,n){"use strict";n.r(t);var s=n("HjM1"),i=n("xs7i"),o=n("sZ1+"),r=(n("Czz9"),n("0Xme")),l=n("ExVU");n("vlF3");class c extends r.a{constructor(e=l.Duration.fromMillis(0),t){super(e,"core_DurationInput","text","core_DurationInput_inner",t),this.preferred_label_position="left",this.input_element.pattern="(60|[0-5][0-9]):(60|[0-5][0-9])",this.set_value(e),this.finalize_construction()}get_value(){const e=this.input_element.value;if(this.input_element.validity.valid)return l.Duration.fromObject({hours:parseInt(e.slice(0,2),10),minutes:parseInt(e.slice(3),10)});{const t=e.indexOf(":");return-1===t?l.Duration.fromObject({minutes:parseInt(e,10)}):l.Duration.fromObject({hours:parseInt(e.slice(0,t),10),minutes:parseInt(e.slice(t+1),10)})}}set_value(e){this.input_element.value=e.toFormat("hh:mm")}}var a=n("yar8"),u=n("ouMO"),d=n("rwco"),h=n("FXpb"),p=n("zsIO"),_=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};const m=d.c.get("hunt_optimizer/gui/MethodsForEpisodeView");class f extends p.a{constructor(e,t){super(),this.element=Object(h.h)({className:"hunt_optimizer_MethodsForEpisodeView"}),this.episode=t,this.enemy_types=o.a.filter(e=>Object(o.d)(e).episode===this.episode);const n=Object(u.c)(),s=this.add(new a.b({class:"hunt_optimizer_MethodsForEpisodeView_table",values:n,sort:e=>{n.sort((t,n)=>{for(const{column:s,direction:i}of e){let e=0;switch(s.key){case"method":e=t.name.localeCompare(n.name);break;case"time":e=t.time.val.as("minutes")-n.time.val.as("minutes");break;default:{const i=o.c[s.key];i&&(e=(t.enemy_counts.get(i)||0)-(n.enemy_counts.get(i)||0))}}if(0!==e)return i===a.a.Asc?e:-e}return 0})},columns:[{key:"method",title:"Method",fixed:!0,width:250,sortable:!0,render_cell:e=>e.name},{key:"time",title:"Time",fixed:!0,width:60,input:!0,sortable:!0,render_cell(e,t){const n=t.add(new c(e.time.val));return t.add(n.value.observe(({value:t})=>e.set_user_time(t))),n.element}},...this.enemy_types.map(e=>({key:o.c[e],title:Object(o.d)(e).simple_name,width:90,text_align:"right",sortable:!0,render_cell(t){const n=t.enemy_counts.get(e);return null==n?"":n.toString()}}))]}));this.element.append(s.element),this.disposables(e.current.observe(({value:e})=>_(this,void 0,void 0,(function*(){try{const t=yield e;this.hunt_methods_observer&&this.hunt_methods_observer.dispose(),this.hunt_methods_observer=t.methods.observe(({value:e})=>{n.val=e.filter(e=>e.episode===this.episode)},{call_now:!0})}catch(e){m.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}dispose(){super.dispose(),this.hunt_methods_observer&&this.hunt_methods_observer.dispose()}}n.d(t,"MethodsView",(function(){return v}));var b=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};class v extends s.a{constructor(e,t){super(e,{class:"hunt_optimizer_MethodsView",tabs:[{title:"Episode I",key:"episode_1",path:"/methods/episode_1",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.I)}))}},{title:"Episode II",key:"episode_2",path:"/methods/episode_2",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.II)}))}},{title:"Episode IV",key:"episode_4",path:"/methods/episode_4",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.IV)}))}}]}),this.finalize_construction()}}},yar8:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return c}));var s=n("TRid"),i=n("FXpb"),o=n("Tpfs");n("/KYB");const r=n("rwco").c.get("core/gui/Table");var l;!function(e){e[e.Asc=0]="Asc",e[e.Desc=1]="Desc"}(l||(l={}));class c extends s.a{constructor(e){super(e),this.tbody_element=Object(i.s)(),this.element=Object(i.r)({className:"core_Table"}),this.children=[],this.create_row=(e,t)=>{const n=new o.a;let s=0;return[Object(i.y)(...this.columns.map((o,l)=>{const c=o.fixed?Object(i.w)():Object(i.t)();try{const t=o.render_cell(e,n);c.append(t),o.input&&c.classList.add("input"),o.fixed&&(c.classList.add("fixed"),c.style.left=`${s}px`,s+=o.width||0),c.style.width=`${o.width}px`,o.text_align&&(c.style.textAlign=o.text_align),o.tooltip&&(c.title=o.tooltip(e))}catch(e){r.warn(`Error while rendering cell for index ${t}, column ${l}.`,e)}return c})),n]},this.update_footer=()=>{if(!this.footer_row_element)return;const e=this.columns.length;for(let t=0;t{const n=Object(i.w)({data:{index:t.toString()}},Object(i.q)(e.title));return e.fixed&&(n.style.position="sticky",n.style.left=`${c}px`,c+=e.width),n.style.width=`${e.width}px`,e.footer&&(a=!0),n}));const u=e.sort;u&&(s.onmousedown=e=>{if(e.target instanceof HTMLElement){let n=e.target;for(let e=0;e<5&&!n.dataset.index;e++){if(!n.parentElement)return;n=n.parentElement}if(!n.dataset.index)return;const s=parseInt(n.dataset.index,10),i=this.columns[s];if(!i.sortable)return;const o=t.findIndex(e=>e.column===i);if(0===o){const e=t[0];e.direction=e.direction===l.Asc?l.Desc:l.Asc}else-1!==o&&t.splice(o,1),t.unshift({column:i,direction:l.Asc});u(t)}}),n.append(s),this.tbody_element=Object(i.s)(),this.element.append(n,this.tbody_element),a&&(this.footer_row_element=Object(i.y)(),this.element.append(Object(i.v)({},this.footer_row_element)),this.create_footer()),this.disposables(Object(i.d)(this.tbody_element,this.values,this.create_row),this.values.observe(this.update_footer)),this.finalize_construction()}create_footer(){const e=[];let t=0;for(let n=0;n{this._value.set_val(this.get_value(),{silent:!1})}),i&&i.readonly&&this.set_attr("readOnly",!0),this.element.append(this.input_element)}set_enabled(e){super.set_enabled(e),this.input_element.disabled=!e}set_attr(e,t,n){if(null==t)return;const s=this.input_element,o=n||(e=>e);Object(i.a)(t)?(s[e]=o(t.val),this.disposable(t.observe(({value:t})=>s[e]=o(t)))):s[e]=o(t)}}},GN66:function(e,t,n){"use strict";n.r(t);var s=n("HjM1"),i=n("xs7i"),o=n("sZ1+"),r=(n("Czz9"),n("0Xme")),l=n("ExVU");n("vlF3");class c extends r.a{constructor(e=l.Duration.fromMillis(0),t){super(e,"core_DurationInput","text","core_DurationInput_inner",t),this.preferred_label_position="left",this.input_element.pattern="(60|[0-5][0-9]):(60|[0-5][0-9])",this.set_value(e),this.finalize_construction()}get_value(){const e=this.input_element.value;if(this.input_element.validity.valid)return l.Duration.fromObject({hours:parseInt(e.slice(0,2),10),minutes:parseInt(e.slice(3),10)});{const t=e.indexOf(":");return-1===t?l.Duration.fromObject({minutes:parseInt(e,10)}):l.Duration.fromObject({hours:parseInt(e.slice(0,t),10),minutes:parseInt(e.slice(t+1),10)})}}set_value(e){this.input_element.value=e.toFormat("hh:mm")}}var a=n("yar8"),u=n("ouMO"),d=n("rwco"),h=n("FXpb"),p=n("zsIO"),m=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};const _=d.a.get("hunt_optimizer/gui/MethodsForEpisodeView");class f extends p.a{constructor(e,t){super(),this.element=Object(h.h)({className:"hunt_optimizer_MethodsForEpisodeView"}),this.episode=t,this.enemy_types=o.a.filter(e=>Object(o.d)(e).episode===this.episode);const n=Object(u.c)(),s=this.add(new a.b({class:"hunt_optimizer_MethodsForEpisodeView_table",values:n,sort:e=>{n.sort((t,n)=>{for(const{column:s,direction:i}of e){let e=0;switch(s.key){case"method":e=t.name.localeCompare(n.name);break;case"time":e=t.time.val.as("minutes")-n.time.val.as("minutes");break;default:{const i=o.c[s.key];i&&(e=(t.enemy_counts.get(i)||0)-(n.enemy_counts.get(i)||0))}}if(0!==e)return i===a.a.Asc?e:-e}return 0})},columns:[{key:"method",title:"Method",fixed:!0,width:250,sortable:!0,render_cell:e=>e.name},{key:"time",title:"Time",fixed:!0,width:60,input:!0,sortable:!0,render_cell(e,t){const n=t.add(new c(e.time.val));return t.add(n.value.observe(({value:t})=>e.set_user_time(t))),n.element}},...this.enemy_types.map(e=>({key:o.c[e],title:Object(o.d)(e).simple_name,width:90,text_align:"right",sortable:!0,render_cell(t){const n=t.enemy_counts.get(e);return null==n?"":n.toString()}}))]}));this.element.append(s.element),this.disposables(e.current.observe(({value:e})=>m(this,void 0,void 0,(function*(){try{const t=yield e;this.hunt_methods_observer&&this.hunt_methods_observer.dispose(),this.hunt_methods_observer=t.methods.observe(({value:e})=>{n.val=e.filter(e=>e.episode===this.episode)},{call_now:!0})}catch(e){_.error("Couldn't load hunt optimizer store.",e)}})),{call_now:!0})),this.finalize_construction()}dispose(){super.dispose(),this.hunt_methods_observer&&this.hunt_methods_observer.dispose()}}n.d(t,"MethodsView",(function(){return v}));var b=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function l(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}c((s=s.apply(e,t||[])).next())}))};class v extends s.a{constructor(e,t){super(e,{class:"hunt_optimizer_MethodsView",tabs:[{title:"Episode I",key:"episode_1",path:"/methods/episode_1",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.I)}))}},{title:"Episode II",key:"episode_2",path:"/methods/episode_2",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.II)}))}},{title:"Episode IV",key:"episode_4",path:"/methods/episode_4",create_view:function(){return b(this,void 0,void 0,(function*(){return new f(t,i.b.IV)}))}}]}),this.finalize_construction()}}},yar8:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return c}));var s=n("TRid"),i=n("FXpb"),o=n("Tpfs");n("/KYB");const r=n("rwco").a.get("core/gui/Table");var l;!function(e){e[e.Asc=0]="Asc",e[e.Desc=1]="Desc"}(l||(l={}));class c extends s.a{constructor(e){super(e),this.tbody_element=Object(i.u)(),this.element=Object(i.t)({className:"core_Table"}),this.children=[],this.create_row=(e,t)=>{const n=new o.a;let s=0;return[Object(i.A)(...this.columns.map((o,l)=>{const c=o.fixed?Object(i.y)():Object(i.v)();try{const t=o.render_cell(e,n);c.append(t),o.input&&c.classList.add("input"),o.fixed&&(c.classList.add("fixed"),c.style.left=`${s}px`,s+=o.width||0),c.style.width=`${o.width}px`,o.text_align&&(c.style.textAlign=o.text_align),o.tooltip&&(c.title=o.tooltip(e))}catch(e){r.warning(`Error while rendering cell for index ${t}, column ${l}.`,e)}return c})),n]},this.update_footer=()=>{if(!this.footer_row_element)return;const e=this.columns.length;for(let t=0;t{const n=Object(i.y)({data:{index:t.toString()}},Object(i.s)(e.title));return e.fixed&&(n.style.position="sticky",n.style.left=`${c}px`,c+=e.width),n.style.width=`${e.width}px`,e.footer&&(a=!0),n}));const u=e.sort;u&&(s.onmousedown=e=>{if(e.target instanceof HTMLElement){let n=e.target;for(let e=0;e<5&&!n.dataset.index;e++){if(!n.parentElement)return;n=n.parentElement}if(!n.dataset.index)return;const s=parseInt(n.dataset.index,10),i=this.columns[s];if(!i.sortable)return;const o=t.findIndex(e=>e.column===i);if(0===o){const e=t[0];e.direction=e.direction===l.Asc?l.Desc:l.Asc}else-1!==o&&t.splice(o,1),t.unshift({column:i,direction:l.Asc});u(t)}}),n.append(s),this.tbody_element=Object(i.u)(),this.element.append(n,this.tbody_element),a&&(this.footer_row_element=Object(i.A)(),this.element.append(Object(i.x)({},this.footer_row_element)),this.create_footer()),this.disposables(Object(i.d)(this.tbody_element,this.values,this.create_row),this.values.observe(this.update_footer)),this.finalize_construction()}create_footer(){const e=[];let t=0;for(let n=0;n{if(t.target instanceof HTMLElement){const e=t.target.dataset.key;e&&this.activate_key(e)}},this.bar_element.onmousedown=this.bar_mousedown;for(const t of e.tabs){const e=Object(o.q)({className:"core_TabContainer_Tab",data:{key:t.key}},t.title);this.bar_element.append(e);const i=this.disposable(new s.a(t.create_view)),n=Object.assign(Object.assign({},t),{tab_element:e,lazy_view:i});this.tabs.push(n),this.panes_element.append(i.element)}this.element.append(this.bar_element,this.panes_element),this.finalize_construction()}get children(){return this.tabs.flatMap(t=>t.lazy_view.children)}resize(t,e){super.resize(t,e),this.bar_element.style.width=`${t}px`,this.bar_element.style.height=`${r}px`;const i=e-r;this.panes_element.style.width=`${t}px`,this.panes_element.style.height=`${i}px`;for(const e of this.tabs)e.lazy_view.resize(t,i);return this}activate(){if(this.active_tab)this.activate_tab(this.active_tab);else{let t;for(const e of this.tabs)null!=e.path&&this.gui_store.path.val.startsWith(e.path)&&(t=e);t?this.activate_tab(t):this.tabs.length&&this.activate_tab(this.tabs[0])}}activate_key(t){for(const e of this.tabs)if(e.key===t){this.activate_tab(e);break}}activate_tab(t){this.active_tab!==t&&(this.active_tab&&(this.active_tab.tab_element.classList.remove("active"),this.active_tab.lazy_view.visible.val=!1,this.active_tab.lazy_view.deactivate()),this.active_tab=t,t.tab_element.classList.add("active"),t.lazy_view.visible.val=!0),null!=t.path&&(this.gui_store.set_path_prefix(t.path),t.lazy_view.activate())}}},I7a6:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("nsCy"),n=i("rwco"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const r=n.c.get("core/persistence/Persister");class a{persist_for_server(t,e,i){this.persist(this.server_key(t,e),i)}persist(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){r.error(`Couldn't persist ${t}.`,e)}}load_for_server(t,e){return o(this,void 0,void 0,(function*(){return this.load(this.server_key(t,e))}))}load(t){return o(this,void 0,void 0,(function*(){try{const e=localStorage.getItem(t);return e&&JSON.parse(e)}catch(e){return void r.error(`Couldn't load ${t}.`,e)}}))}server_key(t,e){let i=e+".";switch(t){case s.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${s.g[t]} not supported.`)}return i}}},"Ix/i":function(t,e,i){"use strict";i.r(e);var s=i("HjM1"),n=i("zsIO"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};class r extends n.a{constructor(t,e,n){super(),this.tab_container=this.add(new s.a(t,{class:"hunt_optimizer_HuntOptimizerView",tabs:[{title:"Optimize",key:"optimize",path:"/optimize",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(6)]).then(i.bind(null,"FNQV"))).OptimizerView)(e)}))}},{title:"Methods",key:"methods",path:"/methods",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(8)]).then(i.bind(null,"GN66"))).MethodsView)(t,n)}))}},{title:"Help",key:"help",path:"/help",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(12)]).then(i.bind(null,"F0Xh"))).HelpView)}))}}]})),this.finalize_construction()}get element(){return this.tab_container.element}resize(t,e){super.resize(t,e),this.tab_container.resize(t,e)}}var a=i("nsCy"),c=i("sZ1+");class u{constructor(t,e,i,s){if(this.id=t,this.name=e,this.episode=i,this.enemy_counts=s,!t)throw new Error("id is required.");if(!e)throw new Error("name is required.");if(!s)throw new Error("enemyCounts is required.")}}var h=i("ouMO"),_=i("ExVU");class l{constructor(t,e,i,s){if(!t)throw new Error("id is required.");if(!_.Duration.isDuration(s))throw new Error("default_time must a valid duration.");if(!e)throw new Error("name is required.");if(!i)throw new Error("quest is required.");this.id=t,this.name=e,this.episode=i.episode,this.quest=i,this.enemy_counts=i.enemy_counts,this.default_time=s,this._user_time=Object(h.e)(void 0),this.user_time=this._user_time,this.time=this.user_time.map(t=>null!=t?t:this.default_time)}set_user_time(t){return this._user_time.val=t,this}}var d=i("kcKQ"),m=i("Ya0R"),f=i("rwco"),p=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const v=f.c.get("hunt_optimizer/stores/HuntMethodStore"),w=_.Duration.fromObject({minutes:30}),y=_.Duration.fromObject({minutes:45}),b=_.Duration.fromObject({minutes:45});function g(t,e,i){return new m.a(e,function(t,e){return i=>p(this,void 0,void 0,(function*(){const s=yield t.get(`/quests.${a.g[i].toLowerCase()}.json`).json(),n=[];for(const t of s){let e=0;const i=new Map;for(const[s,n]of Object.entries(t.enemy_counts)){const t=c.c[s];t?(i.set(t,n),e+=n):v.error(`No NpcType found for code ${s}.`)}switch(t.id){case 31:case 34:case 1305:case 1306:case 1307:case 313:case 314:continue}n.push(new l(`q${t.id}`,t.name,new u(t.id,t.name,t.episode,i),/^\d-\d.*/.test(t.name)?y:e>400?b:w))}return yield e.load_method_user_times(n,i),new z(e,i,n)}))}(t,i))}class z extends d.a{constructor(t,e,i){super(),this.methods=Object(h.c)(t=>[t.user_time],...i),this.disposables(this.methods.observe_list(()=>t.persist_method_user_times(this.methods.val,e)))}}var O=i("lLyO"),x=i.n(O);class j{constructor(t,e){this.item_type=t,this._amount=Object(h.e)(e),this.amount=this._amount}set_amount(t){return this._amount.val=t,this}}class k{constructor(t,e){this.wanted_items=t,this.optimal_methods=e}}class M{constructor(t,e,i,s,n,o,r){this.difficulty=t,this.section_ids=e,this.method_name=i,this.method_episode=s,this.method_time=n,this.runs=o,this.item_counts=r,this.total_time=_.Duration.fromMillis(o*n.as("milliseconds"))}}var P=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};function $(t,e,i,s,n){return new m.a(t,function(t,e,i,s){return n=>P(this,void 0,void 0,(function*(){return new q(t,n,yield e.get(n),yield i.get(n),yield s.get(n))}))}(e,i,s,n))}class q extends d.a{constructor(t,e,i,s,n){super(),this.hunt_optimizer_persister=t,this.server=e,this.item_drop_store=s,this._wanted_items=Object(h.c)(t=>[t.amount]),this.wanted_items=this._wanted_items,this.optimize=(t,e)=>{if(!t.length)return;const i=new Set(t.filter(t=>t.amount.val>0).map(t=>t.item_type)),s=this.item_drop_store.enemy_drops,n={};for(const t of this.wanted_items.val)n[t.item_type.name]={min:t.amount.val};const o={},r=new Map;for(const t of e){const e=new Map;for(const[i,s]of t.enemy_counts.entries()){const t=e.get(i)||0,n=Object(c.d)(i);if(null==n.rare_type)e.set(i,t+s);else{let o,r;n.rare_type===c.c.Kondrieu?(o=1-a.c,r=a.c):(o=1-a.d,r=a.d),e.set(i,t+s*o),e.set(n.rare_type,(e.get(n.rare_type)||0)+s*r)}}const n=[e],u=e.get(c.c.PanArms);if(u){const t=new Map(e);t.delete(c.c.PanArms),t.set(c.c.Migium,u),t.set(c.c.Hidoom,u),n.push(t)}const h=e.get(c.c.PanArms2);if(h){const t=new Map(e);t.delete(c.c.PanArms2),t.set(c.c.Migium2,h),t.set(c.c.Hidoom2,h),n.push(t)}for(let e=0;eP(this,void 0,void 0,(function*(){this._wanted_items.val=yield this.hunt_optimizer_persister.load_wanted_items(this.server),this.disposable(this._wanted_items.observe(({value:t})=>{this.hunt_optimizer_persister.persist_wanted_items(this.server,t)}))})),this.huntable_item_types=i.item_types.filter(t=>s.enemy_drops.get_drops_for_item_type(t.id).length),this.result=Object(h.d)(this.optimize,this.wanted_items,n.methods),this.initialize_persistence()}add_wanted_item(t){this._wanted_items.val.find(e=>e.item_type===t)||this._wanted_items.push(new j(t,1))}remove_wanted_item(t){this._wanted_items.remove(t)}full_method_name(t,e,i,s){let n=`${t}\t${e}\t${i.id}`;return s&&(n+="\tspa"),n}}var E=i("I7a6"),T=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const H="HuntMethodStore.methodUserTimes";class N extends E.a{persist_method_user_times(t,e){const i={};for(const e of t)null!=e.user_time.val&&(i[e.id]=e.user_time.val.as("hours"));this.persist_for_server(e,H,i)}load_method_user_times(t,e){return T(this,void 0,void 0,(function*(){const i=yield this.load_for_server(e,H);if(i)for(const e of t){const t=i[e.id];e.set_user_time(null==t?void 0:_.Duration.fromObject({hours:t}))}}))}}var S=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const C="HuntOptimizerStore.wantedItems";class I extends E.a{constructor(t){super(),this.item_type_stores=t}persist_wanted_items(t,e){this.persist_for_server(t,C,e.map(({item_type:t,amount:e})=>({itemTypeId:t.id,amount:e.val})))}load_wanted_items(t){return S(this,void 0,void 0,(function*(){const e=yield this.item_type_stores.get(t),i=yield this.load_for_server(t,C),s=[];if(i)for(const{itemTypeId:t,itemKindId:n,amount:o}of i){const i=null!=t?e.get_by_id(t):e.get_by_id(n);i&&s.push(new j(i,o))}return s}))}}var D=i("Tpfs");function A(t,e,i,s){const n=new D.a,o=n.add(g(t,e,new N)),a=n.add($(e,new I(i),i,s,o));return{view:n.add(new r(e,a,o)),dispose(){n.dispose()}}}i.d(e,"initialize_hunt_optimizer",(function(){return A}))}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{HjM1:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("39ZU"),n=i("nN8q"),o=(i("4AvX"),i("FXpb"));const r=28;class a extends n.a{constructor(t,e){super(e),this.gui_store=t,this.tabs=[],this.bar_element=Object(o.h)({className:"core_TabContainer_Bar"}),this.panes_element=Object(o.h)({className:"core_TabContainer_Panes"}),this.element=Object(o.h)({className:"core_TabContainer"}),this.bar_mousedown=t=>{if(t.target instanceof HTMLElement){const e=t.target.dataset.key;e&&this.activate_key(e)}},this.bar_element.onmousedown=this.bar_mousedown;for(const t of e.tabs){const e=Object(o.s)({className:"core_TabContainer_Tab",data:{key:t.key}},t.title);this.bar_element.append(e);const i=this.disposable(new s.a(t.create_view)),n=Object.assign(Object.assign({},t),{tab_element:e,lazy_view:i});this.tabs.push(n),this.panes_element.append(i.element)}this.element.append(this.bar_element,this.panes_element),this.finalize_construction()}get children(){return this.tabs.flatMap(t=>t.lazy_view.children)}resize(t,e){super.resize(t,e),this.bar_element.style.width=`${t}px`,this.bar_element.style.height=`${r}px`;const i=e-r;this.panes_element.style.width=`${t}px`,this.panes_element.style.height=`${i}px`;for(const e of this.tabs)e.lazy_view.resize(t,i);return this}activate(){if(this.active_tab)this.activate_tab(this.active_tab);else{let t;for(const e of this.tabs)null!=e.path&&this.gui_store.path.val.startsWith(e.path)&&(t=e);t?this.activate_tab(t):this.tabs.length&&this.activate_tab(this.tabs[0])}}activate_key(t){for(const e of this.tabs)if(e.key===t){this.activate_tab(e);break}}activate_tab(t){this.active_tab!==t&&(this.active_tab&&(this.active_tab.tab_element.classList.remove("active"),this.active_tab.lazy_view.visible.val=!1,this.active_tab.lazy_view.deactivate()),this.active_tab=t,t.tab_element.classList.add("active"),t.lazy_view.visible.val=!0),null!=t.path&&(this.gui_store.set_path_prefix(t.path),t.lazy_view.activate())}}},I7a6:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("nsCy"),n=i("rwco"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const r=n.a.get("core/persistence/Persister");class a{persist_for_server(t,e,i){this.persist(this.server_key(t,e),i)}persist(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){r.error(`Couldn't persist ${t}.`,e)}}load_for_server(t,e){return o(this,void 0,void 0,(function*(){return this.load(this.server_key(t,e))}))}load(t){return o(this,void 0,void 0,(function*(){try{const e=localStorage.getItem(t);return e&&JSON.parse(e)}catch(e){return void r.error(`Couldn't load ${t}.`,e)}}))}server_key(t,e){let i=e+".";switch(t){case s.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${s.g[t]} not supported.`)}return i}}},"Ix/i":function(t,e,i){"use strict";i.r(e);var s=i("HjM1"),n=i("zsIO"),o=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};class r extends n.a{constructor(t,e,n){super(),this.tab_container=this.add(new s.a(t,{class:"hunt_optimizer_HuntOptimizerView",tabs:[{title:"Optimize",key:"optimize",path:"/optimize",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(6)]).then(i.bind(null,"FNQV"))).OptimizerView)(e)}))}},{title:"Methods",key:"methods",path:"/methods",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(8)]).then(i.bind(null,"GN66"))).MethodsView)(t,n)}))}},{title:"Help",key:"help",path:"/help",create_view:function(){return o(this,void 0,void 0,(function*(){return new((yield Promise.all([i.e(1),i.e(12)]).then(i.bind(null,"F0Xh"))).HelpView)}))}}]})),this.finalize_construction()}get element(){return this.tab_container.element}resize(t,e){super.resize(t,e),this.tab_container.resize(t,e)}}var a=i("nsCy"),c=i("sZ1+");class u{constructor(t,e,i,s){if(this.id=t,this.name=e,this.episode=i,this.enemy_counts=s,!t)throw new Error("id is required.");if(!e)throw new Error("name is required.");if(!s)throw new Error("enemyCounts is required.")}}var h=i("ouMO"),_=i("ExVU");class l{constructor(t,e,i,s){if(!t)throw new Error("id is required.");if(!_.Duration.isDuration(s))throw new Error("default_time must a valid duration.");if(!e)throw new Error("name is required.");if(!i)throw new Error("quest is required.");this.id=t,this.name=e,this.episode=i.episode,this.quest=i,this.enemy_counts=i.enemy_counts,this.default_time=s,this._user_time=Object(h.e)(void 0),this.user_time=this._user_time,this.time=this.user_time.map(t=>null!=t?t:this.default_time)}set_user_time(t){return this._user_time.val=t,this}}var d=i("kcKQ"),m=i("Ya0R"),f=i("rwco"),p=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const v=f.a.get("hunt_optimizer/stores/HuntMethodStore"),w=_.Duration.fromObject({minutes:30}),y=_.Duration.fromObject({minutes:45}),b=_.Duration.fromObject({minutes:45});function g(t,e,i){return new m.a(e,function(t,e){return i=>p(this,void 0,void 0,(function*(){const s=yield t.get(`/quests.${a.g[i].toLowerCase()}.json`).json(),n=[];for(const t of s){let e=0;const i=new Map;for(const[s,n]of Object.entries(t.enemy_counts)){const t=c.c[s];t?(i.set(t,n),e+=n):v.error(`No NpcType found for code ${s}.`)}switch(t.id){case 31:case 34:case 1305:case 1306:case 1307:case 313:case 314:continue}n.push(new l(`q${t.id}`,t.name,new u(t.id,t.name,t.episode,i),/^\d-\d.*/.test(t.name)?y:e>400?b:w))}return yield e.load_method_user_times(n,i),new z(e,i,n)}))}(t,i))}class z extends d.a{constructor(t,e,i){super(),this.methods=Object(h.c)(t=>[t.user_time],...i),this.disposables(this.methods.observe_list(()=>t.persist_method_user_times(this.methods.val,e)))}}var O=i("lLyO"),x=i.n(O);class j{constructor(t,e){this.item_type=t,this._amount=Object(h.e)(e),this.amount=this._amount}set_amount(t){return this._amount.val=t,this}}class k{constructor(t,e){this.wanted_items=t,this.optimal_methods=e}}class M{constructor(t,e,i,s,n,o,r){this.difficulty=t,this.section_ids=e,this.method_name=i,this.method_episode=s,this.method_time=n,this.runs=o,this.item_counts=r,this.total_time=_.Duration.fromMillis(o*n.as("milliseconds"))}}var P=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};function $(t,e,i,s,n){return new m.a(t,function(t,e,i,s){return n=>P(this,void 0,void 0,(function*(){return new E(t,n,yield e.get(n),yield i.get(n),yield s.get(n))}))}(e,i,s,n))}class E extends d.a{constructor(t,e,i,s,n){super(),this.hunt_optimizer_persister=t,this.server=e,this.item_drop_store=s,this._wanted_items=Object(h.c)(t=>[t.amount]),this.wanted_items=this._wanted_items,this.optimize=(t,e)=>{if(!t.length)return;const i=new Set(t.filter(t=>t.amount.val>0).map(t=>t.item_type)),s=this.item_drop_store.enemy_drops,n={};for(const t of this.wanted_items.val)n[t.item_type.name]={min:t.amount.val};const o={},r=new Map;for(const t of e){const e=new Map;for(const[i,s]of t.enemy_counts.entries()){const t=e.get(i)||0,n=Object(c.d)(i);if(null==n.rare_type)e.set(i,t+s);else{let o,r;n.rare_type===c.c.Kondrieu?(o=1-a.c,r=a.c):(o=1-a.d,r=a.d),e.set(i,t+s*o),e.set(n.rare_type,(e.get(n.rare_type)||0)+s*r)}}const n=[e],u=e.get(c.c.PanArms);if(u){const t=new Map(e);t.delete(c.c.PanArms),t.set(c.c.Migium,u),t.set(c.c.Hidoom,u),n.push(t)}const h=e.get(c.c.PanArms2);if(h){const t=new Map(e);t.delete(c.c.PanArms2),t.set(c.c.Migium2,h),t.set(c.c.Hidoom2,h),n.push(t)}for(let e=0;eP(this,void 0,void 0,(function*(){this._wanted_items.val=yield this.hunt_optimizer_persister.load_wanted_items(this.server),this.disposable(this._wanted_items.observe(({value:t})=>{this.hunt_optimizer_persister.persist_wanted_items(this.server,t)}))})),this.huntable_item_types=i.item_types.filter(t=>s.enemy_drops.get_drops_for_item_type(t.id).length),this.result=Object(h.d)(this.optimize,this.wanted_items,n.methods),this.initialize_persistence()}add_wanted_item(t){this._wanted_items.val.find(e=>e.item_type===t)||this._wanted_items.push(new j(t,1))}remove_wanted_item(t){this._wanted_items.remove(t)}full_method_name(t,e,i,s){let n=`${t}\t${e}\t${i.id}`;return s&&(n+="\tspa"),n}}var T=i("I7a6"),q=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const H="HuntMethodStore.methodUserTimes";class N extends T.a{persist_method_user_times(t,e){const i={};for(const e of t)null!=e.user_time.val&&(i[e.id]=e.user_time.val.as("hours"));this.persist_for_server(e,H,i)}load_method_user_times(t,e){return q(this,void 0,void 0,(function*(){const i=yield this.load_for_server(e,H);if(i)for(const e of t){const t=i[e.id];e.set_user_time(null==t?void 0:_.Duration.fromObject({hours:t}))}}))}}var S=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}c((s=s.apply(t,e||[])).next())}))};const C="HuntOptimizerStore.wantedItems";class I extends T.a{constructor(t){super(),this.item_type_stores=t}persist_wanted_items(t,e){this.persist_for_server(t,C,e.map(({item_type:t,amount:e})=>({itemTypeId:t.id,amount:e.val})))}load_wanted_items(t){return S(this,void 0,void 0,(function*(){const e=yield this.item_type_stores.get(t),i=yield this.load_for_server(t,C),s=[];if(i)for(const{itemTypeId:t,itemKindId:n,amount:o}of i){const i=null!=t?e.get_by_id(t):e.get_by_id(n);i&&s.push(new j(i,o))}return s}))}}var D=i("Tpfs");function A(t,e,i,s){const n=new D.a,o=n.add(g(t,e,new N)),a=n.add($(e,new I(i),i,s,o));return{view:n.add(new r(e,a,o)),dispose(){n.dispose()}}}i.d(e,"initialize_hunt_optimizer",(function(){return A}))}}]); \ No newline at end of file diff --git a/a4d592df6dd06fe18358.worker.js b/f44b87d30b148fb9b4ec.worker.js similarity index 77% rename from a4d592df6dd06fe18358.worker.js rename to f44b87d30b148fb9b4ec.worker.js index 2e947ca1..054de499 100644 --- a/a4d592df6dd06fe18358.worker.js +++ b/f44b87d30b148fb9b4ec.worker.js @@ -1 +1 @@ -!function(i){var e={};function o(d){if(e[d])return e[d].exports;var v=e[d]={i:d,l:!1,exports:{}};return i[d].call(v.exports,v,v.exports,o),v.l=!0,v.exports}o.m=i,o.c=e,o.d=function(i,e,d){o.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:d})},o.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,e){if(1&e&&(i=o(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var d=Object.create(null);if(o.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var v in i)o.d(d,v,function(e){return i[e]}.bind(null,v));return d},o.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(e,"a",e),e},o.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},o.p="",o(o.s="yL6M")}({yL6M:function(i,e,o){"use strict";var d,v;o.r(e),function(i){i[i.NewAssembly=0]="NewAssembly",i[i.AssemblyChange=1]="AssemblyChange",i[i.SignatureHelp=2]="SignatureHelp",i[i.Definition=3]="Definition",i[i.SettingsChange=4]="SettingsChange"}(d||(d={})),function(i){i[i.NewObjectCode=0]="NewObjectCode",i[i.SignatureHelp=1]="SignatureHelp",i[i.Definition=2]="Definition"}(v||(v={}));const t=new DataView(new ArrayBuffer(4));var n,s;!function(i){i[i.Int=0]="Int",i[i.Float=1]="Float",i[i.InvalidNumber=2]="InvalidNumber",i[i.Register=3]="Register",i[i.Label=4]="Label",i[i.CodeSection=5]="CodeSection",i[i.DataSection=6]="DataSection",i[i.StringSection=7]="StringSection",i[i.InvalidSection=8]="InvalidSection",i[i.String=9]="String",i[i.UnterminatedString=10]="UnterminatedString",i[i.Ident=11]="Ident",i[i.InvalidIdent=12]="InvalidIdent",i[i.ArgSeparator=13]="ArgSeparator"}(n||(n={}));class r{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(i){this.line=i,this.index=0,this._mark=0;const e=[];for(;this.has_next();){const i=this.peek();let o;if("/"===i){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(i)?this.skip():(/[-\d]/.test(i)?o=this.tokenize_number_or_label():","===i?(o={type:n.ArgSeparator,col:this.col,len:1},this.skip()):o="."===i?this.tokenize_section():'"'===i?this.tokenize_string():"r"===i?this.tokenize_register_or_ident():this.tokenize_ident(),e.push(o))}return e}has_next(){return this.index!]*$/.test(e)?n.Ident:n.InvalidIdent;return o===n.Ident?{type:o,col:i,len:this.marked_len(),value:e}:{type:o,col:i,len:this.marked_len()}}}!function(i){i[i.Any=0]="Any",i[i.Byte=1]="Byte",i[i.Word=2]="Word",i[i.DWord=3]="DWord",i[i.Float=4]="Float",i[i.Label=5]="Label",i[i.ILabel=6]="ILabel",i[i.DLabel=7]="DLabel",i[i.SLabel=8]="SLabel",i[i.String=9]="String",i[i.ILabelVar=10]="ILabelVar",i[i.RegRef=11]="RegRef",i[i.RegTupRef=12]="RegTupRef",i[i.RegRefVar=13]="RegRefVar",i[i.Pointer=14]="Pointer"}(s||(s={}));const a={kind:s.Any},l={kind:s.Byte},u={kind:s.Word},_={kind:s.DWord},p={kind:s.Float},g={kind:s.Label},f={kind:s.ILabel},c={kind:s.DLabel},k={kind:s.SLabel},R={kind:s.String},h={kind:s.ILabelVar},w={kind:s.RegRef},b={kind:s.RegRefVar},m={kind:s.Pointer},T=-Math.pow(2,31),y=Math.pow(2,31)-1;Math.pow(2,32);var P,W;function S(i,e,o){return{type:i,doc:e,access:o}}!function(i){i[i.Read=0]="Read",i[i.Write=1]="Write",i[i.ReadWrite=2]="ReadWrite"}(P||(P={})),function(i){i[i.Push=0]="Push",i[i.Pop=1]="Pop"}(W||(W={}));const x=[],I=new Map;function j(i,e,o,d,v){return{code:i,mnemonic:e,doc:o,size:i<256?1:2,params:d,stack:v}}x[0]=j(0,"nop","No operation, does nothing.",[],void 0);const L=x[1]=j(1,"ret","Returns control to caller.",[],void 0),z=(x[2]=j(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),x[3]=j(3,"exit",void 0,[S(_,void 0,void 0)],W.Pop),x[4]=j(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[S(f,void 0,void 0)],void 0),x[5]=j(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),x[6]=j(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),x[7]=j(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[S(f,void 0,void 0)],void 0)),D=x[8]=j(8,"let","Sets the first register's value to second one's value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),C=x[9]=j(9,"leti","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),M=x[10]=j(10,"letb","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(l,void 0,void 0)],void 0),$=x[11]=j(11,"letw","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0),S(u,void 0,void 0)],void 0),N=(x[12]=j(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[13]=j(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S(g,void 0,void 0)],void 0),x[14]=j(14,"unknown_0e",void 0,[],void 0),x[15]=j(15,"unknown_0f",void 0,[],void 0),x[16]=j(16,"set","Sets a register to 1.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),A=x[17]=j(17,"clear","Sets a register to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),q=x[18]=j(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.ReadWrite)]},void 0,void 0)],void 0),F=(x[19]=j(19,"gset",void 0,[S(u,void 0,void 0)],void 0),x[20]=j(20,"gclear",void 0,[S(u,void 0,void 0)],void 0),x[21]=j(21,"grev",void 0,[S(u,void 0,void 0)],void 0),x[22]=j(22,"glet",void 0,[S(u,void 0,void 0)],void 0),x[23]=j(23,"gget","Sets a register to value of the given flag.",[S(u,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0)],void 0),x[24]=j(24,"add",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[25]=j(25,"addi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),E=(x[26]=j(26,"sub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[27]=j(27,"subi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),O=(x[28]=j(28,"mul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[29]=j(29,"muli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),U=(x[30]=j(30,"div",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[31]=j(31,"divi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),V=(x[32]=j(32,"and",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[33]=j(33,"andi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[34]=j(34,"or",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[35]=j(35,"ori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[36]=j(36,"xor",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[37]=j(37,"xori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[38]=j(38,"mod",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[39]=j(39,"modi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[40]=j(40,"jmp",void 0,[S(f,void 0,void 0)],void 0)),B=x[41]=j(41,"call",void 0,[S(f,void 0,void 0)],void 0),H=x[42]=j(42,"jmp_on",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),J=x[43]=j(43,"jmp_off",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),Y=x[44]=j(44,"jmp_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),X=x[45]=j(45,"jmpi_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),Z=x[46]=j(46,"jmp_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),G=x[47]=j(47,"jmpi_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),K=x[48]=j(48,"ujmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),Q=x[49]=j(49,"ujmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ii=x[50]=j(50,"jmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ei=x[51]=j(51,"jmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),oi=x[52]=j(52,"ujmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),di=x[53]=j(53,"ujmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),vi=x[54]=j(54,"jmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ti=x[55]=j(55,"jmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ni=x[56]=j(56,"ujmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),si=x[57]=j(57,"ujmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ri=x[58]=j(58,"jmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ai=x[59]=j(59,"jmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),li=x[60]=j(60,"ujmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ui=x[61]=j(61,"ujmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),_i=x[62]=j(62,"jmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),pi=x[63]=j(63,"jmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),gi=x[64]=j(64,"switch_jmp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),fi=x[65]=j(65,"switch_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),ci=(x[66]=j(66,"stack_push",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[67]=j(67,"stack_pop",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[68]=j(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[S(w,void 0,P.Read),S(_,void 0,void 0)],void 0)),ki=x[69]=j(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[S(w,void 0,P.Write),S(_,void 0,void 0)],void 0),Ri=(x[70]=j(70,"unknown_46",void 0,[],void 0),x[71]=j(71,"unknown_47",void 0,[],void 0),x[72]=j(72,"arg_pushr","Pushes the value of the given register onto the stack.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push)),hi=x[73]=j(73,"arg_pushl","Pushes the given value onto the stack.",[S(_,void 0,void 0)],W.Push),wi=x[74]=j(74,"arg_pushb","Pushes the given value onto the stack.",[S(l,void 0,void 0)],W.Push),bi=x[75]=j(75,"arg_pushw","Pushes the given value onto the stack.",[S(u,void 0,void 0)],W.Push),mi=(x[76]=j(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push),x[77]=j(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[S(g,void 0,void 0)],W.Push),x[78]=j(78,"arg_pushs","Pushes the given value onto the stack.",[S(R,void 0,void 0)],W.Push)),Ti=(x[79]=j(79,"unknown_4f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[80]=j(80,"message",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[81]=j(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[82]=j(82,"fadein",void 0,[],void 0),x[83]=j(83,"fadeout",void 0,[],void 0),x[84]=j(84,"se",void 0,[S(_,void 0,void 0)],W.Pop),x[85]=j(85,"bgm",void 0,[S(_,void 0,void 0)],W.Pop),x[86]=j(86,"unknown_56",void 0,[],void 0),x[87]=j(87,"unknown_57",void 0,[],void 0),x[88]=j(88,"enable",void 0,[S(_,void 0,void 0)],W.Pop),x[89]=j(89,"disable",void 0,[S(_,void 0,void 0)],W.Pop),x[90]=j(90,"window_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[91]=j(91,"add_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[92]=j(92,"mesend",void 0,[],void 0),x[93]=j(93,"gettime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[94]=j(94,"winend",void 0,[],void 0),x[95]=j(95,"unknown_5f",void 0,[],void 0),x[96]=j(96,"npc_crt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[97]=j(97,"npc_stop",void 0,[S(_,void 0,void 0)],W.Pop),x[98]=j(98,"npc_play",void 0,[S(_,void 0,void 0)],W.Pop),x[99]=j(99,"npc_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[100]=j(100,"npc_nont",void 0,[],void 0),x[101]=j(101,"npc_talk",void 0,[],void 0),x[102]=j(102,"npc_crp_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read),S(f,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[103]=j(103,"unknown_67",void 0,[],void 0),x[104]=j(104,"create_pipe",void 0,[S(_,void 0,void 0)],W.Pop),x[105]=j(105,"p_hpstat_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[106]=j(106,"p_dead_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0)],W.Pop),x[107]=j(107,"p_disablewarp",void 0,[],void 0),x[108]=j(108,"p_enablewarp",void 0,[],void 0),x[109]=j(109,"p_move_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[110]=j(110,"p_look",void 0,[S(_,void 0,void 0)],W.Pop),x[111]=j(111,"unknown_6f",void 0,[],void 0),x[112]=j(112,"p_action_disable",void 0,[],void 0),x[113]=j(113,"p_action_enable",void 0,[],void 0),x[114]=j(114,"disable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[115]=j(115,"enable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[116]=j(116,"p_noncol",void 0,[],void 0),x[117]=j(117,"p_col",void 0,[],void 0),x[118]=j(118,"p_setpos","Sets a player's position.",[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Y-axis rotation.",P.Read)]},void 0,void 0)],W.Pop),x[119]=j(119,"p_return_guild",void 0,[],void 0),x[120]=j(120,"p_talk_guild",void 0,[S(_,void 0,void 0)],W.Pop),x[121]=j(121,"npc_talk_pl_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[122]=j(122,"npc_talk_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[123]=j(123,"npc_crtpk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[124]=j(124,"npc_crppk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[125]=j(125,"npc_crptalk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[126]=j(126,"p_look_at_v1",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[127]=j(127,"npc_crp_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[128]=j(128,"cam_quake",void 0,[],void 0),x[129]=j(129,"cam_adj",void 0,[],void 0),x[130]=j(130,"cam_zmin",void 0,[],void 0),x[131]=j(131,"cam_zmout",void 0,[],void 0),x[132]=j(132,"cam_pan_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[133]=j(133,"game_lev_super",void 0,[],void 0),x[134]=j(134,"game_lev_reset",void 0,[],void 0),x[135]=j(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[136]=j(136,"if_zone_clear",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),yi=(x[137]=j(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[138]=j(138,"unhide_obj",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[139]=j(139,"unhide_ene",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[140]=j(140,"at_coords_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[141]=j(141,"at_coords_talk",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[142]=j(142,"col_npcin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[143]=j(143,"col_npcinr",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[144]=j(144,"switch_on",void 0,[S(_,void 0,void 0)],W.Pop),x[145]=j(145,"switch_off",void 0,[S(_,void 0,void 0)],W.Pop),x[146]=j(146,"playbgm_epi",void 0,[S(_,void 0,void 0)],W.Pop),x[147]=j(147,"set_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[148]=j(148,"set_obj_param","Creates a targetable object.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Collision radius.",P.Read),S(f,"Function label.",P.Read),S(_,"Vertical position of the cursor.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},"Object handle.",void 0)],void 0),x[149]=j(149,"set_floor_handler",void 0,[S(_,"Floor number.",void 0),S(f,"Handler function label.",void 0)],W.Pop),x[150]=j(150,"clr_floor_handler",void 0,[S(_,"Floor number.",void 0)],W.Pop),x[151]=j(151,"col_plinaw",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[152]=j(152,"hud_hide",void 0,[],void 0),x[153]=j(153,"hud_show",void 0,[],void 0),x[154]=j(154,"cine_enable",void 0,[],void 0),x[155]=j(155,"cine_disable",void 0,[],void 0),x[156]=j(156,"unknown_9c",void 0,[],void 0),x[157]=j(157,"unknown_9d",void 0,[],void 0),x[158]=j(158,"unknown_9e",void 0,[],void 0),x[159]=j(159,"unknown_9f",void 0,[],void 0),x[160]=j(160,"unknown_a0",void 0,[],void 0),x[161]=j(161,"set_qt_failure",void 0,[S(f,void 0,void 0)],void 0),x[162]=j(162,"set_qt_success",void 0,[S(f,void 0,void 0)],void 0),x[163]=j(163,"clr_qt_failure",void 0,[],void 0),x[164]=j(164,"clr_qt_success",void 0,[],void 0),x[165]=j(165,"set_qt_cancel",void 0,[S(f,void 0,void 0)],void 0),x[166]=j(166,"clr_qt_cancel",void 0,[],void 0),x[167]=j(167,"unknown_a7",void 0,[],void 0),x[168]=j(168,"pl_walk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[169]=j(169,"unknown_a9",void 0,[],void 0),x[170]=j(170,"unknown_aa",void 0,[],void 0),x[171]=j(171,"unknown_ab",void 0,[],void 0),x[172]=j(172,"unknown_ac",void 0,[],void 0),x[173]=j(173,"unknown_ad",void 0,[],void 0),x[174]=j(174,"unknown_ae",void 0,[],void 0),x[175]=j(175,"unknown_af",void 0,[],void 0),x[176]=j(176,"pl_add_meseta",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[177]=j(177,"thread_stg",void 0,[S(f,void 0,void 0)],void 0),x[178]=j(178,"del_obj_param",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},"Object handle.",void 0)],void 0),x[179]=j(179,"item_create",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[180]=j(180,"item_create2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[181]=j(181,"item_delete",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[182]=j(182,"item_delete2","Deletes an item from the player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[183]=j(183,"item_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[184]=j(184,"setevt",void 0,[S(_,void 0,void 0)],W.Pop),x[185]=j(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),Pi=(x[186]=j(186,"set_qt_exit",void 0,[S(f,void 0,void 0)],void 0),x[187]=j(187,"clr_qt_exit",void 0,[],void 0),x[188]=j(188,"unknown_bc",void 0,[],void 0),x[189]=j(189,"unknown_bd",void 0,[],void 0),x[190]=j(190,"unknown_be",void 0,[],void 0),x[191]=j(191,"unknown_bf",void 0,[],void 0),x[192]=j(192,"particle_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[193]=j(193,"npc_text",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[194]=j(194,"npc_chkwarp",void 0,[],void 0),x[195]=j(195,"pl_pkoff",void 0,[],void 0),x[196]=j(196,"map_designate",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0)),Wi=(x[197]=j(197,"masterkey_on",void 0,[],void 0),x[198]=j(198,"masterkey_off",void 0,[],void 0),x[199]=j(199,"window_time",void 0,[],void 0),x[200]=j(200,"winend_time",void 0,[],void 0),x[201]=j(201,"winset_time",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[202]=j(202,"getmtime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[203]=j(203,"set_quest_board_handler",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[204]=j(204,"clear_quest_board_handler",void 0,[S(_,void 0,void 0)],W.Pop),x[205]=j(205,"particle_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[206]=j(206,"npc_crptalk_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[207]=j(207,"npc_lang_clean",void 0,[],void 0),x[208]=j(208,"pl_pkon",void 0,[],void 0),x[209]=j(209,"pl_chk_item2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[210]=j(210,"enable_mainmenu",void 0,[],void 0),x[211]=j(211,"disable_mainmenu",void 0,[],void 0),x[212]=j(212,"start_battlebgm",void 0,[],void 0),x[213]=j(213,"end_battlebgm",void 0,[],void 0),x[214]=j(214,"disp_msg_qb",void 0,[S(R,void 0,void 0)],W.Pop),x[215]=j(215,"close_msg_qb",void 0,[],void 0),x[216]=j(216,"set_eventflag_v3",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[217]=j(217,"sync_leti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),Si=(x[218]=j(218,"set_returnhunter",void 0,[],void 0),x[219]=j(219,"set_returncity",void 0,[],void 0),x[220]=j(220,"load_pvr",void 0,[],void 0),x[221]=j(221,"load_midi",void 0,[],void 0),x[222]=j(222,"unknown_de",void 0,[],void 0),x[223]=j(223,"npc_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[224]=j(224,"pad_dragon",void 0,[],void 0),x[225]=j(225,"clear_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[226]=j(226,"pcam_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[227]=j(227,"start_setevt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[228]=j(228,"warp_on",void 0,[],void 0),x[229]=j(229,"warp_off",void 0,[],void 0),x[230]=j(230,"get_slotnumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),xi=(x[231]=j(231,"get_servernumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[232]=j(232,"set_eventflag2",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[233]=j(233,"res",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[234]=j(234,"unknown_ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[235]=j(235,"enable_bgmctrl",void 0,[S(_,void 0,void 0)],W.Pop),x[236]=j(236,"sw_send",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[237]=j(237,"create_bgmctrl",void 0,[],void 0),x[238]=j(238,"pl_add_meseta2",void 0,[S(_,void 0,void 0)],W.Pop),x[239]=j(239,"sync_register",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[240]=j(240,"send_regwork",void 0,[],void 0),x[241]=j(241,"leti_fixed_camera_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[242]=j(242,"default_camera_pos1",void 0,[],void 0),x[243]=j(243,"unknown_f3",void 0,[],void 0),x[244]=j(244,"unknown_f4",void 0,[],void 0),x[245]=j(245,"unknown_f5",void 0,[],void 0),x[246]=j(246,"unknown_f6",void 0,[],void 0),x[247]=j(247,"unknown_f7",void 0,[],void 0),x[248]=j(248,"unknown_f8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[249]=j(249,"unknown_f9",void 0,[],void 0),x[250]=j(250,"get_gc_number",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[251]=j(251,"unknown_fb",void 0,[S(u,void 0,void 0)],void 0),x[252]=j(252,"unknown_fc",void 0,[],void 0),x[253]=j(253,"unknown_fd",void 0,[],void 0),x[254]=j(254,"unknown_fe",void 0,[],void 0),x[255]=j(255,"unknown_ff",void 0,[],void 0),x[63488]=j(63488,"unknown_f800",void 0,[],void 0),x[63489]=j(63489,"set_chat_callback",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63490]=j(63490,"unknown_f802",void 0,[],void 0),x[63491]=j(63491,"unknown_f803",void 0,[],void 0),x[63492]=j(63492,"unknown_f804",void 0,[],void 0),x[63493]=j(63493,"unknown_f805",void 0,[],void 0),x[63494]=j(63494,"unknown_f806",void 0,[],void 0),x[63495]=j(63495,"unknown_f807",void 0,[],void 0),x[63496]=j(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63497]=j(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63498]=j(63498,"get_coord_of_player","Retrieves a player's position.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Write),S(_,"Y coordinate.",P.Write),S(_,"Z coordinate.",P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63499]=j(63499,"enable_map",void 0,[],void 0),x[63500]=j(63500,"disable_map",void 0,[],void 0),x[63501]=j(63501,"map_designate_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),Ii=(x[63502]=j(63502,"unknown_f80e",void 0,[S(_,void 0,void 0)],W.Pop),x[63503]=j(63503,"unknown_f80f",void 0,[S(_,void 0,void 0)],W.Pop),x[63504]=j(63504,"ba_initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63505]=j(63505,"set_ba_rules",void 0,[],void 0),x[63506]=j(63506,"unknown_f812",void 0,[S(_,void 0,void 0)],W.Pop),x[63507]=j(63507,"unknown_f813",void 0,[S(_,void 0,void 0)],W.Pop),x[63508]=j(63508,"unknown_f814",void 0,[S(_,void 0,void 0)],W.Pop),x[63509]=j(63509,"unknown_f815",void 0,[S(_,void 0,void 0)],W.Pop),x[63510]=j(63510,"unknown_f816",void 0,[S(_,void 0,void 0)],W.Pop),x[63511]=j(63511,"unknown_f817",void 0,[S(_,void 0,void 0)],W.Pop),x[63512]=j(63512,"unknown_f818",void 0,[S(_,void 0,void 0)],W.Pop),x[63513]=j(63513,"unknown_f819",void 0,[S(_,void 0,void 0)],W.Pop),x[63514]=j(63514,"unknown_f81a",void 0,[S(_,void 0,void 0)],W.Pop),x[63515]=j(63515,"unknown_f81b",void 0,[S(_,void 0,void 0)],W.Pop),x[63516]=j(63516,"ba_disp_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[63517]=j(63517,"death_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63518]=j(63518,"death_tech_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63519]=j(63519,"unknown_f81f",void 0,[],void 0),x[63520]=j(63520,"cmode_stage",void 0,[S(_,void 0,void 0)],W.Pop),x[63521]=j(63521,"unknown_f821",void 0,[],void 0),x[63522]=j(63522,"unknown_f822",void 0,[],void 0),x[63523]=j(63523,"unknown_f823",void 0,[S(_,void 0,void 0)],W.Pop),x[63524]=j(63524,"unknown_f824",void 0,[S(_,void 0,void 0)],W.Pop),x[63525]=j(63525,"exp_multiplication",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63526]=j(63526,"exp_division",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63527]=j(63527,"get_user_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63528]=j(63528,"go_floor","Sends a player to the given floor.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read)]},void 0,void 0)],void 0),x[63529]=j(63529,"unknown_f829",void 0,[],void 0),x[63530]=j(63530,"unknown_f82a",void 0,[],void 0),x[63531]=j(63531,"unlock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63532]=j(63532,"lock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63533]=j(63533,"if_switch_not_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63534]=j(63534,"if_switch_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read),S(_,"Switch ID.",P.Read),S(_,"Will be set to 1 if the switch is pressed, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63535]=j(63535,"unknown_f82f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63536]=j(63536,"control_dragon",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63537]=j(63537,"release_dragon",void 0,[],void 0),x[63538]=j(63538,"unknown_f832",void 0,[],void 0),x[63539]=j(63539,"unknown_f833",void 0,[],void 0),x[63540]=j(63540,"unknown_f834",void 0,[],void 0),x[63541]=j(63541,"unknown_f835",void 0,[],void 0),x[63542]=j(63542,"unknown_f836",void 0,[],void 0),x[63543]=j(63543,"unknown_f837",void 0,[],void 0),x[63544]=j(63544,"shrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63545]=j(63545,"unshrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63546]=j(63546,"unknown_f83a",void 0,[],void 0),x[63547]=j(63547,"unknown_f83b",void 0,[],void 0),x[63548]=j(63548,"display_clock2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63549]=j(63549,"unknown_f83d",void 0,[S(_,void 0,void 0)],W.Pop),x[63550]=j(63550,"delete_area_title",void 0,[S(_,void 0,void 0)],W.Pop),x[63551]=j(63551,"unknown_f83f",void 0,[],void 0),x[63552]=j(63552,"load_npc_data",void 0,[],void 0),x[63553]=j(63553,"get_npc_data",void 0,[S(c,void 0,void 0)],void 0),x[63554]=j(63554,"unknown_f842",void 0,[],void 0),x[63555]=j(63555,"unknown_f843",void 0,[],void 0),x[63556]=j(63556,"unknown_f844",void 0,[],void 0),x[63557]=j(63557,"unknown_f845",void 0,[],void 0),x[63558]=j(63558,"unknown_f846",void 0,[],void 0),x[63559]=j(63559,"unknown_f847",void 0,[],void 0),x[63560]=j(63560,"give_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63561]=j(63561,"take_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63562]=j(63562,"unk_score_f84a",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63563]=j(63563,"unk_score_f84b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63564]=j(63564,"kill_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63565]=j(63565,"death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63566]=j(63566,"unk_score_f84e",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63567]=j(63567,"enemy_death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63568]=j(63568,"meseta_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63569]=j(63569,"unknown_f851",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63570]=j(63570,"unknown_f852",void 0,[S(_,void 0,void 0)],W.Pop),x[63571]=j(63571,"reverse_warps",void 0,[],void 0),x[63572]=j(63572,"unreverse_warps",void 0,[],void 0),x[63573]=j(63573,"set_ult_map",void 0,[],void 0),x[63574]=j(63574,"unset_ult_map",void 0,[],void 0),x[63575]=j(63575,"set_area_title",void 0,[S(R,void 0,void 0)],W.Pop),x[63576]=j(63576,"unknown_f858",void 0,[],void 0),x[63577]=j(63577,"unknown_f859",void 0,[],void 0),x[63578]=j(63578,"equip_item",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63579]=j(63579,"unequip_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63580]=j(63580,"unknown_f85c",void 0,[],void 0),x[63581]=j(63581,"unknown_f85d",void 0,[],void 0),x[63582]=j(63582,"unknown_f85e",void 0,[S(_,void 0,void 0)],W.Pop),x[63583]=j(63583,"unknown_f85f",void 0,[S(_,void 0,void 0)],W.Pop),x[63584]=j(63584,"unknown_f860",void 0,[],void 0),x[63585]=j(63585,"unknown_f861",void 0,[S(_,void 0,void 0)],W.Pop),x[63586]=j(63586,"unknown_f862",void 0,[],void 0),x[63587]=j(63587,"unknown_f863",void 0,[],void 0),x[63588]=j(63588,"cmode_rank",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63589]=j(63589,"award_item_name",void 0,[],void 0),x[63590]=j(63590,"award_item_select",void 0,[],void 0),x[63591]=j(63591,"award_item_give_to",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63592]=j(63592,"unknown_f868",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63593]=j(63593,"unknown_f869",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63594]=j(63594,"item_create_cmode",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63595]=j(63595,"unknown_f86b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63596]=j(63596,"award_item_ok",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63597]=j(63597,"unknown_f86d",void 0,[],void 0),x[63598]=j(63598,"unknown_f86e",void 0,[],void 0),x[63599]=j(63599,"ba_set_lives",void 0,[S(_,void 0,void 0)],W.Pop),x[63600]=j(63600,"ba_set_tech_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63601]=j(63601,"ba_set_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63602]=j(63602,"ba_set_time_limit",void 0,[S(_,void 0,void 0)],W.Pop),x[63603]=j(63603,"boss_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63604]=j(63604,"unknown_f874",void 0,[],void 0),x[63605]=j(63605,"unknown_f875",void 0,[],void 0),x[63606]=j(63606,"unknown_f876",void 0,[],void 0),x[63607]=j(63607,"enable_techs","Enables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63608]=j(63608,"disable_techs","Disables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63609]=j(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player gender.",P.Write)]},void 0,void 0)],void 0),x[63610]=j(63610,"get_chara_class","Retrieves the player's race and character class.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player race. 0 If human, 1 if newman, 2 if cast.",P.Write),S(_,"Player class. 0 If hunter, 1 if ranger, 2 if force.",P.Write)]},void 0,void 0)],void 0),x[63611]=j(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,"Amount of meseta to take.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Will be set to 1 if the meseta was taken, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63612]=j(63612,"unknown_f87c",void 0,[],void 0),x[63613]=j(63613,"unknown_f87d",void 0,[],void 0),x[63614]=j(63614,"unknown_f87e",void 0,[],void 0),x[63615]=j(63615,"read_guildcard_flag",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63616]=j(63616,"unknown_f880",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63617]=j(63617,"get_pl_name","Sets the value of to the given player's name.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63618]=j(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63619]=j(63619,"unknown_f883",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63620]=j(63620,"unknown_f884",void 0,[],void 0),x[63621]=j(63621,"unknown_f885",void 0,[],void 0),x[63622]=j(63622,"unknown_f886",void 0,[],void 0),x[63623]=j(63623,"unknown_f887",void 0,[],void 0),x[63624]=j(63624,"unknown_f888",void 0,[],void 0),x[63625]=j(63625,"unknown_f889",void 0,[],void 0),x[63626]=j(63626,"get_player_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63627]=j(63627,"send_mail",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63628]=j(63628,"online_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63629]=j(63629,"chl_set_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63630]=j(63630,"chl_get_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63631]=j(63631,"unknown_f88f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63632]=j(63632,"unknown_f890",void 0,[],void 0),x[63633]=j(63633,"load_enemy_data",void 0,[S(_,void 0,void 0)],W.Pop),x[63634]=j(63634,"get_physical_data",void 0,[S(u,void 0,void 0)],void 0),x[63635]=j(63635,"get_attack_data",void 0,[S(u,void 0,void 0)],void 0),x[63636]=j(63636,"get_resist_data",void 0,[S(u,void 0,void 0)],void 0),x[63637]=j(63637,"get_movement_data",void 0,[S(u,void 0,void 0)],void 0),x[63638]=j(63638,"unknown_f896",void 0,[],void 0),x[63639]=j(63639,"unknown_f897",void 0,[],void 0),x[63640]=j(63640,"shift_left",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63641]=j(63641,"shift_right",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63642]=j(63642,"get_random",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),ji=(x[63643]=j(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),x[63644]=j(63644,"disp_chl_retry_menu",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63645]=j(63645,"chl_reverser",void 0,[],void 0),x[63646]=j(63646,"unknown_f89e",void 0,[S(_,void 0,void 0)],W.Pop),x[63647]=j(63647,"unknown_f89f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63648]=j(63648,"unknown_f8a0",void 0,[],void 0),x[63649]=j(63649,"unknown_f8a1",void 0,[],void 0),x[63650]=j(63650,"unknown_f8a2",void 0,[],void 0),x[63651]=j(63651,"unknown_f8a3",void 0,[],void 0),x[63652]=j(63652,"unknown_f8a4",void 0,[],void 0),x[63653]=j(63653,"unknown_f8a5",void 0,[],void 0),x[63654]=j(63654,"unknown_f8a6",void 0,[],void 0),x[63655]=j(63655,"unknown_f8a7",void 0,[],void 0),x[63656]=j(63656,"unknown_f8a8",void 0,[S(_,void 0,void 0)],W.Pop),x[63657]=j(63657,"unknown_f8a9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63658]=j(63658,"unknown_f8aa",void 0,[],void 0),x[63659]=j(63659,"unknown_f8ab",void 0,[],void 0),x[63660]=j(63660,"unknown_f8ac",void 0,[],void 0),x[63661]=j(63661,"get_number_of_player2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63662]=j(63662,"unknown_f8ae",void 0,[],void 0),x[63663]=j(63663,"unknown_f8af",void 0,[],void 0),x[63664]=j(63664,"unknown_f8b0",void 0,[],void 0),x[63665]=j(63665,"unknown_f8b1",void 0,[],void 0),x[63666]=j(63666,"unknown_f8b2",void 0,[],void 0),x[63667]=j(63667,"unknown_f8b3",void 0,[],void 0),x[63668]=j(63668,"unknown_f8b4",void 0,[],void 0),x[63669]=j(63669,"unknown_f8b5",void 0,[],void 0),x[63670]=j(63670,"unknown_f8b6",void 0,[],void 0),x[63671]=j(63671,"unknown_f8b7",void 0,[],void 0),x[63672]=j(63672,"unknown_f8b8",void 0,[],void 0),x[63673]=j(63673,"chl_recovery",void 0,[],void 0),x[63674]=j(63674,"unknown_f8ba",void 0,[],void 0),x[63675]=j(63675,"unknown_f8bb",void 0,[],void 0),x[63676]=j(63676,"set_episode",void 0,[S(_,void 0,void 0)],void 0),x[63677]=j(63677,"unknown_f8bd",void 0,[],void 0),x[63678]=j(63678,"unknown_f8be",void 0,[],void 0),x[63679]=j(63679,"unknown_f8bf",void 0,[],void 0),x[63680]=j(63680,"file_dl_req",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63681]=j(63681,"get_dl_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63682]=j(63682,"gba_unknown4",void 0,[],void 0),x[63683]=j(63683,"get_gba_state",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63684]=j(63684,"unknown_f8c4",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63685]=j(63685,"unknown_f8c5",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63686]=j(63686,"qexit",void 0,[],void 0),x[63687]=j(63687,"use_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Animation ID.",P.Read),S(_,"Animation duration in number of frames.",P.Read)]},void 0,void 0)],void 0),x[63688]=j(63688,"stop_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63689]=j(63689,"run_to_coord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63690]=j(63690,"set_slot_invincible",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63691]=j(63691,"unknown_f8cb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63692]=j(63692,"set_slot_poison",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63693]=j(63693,"set_slot_paralyze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63694]=j(63694,"set_slot_shock",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63695]=j(63695,"set_slot_freeze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63696]=j(63696,"set_slot_slow",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63697]=j(63697,"set_slot_confuse",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63698]=j(63698,"set_slot_shifta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63699]=j(63699,"set_slot_deband",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63700]=j(63700,"set_slot_jellen",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63701]=j(63701,"set_slot_zalure",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63702]=j(63702,"fleti_fixed_camera",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63703]=j(63703,"fleti_locked_camera",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63704]=j(63704,"default_camera_pos2",void 0,[],void 0),x[63705]=j(63705,"set_motion_blur",void 0,[],void 0),x[63706]=j(63706,"set_screen_bw",void 0,[],void 0),x[63707]=j(63707,"unknown_f8db",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63708]=j(63708,"npc_action_string",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(k,void 0,void 0)],void 0),x[63709]=j(63709,"get_pad_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63710]=j(63710,"get_button_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63711]=j(63711,"freeze_enemies",void 0,[],void 0),x[63712]=j(63712,"unfreeze_enemies",void 0,[],void 0),x[63713]=j(63713,"freeze_everything",void 0,[],void 0),x[63714]=j(63714,"unfreeze_everything",void 0,[],void 0),x[63715]=j(63715,"restore_hp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63716]=j(63716,"restore_tp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63717]=j(63717,"close_chat_bubble",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63718]=j(63718,"move_coords_object",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63719]=j(63719,"at_coords_call_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63720]=j(63720,"unknown_f8e8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63721]=j(63721,"unknown_f8e9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63722]=j(63722,"unknown_f8ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63723]=j(63723,"unknown_f8eb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63724]=j(63724,"unknown_f8ec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63725]=j(63725,"animation_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63726]=j(63726,"call_image_data",void 0,[S(_,void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63727]=j(63727,"unknown_f8ef",void 0,[],void 0),x[63728]=j(63728,"turn_off_bgm_p2",void 0,[],void 0),x[63729]=j(63729,"turn_on_bgm_p2",void 0,[],void 0),x[63730]=j(63730,"load_unk_data",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(c,void 0,void 0)],W.Pop),x[63731]=j(63731,"particle2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63732]=j(63732,"unknown_f8f4",void 0,[],void 0),x[63733]=j(63733,"unknown_f8f5",void 0,[],void 0),x[63734]=j(63734,"unknown_f8f6",void 0,[],void 0),x[63735]=j(63735,"unknown_f8f7",void 0,[],void 0),x[63736]=j(63736,"unknown_f8f8",void 0,[],void 0),x[63737]=j(63737,"unknown_f8f9",void 0,[],void 0),x[63738]=j(63738,"unknown_f8fa",void 0,[],void 0),x[63739]=j(63739,"unknown_f8fb",void 0,[],void 0),x[63740]=j(63740,"unknown_f8fc",void 0,[],void 0),x[63741]=j(63741,"unknown_f8fd",void 0,[],void 0),x[63742]=j(63742,"unknown_f8fe",void 0,[],void 0),x[63743]=j(63743,"unknown_f8ff",void 0,[],void 0),x[63744]=j(63744,"unknown_f900",void 0,[],void 0),x[63745]=j(63745,"dec2float",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63746]=j(63746,"float2dec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63747]=j(63747,"flet",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63748]=j(63748,"fleti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63749]=j(63749,"unknown_f905",void 0,[],void 0),x[63750]=j(63750,"unknown_f906",void 0,[],void 0),x[63751]=j(63751,"unknown_f907",void 0,[],void 0),x[63752]=j(63752,"fadd",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63753]=j(63753,"faddi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63754]=j(63754,"fsub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63755]=j(63755,"fsubi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63756]=j(63756,"fmul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63757]=j(63757,"fmuli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63758]=j(63758,"fdiv",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63759]=j(63759,"fdivi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63760]=j(63760,"get_unknown_count",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63761]=j(63761,"get_stackable_item_count",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63762]=j(63762,"freeze_and_hide_equip",void 0,[],void 0),x[63763]=j(63763,"thaw_and_show_equip",void 0,[],void 0),x[63764]=j(63764,"set_palettex_callback",void 0,[S(_,"Player slot.",void 0),S(f,void 0,void 0)],W.Pop),x[63765]=j(63765,"activate_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63766]=j(63766,"enable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63767]=j(63767,"restore_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63768]=j(63768,"disable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63769]=j(63769,"get_palettex_activated",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63770]=j(63770,"get_unknown_palettex_status",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63771]=j(63771,"disable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63772]=j(63772,"enable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63773]=j(63773,"get_time_played",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63774]=j(63774,"get_guildcard_total",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63775]=j(63775,"get_slot_meseta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63776]=j(63776,"get_player_level",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63777]=j(63777,"get_section_id",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63778]=j(63778,"get_player_hp",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Maximum HP.",P.Write),S(_,"Current HP.",P.Write),S(_,"Maximum TP.",P.Write),S(_,"Current TP.",P.Write)]},void 0,void 0)],W.Pop),x[63779]=j(63779,"get_floor_number",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63780]=j(63780,"get_coord_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63781]=j(63781,"read_global_flag",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63782]=j(63782,"write_global_flag",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63783]=j(63783,"unknown_f927",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63784]=j(63784,"floor_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63785]=j(63785,"read_disk_file",void 0,[S(R,void 0,void 0)],W.Pop),x[63786]=j(63786,"open_pack_select",void 0,[],void 0),x[63787]=j(63787,"item_select",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63788]=j(63788,"get_item_id",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63789]=j(63789,"color_change",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63790]=j(63790,"send_statistic",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63791]=j(63791,"unknown_f92f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63792]=j(63792,"chat_box",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63793]=j(63793,"chat_bubble",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63794]=j(63794,"unknown_f932",void 0,[],void 0),x[63795]=j(63795,"unknown_f933",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63796]=j(63796,"scroll_text",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63797]=j(63797,"gba_unknown1",void 0,[],void 0),x[63798]=j(63798,"gba_unknown2",void 0,[],void 0),x[63799]=j(63799,"gba_unknown3",void 0,[],void 0),x[63800]=j(63800,"add_damage_to",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63801]=j(63801,"item_delete3",void 0,[S(_,void 0,void 0)],W.Pop),x[63802]=j(63802,"get_item_info",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63803]=j(63803,"item_packing1",void 0,[S(_,void 0,void 0)],W.Pop),x[63804]=j(63804,"item_packing2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63805]=j(63805,"get_lang_setting",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63806]=j(63806,"prepare_statistic",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63807]=j(63807,"keyword_detect",void 0,[],void 0),x[63808]=j(63808,"keyword",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0),S(R,void 0,void 0)],W.Pop),x[63809]=j(63809,"get_guildcard_num",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63810]=j(63810,"unknown_f942",void 0,[],void 0),x[63811]=j(63811,"unknown_f943",void 0,[],void 0),x[63812]=j(63812,"get_wrap_status",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63813]=j(63813,"initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63814]=j(63814,"sin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63815]=j(63815,"cos",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63816]=j(63816,"unknown_f948",void 0,[],void 0),x[63817]=j(63817,"unknown_f949",void 0,[],void 0),x[63818]=j(63818,"boss_is_dead2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63819]=j(63819,"unknown_f94b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63820]=j(63820,"unknown_f94c",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63821]=j(63821,"is_there_cardbattle",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63822]=j(63822,"unknown_f94e",void 0,[],void 0),x[63823]=j(63823,"unknown_f94f",void 0,[],void 0),x[63824]=j(63824,"bb_p2_menu",void 0,[S(_,void 0,void 0)],W.Pop),x[63825]=j(63825,"bb_map_designate",void 0,[S(l,void 0,void 0),S(u,void 0,void 0),S(l,void 0,void 0),S(l,void 0,void 0)],void 0));x[63826]=j(63826,"bb_get_number_in_pack",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63827]=j(63827,"bb_swap_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63828]=j(63828,"bb_check_wrap",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63829]=j(63829,"bb_exchange_pd_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63830]=j(63830,"bb_exchange_pd_srank",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63831]=j(63831,"bb_exchange_pd_special",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63832]=j(63832,"bb_exchange_pd_percent",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63833]=j(63833,"unknown_f959",void 0,[S(_,void 0,void 0)],W.Pop),x[63834]=j(63834,"unknown_f95a",void 0,[],void 0),x[63835]=j(63835,"unknown_f95b",void 0,[],void 0),x[63836]=j(63836,"bb_exchange_slt",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63837]=j(63837,"bb_exchange_pc",void 0,[],void 0),x[63838]=j(63838,"bb_box_create_bp",void 0,[S(_,void 0,void 0),S(p,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63839]=j(63839,"bb_exchange_pt",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63840]=j(63840,"unknown_f960",void 0,[S(_,void 0,void 0)],W.Pop),x[63841]=j(63841,"unknown_f961",void 0,[],void 0),x[63842]=j(63842,"unknown_f962",void 0,[],void 0),x[63843]=j(63843,"unknown_f963",void 0,[],void 0),x[63844]=j(63844,"unknown_f964",void 0,[],void 0),x[63845]=j(63845,"unknown_f965",void 0,[],void 0),x[63846]=j(63846,"unknown_f966",void 0,[],void 0),x[63847]=j(63847,"unknown_f967",void 0,[],void 0),x[63848]=j(63848,"unknown_f968",void 0,[],void 0),x[63849]=j(63849,"unknown_f969",void 0,[],void 0),x[63850]=j(63850,"unknown_f96a",void 0,[],void 0),x[63851]=j(63851,"unknown_f96b",void 0,[],void 0),x[63852]=j(63852,"unknown_f96c",void 0,[],void 0),x[63853]=j(63853,"unknown_f96d",void 0,[],void 0),x[63854]=j(63854,"unknown_f96e",void 0,[],void 0),x[63855]=j(63855,"unknown_f96f",void 0,[],void 0),x[63856]=j(63856,"unknown_f970",void 0,[],void 0),x[63857]=j(63857,"unknown_f971",void 0,[],void 0),x[63858]=j(63858,"unknown_f972",void 0,[],void 0),x[63859]=j(63859,"unknown_f973",void 0,[],void 0),x[63860]=j(63860,"unknown_f974",void 0,[],void 0),x[63861]=j(63861,"unknown_f975",void 0,[],void 0),x[63862]=j(63862,"unknown_f976",void 0,[],void 0),x[63863]=j(63863,"unknown_f977",void 0,[],void 0),x[63864]=j(63864,"unknown_f978",void 0,[],void 0),x[63865]=j(63865,"unknown_f979",void 0,[],void 0),x[63866]=j(63866,"unknown_f97a",void 0,[],void 0),x[63867]=j(63867,"unknown_f97b",void 0,[],void 0),x[63868]=j(63868,"unknown_f97c",void 0,[],void 0),x[63869]=j(63869,"unknown_f97d",void 0,[],void 0),x[63870]=j(63870,"unknown_f97e",void 0,[],void 0),x[63871]=j(63871,"unknown_f97f",void 0,[],void 0),x[63872]=j(63872,"unknown_f980",void 0,[],void 0),x[63873]=j(63873,"unknown_f981",void 0,[],void 0),x[63874]=j(63874,"unknown_f982",void 0,[],void 0),x[63875]=j(63875,"unknown_f983",void 0,[],void 0),x[63876]=j(63876,"unknown_f984",void 0,[],void 0),x[63877]=j(63877,"unknown_f985",void 0,[],void 0),x[63878]=j(63878,"unknown_f986",void 0,[],void 0),x[63879]=j(63879,"unknown_f987",void 0,[],void 0),x[63880]=j(63880,"unknown_f988",void 0,[],void 0),x[63881]=j(63881,"unknown_f989",void 0,[],void 0),x[63882]=j(63882,"unknown_f98a",void 0,[],void 0),x[63883]=j(63883,"unknown_f98b",void 0,[],void 0),x[63884]=j(63884,"unknown_f98c",void 0,[],void 0),x[63885]=j(63885,"unknown_f98d",void 0,[],void 0),x[63886]=j(63886,"unknown_f98e",void 0,[],void 0),x[63887]=j(63887,"unknown_f98f",void 0,[],void 0),x[63888]=j(63888,"unknown_f990",void 0,[],void 0),x[63889]=j(63889,"unknown_f991",void 0,[],void 0),x[63890]=j(63890,"unknown_f992",void 0,[],void 0),x[63891]=j(63891,"unknown_f993",void 0,[],void 0),x[63892]=j(63892,"unknown_f994",void 0,[],void 0),x[63893]=j(63893,"unknown_f995",void 0,[],void 0),x[63894]=j(63894,"unknown_f996",void 0,[],void 0),x[63895]=j(63895,"unknown_f997",void 0,[],void 0),x[63896]=j(63896,"unknown_f998",void 0,[],void 0),x[63897]=j(63897,"unknown_f999",void 0,[],void 0),x[63898]=j(63898,"unknown_f99a",void 0,[],void 0),x[63899]=j(63899,"unknown_f99b",void 0,[],void 0),x[63900]=j(63900,"unknown_f99c",void 0,[],void 0),x[63901]=j(63901,"unknown_f99d",void 0,[],void 0),x[63902]=j(63902,"unknown_f99e",void 0,[],void 0),x[63903]=j(63903,"unknown_f99f",void 0,[],void 0),x[63904]=j(63904,"unknown_f9a0",void 0,[],void 0),x[63905]=j(63905,"unknown_f9a1",void 0,[],void 0),x[63906]=j(63906,"unknown_f9a2",void 0,[],void 0),x[63907]=j(63907,"unknown_f9a3",void 0,[],void 0),x[63908]=j(63908,"unknown_f9a4",void 0,[],void 0),x[63909]=j(63909,"unknown_f9a5",void 0,[],void 0),x[63910]=j(63910,"unknown_f9a6",void 0,[],void 0),x[63911]=j(63911,"unknown_f9a7",void 0,[],void 0),x[63912]=j(63912,"unknown_f9a8",void 0,[],void 0),x[63913]=j(63913,"unknown_f9a9",void 0,[],void 0),x[63914]=j(63914,"unknown_f9aa",void 0,[],void 0),x[63915]=j(63915,"unknown_f9ab",void 0,[],void 0),x[63916]=j(63916,"unknown_f9ac",void 0,[],void 0),x[63917]=j(63917,"unknown_f9ad",void 0,[],void 0),x[63918]=j(63918,"unknown_f9ae",void 0,[],void 0),x[63919]=j(63919,"unknown_f9af",void 0,[],void 0),x[63920]=j(63920,"unknown_f9b0",void 0,[],void 0),x[63921]=j(63921,"unknown_f9b1",void 0,[],void 0),x[63922]=j(63922,"unknown_f9b2",void 0,[],void 0),x[63923]=j(63923,"unknown_f9b3",void 0,[],void 0),x[63924]=j(63924,"unknown_f9b4",void 0,[],void 0),x[63925]=j(63925,"unknown_f9b5",void 0,[],void 0),x[63926]=j(63926,"unknown_f9b6",void 0,[],void 0),x[63927]=j(63927,"unknown_f9b7",void 0,[],void 0),x[63928]=j(63928,"unknown_f9b8",void 0,[],void 0),x[63929]=j(63929,"unknown_f9b9",void 0,[],void 0),x[63930]=j(63930,"unknown_f9ba",void 0,[],void 0),x[63931]=j(63931,"unknown_f9bb",void 0,[],void 0),x[63932]=j(63932,"unknown_f9bc",void 0,[],void 0),x[63933]=j(63933,"unknown_f9bd",void 0,[],void 0),x[63934]=j(63934,"unknown_f9be",void 0,[],void 0),x[63935]=j(63935,"unknown_f9bf",void 0,[],void 0),x[63936]=j(63936,"unknown_f9c0",void 0,[],void 0),x[63937]=j(63937,"unknown_f9c1",void 0,[],void 0),x[63938]=j(63938,"unknown_f9c2",void 0,[],void 0),x[63939]=j(63939,"unknown_f9c3",void 0,[],void 0),x[63940]=j(63940,"unknown_f9c4",void 0,[],void 0),x[63941]=j(63941,"unknown_f9c5",void 0,[],void 0),x[63942]=j(63942,"unknown_f9c6",void 0,[],void 0),x[63943]=j(63943,"unknown_f9c7",void 0,[],void 0),x[63944]=j(63944,"unknown_f9c8",void 0,[],void 0),x[63945]=j(63945,"unknown_f9c9",void 0,[],void 0),x[63946]=j(63946,"unknown_f9ca",void 0,[],void 0),x[63947]=j(63947,"unknown_f9cb",void 0,[],void 0),x[63948]=j(63948,"unknown_f9cc",void 0,[],void 0),x[63949]=j(63949,"unknown_f9cd",void 0,[],void 0),x[63950]=j(63950,"unknown_f9ce",void 0,[],void 0),x[63951]=j(63951,"unknown_f9cf",void 0,[],void 0),x[63952]=j(63952,"unknown_f9d0",void 0,[],void 0),x[63953]=j(63953,"unknown_f9d1",void 0,[],void 0),x[63954]=j(63954,"unknown_f9d2",void 0,[],void 0),x[63955]=j(63955,"unknown_f9d3",void 0,[],void 0),x[63956]=j(63956,"unknown_f9d4",void 0,[],void 0),x[63957]=j(63957,"unknown_f9d5",void 0,[],void 0),x[63958]=j(63958,"unknown_f9d6",void 0,[],void 0),x[63959]=j(63959,"unknown_f9d7",void 0,[],void 0),x[63960]=j(63960,"unknown_f9d8",void 0,[],void 0),x[63961]=j(63961,"unknown_f9d9",void 0,[],void 0),x[63962]=j(63962,"unknown_f9da",void 0,[],void 0),x[63963]=j(63963,"unknown_f9db",void 0,[],void 0),x[63964]=j(63964,"unknown_f9dc",void 0,[],void 0),x[63965]=j(63965,"unknown_f9dd",void 0,[],void 0),x[63966]=j(63966,"unknown_f9de",void 0,[],void 0),x[63967]=j(63967,"unknown_f9df",void 0,[],void 0),x[63968]=j(63968,"unknown_f9e0",void 0,[],void 0),x[63969]=j(63969,"unknown_f9e1",void 0,[],void 0),x[63970]=j(63970,"unknown_f9e2",void 0,[],void 0),x[63971]=j(63971,"unknown_f9e3",void 0,[],void 0),x[63972]=j(63972,"unknown_f9e4",void 0,[],void 0),x[63973]=j(63973,"unknown_f9e5",void 0,[],void 0),x[63974]=j(63974,"unknown_f9e6",void 0,[],void 0),x[63975]=j(63975,"unknown_f9e7",void 0,[],void 0),x[63976]=j(63976,"unknown_f9e8",void 0,[],void 0),x[63977]=j(63977,"unknown_f9e9",void 0,[],void 0),x[63978]=j(63978,"unknown_f9ea",void 0,[],void 0),x[63979]=j(63979,"unknown_f9eb",void 0,[],void 0),x[63980]=j(63980,"unknown_f9ec",void 0,[],void 0),x[63981]=j(63981,"unknown_f9ed",void 0,[],void 0),x[63982]=j(63982,"unknown_f9ee",void 0,[],void 0),x[63983]=j(63983,"unknown_f9ef",void 0,[],void 0),x[63984]=j(63984,"unknown_f9f0",void 0,[],void 0),x[63985]=j(63985,"unknown_f9f1",void 0,[],void 0),x[63986]=j(63986,"unknown_f9f2",void 0,[],void 0),x[63987]=j(63987,"unknown_f9f3",void 0,[],void 0),x[63988]=j(63988,"unknown_f9f4",void 0,[],void 0),x[63989]=j(63989,"unknown_f9f5",void 0,[],void 0),x[63990]=j(63990,"unknown_f9f6",void 0,[],void 0),x[63991]=j(63991,"unknown_f9f7",void 0,[],void 0),x[63992]=j(63992,"unknown_f9f8",void 0,[],void 0),x[63993]=j(63993,"unknown_f9f9",void 0,[],void 0),x[63994]=j(63994,"unknown_f9fa",void 0,[],void 0),x[63995]=j(63995,"unknown_f9fb",void 0,[],void 0),x[63996]=j(63996,"unknown_f9fc",void 0,[],void 0),x[63997]=j(63997,"unknown_f9fd",void 0,[],void 0),x[63998]=j(63998,"unknown_f9fe",void 0,[],void 0),x[63999]=j(63999,"unknown_f9ff",void 0,[],void 0);function Li(i,e){if(!i){let i="Assertion Error";throw e&&(i+=": "+(e instanceof Function?e():e)),new Error(i)}}var zi,Di;x.forEach(i=>{I.set(i.mnemonic,i)}),function(i){i[i.Instructions=0]="Instructions",i[i.Data=1]="Data",i[i.String=2]="String"}(zi||(zi={})),function(i){i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warn=3]="Warn",i[i.Error=4]="Error",i[i.Off=5]="Off"}(Di||(Di={}));!function(i){const e=Object.values(i),o=e.filter(i=>"number"==typeof i);o.length}(Di);function Ci(i,e){return i.toString().padStart(e,"0")}class Mi{constructor(i){this.name=i,this.trace=(i,e)=>{this.handle(Di.Trace,i,e)},this.debug=(i,e)=>{this.handle(Di.Debug,i,e)},this.info=(i,e)=>{this.handle(Di.Info,i,e)},this.warn=(i,e)=>{this.handle(Di.Warn,i,e)},this.error=(i,e)=>{this.handle(Di.Error,i,e)}}get level(){var i;return null!=(i=this._level)?i:$i.default_level}set level(i){this._level=i}get handler(){var i;return null!=(i=this._handler)?i:$i.default_handler}set handler(i){this._handler=i}handle(i,e,o){i>=this.level&&this.handler({time:new Date,message:e,level:i,logger:this,cause:o},this.name)}}class $i{static get(i){let e=this.loggers.get(i);return e||(e=new Mi(i),this.loggers.set(i,e)),e}static with_default_handler(i,e){const o=this.default_handler;let d=!1;try{this.default_handler=i;const v=e();return v instanceof Promise?(d=!0,v.finally(()=>this.default_handler=o)):v}finally{d||(this.default_handler=o)}}}$i.loggers=new Map,$i.default_level=function(i){const e=Di[i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()];return Li(null!=e,()=>`"${i}" is not a valid log level.`),e}("INFO"),$i.default_handler=function({time:i,message:e,level:o,logger:d,cause:v}){const t=`${function(i){const e=Ci(i.getHours(),2),o=Ci(i.getMinutes(),2),d=Ci(i.getSeconds(),2),v=Ci(i.getMilliseconds(),3);return`${e}:${o}:${d}.${v}`}(i)} [${Di[o]}] ${d.name} - ${e}`;let n;switch(o){case Di.Trace:n=console.trace;break;case Di.Debug:n=console.debug;break;case Di.Info:n=console.info;break;case Di.Warn:n=console.warn;break;case Di.Error:n=console.error;break;default:n=console.log}null==v?n.call(console,t):n.call(console,t,v)};const Ni=$i.get("quest_editor/scripting/assembly");class Ai{constructor(i,e){this.assembly=i,this.manual_stack=e,this.lexer=new r,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const i of this.assembly){if(this.tokens=this.lexer.tokenize_line(i),this.tokens.length>0){const i=this.tokens.shift();let e=!1;switch(i.type){case n.Label:this.parse_label(i),e=!0;break;case n.CodeSection:case n.DataSection:case n.StringSection:this.parse_section(i);break;case n.Int:this.section===zi.Data?this.parse_bytes(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.String:this.section===zi.String?this.parse_string(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.Ident:this.section===zi.Instructions?this.parse_instruction(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.InvalidSection:this.add_error({col:i.col,length:i.len,message:"Invalid section type."});break;case n.InvalidIdent:this.add_error({col:i.col,length:i.len,message:"Invalid identifier."});break;default:this.add_error({col:i.col,length:i.len,message:"Unexpected token."})}this.prev_line_had_label=e}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(i,e,o,d,v,t){if(this.segment)this.segment.type===zi.Instructions?this.segment.instructions.push(function(i,e,o){const d=Math.min(i.params.length,e.length),v=[];let t=0;for(let o=0;o({line_no:this.line_no,col:i.col,len:i.len})),stack_args:t.map((i,e)=>({line_no:this.line_no,col:i.col,len:i.len,value:o[e].value}))})):Ni.error(`Line ${this.line_no}: Expected instructions segment.`);else{const i={labels:[],type:zi.Instructions,instructions:[],asm:{labels:[]}};this.segment=i,this.object_code.push(i)}}add_bytes(i){if(this.segment)if(this.segment.type===zi.Data){const e=new ArrayBuffer(this.segment.data.byteLength+i.length),o=new Uint8Array(e);o.set(new Uint8Array(this.segment.data)),o.set(new Uint8Array(i),this.segment.data.byteLength),this.segment.data=e}else Ni.error(`Line ${this.line_no}: Expected data segment.`);else{const e={labels:[],type:zi.Data,data:new Uint8Array(i).buffer,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_string(i){if(this.segment)this.segment.type===zi.String?this.segment.value+=i:Ni.error(`Line ${this.line_no}: Expected string segment.`);else{const e={labels:[],type:zi.String,value:i,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_error({col:i,length:e,message:o}){this.errors.push({line_no:this.line_no,col:i,length:e,message:o})}add_warning({col:i,length:e,message:o}){this.warnings.push({line_no:this.line_no,col:i,length:e,message:o})}parse_label({col:i,len:e,value:o}){this.labels.has(o)&&this.add_error({col:i,length:e,message:"Duplicate label."}),this.labels.add(o);const d=this.tokens.shift(),v={line_no:this.line_no,col:i,len:e};if(this.prev_line_had_label){const i=this.object_code[this.object_code.length-1];i.labels.push(o),i.asm.labels.push(v)}switch(this.section){case zi.Instructions:this.prev_line_had_label||(this.segment={type:zi.Instructions,labels:[o],instructions:[],asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Ident?this.parse_instruction(d):this.add_error({col:d.col,length:d.len,message:"Expected opcode mnemonic."}));break;case zi.Data:this.prev_line_had_label||(this.segment={type:zi.Data,labels:[o],data:new ArrayBuffer(0),asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Int?this.parse_bytes(d):this.add_error({col:d.col,length:d.len,message:"Expected bytes."}));break;case zi.String:this.prev_line_had_label||(this.segment={type:zi.String,labels:[o],value:"",asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.String?this.parse_string(d):this.add_error({col:d.col,length:d.len,message:"Expected a string."}))}}parse_section({type:i,col:e,len:o}){let d;switch(i){case n.CodeSection:d=zi.Instructions;break;case n.DataSection:d=zi.Data;break;case n.StringSection:d=zi.String}this.section!==d||this.first_section_marker||this.add_warning({col:e,length:o,message:"Unnecessary section marker."}),this.section=d,this.first_section_marker=!1;const v=this.tokens.shift();v&&this.add_error({col:v.col,length:v.len,message:"Unexpected token."})}parse_instruction(i){const{col:e,len:o,value:d}=i,v=I.get(d);if(v){const o=-1!==v.params.findIndex(i=>i.type.kind===s.ILabelVar||i.type.kind===s.RegRefVar),d=this.manual_stack&&v.stack===W.Pop?0:v.params.length;let a=0;for(const i of this.tokens)i.type!==n.ArgSeparator&&a++;const l=this.tokens[this.tokens.length-1],u=l?l.col+l.len-e:0,_=[],p=[];if(!o&&a!==d)return void this.add_error({col:e,length:u,message:`Expected ${d} argument${1===d?"":"s"}, got ${a}.`});if(o&&ar?this.add_error({col:v,length:t,message:`${n}-Bit integer can't be greater than ${r}.`}):o.push([{value:d,size:i},e])}parse_register(i,e){const{col:o,len:d,value:v}=i;v>255?this.add_error({col:o,length:d,message:"Invalid register reference, expected r0-r255."}):e.push([{value:v,size:1},i])}parse_bytes(i){const e=[];let o=i,d=0;for(;o.type===n.Int&&(o.value<0?this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be less than 0."}):o.value>255&&this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be greater than 255."}),e.push(o.value),d"))}}var qi;!function(i){i[i.None=0]="None",i[i.Return=1]="Return",i[i.Jump=2]="Jump",i[i.ConditionalJump=3]="ConditionalJump",i[i.Call=4]="Call"}(qi||(qi={}));class Fi{constructor(i,e,o,d,v){this.from=[],this.to=[],this.segment=i,this.start=e,this.end=o,this.branch_type=d,this.branch_labels=v}link_to(i){this.to.includes(i)||(this.to.push(i),i.from.push(this))}index_of_instruction(i){const e=this.segment.instructions.indexOf(i,this.start);return ei.value);break;case B.code:case z.code:s=qi.Call,r=[n.args[0].value];break;case fi.code:s=qi.Call,r=n.args.slice(1).map(i=>i.value);break;default:if(t===o-1){s=qi.None,r=[];break}continue}const a=new Fi(e,d,t+1,s,r);for(let e=a.start;e{let i=0,e=NaN;return{next:()=>{let o=!0;return ithis.intervals[i].end?(i++,ii+e.end-e.start+1,0)}get(i){for(const{start:e,end:o}of this.intervals){const d=o-e+1;if(ithis.intervals[d].start;)i.end=this.intervals[d].end,d++;this.intervals.splice(e+1,d-e-1),i.end=Math.max(i.end,o.end),e++;continue i}e++}this.intervals.push(o)}return this}to_array(){const i=[];for(const{start:e,end:o}of this.intervals)for(let d=e;d<=o;d++)i.push(d);return i}}const Bi=$i.get("core/data_formats/asm/data_flow_analysis/register_value"),Hi=T,Ji=y;Math.pow(2,32);function Yi(i,e,o){const d=i.get_block_for_instruction(e);return d?function i(e,o,d,v,t){if(++e.iterations>100)return Bi.warn("Too many iterations."),(new Vi).set_interval(Hi,Ji);for(let n=v-1;n>=d.start;n--){const v=d.segment.instructions[n],r=v.args;switch(v.opcode.code){case D.code:if(r[0].value===t)return i(e,new Set(o),d,n,r[1].value);break;case C.code:case M.code:case $.code:case Wi.code:if(r[0].value===t)return(new Vi).set_value(r[1].value);break;case N.code:if(r[0].value===t)return(new Vi).set_value(1);break;case A.code:if(r[0].value===t)return(new Vi).set_value(0);break;case q.code:if(r[0].value===t){const v=i(e,new Set(o),d,n,t),s=v.size();return 0===s||1===s&&0===v.get(0)?(new Vi).set_value(1):v.has(0)?(new Vi).set_interval(0,1):(new Vi).set_value(0)}break;case F.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_add(r[1].value)}break;case E.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_sub(r[1].value)}break;case O.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_mul(r[1].value)}break;case U.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_div(r[1].value)}break;case Ti.code:if(r[0].value===t)return(new Vi).set_interval(0,1);break;case yi.code:if(r[0].value===t)return(new Vi).set_interval(0,2);break;case Si.code:if(r[0].value===t)return(new Vi).set_interval(0,3);break;case Ii.code:if(r[1].value===t){const v=i(e,new Set(o),d,n,r[0].value).min()||0,t=Math.max(i(e,new Set(o),d,n,r[0].value+1).max()||0,v+1);return(new Vi).set_interval(v,t-1)}break;case ci.code:case ki.code:{const i=r[0].value,e=r[0].value+r[1].value;if(i<=t&&ti.type===n.Ident);if(t&&(e=I.get(t.value),e))for(const e of v){if(e.col+e.len>i.col)break;e.type===n.Ident&&-1===o?o=0:e.type===n.ArgSeparator&&o++}}const d={type:v.SignatureHelp,id:i.id,opcode:e,active_param:o};Ki.postMessage(d)}function ae(i){const e=function(i,e){const o=ee[i];if(!o)return;const d=ie[o.segment_index];if(!d||d.type!==zi.Instructions)return;for(const v of o.instruction_indices){const o=d.instructions[v];if(o&&o.asm){const d=o.opcode.params;for(let v=0;vi.type===zi.Instructions);for(let i=0;i=o.col&&e<=o.col+o.len)}Ki.onmessage=i=>{de.push(i.data),ve||(ne(),ve=setTimeout(()=>{ve=void 0,ne()},100))}}}); \ No newline at end of file +!function(i){var e={};function o(d){if(e[d])return e[d].exports;var t=e[d]={i:d,l:!1,exports:{}};return i[d].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=i,o.c=e,o.d=function(i,e,d){o.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:d})},o.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,e){if(1&e&&(i=o(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var d=Object.create(null);if(o.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var t in i)o.d(d,t,function(e){return i[e]}.bind(null,t));return d},o.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(e,"a",e),e},o.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},o.p="",o(o.s="yL6M")}({yL6M:function(i,e,o){"use strict";var d,t;o.r(e),function(i){i[i.NewAssembly=0]="NewAssembly",i[i.AssemblyChange=1]="AssemblyChange",i[i.SignatureHelp=2]="SignatureHelp",i[i.Definition=3]="Definition",i[i.SettingsChange=4]="SettingsChange"}(d||(d={})),function(i){i[i.NewObjectCode=0]="NewObjectCode",i[i.SignatureHelp=1]="SignatureHelp",i[i.Definition=2]="Definition"}(t||(t={}));const v=new DataView(new ArrayBuffer(4));var n,s;!function(i){i[i.Int=0]="Int",i[i.Float=1]="Float",i[i.InvalidNumber=2]="InvalidNumber",i[i.Register=3]="Register",i[i.Label=4]="Label",i[i.CodeSection=5]="CodeSection",i[i.DataSection=6]="DataSection",i[i.StringSection=7]="StringSection",i[i.InvalidSection=8]="InvalidSection",i[i.String=9]="String",i[i.UnterminatedString=10]="UnterminatedString",i[i.Ident=11]="Ident",i[i.InvalidIdent=12]="InvalidIdent",i[i.ArgSeparator=13]="ArgSeparator"}(n||(n={}));class r{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(i){this.line=i,this.index=0,this._mark=0;const e=[];for(;this.has_next();){const i=this.peek();let o;if("/"===i){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(i)?this.skip():(/[-\d]/.test(i)?o=this.tokenize_number_or_label():","===i?(o={type:n.ArgSeparator,col:this.col,len:1},this.skip()):o="."===i?this.tokenize_section():'"'===i?this.tokenize_string():"r"===i?this.tokenize_register_or_ident():this.tokenize_ident(),e.push(o))}return e}has_next(){return this.index!]*$/.test(e)?n.Ident:n.InvalidIdent;return o===n.Ident?{type:o,col:i,len:this.marked_len(),value:e}:{type:o,col:i,len:this.marked_len()}}}!function(i){i[i.Any=0]="Any",i[i.Byte=1]="Byte",i[i.Word=2]="Word",i[i.DWord=3]="DWord",i[i.Float=4]="Float",i[i.Label=5]="Label",i[i.ILabel=6]="ILabel",i[i.DLabel=7]="DLabel",i[i.SLabel=8]="SLabel",i[i.String=9]="String",i[i.ILabelVar=10]="ILabelVar",i[i.RegRef=11]="RegRef",i[i.RegTupRef=12]="RegTupRef",i[i.RegRefVar=13]="RegRefVar",i[i.Pointer=14]="Pointer"}(s||(s={}));const a={kind:s.Any},l={kind:s.Byte},u={kind:s.Word},_={kind:s.DWord},p={kind:s.Float},g={kind:s.Label},f={kind:s.ILabel},c={kind:s.DLabel},k={kind:s.SLabel},R={kind:s.String},h={kind:s.ILabelVar},w={kind:s.RegRef},b={kind:s.RegRefVar},m={kind:s.Pointer},T=-Math.pow(2,31),y=Math.pow(2,31)-1;Math.pow(2,32);var P,W;function S(i,e,o){return{type:i,doc:e,access:o}}!function(i){i[i.Read=0]="Read",i[i.Write=1]="Write",i[i.ReadWrite=2]="ReadWrite"}(P||(P={})),function(i){i[i.Push=0]="Push",i[i.Pop=1]="Pop"}(W||(W={}));const x=[],I=new Map;function j(i,e,o,d,t){return{code:i,mnemonic:e,doc:o,size:i<256?1:2,params:d,stack:t}}x[0]=j(0,"nop","No operation, does nothing.",[],void 0);const L=x[1]=j(1,"ret","Returns control to caller.",[],void 0),z=(x[2]=j(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),x[3]=j(3,"exit",void 0,[S(_,void 0,void 0)],W.Pop),x[4]=j(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[S(f,void 0,void 0)],void 0),x[5]=j(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),x[6]=j(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),x[7]=j(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[S(f,void 0,void 0)],void 0)),D=x[8]=j(8,"let","Sets the first register's value to second one's value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),C=x[9]=j(9,"leti","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),M=x[10]=j(10,"letb","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(l,void 0,void 0)],void 0),$=x[11]=j(11,"letw","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0),S(u,void 0,void 0)],void 0),A=(x[12]=j(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[13]=j(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S(g,void 0,void 0)],void 0),x[14]=j(14,"unknown_0e",void 0,[],void 0),x[15]=j(15,"unknown_0f",void 0,[],void 0),x[16]=j(16,"set","Sets a register to 1.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),N=x[17]=j(17,"clear","Sets a register to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),q=x[18]=j(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.ReadWrite)]},void 0,void 0)],void 0),F=(x[19]=j(19,"gset",void 0,[S(u,void 0,void 0)],void 0),x[20]=j(20,"gclear",void 0,[S(u,void 0,void 0)],void 0),x[21]=j(21,"grev",void 0,[S(u,void 0,void 0)],void 0),x[22]=j(22,"glet",void 0,[S(u,void 0,void 0)],void 0),x[23]=j(23,"gget","Sets a register to value of the given flag.",[S(u,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0)],void 0),x[24]=j(24,"add",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[25]=j(25,"addi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),E=(x[26]=j(26,"sub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[27]=j(27,"subi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),O=(x[28]=j(28,"mul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[29]=j(29,"muli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),U=(x[30]=j(30,"div",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[31]=j(31,"divi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),V=(x[32]=j(32,"and",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[33]=j(33,"andi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[34]=j(34,"or",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[35]=j(35,"ori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[36]=j(36,"xor",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[37]=j(37,"xori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[38]=j(38,"mod",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[39]=j(39,"modi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[40]=j(40,"jmp",void 0,[S(f,void 0,void 0)],void 0)),B=x[41]=j(41,"call",void 0,[S(f,void 0,void 0)],void 0),H=x[42]=j(42,"jmp_on",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),J=x[43]=j(43,"jmp_off",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),Y=x[44]=j(44,"jmp_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),X=x[45]=j(45,"jmpi_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),Z=x[46]=j(46,"jmp_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),G=x[47]=j(47,"jmpi_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),K=x[48]=j(48,"ujmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),Q=x[49]=j(49,"ujmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ii=x[50]=j(50,"jmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ei=x[51]=j(51,"jmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),oi=x[52]=j(52,"ujmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),di=x[53]=j(53,"ujmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ti=x[54]=j(54,"jmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),vi=x[55]=j(55,"jmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ni=x[56]=j(56,"ujmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),si=x[57]=j(57,"ujmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ri=x[58]=j(58,"jmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ai=x[59]=j(59,"jmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),li=x[60]=j(60,"ujmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ui=x[61]=j(61,"ujmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),_i=x[62]=j(62,"jmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),pi=x[63]=j(63,"jmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),gi=x[64]=j(64,"switch_jmp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),fi=x[65]=j(65,"switch_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),ci=(x[66]=j(66,"stack_push",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[67]=j(67,"stack_pop",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[68]=j(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[S(w,void 0,P.Read),S(_,void 0,void 0)],void 0)),ki=x[69]=j(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[S(w,void 0,P.Write),S(_,void 0,void 0)],void 0),Ri=(x[70]=j(70,"unknown_46",void 0,[],void 0),x[71]=j(71,"unknown_47",void 0,[],void 0),x[72]=j(72,"arg_pushr","Pushes the value of the given register onto the stack.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push)),hi=x[73]=j(73,"arg_pushl","Pushes the given value onto the stack.",[S(_,void 0,void 0)],W.Push),wi=x[74]=j(74,"arg_pushb","Pushes the given value onto the stack.",[S(l,void 0,void 0)],W.Push),bi=x[75]=j(75,"arg_pushw","Pushes the given value onto the stack.",[S(u,void 0,void 0)],W.Push),mi=(x[76]=j(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push),x[77]=j(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[S(g,void 0,void 0)],W.Push),x[78]=j(78,"arg_pushs","Pushes the given value onto the stack.",[S(R,void 0,void 0)],W.Push)),Ti=(x[79]=j(79,"unknown_4f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[80]=j(80,"message",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[81]=j(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[82]=j(82,"fadein",void 0,[],void 0),x[83]=j(83,"fadeout",void 0,[],void 0),x[84]=j(84,"se",void 0,[S(_,void 0,void 0)],W.Pop),x[85]=j(85,"bgm",void 0,[S(_,void 0,void 0)],W.Pop),x[86]=j(86,"unknown_56",void 0,[],void 0),x[87]=j(87,"unknown_57",void 0,[],void 0),x[88]=j(88,"enable",void 0,[S(_,void 0,void 0)],W.Pop),x[89]=j(89,"disable",void 0,[S(_,void 0,void 0)],W.Pop),x[90]=j(90,"window_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[91]=j(91,"add_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[92]=j(92,"mesend",void 0,[],void 0),x[93]=j(93,"gettime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[94]=j(94,"winend",void 0,[],void 0),x[95]=j(95,"unknown_5f",void 0,[],void 0),x[96]=j(96,"npc_crt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[97]=j(97,"npc_stop",void 0,[S(_,void 0,void 0)],W.Pop),x[98]=j(98,"npc_play",void 0,[S(_,void 0,void 0)],W.Pop),x[99]=j(99,"npc_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[100]=j(100,"npc_nont",void 0,[],void 0),x[101]=j(101,"npc_talk",void 0,[],void 0),x[102]=j(102,"npc_crp_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read),S(f,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[103]=j(103,"unknown_67",void 0,[],void 0),x[104]=j(104,"create_pipe",void 0,[S(_,void 0,void 0)],W.Pop),x[105]=j(105,"p_hpstat_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[106]=j(106,"p_dead_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0)],W.Pop),x[107]=j(107,"p_disablewarp",void 0,[],void 0),x[108]=j(108,"p_enablewarp",void 0,[],void 0),x[109]=j(109,"p_move_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[110]=j(110,"p_look",void 0,[S(_,void 0,void 0)],W.Pop),x[111]=j(111,"unknown_6f",void 0,[],void 0),x[112]=j(112,"p_action_disable",void 0,[],void 0),x[113]=j(113,"p_action_enable",void 0,[],void 0),x[114]=j(114,"disable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[115]=j(115,"enable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[116]=j(116,"p_noncol",void 0,[],void 0),x[117]=j(117,"p_col",void 0,[],void 0),x[118]=j(118,"p_setpos","Sets a player's position.",[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Y-axis rotation.",P.Read)]},void 0,void 0)],W.Pop),x[119]=j(119,"p_return_guild",void 0,[],void 0),x[120]=j(120,"p_talk_guild",void 0,[S(_,void 0,void 0)],W.Pop),x[121]=j(121,"npc_talk_pl_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[122]=j(122,"npc_talk_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[123]=j(123,"npc_crtpk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[124]=j(124,"npc_crppk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[125]=j(125,"npc_crptalk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[126]=j(126,"p_look_at_v1",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[127]=j(127,"npc_crp_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[128]=j(128,"cam_quake",void 0,[],void 0),x[129]=j(129,"cam_adj",void 0,[],void 0),x[130]=j(130,"cam_zmin",void 0,[],void 0),x[131]=j(131,"cam_zmout",void 0,[],void 0),x[132]=j(132,"cam_pan_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[133]=j(133,"game_lev_super",void 0,[],void 0),x[134]=j(134,"game_lev_reset",void 0,[],void 0),x[135]=j(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[136]=j(136,"if_zone_clear",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),yi=(x[137]=j(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[138]=j(138,"unhide_obj",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[139]=j(139,"unhide_ene",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[140]=j(140,"at_coords_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[141]=j(141,"at_coords_talk",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[142]=j(142,"col_npcin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[143]=j(143,"col_npcinr",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[144]=j(144,"switch_on",void 0,[S(_,void 0,void 0)],W.Pop),x[145]=j(145,"switch_off",void 0,[S(_,void 0,void 0)],W.Pop),x[146]=j(146,"playbgm_epi",void 0,[S(_,void 0,void 0)],W.Pop),x[147]=j(147,"set_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[148]=j(148,"set_obj_param","Creates a targetable object.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Collision radius.",P.Read),S(f,"Function label.",P.Read),S(_,"Vertical position of the cursor.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},"Object handle.",void 0)],void 0),x[149]=j(149,"set_floor_handler",void 0,[S(_,"Floor number.",void 0),S(f,"Handler function label.",void 0)],W.Pop),x[150]=j(150,"clr_floor_handler",void 0,[S(_,"Floor number.",void 0)],W.Pop),x[151]=j(151,"col_plinaw",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[152]=j(152,"hud_hide",void 0,[],void 0),x[153]=j(153,"hud_show",void 0,[],void 0),x[154]=j(154,"cine_enable",void 0,[],void 0),x[155]=j(155,"cine_disable",void 0,[],void 0),x[156]=j(156,"unknown_9c",void 0,[],void 0),x[157]=j(157,"unknown_9d",void 0,[],void 0),x[158]=j(158,"unknown_9e",void 0,[],void 0),x[159]=j(159,"unknown_9f",void 0,[],void 0),x[160]=j(160,"unknown_a0",void 0,[],void 0),x[161]=j(161,"set_qt_failure",void 0,[S(f,void 0,void 0)],void 0),x[162]=j(162,"set_qt_success",void 0,[S(f,void 0,void 0)],void 0),x[163]=j(163,"clr_qt_failure",void 0,[],void 0),x[164]=j(164,"clr_qt_success",void 0,[],void 0),x[165]=j(165,"set_qt_cancel",void 0,[S(f,void 0,void 0)],void 0),x[166]=j(166,"clr_qt_cancel",void 0,[],void 0),x[167]=j(167,"unknown_a7",void 0,[],void 0),x[168]=j(168,"pl_walk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[169]=j(169,"unknown_a9",void 0,[],void 0),x[170]=j(170,"unknown_aa",void 0,[],void 0),x[171]=j(171,"unknown_ab",void 0,[],void 0),x[172]=j(172,"unknown_ac",void 0,[],void 0),x[173]=j(173,"unknown_ad",void 0,[],void 0),x[174]=j(174,"unknown_ae",void 0,[],void 0),x[175]=j(175,"unknown_af",void 0,[],void 0),x[176]=j(176,"pl_add_meseta",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[177]=j(177,"thread_stg",void 0,[S(f,void 0,void 0)],void 0),x[178]=j(178,"del_obj_param",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},"Object handle.",void 0)],void 0),x[179]=j(179,"item_create",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[180]=j(180,"item_create2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[181]=j(181,"item_delete",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[182]=j(182,"item_delete2","Deletes an item from the player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[183]=j(183,"item_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[184]=j(184,"setevt",void 0,[S(_,void 0,void 0)],W.Pop),x[185]=j(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),Pi=(x[186]=j(186,"set_qt_exit",void 0,[S(f,void 0,void 0)],void 0),x[187]=j(187,"clr_qt_exit",void 0,[],void 0),x[188]=j(188,"unknown_bc",void 0,[],void 0),x[189]=j(189,"unknown_bd",void 0,[],void 0),x[190]=j(190,"unknown_be",void 0,[],void 0),x[191]=j(191,"unknown_bf",void 0,[],void 0),x[192]=j(192,"particle_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[193]=j(193,"npc_text",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[194]=j(194,"npc_chkwarp",void 0,[],void 0),x[195]=j(195,"pl_pkoff",void 0,[],void 0),x[196]=j(196,"map_designate",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0)),Wi=(x[197]=j(197,"masterkey_on",void 0,[],void 0),x[198]=j(198,"masterkey_off",void 0,[],void 0),x[199]=j(199,"window_time",void 0,[],void 0),x[200]=j(200,"winend_time",void 0,[],void 0),x[201]=j(201,"winset_time",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[202]=j(202,"getmtime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[203]=j(203,"set_quest_board_handler",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[204]=j(204,"clear_quest_board_handler",void 0,[S(_,void 0,void 0)],W.Pop),x[205]=j(205,"particle_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[206]=j(206,"npc_crptalk_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[207]=j(207,"npc_lang_clean",void 0,[],void 0),x[208]=j(208,"pl_pkon",void 0,[],void 0),x[209]=j(209,"pl_chk_item2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[210]=j(210,"enable_mainmenu",void 0,[],void 0),x[211]=j(211,"disable_mainmenu",void 0,[],void 0),x[212]=j(212,"start_battlebgm",void 0,[],void 0),x[213]=j(213,"end_battlebgm",void 0,[],void 0),x[214]=j(214,"disp_msg_qb",void 0,[S(R,void 0,void 0)],W.Pop),x[215]=j(215,"close_msg_qb",void 0,[],void 0),x[216]=j(216,"set_eventflag_v3",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[217]=j(217,"sync_leti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),Si=(x[218]=j(218,"set_returnhunter",void 0,[],void 0),x[219]=j(219,"set_returncity",void 0,[],void 0),x[220]=j(220,"load_pvr",void 0,[],void 0),x[221]=j(221,"load_midi",void 0,[],void 0),x[222]=j(222,"unknown_de",void 0,[],void 0),x[223]=j(223,"npc_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[224]=j(224,"pad_dragon",void 0,[],void 0),x[225]=j(225,"clear_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[226]=j(226,"pcam_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[227]=j(227,"start_setevt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[228]=j(228,"warp_on",void 0,[],void 0),x[229]=j(229,"warp_off",void 0,[],void 0),x[230]=j(230,"get_slotnumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),xi=(x[231]=j(231,"get_servernumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[232]=j(232,"set_eventflag2",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[233]=j(233,"res",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[234]=j(234,"unknown_ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[235]=j(235,"enable_bgmctrl",void 0,[S(_,void 0,void 0)],W.Pop),x[236]=j(236,"sw_send",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[237]=j(237,"create_bgmctrl",void 0,[],void 0),x[238]=j(238,"pl_add_meseta2",void 0,[S(_,void 0,void 0)],W.Pop),x[239]=j(239,"sync_register",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[240]=j(240,"send_regwork",void 0,[],void 0),x[241]=j(241,"leti_fixed_camera_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[242]=j(242,"default_camera_pos1",void 0,[],void 0),x[243]=j(243,"unknown_f3",void 0,[],void 0),x[244]=j(244,"unknown_f4",void 0,[],void 0),x[245]=j(245,"unknown_f5",void 0,[],void 0),x[246]=j(246,"unknown_f6",void 0,[],void 0),x[247]=j(247,"unknown_f7",void 0,[],void 0),x[248]=j(248,"unknown_f8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[249]=j(249,"unknown_f9",void 0,[],void 0),x[250]=j(250,"get_gc_number",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[251]=j(251,"unknown_fb",void 0,[S(u,void 0,void 0)],void 0),x[252]=j(252,"unknown_fc",void 0,[],void 0),x[253]=j(253,"unknown_fd",void 0,[],void 0),x[254]=j(254,"unknown_fe",void 0,[],void 0),x[255]=j(255,"unknown_ff",void 0,[],void 0),x[63488]=j(63488,"unknown_f800",void 0,[],void 0),x[63489]=j(63489,"set_chat_callback",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63490]=j(63490,"unknown_f802",void 0,[],void 0),x[63491]=j(63491,"unknown_f803",void 0,[],void 0),x[63492]=j(63492,"unknown_f804",void 0,[],void 0),x[63493]=j(63493,"unknown_f805",void 0,[],void 0),x[63494]=j(63494,"unknown_f806",void 0,[],void 0),x[63495]=j(63495,"unknown_f807",void 0,[],void 0),x[63496]=j(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63497]=j(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63498]=j(63498,"get_coord_of_player","Retrieves a player's position.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Write),S(_,"Y coordinate.",P.Write),S(_,"Z coordinate.",P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63499]=j(63499,"enable_map",void 0,[],void 0),x[63500]=j(63500,"disable_map",void 0,[],void 0),x[63501]=j(63501,"map_designate_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),Ii=(x[63502]=j(63502,"unknown_f80e",void 0,[S(_,void 0,void 0)],W.Pop),x[63503]=j(63503,"unknown_f80f",void 0,[S(_,void 0,void 0)],W.Pop),x[63504]=j(63504,"ba_initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63505]=j(63505,"set_ba_rules",void 0,[],void 0),x[63506]=j(63506,"unknown_f812",void 0,[S(_,void 0,void 0)],W.Pop),x[63507]=j(63507,"unknown_f813",void 0,[S(_,void 0,void 0)],W.Pop),x[63508]=j(63508,"unknown_f814",void 0,[S(_,void 0,void 0)],W.Pop),x[63509]=j(63509,"unknown_f815",void 0,[S(_,void 0,void 0)],W.Pop),x[63510]=j(63510,"unknown_f816",void 0,[S(_,void 0,void 0)],W.Pop),x[63511]=j(63511,"unknown_f817",void 0,[S(_,void 0,void 0)],W.Pop),x[63512]=j(63512,"unknown_f818",void 0,[S(_,void 0,void 0)],W.Pop),x[63513]=j(63513,"unknown_f819",void 0,[S(_,void 0,void 0)],W.Pop),x[63514]=j(63514,"unknown_f81a",void 0,[S(_,void 0,void 0)],W.Pop),x[63515]=j(63515,"unknown_f81b",void 0,[S(_,void 0,void 0)],W.Pop),x[63516]=j(63516,"ba_disp_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[63517]=j(63517,"death_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63518]=j(63518,"death_tech_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63519]=j(63519,"unknown_f81f",void 0,[],void 0),x[63520]=j(63520,"cmode_stage",void 0,[S(_,void 0,void 0)],W.Pop),x[63521]=j(63521,"unknown_f821",void 0,[],void 0),x[63522]=j(63522,"unknown_f822",void 0,[],void 0),x[63523]=j(63523,"unknown_f823",void 0,[S(_,void 0,void 0)],W.Pop),x[63524]=j(63524,"unknown_f824",void 0,[S(_,void 0,void 0)],W.Pop),x[63525]=j(63525,"exp_multiplication",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63526]=j(63526,"exp_division",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63527]=j(63527,"get_user_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63528]=j(63528,"go_floor","Sends a player to the given floor.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read)]},void 0,void 0)],void 0),x[63529]=j(63529,"unknown_f829",void 0,[],void 0),x[63530]=j(63530,"unknown_f82a",void 0,[],void 0),x[63531]=j(63531,"unlock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63532]=j(63532,"lock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63533]=j(63533,"if_switch_not_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63534]=j(63534,"if_switch_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read),S(_,"Switch ID.",P.Read),S(_,"Will be set to 1 if the switch is pressed, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63535]=j(63535,"unknown_f82f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63536]=j(63536,"control_dragon",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63537]=j(63537,"release_dragon",void 0,[],void 0),x[63538]=j(63538,"unknown_f832",void 0,[],void 0),x[63539]=j(63539,"unknown_f833",void 0,[],void 0),x[63540]=j(63540,"unknown_f834",void 0,[],void 0),x[63541]=j(63541,"unknown_f835",void 0,[],void 0),x[63542]=j(63542,"unknown_f836",void 0,[],void 0),x[63543]=j(63543,"unknown_f837",void 0,[],void 0),x[63544]=j(63544,"shrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63545]=j(63545,"unshrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63546]=j(63546,"unknown_f83a",void 0,[],void 0),x[63547]=j(63547,"unknown_f83b",void 0,[],void 0),x[63548]=j(63548,"display_clock2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63549]=j(63549,"unknown_f83d",void 0,[S(_,void 0,void 0)],W.Pop),x[63550]=j(63550,"delete_area_title",void 0,[S(_,void 0,void 0)],W.Pop),x[63551]=j(63551,"unknown_f83f",void 0,[],void 0),x[63552]=j(63552,"load_npc_data",void 0,[],void 0),x[63553]=j(63553,"get_npc_data",void 0,[S(c,void 0,void 0)],void 0),x[63554]=j(63554,"unknown_f842",void 0,[],void 0),x[63555]=j(63555,"unknown_f843",void 0,[],void 0),x[63556]=j(63556,"unknown_f844",void 0,[],void 0),x[63557]=j(63557,"unknown_f845",void 0,[],void 0),x[63558]=j(63558,"unknown_f846",void 0,[],void 0),x[63559]=j(63559,"unknown_f847",void 0,[],void 0),x[63560]=j(63560,"give_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63561]=j(63561,"take_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63562]=j(63562,"unk_score_f84a",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63563]=j(63563,"unk_score_f84b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63564]=j(63564,"kill_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63565]=j(63565,"death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63566]=j(63566,"unk_score_f84e",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63567]=j(63567,"enemy_death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63568]=j(63568,"meseta_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63569]=j(63569,"unknown_f851",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63570]=j(63570,"unknown_f852",void 0,[S(_,void 0,void 0)],W.Pop),x[63571]=j(63571,"reverse_warps",void 0,[],void 0),x[63572]=j(63572,"unreverse_warps",void 0,[],void 0),x[63573]=j(63573,"set_ult_map",void 0,[],void 0),x[63574]=j(63574,"unset_ult_map",void 0,[],void 0),x[63575]=j(63575,"set_area_title",void 0,[S(R,void 0,void 0)],W.Pop),x[63576]=j(63576,"unknown_f858",void 0,[],void 0),x[63577]=j(63577,"unknown_f859",void 0,[],void 0),x[63578]=j(63578,"equip_item",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63579]=j(63579,"unequip_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63580]=j(63580,"unknown_f85c",void 0,[],void 0),x[63581]=j(63581,"unknown_f85d",void 0,[],void 0),x[63582]=j(63582,"unknown_f85e",void 0,[S(_,void 0,void 0)],W.Pop),x[63583]=j(63583,"unknown_f85f",void 0,[S(_,void 0,void 0)],W.Pop),x[63584]=j(63584,"unknown_f860",void 0,[],void 0),x[63585]=j(63585,"unknown_f861",void 0,[S(_,void 0,void 0)],W.Pop),x[63586]=j(63586,"unknown_f862",void 0,[],void 0),x[63587]=j(63587,"unknown_f863",void 0,[],void 0),x[63588]=j(63588,"cmode_rank",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63589]=j(63589,"award_item_name",void 0,[],void 0),x[63590]=j(63590,"award_item_select",void 0,[],void 0),x[63591]=j(63591,"award_item_give_to",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63592]=j(63592,"unknown_f868",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63593]=j(63593,"unknown_f869",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63594]=j(63594,"item_create_cmode",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63595]=j(63595,"unknown_f86b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63596]=j(63596,"award_item_ok",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63597]=j(63597,"unknown_f86d",void 0,[],void 0),x[63598]=j(63598,"unknown_f86e",void 0,[],void 0),x[63599]=j(63599,"ba_set_lives",void 0,[S(_,void 0,void 0)],W.Pop),x[63600]=j(63600,"ba_set_tech_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63601]=j(63601,"ba_set_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63602]=j(63602,"ba_set_time_limit",void 0,[S(_,void 0,void 0)],W.Pop),x[63603]=j(63603,"boss_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63604]=j(63604,"unknown_f874",void 0,[],void 0),x[63605]=j(63605,"unknown_f875",void 0,[],void 0),x[63606]=j(63606,"unknown_f876",void 0,[],void 0),x[63607]=j(63607,"enable_techs","Enables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63608]=j(63608,"disable_techs","Disables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63609]=j(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player gender.",P.Write)]},void 0,void 0)],void 0),x[63610]=j(63610,"get_chara_class","Retrieves the player's race and character class.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player race. 0 If human, 1 if newman, 2 if cast.",P.Write),S(_,"Player class. 0 If hunter, 1 if ranger, 2 if force.",P.Write)]},void 0,void 0)],void 0),x[63611]=j(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,"Amount of meseta to take.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Will be set to 1 if the meseta was taken, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63612]=j(63612,"unknown_f87c",void 0,[],void 0),x[63613]=j(63613,"unknown_f87d",void 0,[],void 0),x[63614]=j(63614,"unknown_f87e",void 0,[],void 0),x[63615]=j(63615,"read_guildcard_flag",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63616]=j(63616,"unknown_f880",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63617]=j(63617,"get_pl_name","Sets the value of to the given player's name.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63618]=j(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63619]=j(63619,"unknown_f883",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63620]=j(63620,"unknown_f884",void 0,[],void 0),x[63621]=j(63621,"unknown_f885",void 0,[],void 0),x[63622]=j(63622,"unknown_f886",void 0,[],void 0),x[63623]=j(63623,"unknown_f887",void 0,[],void 0),x[63624]=j(63624,"unknown_f888",void 0,[],void 0),x[63625]=j(63625,"unknown_f889",void 0,[],void 0),x[63626]=j(63626,"get_player_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63627]=j(63627,"send_mail",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63628]=j(63628,"online_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63629]=j(63629,"chl_set_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63630]=j(63630,"chl_get_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63631]=j(63631,"unknown_f88f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63632]=j(63632,"unknown_f890",void 0,[],void 0),x[63633]=j(63633,"load_enemy_data",void 0,[S(_,void 0,void 0)],W.Pop),x[63634]=j(63634,"get_physical_data",void 0,[S(u,void 0,void 0)],void 0),x[63635]=j(63635,"get_attack_data",void 0,[S(u,void 0,void 0)],void 0),x[63636]=j(63636,"get_resist_data",void 0,[S(u,void 0,void 0)],void 0),x[63637]=j(63637,"get_movement_data",void 0,[S(u,void 0,void 0)],void 0),x[63638]=j(63638,"unknown_f896",void 0,[],void 0),x[63639]=j(63639,"unknown_f897",void 0,[],void 0),x[63640]=j(63640,"shift_left",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63641]=j(63641,"shift_right",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63642]=j(63642,"get_random",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),ji=(x[63643]=j(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),x[63644]=j(63644,"disp_chl_retry_menu",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63645]=j(63645,"chl_reverser",void 0,[],void 0),x[63646]=j(63646,"unknown_f89e",void 0,[S(_,void 0,void 0)],W.Pop),x[63647]=j(63647,"unknown_f89f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63648]=j(63648,"unknown_f8a0",void 0,[],void 0),x[63649]=j(63649,"unknown_f8a1",void 0,[],void 0),x[63650]=j(63650,"unknown_f8a2",void 0,[],void 0),x[63651]=j(63651,"unknown_f8a3",void 0,[],void 0),x[63652]=j(63652,"unknown_f8a4",void 0,[],void 0),x[63653]=j(63653,"unknown_f8a5",void 0,[],void 0),x[63654]=j(63654,"unknown_f8a6",void 0,[],void 0),x[63655]=j(63655,"unknown_f8a7",void 0,[],void 0),x[63656]=j(63656,"unknown_f8a8",void 0,[S(_,void 0,void 0)],W.Pop),x[63657]=j(63657,"unknown_f8a9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63658]=j(63658,"unknown_f8aa",void 0,[],void 0),x[63659]=j(63659,"unknown_f8ab",void 0,[],void 0),x[63660]=j(63660,"unknown_f8ac",void 0,[],void 0),x[63661]=j(63661,"get_number_of_player2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63662]=j(63662,"unknown_f8ae",void 0,[],void 0),x[63663]=j(63663,"unknown_f8af",void 0,[],void 0),x[63664]=j(63664,"unknown_f8b0",void 0,[],void 0),x[63665]=j(63665,"unknown_f8b1",void 0,[],void 0),x[63666]=j(63666,"unknown_f8b2",void 0,[],void 0),x[63667]=j(63667,"unknown_f8b3",void 0,[],void 0),x[63668]=j(63668,"unknown_f8b4",void 0,[],void 0),x[63669]=j(63669,"unknown_f8b5",void 0,[],void 0),x[63670]=j(63670,"unknown_f8b6",void 0,[],void 0),x[63671]=j(63671,"unknown_f8b7",void 0,[],void 0),x[63672]=j(63672,"unknown_f8b8",void 0,[],void 0),x[63673]=j(63673,"chl_recovery",void 0,[],void 0),x[63674]=j(63674,"unknown_f8ba",void 0,[],void 0),x[63675]=j(63675,"unknown_f8bb",void 0,[],void 0),x[63676]=j(63676,"set_episode",void 0,[S(_,void 0,void 0)],void 0),x[63677]=j(63677,"unknown_f8bd",void 0,[],void 0),x[63678]=j(63678,"unknown_f8be",void 0,[],void 0),x[63679]=j(63679,"unknown_f8bf",void 0,[],void 0),x[63680]=j(63680,"file_dl_req",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63681]=j(63681,"get_dl_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63682]=j(63682,"gba_unknown4",void 0,[],void 0),x[63683]=j(63683,"get_gba_state",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63684]=j(63684,"unknown_f8c4",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63685]=j(63685,"unknown_f8c5",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63686]=j(63686,"qexit",void 0,[],void 0),x[63687]=j(63687,"use_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Animation ID.",P.Read),S(_,"Animation duration in number of frames.",P.Read)]},void 0,void 0)],void 0),x[63688]=j(63688,"stop_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63689]=j(63689,"run_to_coord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63690]=j(63690,"set_slot_invincible",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63691]=j(63691,"unknown_f8cb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63692]=j(63692,"set_slot_poison",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63693]=j(63693,"set_slot_paralyze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63694]=j(63694,"set_slot_shock",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63695]=j(63695,"set_slot_freeze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63696]=j(63696,"set_slot_slow",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63697]=j(63697,"set_slot_confuse",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63698]=j(63698,"set_slot_shifta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63699]=j(63699,"set_slot_deband",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63700]=j(63700,"set_slot_jellen",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63701]=j(63701,"set_slot_zalure",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63702]=j(63702,"fleti_fixed_camera",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63703]=j(63703,"fleti_locked_camera",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63704]=j(63704,"default_camera_pos2",void 0,[],void 0),x[63705]=j(63705,"set_motion_blur",void 0,[],void 0),x[63706]=j(63706,"set_screen_bw",void 0,[],void 0),x[63707]=j(63707,"unknown_f8db",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63708]=j(63708,"npc_action_string",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(k,void 0,void 0)],void 0),x[63709]=j(63709,"get_pad_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63710]=j(63710,"get_button_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63711]=j(63711,"freeze_enemies",void 0,[],void 0),x[63712]=j(63712,"unfreeze_enemies",void 0,[],void 0),x[63713]=j(63713,"freeze_everything",void 0,[],void 0),x[63714]=j(63714,"unfreeze_everything",void 0,[],void 0),x[63715]=j(63715,"restore_hp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63716]=j(63716,"restore_tp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63717]=j(63717,"close_chat_bubble",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63718]=j(63718,"move_coords_object",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63719]=j(63719,"at_coords_call_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63720]=j(63720,"unknown_f8e8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63721]=j(63721,"unknown_f8e9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63722]=j(63722,"unknown_f8ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63723]=j(63723,"unknown_f8eb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63724]=j(63724,"unknown_f8ec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63725]=j(63725,"animation_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63726]=j(63726,"call_image_data",void 0,[S(_,void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63727]=j(63727,"unknown_f8ef",void 0,[],void 0),x[63728]=j(63728,"turn_off_bgm_p2",void 0,[],void 0),x[63729]=j(63729,"turn_on_bgm_p2",void 0,[],void 0),x[63730]=j(63730,"load_unk_data",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(c,void 0,void 0)],W.Pop),x[63731]=j(63731,"particle2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63732]=j(63732,"unknown_f8f4",void 0,[],void 0),x[63733]=j(63733,"unknown_f8f5",void 0,[],void 0),x[63734]=j(63734,"unknown_f8f6",void 0,[],void 0),x[63735]=j(63735,"unknown_f8f7",void 0,[],void 0),x[63736]=j(63736,"unknown_f8f8",void 0,[],void 0),x[63737]=j(63737,"unknown_f8f9",void 0,[],void 0),x[63738]=j(63738,"unknown_f8fa",void 0,[],void 0),x[63739]=j(63739,"unknown_f8fb",void 0,[],void 0),x[63740]=j(63740,"unknown_f8fc",void 0,[],void 0),x[63741]=j(63741,"unknown_f8fd",void 0,[],void 0),x[63742]=j(63742,"unknown_f8fe",void 0,[],void 0),x[63743]=j(63743,"unknown_f8ff",void 0,[],void 0),x[63744]=j(63744,"unknown_f900",void 0,[],void 0),x[63745]=j(63745,"dec2float",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63746]=j(63746,"float2dec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63747]=j(63747,"flet",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63748]=j(63748,"fleti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63749]=j(63749,"unknown_f905",void 0,[],void 0),x[63750]=j(63750,"unknown_f906",void 0,[],void 0),x[63751]=j(63751,"unknown_f907",void 0,[],void 0),x[63752]=j(63752,"fadd",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63753]=j(63753,"faddi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63754]=j(63754,"fsub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63755]=j(63755,"fsubi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63756]=j(63756,"fmul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63757]=j(63757,"fmuli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63758]=j(63758,"fdiv",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63759]=j(63759,"fdivi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63760]=j(63760,"get_unknown_count",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63761]=j(63761,"get_stackable_item_count",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63762]=j(63762,"freeze_and_hide_equip",void 0,[],void 0),x[63763]=j(63763,"thaw_and_show_equip",void 0,[],void 0),x[63764]=j(63764,"set_palettex_callback",void 0,[S(_,"Player slot.",void 0),S(f,void 0,void 0)],W.Pop),x[63765]=j(63765,"activate_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63766]=j(63766,"enable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63767]=j(63767,"restore_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63768]=j(63768,"disable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63769]=j(63769,"get_palettex_activated",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63770]=j(63770,"get_unknown_palettex_status",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63771]=j(63771,"disable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63772]=j(63772,"enable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63773]=j(63773,"get_time_played",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63774]=j(63774,"get_guildcard_total",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63775]=j(63775,"get_slot_meseta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63776]=j(63776,"get_player_level",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63777]=j(63777,"get_section_id",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63778]=j(63778,"get_player_hp",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Maximum HP.",P.Write),S(_,"Current HP.",P.Write),S(_,"Maximum TP.",P.Write),S(_,"Current TP.",P.Write)]},void 0,void 0)],W.Pop),x[63779]=j(63779,"get_floor_number",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63780]=j(63780,"get_coord_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63781]=j(63781,"read_global_flag",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63782]=j(63782,"write_global_flag",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63783]=j(63783,"unknown_f927",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63784]=j(63784,"floor_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63785]=j(63785,"read_disk_file",void 0,[S(R,void 0,void 0)],W.Pop),x[63786]=j(63786,"open_pack_select",void 0,[],void 0),x[63787]=j(63787,"item_select",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63788]=j(63788,"get_item_id",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63789]=j(63789,"color_change",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63790]=j(63790,"send_statistic",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63791]=j(63791,"unknown_f92f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63792]=j(63792,"chat_box",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63793]=j(63793,"chat_bubble",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63794]=j(63794,"unknown_f932",void 0,[],void 0),x[63795]=j(63795,"unknown_f933",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63796]=j(63796,"scroll_text",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63797]=j(63797,"gba_unknown1",void 0,[],void 0),x[63798]=j(63798,"gba_unknown2",void 0,[],void 0),x[63799]=j(63799,"gba_unknown3",void 0,[],void 0),x[63800]=j(63800,"add_damage_to",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63801]=j(63801,"item_delete3",void 0,[S(_,void 0,void 0)],W.Pop),x[63802]=j(63802,"get_item_info",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63803]=j(63803,"item_packing1",void 0,[S(_,void 0,void 0)],W.Pop),x[63804]=j(63804,"item_packing2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63805]=j(63805,"get_lang_setting",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63806]=j(63806,"prepare_statistic",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63807]=j(63807,"keyword_detect",void 0,[],void 0),x[63808]=j(63808,"keyword",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0),S(R,void 0,void 0)],W.Pop),x[63809]=j(63809,"get_guildcard_num",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63810]=j(63810,"unknown_f942",void 0,[],void 0),x[63811]=j(63811,"unknown_f943",void 0,[],void 0),x[63812]=j(63812,"get_wrap_status",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63813]=j(63813,"initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63814]=j(63814,"sin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63815]=j(63815,"cos",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63816]=j(63816,"unknown_f948",void 0,[],void 0),x[63817]=j(63817,"unknown_f949",void 0,[],void 0),x[63818]=j(63818,"boss_is_dead2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63819]=j(63819,"unknown_f94b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63820]=j(63820,"unknown_f94c",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63821]=j(63821,"is_there_cardbattle",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63822]=j(63822,"unknown_f94e",void 0,[],void 0),x[63823]=j(63823,"unknown_f94f",void 0,[],void 0),x[63824]=j(63824,"bb_p2_menu",void 0,[S(_,void 0,void 0)],W.Pop),x[63825]=j(63825,"bb_map_designate",void 0,[S(l,void 0,void 0),S(u,void 0,void 0),S(l,void 0,void 0),S(l,void 0,void 0)],void 0));x[63826]=j(63826,"bb_get_number_in_pack",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63827]=j(63827,"bb_swap_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63828]=j(63828,"bb_check_wrap",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63829]=j(63829,"bb_exchange_pd_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63830]=j(63830,"bb_exchange_pd_srank",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63831]=j(63831,"bb_exchange_pd_special",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63832]=j(63832,"bb_exchange_pd_percent",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63833]=j(63833,"unknown_f959",void 0,[S(_,void 0,void 0)],W.Pop),x[63834]=j(63834,"unknown_f95a",void 0,[],void 0),x[63835]=j(63835,"unknown_f95b",void 0,[],void 0),x[63836]=j(63836,"bb_exchange_slt",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63837]=j(63837,"bb_exchange_pc",void 0,[],void 0),x[63838]=j(63838,"bb_box_create_bp",void 0,[S(_,void 0,void 0),S(p,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63839]=j(63839,"bb_exchange_pt",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63840]=j(63840,"unknown_f960",void 0,[S(_,void 0,void 0)],W.Pop),x[63841]=j(63841,"unknown_f961",void 0,[],void 0),x[63842]=j(63842,"unknown_f962",void 0,[],void 0),x[63843]=j(63843,"unknown_f963",void 0,[],void 0),x[63844]=j(63844,"unknown_f964",void 0,[],void 0),x[63845]=j(63845,"unknown_f965",void 0,[],void 0),x[63846]=j(63846,"unknown_f966",void 0,[],void 0),x[63847]=j(63847,"unknown_f967",void 0,[],void 0),x[63848]=j(63848,"unknown_f968",void 0,[],void 0),x[63849]=j(63849,"unknown_f969",void 0,[],void 0),x[63850]=j(63850,"unknown_f96a",void 0,[],void 0),x[63851]=j(63851,"unknown_f96b",void 0,[],void 0),x[63852]=j(63852,"unknown_f96c",void 0,[],void 0),x[63853]=j(63853,"unknown_f96d",void 0,[],void 0),x[63854]=j(63854,"unknown_f96e",void 0,[],void 0),x[63855]=j(63855,"unknown_f96f",void 0,[],void 0),x[63856]=j(63856,"unknown_f970",void 0,[],void 0),x[63857]=j(63857,"unknown_f971",void 0,[],void 0),x[63858]=j(63858,"unknown_f972",void 0,[],void 0),x[63859]=j(63859,"unknown_f973",void 0,[],void 0),x[63860]=j(63860,"unknown_f974",void 0,[],void 0),x[63861]=j(63861,"unknown_f975",void 0,[],void 0),x[63862]=j(63862,"unknown_f976",void 0,[],void 0),x[63863]=j(63863,"unknown_f977",void 0,[],void 0),x[63864]=j(63864,"unknown_f978",void 0,[],void 0),x[63865]=j(63865,"unknown_f979",void 0,[],void 0),x[63866]=j(63866,"unknown_f97a",void 0,[],void 0),x[63867]=j(63867,"unknown_f97b",void 0,[],void 0),x[63868]=j(63868,"unknown_f97c",void 0,[],void 0),x[63869]=j(63869,"unknown_f97d",void 0,[],void 0),x[63870]=j(63870,"unknown_f97e",void 0,[],void 0),x[63871]=j(63871,"unknown_f97f",void 0,[],void 0),x[63872]=j(63872,"unknown_f980",void 0,[],void 0),x[63873]=j(63873,"unknown_f981",void 0,[],void 0),x[63874]=j(63874,"unknown_f982",void 0,[],void 0),x[63875]=j(63875,"unknown_f983",void 0,[],void 0),x[63876]=j(63876,"unknown_f984",void 0,[],void 0),x[63877]=j(63877,"unknown_f985",void 0,[],void 0),x[63878]=j(63878,"unknown_f986",void 0,[],void 0),x[63879]=j(63879,"unknown_f987",void 0,[],void 0),x[63880]=j(63880,"unknown_f988",void 0,[],void 0),x[63881]=j(63881,"unknown_f989",void 0,[],void 0),x[63882]=j(63882,"unknown_f98a",void 0,[],void 0),x[63883]=j(63883,"unknown_f98b",void 0,[],void 0),x[63884]=j(63884,"unknown_f98c",void 0,[],void 0),x[63885]=j(63885,"unknown_f98d",void 0,[],void 0),x[63886]=j(63886,"unknown_f98e",void 0,[],void 0),x[63887]=j(63887,"unknown_f98f",void 0,[],void 0),x[63888]=j(63888,"unknown_f990",void 0,[],void 0),x[63889]=j(63889,"unknown_f991",void 0,[],void 0),x[63890]=j(63890,"unknown_f992",void 0,[],void 0),x[63891]=j(63891,"unknown_f993",void 0,[],void 0),x[63892]=j(63892,"unknown_f994",void 0,[],void 0),x[63893]=j(63893,"unknown_f995",void 0,[],void 0),x[63894]=j(63894,"unknown_f996",void 0,[],void 0),x[63895]=j(63895,"unknown_f997",void 0,[],void 0),x[63896]=j(63896,"unknown_f998",void 0,[],void 0),x[63897]=j(63897,"unknown_f999",void 0,[],void 0),x[63898]=j(63898,"unknown_f99a",void 0,[],void 0),x[63899]=j(63899,"unknown_f99b",void 0,[],void 0),x[63900]=j(63900,"unknown_f99c",void 0,[],void 0),x[63901]=j(63901,"unknown_f99d",void 0,[],void 0),x[63902]=j(63902,"unknown_f99e",void 0,[],void 0),x[63903]=j(63903,"unknown_f99f",void 0,[],void 0),x[63904]=j(63904,"unknown_f9a0",void 0,[],void 0),x[63905]=j(63905,"unknown_f9a1",void 0,[],void 0),x[63906]=j(63906,"unknown_f9a2",void 0,[],void 0),x[63907]=j(63907,"unknown_f9a3",void 0,[],void 0),x[63908]=j(63908,"unknown_f9a4",void 0,[],void 0),x[63909]=j(63909,"unknown_f9a5",void 0,[],void 0),x[63910]=j(63910,"unknown_f9a6",void 0,[],void 0),x[63911]=j(63911,"unknown_f9a7",void 0,[],void 0),x[63912]=j(63912,"unknown_f9a8",void 0,[],void 0),x[63913]=j(63913,"unknown_f9a9",void 0,[],void 0),x[63914]=j(63914,"unknown_f9aa",void 0,[],void 0),x[63915]=j(63915,"unknown_f9ab",void 0,[],void 0),x[63916]=j(63916,"unknown_f9ac",void 0,[],void 0),x[63917]=j(63917,"unknown_f9ad",void 0,[],void 0),x[63918]=j(63918,"unknown_f9ae",void 0,[],void 0),x[63919]=j(63919,"unknown_f9af",void 0,[],void 0),x[63920]=j(63920,"unknown_f9b0",void 0,[],void 0),x[63921]=j(63921,"unknown_f9b1",void 0,[],void 0),x[63922]=j(63922,"unknown_f9b2",void 0,[],void 0),x[63923]=j(63923,"unknown_f9b3",void 0,[],void 0),x[63924]=j(63924,"unknown_f9b4",void 0,[],void 0),x[63925]=j(63925,"unknown_f9b5",void 0,[],void 0),x[63926]=j(63926,"unknown_f9b6",void 0,[],void 0),x[63927]=j(63927,"unknown_f9b7",void 0,[],void 0),x[63928]=j(63928,"unknown_f9b8",void 0,[],void 0),x[63929]=j(63929,"unknown_f9b9",void 0,[],void 0),x[63930]=j(63930,"unknown_f9ba",void 0,[],void 0),x[63931]=j(63931,"unknown_f9bb",void 0,[],void 0),x[63932]=j(63932,"unknown_f9bc",void 0,[],void 0),x[63933]=j(63933,"unknown_f9bd",void 0,[],void 0),x[63934]=j(63934,"unknown_f9be",void 0,[],void 0),x[63935]=j(63935,"unknown_f9bf",void 0,[],void 0),x[63936]=j(63936,"unknown_f9c0",void 0,[],void 0),x[63937]=j(63937,"unknown_f9c1",void 0,[],void 0),x[63938]=j(63938,"unknown_f9c2",void 0,[],void 0),x[63939]=j(63939,"unknown_f9c3",void 0,[],void 0),x[63940]=j(63940,"unknown_f9c4",void 0,[],void 0),x[63941]=j(63941,"unknown_f9c5",void 0,[],void 0),x[63942]=j(63942,"unknown_f9c6",void 0,[],void 0),x[63943]=j(63943,"unknown_f9c7",void 0,[],void 0),x[63944]=j(63944,"unknown_f9c8",void 0,[],void 0),x[63945]=j(63945,"unknown_f9c9",void 0,[],void 0),x[63946]=j(63946,"unknown_f9ca",void 0,[],void 0),x[63947]=j(63947,"unknown_f9cb",void 0,[],void 0),x[63948]=j(63948,"unknown_f9cc",void 0,[],void 0),x[63949]=j(63949,"unknown_f9cd",void 0,[],void 0),x[63950]=j(63950,"unknown_f9ce",void 0,[],void 0),x[63951]=j(63951,"unknown_f9cf",void 0,[],void 0),x[63952]=j(63952,"unknown_f9d0",void 0,[],void 0),x[63953]=j(63953,"unknown_f9d1",void 0,[],void 0),x[63954]=j(63954,"unknown_f9d2",void 0,[],void 0),x[63955]=j(63955,"unknown_f9d3",void 0,[],void 0),x[63956]=j(63956,"unknown_f9d4",void 0,[],void 0),x[63957]=j(63957,"unknown_f9d5",void 0,[],void 0),x[63958]=j(63958,"unknown_f9d6",void 0,[],void 0),x[63959]=j(63959,"unknown_f9d7",void 0,[],void 0),x[63960]=j(63960,"unknown_f9d8",void 0,[],void 0),x[63961]=j(63961,"unknown_f9d9",void 0,[],void 0),x[63962]=j(63962,"unknown_f9da",void 0,[],void 0),x[63963]=j(63963,"unknown_f9db",void 0,[],void 0),x[63964]=j(63964,"unknown_f9dc",void 0,[],void 0),x[63965]=j(63965,"unknown_f9dd",void 0,[],void 0),x[63966]=j(63966,"unknown_f9de",void 0,[],void 0),x[63967]=j(63967,"unknown_f9df",void 0,[],void 0),x[63968]=j(63968,"unknown_f9e0",void 0,[],void 0),x[63969]=j(63969,"unknown_f9e1",void 0,[],void 0),x[63970]=j(63970,"unknown_f9e2",void 0,[],void 0),x[63971]=j(63971,"unknown_f9e3",void 0,[],void 0),x[63972]=j(63972,"unknown_f9e4",void 0,[],void 0),x[63973]=j(63973,"unknown_f9e5",void 0,[],void 0),x[63974]=j(63974,"unknown_f9e6",void 0,[],void 0),x[63975]=j(63975,"unknown_f9e7",void 0,[],void 0),x[63976]=j(63976,"unknown_f9e8",void 0,[],void 0),x[63977]=j(63977,"unknown_f9e9",void 0,[],void 0),x[63978]=j(63978,"unknown_f9ea",void 0,[],void 0),x[63979]=j(63979,"unknown_f9eb",void 0,[],void 0),x[63980]=j(63980,"unknown_f9ec",void 0,[],void 0),x[63981]=j(63981,"unknown_f9ed",void 0,[],void 0),x[63982]=j(63982,"unknown_f9ee",void 0,[],void 0),x[63983]=j(63983,"unknown_f9ef",void 0,[],void 0),x[63984]=j(63984,"unknown_f9f0",void 0,[],void 0),x[63985]=j(63985,"unknown_f9f1",void 0,[],void 0),x[63986]=j(63986,"unknown_f9f2",void 0,[],void 0),x[63987]=j(63987,"unknown_f9f3",void 0,[],void 0),x[63988]=j(63988,"unknown_f9f4",void 0,[],void 0),x[63989]=j(63989,"unknown_f9f5",void 0,[],void 0),x[63990]=j(63990,"unknown_f9f6",void 0,[],void 0),x[63991]=j(63991,"unknown_f9f7",void 0,[],void 0),x[63992]=j(63992,"unknown_f9f8",void 0,[],void 0),x[63993]=j(63993,"unknown_f9f9",void 0,[],void 0),x[63994]=j(63994,"unknown_f9fa",void 0,[],void 0),x[63995]=j(63995,"unknown_f9fb",void 0,[],void 0),x[63996]=j(63996,"unknown_f9fc",void 0,[],void 0),x[63997]=j(63997,"unknown_f9fd",void 0,[],void 0),x[63998]=j(63998,"unknown_f9fe",void 0,[],void 0),x[63999]=j(63999,"unknown_f9ff",void 0,[],void 0);function Li(i,e){if(!i){let i="Assertion Error";throw e&&(i+=": "+(e instanceof Function?e():e)),new Error(i)}}var zi,Di;x.forEach(i=>{I.set(i.mnemonic,i)}),function(i){i[i.Instructions=0]="Instructions",i[i.Data=1]="Data",i[i.String=2]="String"}(zi||(zi={})),function(i){i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warning=3]="Warning",i[i.Error=4]="Error",i[i.Off=5]="Off"}(Di||(Di={}));!function(i){const e=Object.values(i),o=e.filter(i=>"number"==typeof i);o.length}(Di);function Ci(i,e){return i.toString().padStart(e,"0")}class Mi{constructor(i){this.name=i,this.trace=(i,e)=>{this.log(Di.Trace,i,e)},this.debug=(i,e)=>{this.log(Di.Debug,i,e)},this.info=(i,e)=>{this.log(Di.Info,i,e)},this.warning=(i,e)=>{this.log(Di.Warning,i,e)},this.error=(i,e)=>{this.log(Di.Error,i,e)}}get severity(){var i;return null!=(i=this._severity)?i:$i.default_severity}set severity(i){this._severity=i}get handler(){var i;return null!=(i=this._handler)?i:$i.default_handler}set handler(i){this._handler=i}log(i,e,o){i>=this.severity&&this.handler({time:new Date,message:e,severity:i,logger:this,cause:o},this.name)}}class $i{static get(i){let e=this.loggers.get(i);return e||(e=new Mi(i),this.loggers.set(i,e)),e}static with_default_handler(i,e){const o=this.default_handler;let d=!1;try{this.default_handler=i;const t=e();return t instanceof Promise?(d=!0,t.finally(()=>this.default_handler=o)):t}finally{d||(this.default_handler=o)}}}$i.loggers=new Map,$i.default_severity=function(i){const e=Di[i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()];return Li(null!=e,()=>`"${i}" is not a valid severity.`),e}("Info"),$i.default_handler=function({time:i,message:e,severity:o,logger:d,cause:t}){const v=`${function(i){const e=Ci(i.getHours(),2),o=Ci(i.getMinutes(),2),d=Ci(i.getSeconds(),2),t=Ci(i.getMilliseconds(),3);return`${e}:${o}:${d}.${t}`}(i)} [${Di[o]}] ${d.name} - ${e}`;let n;switch(o){case Di.Trace:n=console.trace;break;case Di.Debug:n=console.debug;break;case Di.Info:n=console.info;break;case Di.Warning:n=console.warn;break;case Di.Error:n=console.error;break;default:n=console.log}null==t?n.call(console,v):n.call(console,v,t)};const Ai=$i.get("quest_editor/scripting/assembly");class Ni{constructor(i,e){this.assembly=i,this.manual_stack=e,this.lexer=new r,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const i of this.assembly){if(this.tokens=this.lexer.tokenize_line(i),this.tokens.length>0){const i=this.tokens.shift();let e=!1;switch(i.type){case n.Label:this.parse_label(i),e=!0;break;case n.CodeSection:case n.DataSection:case n.StringSection:this.parse_section(i);break;case n.Int:this.section===zi.Data?this.parse_bytes(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.String:this.section===zi.String?this.parse_string(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.Ident:this.section===zi.Instructions?this.parse_instruction(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.InvalidSection:this.add_error({col:i.col,length:i.len,message:"Invalid section type."});break;case n.InvalidIdent:this.add_error({col:i.col,length:i.len,message:"Invalid identifier."});break;default:this.add_error({col:i.col,length:i.len,message:"Unexpected token."})}this.prev_line_had_label=e}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(i,e,o,d,t,v){if(this.segment)this.segment.type===zi.Instructions?this.segment.instructions.push(function(i,e,o){const d=Math.min(i.params.length,e.length),t=[];let v=0;for(let o=0;o({line_no:this.line_no,col:i.col,len:i.len})),stack_args:v.map((i,e)=>({line_no:this.line_no,col:i.col,len:i.len,value:o[e].value}))})):Ai.error(`Line ${this.line_no}: Expected instructions segment.`);else{const i={labels:[],type:zi.Instructions,instructions:[],asm:{labels:[]}};this.segment=i,this.object_code.push(i)}}add_bytes(i){if(this.segment)if(this.segment.type===zi.Data){const e=new ArrayBuffer(this.segment.data.byteLength+i.length),o=new Uint8Array(e);o.set(new Uint8Array(this.segment.data)),o.set(new Uint8Array(i),this.segment.data.byteLength),this.segment.data=e}else Ai.error(`Line ${this.line_no}: Expected data segment.`);else{const e={labels:[],type:zi.Data,data:new Uint8Array(i).buffer,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_string(i){if(this.segment)this.segment.type===zi.String?this.segment.value+=i:Ai.error(`Line ${this.line_no}: Expected string segment.`);else{const e={labels:[],type:zi.String,value:i,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_error({col:i,length:e,message:o}){this.errors.push({line_no:this.line_no,col:i,length:e,message:o})}add_warning({col:i,length:e,message:o}){this.warnings.push({line_no:this.line_no,col:i,length:e,message:o})}parse_label({col:i,len:e,value:o}){this.labels.has(o)&&this.add_error({col:i,length:e,message:"Duplicate label."}),this.labels.add(o);const d=this.tokens.shift(),t={line_no:this.line_no,col:i,len:e};if(this.prev_line_had_label){const i=this.object_code[this.object_code.length-1];i.labels.push(o),i.asm.labels.push(t)}switch(this.section){case zi.Instructions:this.prev_line_had_label||(this.segment={type:zi.Instructions,labels:[o],instructions:[],asm:{labels:[t]}},this.object_code.push(this.segment)),d&&(d.type===n.Ident?this.parse_instruction(d):this.add_error({col:d.col,length:d.len,message:"Expected opcode mnemonic."}));break;case zi.Data:this.prev_line_had_label||(this.segment={type:zi.Data,labels:[o],data:new ArrayBuffer(0),asm:{labels:[t]}},this.object_code.push(this.segment)),d&&(d.type===n.Int?this.parse_bytes(d):this.add_error({col:d.col,length:d.len,message:"Expected bytes."}));break;case zi.String:this.prev_line_had_label||(this.segment={type:zi.String,labels:[o],value:"",asm:{labels:[t]}},this.object_code.push(this.segment)),d&&(d.type===n.String?this.parse_string(d):this.add_error({col:d.col,length:d.len,message:"Expected a string."}))}}parse_section({type:i,col:e,len:o}){let d;switch(i){case n.CodeSection:d=zi.Instructions;break;case n.DataSection:d=zi.Data;break;case n.StringSection:d=zi.String}this.section!==d||this.first_section_marker||this.add_warning({col:e,length:o,message:"Unnecessary section marker."}),this.section=d,this.first_section_marker=!1;const t=this.tokens.shift();t&&this.add_error({col:t.col,length:t.len,message:"Unexpected token."})}parse_instruction(i){const{col:e,len:o,value:d}=i,t=I.get(d);if(t){const o=-1!==t.params.findIndex(i=>i.type.kind===s.ILabelVar||i.type.kind===s.RegRefVar),d=this.manual_stack&&t.stack===W.Pop?0:t.params.length;let a=0;for(const i of this.tokens)i.type!==n.ArgSeparator&&a++;const l=this.tokens[this.tokens.length-1],u=l?l.col+l.len-e:0,_=[],p=[];if(!o&&a!==d)return void this.add_error({col:e,length:u,message:`Expected ${d} argument${1===d?"":"s"}, got ${a}.`});if(o&&ar?this.add_error({col:t,length:v,message:`${n}-Bit integer can't be greater than ${r}.`}):o.push([{value:d,size:i},e])}parse_register(i,e){const{col:o,len:d,value:t}=i;t>255?this.add_error({col:o,length:d,message:"Invalid register reference, expected r0-r255."}):e.push([{value:t,size:1},i])}parse_bytes(i){const e=[];let o=i,d=0;for(;o.type===n.Int&&(o.value<0?this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be less than 0."}):o.value>255&&this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be greater than 255."}),e.push(o.value),d"))}}var qi;!function(i){i[i.None=0]="None",i[i.Return=1]="Return",i[i.Jump=2]="Jump",i[i.ConditionalJump=3]="ConditionalJump",i[i.Call=4]="Call"}(qi||(qi={}));class Fi{constructor(i,e,o,d,t){this.from=[],this.to=[],this.segment=i,this.start=e,this.end=o,this.branch_type=d,this.branch_labels=t}link_to(i){this.to.includes(i)||(this.to.push(i),i.from.push(this))}index_of_instruction(i){const e=this.segment.instructions.indexOf(i,this.start);return ei.value);break;case B.code:case z.code:s=qi.Call,r=[n.args[0].value];break;case fi.code:s=qi.Call,r=n.args.slice(1).map(i=>i.value);break;default:if(v===o-1){s=qi.None,r=[];break}continue}const a=new Fi(e,d,v+1,s,r);for(let e=a.start;e{let i=0,e=NaN;return{next:()=>{let o=!0;return ithis.intervals[i].end?(i++,ii+e.end-e.start+1,0)}get(i){for(const{start:e,end:o}of this.intervals){const d=o-e+1;if(ithis.intervals[d].start;)i.end=this.intervals[d].end,d++;this.intervals.splice(e+1,d-e-1),i.end=Math.max(i.end,o.end),e++;continue i}e++}this.intervals.push(o)}return this}to_array(){const i=[];for(const{start:e,end:o}of this.intervals)for(let d=e;d<=o;d++)i.push(d);return i}}const Bi=$i.get("core/data_formats/asm/data_flow_analysis/register_value"),Hi=T,Ji=y;Math.pow(2,32);function Yi(i,e,o){const d=i.get_block_for_instruction(e);return d?function i(e,o,d,t,v){if(++e.iterations>100)return Bi.warning("Too many iterations."),(new Vi).set_interval(Hi,Ji);for(let n=t-1;n>=d.start;n--){const t=d.segment.instructions[n],r=t.args;switch(t.opcode.code){case D.code:if(r[0].value===v)return i(e,new Set(o),d,n,r[1].value);break;case C.code:case M.code:case $.code:case Wi.code:if(r[0].value===v)return(new Vi).set_value(r[1].value);break;case A.code:if(r[0].value===v)return(new Vi).set_value(1);break;case N.code:if(r[0].value===v)return(new Vi).set_value(0);break;case q.code:if(r[0].value===v){const t=i(e,new Set(o),d,n,v),s=t.size();return 0===s||1===s&&0===t.get(0)?(new Vi).set_value(1):t.has(0)?(new Vi).set_interval(0,1):(new Vi).set_value(0)}break;case F.code:if(r[0].value===v){return i(e,new Set(o),d,n,v).scalar_add(r[1].value)}break;case E.code:if(r[0].value===v){return i(e,new Set(o),d,n,v).scalar_sub(r[1].value)}break;case O.code:if(r[0].value===v){return i(e,new Set(o),d,n,v).scalar_mul(r[1].value)}break;case U.code:if(r[0].value===v){return i(e,new Set(o),d,n,v).scalar_div(r[1].value)}break;case Ti.code:if(r[0].value===v)return(new Vi).set_interval(0,1);break;case yi.code:if(r[0].value===v)return(new Vi).set_interval(0,2);break;case Si.code:if(r[0].value===v)return(new Vi).set_interval(0,3);break;case Ii.code:if(r[1].value===v){const t=i(e,new Set(o),d,n,r[0].value).min()||0,v=Math.max(i(e,new Set(o),d,n,r[0].value+1).max()||0,t+1);return(new Vi).set_interval(t,v-1)}break;case ci.code:case ki.code:{const i=r[0].value,e=r[0].value+r[1].value;if(i<=v&&vi.type===n.Ident);if(v&&(e=I.get(v.value),e))for(const e of t){if(e.col+e.len>i.col)break;e.type===n.Ident&&-1===o?o=0:e.type===n.ArgSeparator&&o++}}const d={type:t.SignatureHelp,id:i.id,opcode:e,active_param:o};Ki.postMessage(d)}function ae(i){const e=function(i,e){const o=ee[i];if(!o)return;const d=ie[o.segment_index];if(!d||d.type!==zi.Instructions)return;for(const t of o.instruction_indices){const o=d.instructions[t];if(o&&o.asm){const d=o.opcode.params;for(let t=0;ti.type===zi.Instructions);for(let i=0;i=o.col&&e<=o.col+o.len)}Ki.onmessage=i=>{de.push(i.data),te||(ne(),te=setTimeout(()=>{te=void 0,ne()},100))}}}); \ No newline at end of file diff --git a/index.html b/index.html index b4520f27..fc99fb61 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Phantasmal World - + - + \ No newline at end of file diff --git a/main.5341660f114e006490ee.js b/main.5341660f114e006490ee.js deleted file mode 100644 index d488487b..00000000 --- a/main.5341660f114e006490ee.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"+LO4":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));const s=i("rwco").c.get("core/observable/property/AbstractMinimalProperty");class n{constructor(){this.is_property=!0,this.observers=[]}observe(e,t){return this.observers.push(e),t&&t.call_now&&this.call_observer(e,this.val),{dispose:()=>{const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}}}emit(){const e=this.val;for(const t of this.observers)this.call_observer(t,e)}call_observer(e,t){try{e({value:t})}catch(e){s.error("Observer threw error.",e)}}}},"/7QA":function(e,t,i){"use strict";i.r(t);i("LSZE"),i("8UJ8"),i("XtFL"),i("tjRy"),i("3oCa"),i("OP0w");var s=i("4SjJ");i("ouMO");class n{constructor(e,t,i,s,n,o,r){this.id=e,this.name=t,this.min_atp=i,this.max_atp=s,this.ata=n,this.max_grind=o,this.required_atp=r}}class o{constructor(e,t,i,s,n,o,r,a,l,u,d){this.id=e,this.name=t,this.atp=i,this.ata=s,this.min_evp=n,this.max_evp=o,this.min_dfp=r,this.max_dfp=a,this.mst=l,this.hp=u,this.lck=d}}class r{constructor(e,t,i,s,n,o,r,a,l,u,d){this.id=e,this.name=t,this.atp=i,this.ata=s,this.min_evp=n,this.max_evp=o,this.min_dfp=r,this.max_dfp=a,this.mst=l,this.hp=u,this.lck=d}}class a{constructor(e,t){this.id=e,this.name=t}}class l{constructor(e,t){this.id=e,this.name=t}}var u=i("nsCy"),d=i("Ya0R"),h=i("kcKQ"),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};function p(e,t){return new d.a(t,function(e){return t=>c(this,void 0,void 0,(function*(){const i=yield e.get(`/item_types.${u.g[t].toLowerCase()}.json`).json(),s=[],d=[];for(const e of i){let t;switch(e.class){case"weapon":t=new n(e.id,e.name,e.min_atp,e.max_atp,e.ata,e.max_grind,e.required_atp);break;case"armor":t=new o(e.id,e.name,e.atp,e.ata,e.min_evp,e.max_evp,e.min_dfp,e.max_dfp,e.mst,e.hp,e.lck);break;case"shield":t=new r(e.id,e.name,e.atp,e.ata,e.min_evp,e.max_evp,e.min_dfp,e.max_dfp,e.mst,e.hp,e.lck);break;case"unit":t=new a(e.id,e.name);break;case"tool":t=new l(e.id,e.name);break;default:continue}d[t.id]=t,s.push(t)}return new v(s,d)}))}(e))}class v extends h.a{constructor(e,t){super(),this.id_to_item_type=t,this.get_by_id=e=>this.id_to_item_type[e],this.item_types=e}}var _=i("sZ1+");class m{constructor(e,t,i,s,n,o){this.difficulty=e,this.section_id=t,this.npc_type=i,this.item_type=s,this.anything_rate=n,this.rare_rate=o,this.rate=n*o}}var b=i("rwco"),f=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};const g=b.c.get("stores/ItemDropStore");function w(e,t,i){return new d.a(t,function(e,t){return i=>f(this,void 0,void 0,(function*(){const s=yield t.get(i),n=yield e.get(`/enemy_drops.${u.g[i].toLowerCase()}.json`).json(),o=new D;for(const e of n){const t=_.c[e.enemy];if(!t){g.warn(`Couldn't determine NpcType of episode ${e.episode} ${e.enemy}.`);continue}const i=u.b[e.difficulty],n=s.get_by_id(e.item_type_id);if(!n){g.warn(`Couldn't find item kind ${e.item_type_id}.`);continue}const r=u.e[e.section_id];null!=r?o.set_drop(i,r,t,new m(i,r,t,n,e.drop_rate,e.rare_rate)):g.warn(`Couldn't find section ID ${e.section_id}.`)}return new y(o)}))}(e,i))}class y extends h.a{constructor(e){super(),this.enemy_drops=e}}class D{constructor(){this.table=[],this.item_type_to_drops=[];for(let e=0;e[e,this.add(new G(e,t))])),this.server_select=this.add(new M.a({label:"Server:",items:["Ephinea"],to_label:e=>e,enabled:!1,selected:"Ephinea",tooltip:"Only Ephinea is supported at the moment"})),this.element=Object(S.h)({className:"application_NavigationView"},...[...this.buttons.values()].map(e=>e.element),Object(S.h)({className:"application_NavigationView_spacer"}),Object(S.q)({className:"application_NavigationView_server"},this.server_select.label.element,this.server_select.element),Object(S.b)({className:"application_NavigationView_github",href:"https://github.com/DaanVandenBosch/phantasmal-world",title:"GitHub"},Object(S.j)(S.a.GitHub))),this.height=30,this.mousedown=e=>{e.target instanceof HTMLLabelElement&&e.target.control instanceof HTMLInputElement&&this.gui_store.set_tool(s.b[e.target.control.value])},this.mark_tool_button=e=>{const t=this.buttons.get(e);t&&(t.checked=!0)},this.element.style.height=`${this.height}px`,this.element.onmousedown=this.mousedown,this.disposables(e.tool.observe(({value:e})=>this.mark_tool_button(e),{call_now:!0})),this.finalize_construction()}}var R=i("39ZU"),B=i("zsIO");class j extends B.a{constructor(e,t){super(),this.element=Object(S.h)({className:"application_MainContentView"}),this.tool_views=new Map(t.map(([e,t])=>[e,this.add(new R.a(t))]));for(const e of this.tool_views.values())this.element.append(e.element);this.disposables(e.tool.observe(({value:e})=>this.set_current_tool(e),{call_now:!0})),this.finalize_construction()}resize(e,t){super.resize(e,t);for(const i of this.tool_views.values())i.resize(e,t);return this}set_current_tool(e){this.current_tool_view&&(this.current_tool_view.visible.val=!1,this.current_tool_view.deactivate()),this.current_tool_view=this.tool_views.get(e),this.current_tool_view&&(this.current_tool_view.visible.val=!0,this.current_tool_view.activate())}}i("Pjoc");class z extends B.a{constructor(e,t){super(),this.menu_view=this.add(new L(e)),this.main_content_view=this.add(new j(e,t)),this.element=Object(S.h)({className:"application_ApplicationView"},this.menu_view.element,this.main_content_view.element),this.element.id="root",this.finalize_construction()}resize(e,t){return super.resize(e,t),this.main_content_view.resize(e,t-this.menu_view.height),this}}var E=i("LvDl"),P=i("Tpfs"),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};function A(e){const t=e;"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||e.preventDefault()}function C(e){const t=e;t.ctrlKey&&!t.altKey&&"Z"===t.key.toUpperCase()&&t.preventDefault()}function N(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none")}function H(e){N(e)}function F(e){N(e)}var V=i("4eU9");var T=i("Womt");!function(e,t,n){const o=new P.a;o.add(Object(S.f)(document,"beforeinput",A)),o.add(Object(S.g)(document,"keydown",C)),o.add_all(Object(S.g)(document,"dragenter",N),Object(S.g)(document,"dragover",H),Object(S.g)(document,"drop",F));const r=o.add(new s.a),a=o.add(p(e,r)),l=o.add(w(e,r,a)),u=o.add(new z(r,[[s.b.Viewer,()=>I(this,void 0,void 0,(function*(){const{initialize_viewer:s}=yield Promise.all([i.e(0),i.e(1),i.e(2),i.e(5)]).then(i.bind(null,"U6CM"));return o.add(s(e,t,r,n)).view}))],[s.b.QuestEditor,()=>I(this,void 0,void 0,(function*(){const{initialize_quest_editor:t}=yield Promise.all([i.e(0),i.e(1),i.e(2),i.e(7)]).then(i.bind(null,"4aaK"));return o.add(t(e,r,n)).view}))],[s.b.HuntOptimizer,()=>I(this,void 0,void 0,(function*(){const{initialize_hunt_optimizer:t}=yield Promise.all([i.e(0),i.e(1),i.e(9)]).then(i.bind(null,"Ix/i"));return o.add(t(e,r,a,l)).view}))]])),d=Object(E.throttle)(()=>{u.resize(window.innerWidth,window.innerHeight)},100,{leading:!0,trailing:!0});d(),document.body.append(u.element),u.activate(),o.add(Object(S.g)(window,"resize",d))}(new class{get(e){const t=new AbortController,i=fetch("/assets"+e,{signal:t.signal});return{json:()=>new V.a((e,t)=>{i.then(e=>e.json()).then(t=>e(t),e=>t(e))},()=>t.abort()),array_buffer:()=>new V.a((e,t)=>{i.then(e=>e.arrayBuffer()).then(t=>e(t),e=>t(e))},()=>t.abort())}}},new class{constructor(e=Math.random){this.random_number=e}integer(e,t){return e+Math.floor(this.random_number()*(t-e))}sample_array(e){return e[this.integer(0,e.length)]}},(function(){const e=new T.WebGLRenderer({antialias:!0,alpha:!0});return e.setPixelRatio(window.devicePixelRatio),e}))},"0CzU":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("hUhj"),n=i("jJhE");class o extends s.a{constructor(e){super(),this._val=e}get val(){return this.get_val()}set val(e){this.set_val(e)}get_val(){return this._val}set_val(e,t={}){e!==this._val&&(this._val=e,t.silent||this.emit())}update(e){this.val=e(this.val)}bind_to(e){return Object(n.a)(e)&&(this.val=e.val),e.observe(e=>this.val=e.value)}}},"39ZU":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("nN8q"),n=i("FXpb");class o extends s.a{constructor(e){super(),this.create_view=e,this.initialized=!1,this.element=Object(n.h)({className:"core_LazyView"}),this.visible.val=!1}get children(){return this.view?[this.view]:[]}resize(e,t){return super.resize(e,t),this.view&&this.view.resize(e,t),this}set_visible(e){super.set_visible(e),e&&!this.initialized&&(this.initialized=!0,this.create_view().then(e=>{this.disposed?e.dispose():(this.view=this.disposable(e),this.view.resize(this.width,this.height),this.element.append(e.element),this.view.activate())})),this.finalize_construction()}}},"4SjJ":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return h}));var s,n=i("ouMO"),o=i("nsCy"),r=i("kcKQ"),a=i("FXpb"),l=i("wtpc");!function(e){e[e.Viewer=0]="Viewer",e[e.QuestEditor=1]="QuestEditor",e[e.HuntOptimizer=2]="HuntOptimizer"}(s||(s={}));const u=new Map([[s.Viewer,"viewer"],[s.QuestEditor,"quest_editor"],[s.HuntOptimizer,"hunt_optimizer"]]),d=new Map([...u.entries()].map(([e,t])=>[t,e]));class h extends r.a{constructor(){var e;super(),this._tool=Object(n.e)(s.Viewer),this._path=Object(n.e)(""),this.parameters=new Map,this._server=Object(n.e)(o.g.Ephinea),this.global_keydown_handlers=new Map,this.features=new Set,this.tool=this._tool,this.path=this._path,this.server=this._server,this.dispatch_global_keydown=e=>{const t=[];e.ctrlKey&&t.push("Ctrl"),e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt"),t.push(e.key.toUpperCase());const i=t.join("-"),s=this.global_keydown_handlers.get(this.handler_key(this.tool.val,i));s&&(e.preventDefault(),s(e))};const t=window.location.hash.slice(1),[i,r]=t.split("?"),l=i.indexOf("/",1),u=null!=(e=function(e){return d.get(e)}(-1===l?i:i.slice(1,l)))?e:s.Viewer,h=-1===l?"":i.slice(l);if(r){const e=new Map;for(const[t,i]of r.split("&").map(e=>e.split("=",2)))if("features"===t)for(const e of i.split(","))this.features.add(e);else e.set(t,i);this.parameters.set(i,e)}this.disposables(Object(a.g)(window,"keydown",this.dispatch_global_keydown)),this.set_tool(u,h)}get full_path(){return`/${c(this.tool.val)}${this.path.val}`}set_tool(e,t=""){this._path.val=t,this._tool.val=e,this.update_location()}set_path_prefix(e){this.path.val.startsWith(e)||(this._path.val=e,this.update_location())}get_parameter(e,t,i){return Object(l.h)(this.parameters,`/${c(e)}${t}`,()=>new Map).get(i)}bind_parameter(e,t,i,s){Object(l.d)("features"!==i,"features can't be bound because it is a global parameter.");const n=Object(l.h)(this.parameters,this.full_path,()=>new Map);return s.observe(({value:s})=>{this.tool.val===e&&this.path.val===t&&(void 0===s?n.delete(i):n.set(i,s),this.update_location())})}update_location(){const e=[],t=this.parameters.get(this.full_path);if(t)for(const[i,s]of t.entries())e.push([i,s]);this.features.size&&e.push(["features",[...this.features].join(",")]);const i=0===e.length?"":"?"+e.map(e=>e.join("=")).join("&");window.location.hash=`#${this.full_path}${i}`}on_global_keydown(e,t,i){const s=this.handler_key(e,t);return this.global_keydown_handlers.set(s,i),{dispose:()=>{this.global_keydown_handlers.delete(s)}}}feature_active(e){return this.features.has(e)}handler_key(e,t){return`${s[e]} -> ${t}`}}function c(e){const t=u.get(e);if(t)return t;throw new Error(`To string not implemented for ${s[e]}.`)}},"4VsB":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("0CzU");class n extends s.a{constructor(e,t,i){super(t),this.widget=e,this.set_value=i}set_val(e,t){this.set_value.call(this.widget,e),super.set_val(e,Object.assign({silent:!0},t))}}},"4eU9":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s extends Promise{constructor(e,t){let i,s;super((e,t)=>{i=e,s=t}),this.disposed=!1,this.disposal_handler=t,e(e=>{this.disposed||i(e)},e=>{this.disposed||s(e)})}static resolve(e){return new s((t,i)=>{void 0===e?new s(()=>void 0):"then"in e?e.then(t,i):t(e)})}static wrap(e,t){return e instanceof s?e:new s((t,i)=>{e.then(t).catch(i)},t)}then(e,t){return s.wrap(super.then(e,t),()=>this.dispose())}catch(e){return s.wrap(super.catch(e),()=>this.dispose())}finally(e){return s.wrap(super.finally(e),()=>this.dispose())}dispose(){var e;this.disposed||(this.disposed=!0,null===(e=this.disposal_handler)||void 0===e||e.call(this))}}},"52VV":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Ge8H"),n=i("nEgy");class o extends n.a{constructor(e,t){super(e),this.compute=t}get_val(){return this.should_recompute()||!this.computed_property?super.get_val():this.computed_property.val}observe(e,t){const i=super.observe(e,t);return{dispose:()=>{var e;i.dispose(),0===this.observers.length&&(null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_disposable=void 0,this.computed_property=void 0)}}}map(e){return new s.a([this],()=>e(this.val))}flat_map(e){return new o([this],()=>e(this.val))}compute_value(){var e;return null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_property=this.compute(),this.computed_disposable=this.computed_property.observe(()=>{this.emit()}),this.computed_property.val}}},"6Fug":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("TRid"),n=i("wtpc");class o extends s.a{constructor(){super(...arguments),this._children=[]}get children(){return this._children}dispose(){this._children.splice(0),super.dispose()}add(e){return this._children.push(e),this.disposable(e)}remove(e){Object(n.b)(this._children,e),this.remove_disposable(e)}}},"7ZX1":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("TRid"),n=(i("ku4b"),i("4VsB")),o=i("FXpb");class r extends s.a{constructor(e,t){super(t),this._text=new n.a(this,"",this.set_text),this.element=Object(o.m)({className:"core_Label"}),this.children=[],this.text=this._text,"string"==typeof e?this.set_text(e):this.disposable(this._text.bind_to(e)),this.finalize_construction()}set for(e){this.element.htmlFor=e}set_text(e){this.element.textContent=e}}},FXpb:function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"e",(function(){return u})),i.d(t,"h",(function(){return d})),i.d(t,"i",(function(){return h})),i.d(t,"l",(function(){return c})),i.d(t,"k",(function(){return p})),i.d(t,"m",(function(){return v})),i.d(t,"n",(function(){return _})),i.d(t,"o",(function(){return m})),i.d(t,"q",(function(){return b})),i.d(t,"r",(function(){return f})),i.d(t,"s",(function(){return g})),i.d(t,"t",(function(){return w})),i.d(t,"u",(function(){return y})),i.d(t,"v",(function(){return D})),i.d(t,"w",(function(){return S})),i.d(t,"x",(function(){return k})),i.d(t,"y",(function(){return G})),i.d(t,"z",(function(){return M})),i.d(t,"c",(function(){return O})),i.d(t,"a",(function(){return L})),i.d(t,"j",(function(){return R})),i.d(t,"p",(function(){return B})),i.d(t,"g",(function(){return j})),i.d(t,"f",(function(){return z})),i.d(t,"d",(function(){return E}));var s=i("jJhE"),n=i("nsCy"),o=i("oxtq"),r=i("Tpfs");const a=i("rwco").c.get("core/gui/dom");function l(e,...t){const i=x("a",e,...t);return e&&e.href&&e.href.trimLeft().startsWith("http")&&(i.target="_blank",i.rel="noopener noreferrer"),i}function u(e,...t){return x("button",e,...t)}function d(e,...t){return x("div",e,...t)}function h(e,...t){return x("h2",e,...t)}function c(e,...t){return x("input",e,...t)}function p(e,...t){return x("img",e,...t)}function v(e,...t){return x("label",e,...t)}function _(e,...t){return x("li",e,...t)}function m(e,...t){return x("p",e,...t)}function b(e,...t){return x("span",e,...t)}function f(e,...t){return x("table",e,...t)}function g(e,...t){return x("tbody",e,...t)}function w(e,...t){return x("td",e,...t)}function y(e,...t){return x("textarea",e,...t)}function D(e,...t){return x("tfoot",e,...t)}function S(e,...t){return x("th",e,...t)}function k(e,...t){return x("thead",e,...t)}function G(e,...t){return x("tr",e,...t)}function M(e,...t){return x("ul",e,...t)}function x(e,t,...i){const s=document.createElement(e);if(t)if(t instanceof Node||"string"==typeof t)s.append(t);else{const e=t.data;if(delete t.data,Object.assign(s,t),e)for(const[t,i]of Object.entries(e))s.dataset[t]=i}return s.append(...i),s}function O(e,t,i){return Object(s.a)(i)&&(e[t]=i.val),i.observe(({value:i})=>e[t]=i)}var L;function R(e){let t;switch(e){case L.ArrowDown:t="fas fa-arrow-down";break;case L.Eye:t="far fa-eye";break;case L.File:t="fas fa-file";break;case L.GitHub:t="fab fa-github";break;case L.LevelDown:t="fas fa-level-down-alt";break;case L.LevelUp:t="fas fa-level-up-alt";break;case L.LongArrowRight:t="fas fa-long-arrow-alt-right";break;case L.NewFile:t="fas fa-file-medical";break;case L.Play:t="fas fa-play";break;case L.Plus:t="fas fa-plus";break;case L.Redo:t="fas fa-redo";break;case L.Remove:t="fas fa-trash-alt";break;case L.Save:t="fas fa-save";break;case L.Stop:t="fas fa-stop";break;case L.SquareArrowRight:t="far fa-caret-square-right";break;case L.TriangleDown:t="fas fa-caret-down";break;case L.TriangleUp:t="fas fa-caret-up";break;case L.Undo:t="fas fa-undo"}return b(b({className:t}))}function B(e,t){const i=b(),s=t&&t.size;return i.style.display="inline-block",i.style.width=`${s}px`,i.style.height=`${s}px`,i.style.backgroundImage=`url(/assets/images/sectionids/${n.e[e]}.png)`,i.style.backgroundSize=`${s}px`,i.title=n.e[e],i}function j(e,t,i,s){return e.addEventListener(t,i,s),{dispose(){e.removeEventListener(t,i)}}}function z(e,t,i,s){return e.addEventListener(t,i,s),{dispose(){e.removeEventListener(t,i)}}}function E(e,t,i,s){const n=new r.a,l=t.observe_list(t=>{var r,l,u;t.type===o.a.ListChange?function(t){for(let i=0;i{const o=i(e,t.index+s);return Array.isArray(o)?(n.insert(t.index+s,o[1]),o[0]):o});if(t.index>=e.childElementCount)e.append(...s);else for(let i=0;i"),t.join("")}!function(e){e[e.ArrowDown=0]="ArrowDown",e[e.Eye=1]="Eye",e[e.File=2]="File",e[e.GitHub=3]="GitHub",e[e.LevelDown=4]="LevelDown",e[e.LevelUp=5]="LevelUp",e[e.LongArrowRight=6]="LongArrowRight",e[e.NewFile=7]="NewFile",e[e.Play=8]="Play",e[e.Plus=9]="Plus",e[e.Redo=10]="Redo",e[e.Remove=11]="Remove",e[e.Save=12]="Save",e[e.SquareArrowRight=13]="SquareArrowRight",e[e.Stop=14]="Stop",e[e.TriangleDown=15]="TriangleDown",e[e.TriangleUp=16]="TriangleUp",e[e.Undo=17]="Undo"}(L||(L={}))},Ge8H:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("52VV"),n=i("nEgy");class o extends n.a{constructor(e,t){super(e),this.compute_value=t}map(e){return new o([this],()=>e(this.val))}flat_map(e){return new s.a([this],()=>e(this.val))}}},KVVN:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("FXpb"),n=(i("Tp1L"),i("ouMO")),o=i("QmPX"),r=i("4VsB");class a extends o.a{constructor(e){var t,i,o,a;super(e),this.element=Object(s.e)({className:"core_Button"});const l=Object(s.q)({className:"core_Button_inner"});null!=(null===(t=e)||void 0===t?void 0:t.icon_left)&&l.append(Object(s.q)({className:"core_Button_left"},Object(s.j)(e.icon_left))),this.center_element=Object(s.q)({className:"core_Button_center"}),l.append(this.center_element),null!=(null===(i=e)||void 0===i?void 0:i.icon_right)&&l.append(Object(s.q)({className:"core_Button_right"},Object(s.j)(e.icon_right))),this._mousedown=Object(n.a)(),this.mousedown=this._mousedown,this.element.onmousedown=e=>this._mousedown.emit({value:e}),this._mouseup=Object(n.a)(),this.mouseup=this._mouseup,this.element.onmouseup=e=>this._mouseup.emit({value:e}),this._click=Object(n.a)(),this.click=this._click,this.element.onclick=e=>this._click.emit({value:e}),this._keydown=Object(n.a)(),this.keydown=this._keydown,this.element.onkeydown=e=>this._keydown.emit({value:e}),this._keyup=Object(n.a)(),this.keyup=this._keyup,this.element.onkeyup=e=>this._keyup.emit({value:e}),this._text=new r.a(this,"",this.set_text),this.text=this._text,"string"==typeof(null===(o=e)||void 0===o?void 0:o.text)?this.text.val=e.text:(null===(a=e)||void 0===a?void 0:a.text)?this.text.bind_to(e.text):this.text.val="",this.element.append(l),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.element.disabled=!e}set_text(e){this.center_element.textContent=e,this.center_element.hidden=""===e}}},LSoc:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var s=i("FXpb"),n=i("TRid"),o=i("jJhE"),r=i("ouMO"),a=i("4VsB");i("/xfa");class l extends n.a{constructor(e){var t;super(),this.element=Object(s.h)({className:"core_Menu",tabIndex:-1}),this.children=[],this.inner_element=Object(s.h)({className:"core_Menu_inner"}),this.mouseup=e=>{if(!(e.target instanceof HTMLElement))return;const t=e.target.dataset.index;null!=t&&this.select_item(parseInt(t,10))},this.keydown=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.hover_next();break;case"ArrowUp":e.preventDefault(),this.hover_prev();break;case"Enter":e.preventDefault(),this.select_hovered()}},this.blur=()=>{this.visible.val=!1},this.inner_mouseover=e=>{if(e.target&&e.target instanceof HTMLElement){const t=e.target.dataset.index;null!=t&&this.hover_item(parseInt(t,10))}},this.document_mousedown=e=>{!this.visible.val||this.element.contains(e.target)||this.related_element.contains(e.target)||this.visible.set_val(!1,{silent:!1})},this.document_keydown=e=>{"Escape"===e.key&&this.visible.set_val(!1,{silent:!1})},this.visible.val=!1,this.element.onmouseup=this.mouseup,this.element.onkeydown=this.keydown,this.element.onblur=this.blur,this.inner_element.onmouseover=this.inner_mouseover,this.element.append(this.inner_element),this.to_label=null!=(t=e.to_label)?t:e=>String(e),this.items=Object(o.a)(e.items)?e.items:Object(r.e)(e.items),this.related_element=e.related_element,this._selected=new a.a(this,void 0,this.set_selected),this.selected=this._selected,this.disposables(this.items.observe(({value:e})=>{this.inner_element.innerHTML="",this.inner_element.append(...e.map((e,t)=>Object(s.h)({data:{index:t.toString()}},this.to_label(e)))),this.hover_item()},{call_now:!0}),Object(s.g)(document,"mousedown",this.document_mousedown,{capture:!0}),Object(s.g)(document,"keydown",this.document_keydown)),this.finalize_construction()}focus(){var e;this.previously_focused_element=null!=(e=document.activeElement)?e:void 0,this.element.focus()}hover_next(){this.visible.set_val(!0,{silent:!1}),this.hover_item(null!=this.hovered_index?(this.hovered_index+1)%this.items.val.length:0)}hover_prev(){this.visible.set_val(!0,{silent:!1}),this.hover_item(this.hovered_index?this.hovered_index-1:this.items.val.length-1)}select_hovered(){null!=this.hovered_index&&this.select_item(this.hovered_index)}set_visible(e){super.set_visible(e),this.visible.val!=e&&(this.hover_item(),this.inner_element.scrollTop=0,!e&&this.previously_focused_element instanceof HTMLElement&&this.previously_focused_element.focus())}set_selected(){}hover_item(e){this.hovered_element&&this.hovered_element.classList.remove("core_Menu_hovered"),null==e?(this.hovered_index=void 0,this.hovered_element=void 0):(this.hovered_element=this.inner_element.children.item(e),this.hovered_element&&(this.hovered_index=e,this.hovered_element.classList.add("core_Menu_hovered"),this.hovered_element.scrollIntoView({block:"nearest"})))}select_item(e){const t=this.items.val[e];void 0!==t&&(this.selected.set_val(t,{silent:!1}),this.visible.set_val(!1,{silent:!1}))}}},QmPX:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("TRid");class n extends s.a{constructor(){super(...arguments),this.children=[]}}},TRid:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Tpfs"),n=i("4VsB");const o=i("rwco").c.get("core/gui/Widget");class r{constructor(e={}){this.disposer=new s.a,this._active=!1,this._visible=new n.a(this,!0,this.set_visible),this._enabled=new n.a(this,!0,this.set_enabled),this._tooltip=new n.a(this,"",this.set_tooltip),this.construction_finalized=!1,this.visible=this._visible,this.enabled=this._enabled,this.tooltip=this._tooltip,this.options=e,setTimeout(()=>{this.construction_finalized||o.error(`finalize_construction is never called for ${Object.getPrototypeOf(this).constructor.name}.`)},0)}get id(){return this.element.id}set id(e){this.element.id=e}get active(){return this._active}get disposed(){return this.disposer.disposed}activate(){this._active=!0;for(const e of this.children)e.activate()}deactivate(){this._active=!1;for(const e of this.children)e.deactivate()}focus(){this.element.focus()}dispose(){this.element.remove(),this.disposer.dispose()}finalize_construction(){Object.getPrototypeOf(this)===this.constructor.prototype&&(this.options.id&&(this.element.id=this.options.id),this.options.class&&this.element.classList.add(this.options.class),"boolean"==typeof this.options.enabled?this.enabled.val=this.options.enabled:this.options.enabled&&this.enabled.bind_to(this.options.enabled),"string"==typeof this.options.tooltip?this.tooltip.val=this.options.tooltip:this.options.tooltip&&this.tooltip.bind_to(this.options.tooltip),this.construction_finalized=!0)}set_visible(e){this.element.hidden=!e}set_enabled(e){e?this.element.classList.remove("disabled"):this.element.classList.add("disabled")}set_tooltip(e){this.element.title=e}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}remove_disposable(e){this.disposer.remove(e)}}},Tpfs:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("rwco"),n=i("wtpc");const o=s.c.get("core/observable/Disposer");class r{constructor(...e){this._disposed=!1,this.disposables=e}get length(){return this.disposables.length}get disposed(){return this._disposed}add(e){return this.disposed?e.dispose():this.disposables.push(e),e}insert(e,t){return this._disposed||this.disposables.splice(e,0,t),t}add_all(...e){return this._disposed||this.disposables.push(...e),this}remove(e){Object(n.b)(this.disposables,e),e.dispose()}dispose_all(){this.dispose_at(0,this.disposables.length)}dispose(){this.dispose_all(),this._disposed=!0}dispose_at(e,t=1){for(const i of this.disposables.splice(e,t))try{i.dispose()}catch(e){o.warn("Error while disposing.",e)}}}},Ya0R:function(e,t,i){"use strict";var s=i("LvDl");class n{constructor(e,t){this.gui_store=e,this.get_value=Object(s.memoize)(t)}get current(){return this._current||(this._current=this.gui_store.server.map(e=>this.get(e))),this._current}get(e){return this.get_value(e)}}var o=i("Tpfs");i.d(t,"a",(function(){return a}));var r=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};class a extends n{constructor(e,t){super(e,e=>r(this,void 0,void 0,(function*(){const i=yield t(e);return this.disposer.disposed?i.dispose():this.disposer.add(i),i}))),this.disposer=new o.a}dispose(){this.disposer.dispose()}}},hUhj:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Ge8H"),n=i("52VV"),o=i("+LO4");class r extends o.a{map(e){return new s.a([this],()=>e(this.val))}flat_map(e){return new n.a([this],()=>e(this.val))}}},jJhE:function(e,t,i){"use strict";function s(e){return null!=e&&e.is_property}i.d(t,"a",(function(){return s}))},kcKQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("Tpfs");class n{constructor(){this.disposer=new s.a}dispose(){this.disposer.dispose()}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}}},nEgy:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Tpfs"),n=i("+LO4");class o extends n.a{constructor(e){super(),this.dependencies=e,this.dependency_disposer=new s.a}get val(){return this.get_val()}get_val(){return this.should_recompute()&&(this._val=this.compute_value()),this._val}observe(e,t){0===this.dependency_disposer.length&&(this._val=this.compute_value(),this.dependency_disposer.add_all(...this.dependencies.map(e=>e.observe(()=>{const e=this._val;this._val=this.compute_value(),this._val!==e&&this.emit()}))));const i=super.observe(e,t);return{dispose:()=>{i.dispose(),0===this.observers.length&&this.dependency_disposer.dispose_all()}}}should_recompute(){return 0===this.dependency_disposer.length}}},nN8q:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("TRid");class n extends s.a{constructor(){super(...arguments),this.width=0,this.height=0}resize(e,t){this.width=e,this.height=t,this.element.style.width=`${e}px`,this.element.style.height=`${t}px`}}},nsCy:function(e,t,i){"use strict";i.d(t,"d",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"g",(function(){return r})),i.d(t,"e",(function(){return a})),i.d(t,"f",(function(){return l})),i.d(t,"b",(function(){return u})),i.d(t,"a",(function(){return d}));var s=i("uiJh");const n=1/512,o=.1;var r;!function(e){e.Ephinea="Ephinea"}(r||(r={}));Object(s.a)(r);var a;!function(e){e[e.Viridia=0]="Viridia",e[e.Greenill=1]="Greenill",e[e.Skyly=2]="Skyly",e[e.Bluefull=3]="Bluefull",e[e.Purplenum=4]="Purplenum",e[e.Pinkal=5]="Pinkal",e[e.Redria=6]="Redria",e[e.Oran=7]="Oran",e[e.Yellowboze=8]="Yellowboze",e[e.Whitill=9]="Whitill"}(a||(a={}));const l=Object(s.a)(a);var u;!function(e){e[e.Normal=0]="Normal",e[e.Hard=1]="Hard",e[e.VHard=2]="VHard",e[e.Ultimate=3]="Ultimate"}(u||(u={}));const d=Object(s.a)(u)},ouMO:function(e,t,i){"use strict";var s=i("rwco");const n=s.c.get("core/observable/SimpleEmitter");class o{constructor(){this.observers=[]}emit(e){for(const t of this.observers)try{t(e)}catch(e){n.error("Observer threw error.",e)}}observe(e){return this.observers.includes(e)||this.observers.push(e),{dispose:()=>{const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}}}}var r=i("0CzU"),a=i("Ge8H"),l=i("jJhE"),u=i("oxtq"),d=i("hUhj");const h=s.c.get("core/observable/property/list/AbstractListProperty");class c extends d.a{constructor(e){super(),this.compute_length=e,this.length=0}get val(){return this.get_val()}get_val(){return this.length=this.compute_length()}update(){const e=this.length,t=this.compute_length();e!==t&&(this.length=t,this.emit())}}class p extends d.a{constructor(e){super(),this.is_list_property=!0,this.value_observers=[],this.list_observers=[],this._length=new c(()=>this.compute_length()),this.length=this._length,this.extract_observables=e}get(e){return this.val[e]}observe_list(e,t){return 0===this.value_observers.length&&this.extract_observables&&this.replace_element_observers(0,1/0,this.val),this.list_observers.includes(e)||this.list_observers.push(e),t&&t.call_now&&this.call_list_observer(e,{type:u.a.ListChange,index:0,removed:[],inserted:this.val.slice()}),{dispose:()=>{const t=this.list_observers.indexOf(e);if(-1!==t&&this.list_observers.splice(t,1),0===this.list_observers.length){for(const{disposables:e}of this.value_observers)for(const t of e)t.dispose();this.value_observers.splice(0,1/0)}}}}[Symbol.iterator](){return this.val[Symbol.iterator]()}finalize_update(e){this.list_observers.length&&this.extract_observables&&e.type===u.a.ListChange&&this.replace_element_observers(e.index,e.removed.length,e.inserted),this._length.update();for(const t of this.list_observers)this.call_list_observer(t,e);this.emit()}call_list_observer(e,t){try{e(t)}catch(e){h.error("Observer threw error.",e)}}replace_element_observers(e,t,i){let s=e;const n=this.value_observers.splice(e,t,...i.map(e=>{const t={index:s,disposables:this.extract_observables(e).map(i=>i.observe(()=>{this.finalize_update({type:u.a.ValueChange,updated:[e],index:t.index})}))};return s++,t}));for(const{disposables:e}of n)for(const t of e)t.dispose();for(;s{i.dispose(),this.dispose_dependency_disposables()}}}observe_list(e,t){const i=super.observe_list(e,t);return this.init_dependency_disposables(),{dispose:()=>{i.dispose(),this.dispose_dependency_disposables()}}}should_recompute(){return 0===this.dependency_disposer.length}compute_length(){return this.should_recompute()&&(this.values=this.compute_values()),this.values.length}recompute_and_emit(){const e=this.values.slice();this.values=this.compute_values(),this.finalize_update({type:u.a.ListChange,index:0,removed:e,inserted:this.values.slice()})}init_dependency_disposables(){0===this.dependency_disposer.length&&(this.values=this.compute_values(),this.dependency_disposer.add_all(...this.dependencies.map(e=>e.observe(()=>{this.recompute_and_emit()}))))}dispose_dependency_disposables(){0===this.observers.length&&0===this.list_observers.length&&this.dependency_disposer.dispose_all()}}class m extends _{constructor(e,t){super(e),this.compute_values=t}filtered(e){return Object(l.a)(e)?new m([this,e],()=>this.val.filter(e.val)):new m([this],()=>this.val.filter(e))}}class b extends p{constructor(e,...t){super(e),this.values=t||[]}get val(){return this.get_val()}set val(e){this.set_val(e)}get_val(){return this.values}set_val(e){const t=this.values.splice(0,this.values.length,...e);return this.finalize_update({type:u.a.ListChange,index:0,removed:t,inserted:e.slice()}),t}filtered(e){return Object(l.a)(e)?new m([this,e],()=>this.val.filter(e.val)):new m([this],()=>this.val.filter(e))}bind_to(e){return Object(u.b)(e)?(this.set_val(e.val),e.observe_list(e=>{e.type===u.a.ListChange&&this.splice(e.index,e.removed.length,...e.inserted)})):(Object(l.a)(e)&&this.set_val(e.val),e.observe(({value:e})=>this.set_val(e)))}update(e){this.splice(0,this.values.length,...e(this.values))}set(e,t){const i=[this.values[e]];this.values[e]=t,this.finalize_update({type:u.a.ListChange,index:e,removed:i,inserted:[t]})}push(...e){const t=this.values.length;return this.values.push(...e),this.finalize_update({type:u.a.ListChange,index:t,removed:[],inserted:e.slice()}),this.length.val}remove(...e){for(const t of e){const e=this.values.indexOf(t);e>-1&&(this.values.splice(e,1),this.finalize_update({type:u.a.ListChange,index:e,removed:[t],inserted:[]}))}}clear(){const e=this.values.splice(0,this.values.length);this.finalize_update({type:u.a.ListChange,index:0,removed:e,inserted:[]})}splice(e,t,...i){let s;return s=null==t?this.values.splice(e):this.values.splice(e,t,...i),this.finalize_update({type:u.a.ListChange,index:e,removed:s,inserted:i.slice()}),s}sort(e){const t=this.values.slice();this.values.sort(e),this.finalize_update({type:u.a.ListChange,index:0,removed:t,inserted:this.values.slice()})}compute_length(){return this.values.length}}var f=i("52VV");class g extends _{constructor(e,t){super(e),this.compute=t}get_val(){return this.should_recompute()||!this.computed_property?super.get_val():this.computed_property.val}observe(e,t){const i=super.observe(e,t);return{dispose:()=>{var e;i.dispose(),0===this.observers.length&&(null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_disposable=void 0,this.computed_property=void 0)}}}observe_list(e,t){const i=super.observe_list(e,t);return{dispose:()=>{i.dispose()}}}map(e){return new a.a([this],()=>e(this.val))}flat_map(e){return new f.a([this],()=>e(this.val))}filtered(e){return Object(l.a)(e)?new m([this,e],()=>this.val.filter(e.val)):new m([this],()=>this.val.filter(e))}compute_values(){var e;return null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_property=this.compute(),this.computed_disposable=this.computed_property.observe_list(e=>{e.type===u.a.ListChange&&this.values.splice(e.index,e.removed.length,...e.inserted),this.finalize_update(e)}),this.computed_property.val.slice()}}function w(){return new o}function y(e){return new r.a(e)}function D(e,...t){return new b(e,...t)}function S(e,...t){return new a.a(t,()=>e(...t.map(e=>e.val)))}function k(e,...t){return new g(t,()=>e(...t.map(e=>e.val)))}i.d(t,"a",(function(){return w})),i.d(t,"e",(function(){return y})),i.d(t,"c",(function(){return D})),i.d(t,"d",(function(){return S})),i.d(t,"b",(function(){return k}))},oxtq:function(e,t,i){"use strict";var s;function n(e){return null!=e&&e.is_list_property}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return n})),function(e){e[e.ListChange=0]="ListChange",e[e.ValueChange=1]="ValueChange"}(s||(s={}))},rwco:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"d",(function(){return a})),i.d(t,"c",(function(){return d}));var s,n=i("uiJh"),o=i("wtpc");!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Off=5]="Off"}(s||(s={}));const r=Object(n.a)(s);function a(e){return`${l(e.getHours(),2)}:${l(e.getMinutes(),2)}:${l(e.getSeconds(),2)}.${l(e.getMilliseconds(),3)}`}function l(e,t){return e.toString().padStart(t,"0")}class u{constructor(e){this.name=e,this.trace=(e,t)=>{this.handle(s.Trace,e,t)},this.debug=(e,t)=>{this.handle(s.Debug,e,t)},this.info=(e,t)=>{this.handle(s.Info,e,t)},this.warn=(e,t)=>{this.handle(s.Warn,e,t)},this.error=(e,t)=>{this.handle(s.Error,e,t)}}get level(){var e;return null!=(e=this._level)?e:d.default_level}set level(e){this._level=e}get handler(){var e;return null!=(e=this._handler)?e:d.default_handler}set handler(e){this._handler=e}handle(e,t,i){e>=this.level&&this.handler({time:new Date,message:t,level:e,logger:this,cause:i},this.name)}}class d{static get(e){let t=this.loggers.get(e);return t||(t=new u(e),this.loggers.set(e,t)),t}static with_default_handler(e,t){const i=this.default_handler;let s=!1;try{this.default_handler=e;const n=t();return n instanceof Promise?(s=!0,n.finally(()=>this.default_handler=i)):n}finally{s||(this.default_handler=i)}}}d.loggers=new Map,d.default_level=function(e){const t=s[e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()];return Object(o.d)(null!=t,()=>`"${e}" is not a valid log level.`),t}("INFO"),d.default_handler=function({time:e,message:t,level:i,logger:n,cause:o}){const r=`${a(e)} [${s[i]}] ${n.name} - ${t}`;let l;switch(i){case s.Trace:l=console.trace;break;case s.Debug:l=console.debug;break;case s.Info:l=console.info;break;case s.Warn:l=console.warn;break;case s.Error:l=console.error;break;default:l=console.log}null==o?l.call(console,r):l.call(console,r,o)}},"sDu+":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("7ZX1"),n=i("QmPX");class o extends n.a{constructor(e){super(e),this._label_text=e&&e.label}get label(){return this._label||null==this._label_text||(this._label=this.disposable(new s.a(this._label_text,{enabled:this.enabled.val,tooltip:this.tooltip.val})),this.id||(this.id="core_LabelledControl_id_"+String(r++)),this._label.for=this.id),this._label}set_enabled(e){super.set_enabled(e),this._label&&(this._label.enabled.val=e)}set_tooltip(e){super.set_tooltip(e),this._label&&(this._label.tooltip.val=e)}}let r=0},"sZ1+":function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"d",(function(){return r}));var s;i("xs7i");!function(e){e[e.Unknown=0]="Unknown",e[e.FemaleFat=1]="FemaleFat",e[e.FemaleMacho=2]="FemaleMacho",e[e.FemaleTall=3]="FemaleTall",e[e.MaleDwarf=4]="MaleDwarf",e[e.MaleFat=5]="MaleFat",e[e.MaleMacho=6]="MaleMacho",e[e.MaleOld=7]="MaleOld",e[e.BlueSoldier=8]="BlueSoldier",e[e.RedSoldier=9]="RedSoldier",e[e.Principal=10]="Principal",e[e.Tekker=11]="Tekker",e[e.GuildLady=12]="GuildLady",e[e.Scientist=13]="Scientist",e[e.Nurse=14]="Nurse",e[e.Irene=15]="Irene",e[e.ItemShop=16]="ItemShop",e[e.Nurse2=17]="Nurse2",e[e.Hildebear=18]="Hildebear",e[e.Hildeblue=19]="Hildeblue",e[e.RagRappy=20]="RagRappy",e[e.AlRappy=21]="AlRappy",e[e.Monest=22]="Monest",e[e.Mothmant=23]="Mothmant",e[e.SavageWolf=24]="SavageWolf",e[e.BarbarousWolf=25]="BarbarousWolf",e[e.Booma=26]="Booma",e[e.Gobooma=27]="Gobooma",e[e.Gigobooma=28]="Gigobooma",e[e.Dragon=29]="Dragon",e[e.GrassAssassin=30]="GrassAssassin",e[e.PoisonLily=31]="PoisonLily",e[e.NarLily=32]="NarLily",e[e.NanoDragon=33]="NanoDragon",e[e.EvilShark=34]="EvilShark",e[e.PalShark=35]="PalShark",e[e.GuilShark=36]="GuilShark",e[e.PofuillySlime=37]="PofuillySlime",e[e.PouillySlime=38]="PouillySlime",e[e.PanArms=39]="PanArms",e[e.Migium=40]="Migium",e[e.Hidoom=41]="Hidoom",e[e.DeRolLe=42]="DeRolLe",e[e.Dubchic=43]="Dubchic",e[e.Gilchic=44]="Gilchic",e[e.Garanz=45]="Garanz",e[e.SinowBeat=46]="SinowBeat",e[e.SinowGold=47]="SinowGold",e[e.Canadine=48]="Canadine",e[e.Canane=49]="Canane",e[e.Dubswitch=50]="Dubswitch",e[e.VolOptPart1=51]="VolOptPart1",e[e.VolOptPart2=52]="VolOptPart2",e[e.Delsaber=53]="Delsaber",e[e.ChaosSorcerer=54]="ChaosSorcerer",e[e.DarkGunner=55]="DarkGunner",e[e.DeathGunner=56]="DeathGunner",e[e.ChaosBringer=57]="ChaosBringer",e[e.DarkBelra=58]="DarkBelra",e[e.Dimenian=59]="Dimenian",e[e.LaDimenian=60]="LaDimenian",e[e.SoDimenian=61]="SoDimenian",e[e.Bulclaw=62]="Bulclaw",e[e.Bulk=63]="Bulk",e[e.Claw=64]="Claw",e[e.DarkFalz=65]="DarkFalz",e[e.Hildebear2=66]="Hildebear2",e[e.Hildeblue2=67]="Hildeblue2",e[e.RagRappy2=68]="RagRappy2",e[e.LoveRappy=69]="LoveRappy",e[e.StRappy=70]="StRappy",e[e.HalloRappy=71]="HalloRappy",e[e.EggRappy=72]="EggRappy",e[e.Monest2=73]="Monest2",e[e.Mothmant2=74]="Mothmant2",e[e.PoisonLily2=75]="PoisonLily2",e[e.NarLily2=76]="NarLily2",e[e.GrassAssassin2=77]="GrassAssassin2",e[e.Dimenian2=78]="Dimenian2",e[e.LaDimenian2=79]="LaDimenian2",e[e.SoDimenian2=80]="SoDimenian2",e[e.DarkBelra2=81]="DarkBelra2",e[e.BarbaRay=82]="BarbaRay",e[e.SavageWolf2=83]="SavageWolf2",e[e.BarbarousWolf2=84]="BarbarousWolf2",e[e.PanArms2=85]="PanArms2",e[e.Migium2=86]="Migium2",e[e.Hidoom2=87]="Hidoom2",e[e.Dubchic2=88]="Dubchic2",e[e.Gilchic2=89]="Gilchic2",e[e.Garanz2=90]="Garanz2",e[e.Dubswitch2=91]="Dubswitch2",e[e.Delsaber2=92]="Delsaber2",e[e.ChaosSorcerer2=93]="ChaosSorcerer2",e[e.GolDragon=94]="GolDragon",e[e.SinowBerill=95]="SinowBerill",e[e.SinowSpigell=96]="SinowSpigell",e[e.Merillia=97]="Merillia",e[e.Meriltas=98]="Meriltas",e[e.Mericarol=99]="Mericarol",e[e.Mericus=100]="Mericus",e[e.Merikle=101]="Merikle",e[e.UlGibbon=102]="UlGibbon",e[e.ZolGibbon=103]="ZolGibbon",e[e.Gibbles=104]="Gibbles",e[e.Gee=105]="Gee",e[e.GiGue=106]="GiGue",e[e.IllGill=107]="IllGill",e[e.DelLily=108]="DelLily",e[e.Epsilon=109]="Epsilon",e[e.GalGryphon=110]="GalGryphon",e[e.Deldepth=111]="Deldepth",e[e.Delbiter=112]="Delbiter",e[e.Dolmolm=113]="Dolmolm",e[e.Dolmdarl=114]="Dolmdarl",e[e.Morfos=115]="Morfos",e[e.Recobox=116]="Recobox",e[e.Recon=117]="Recon",e[e.SinowZoa=118]="SinowZoa",e[e.SinowZele=119]="SinowZele",e[e.OlgaFlow=120]="OlgaFlow",e[e.SandRappy=121]="SandRappy",e[e.DelRappy=122]="DelRappy",e[e.Astark=123]="Astark",e[e.SatelliteLizard=124]="SatelliteLizard",e[e.Yowie=125]="Yowie",e[e.MerissaA=126]="MerissaA",e[e.MerissaAA=127]="MerissaAA",e[e.Girtablulu=128]="Girtablulu",e[e.Zu=129]="Zu",e[e.Pazuzu=130]="Pazuzu",e[e.Boota=131]="Boota",e[e.ZeBoota=132]="ZeBoota",e[e.BaBoota=133]="BaBoota",e[e.Dorphon=134]="Dorphon",e[e.DorphonEclair=135]="DorphonEclair",e[e.Goran=136]="Goran",e[e.PyroGoran=137]="PyroGoran",e[e.GoranDetonator=138]="GoranDetonator",e[e.SaintMilion=139]="SaintMilion",e[e.Shambertin=140]="Shambertin",e[e.Kondrieu=141]="Kondrieu"}(s||(s={}));const n=[],o=[];function r(e){return l[e]}const a=[void 0,new Map,new Map,void 0,new Map],l=[];function u(e,t,i,s,r,u,d,h,c,p,v){if(n.push(e),u&&o.push(e),l[e]=Object.freeze({name:t,simple_name:i,ultimate_name:s,episode:r,enemy:u,rare_type:d,area_ids:h,pso_type_id:c,pso_roaming:p,pso_regular:v}),r){const t=a[r];t&&(t.set(i,e),t.set(s,e))}}u(s.Unknown,"Unknown","Unknown","Unknown",void 0,!1,void 0,[],void 0,void 0,void 0),u(s.FemaleFat,"Female Fat","Female Fat","Female Fat",void 0,!1,void 0,[0],4,0,!0),u(s.FemaleMacho,"Female Macho","Female Macho","Female Macho",void 0,!1,void 0,[0],5,0,!0),u(s.FemaleTall,"Female Tall","Female Tall","Female Tall",void 0,!1,void 0,[0],7,0,!0),u(s.MaleDwarf,"Male Dwarf","Male Dwarf","Male Dwarf",void 0,!1,void 0,[0],10,0,!0),u(s.MaleFat,"Male Fat","Male Fat","Male Fat",void 0,!1,void 0,[0],11,0,!0),u(s.MaleMacho,"Male Macho","Male Macho","Male Macho",void 0,!1,void 0,[0],12,0,!0),u(s.MaleOld,"Male Old","Male Old","Male Old",void 0,!1,void 0,[0],13,0,!0),u(s.BlueSoldier,"Blue Soldier","Blue Soldier","Blue Soldier",void 0,!1,void 0,[0],25,0,!0),u(s.RedSoldier,"Red Soldier","Red Soldier","Red Soldier",void 0,!1,void 0,[0],26,0,!0),u(s.Principal,"Principal","Principal","Principal",void 0,!1,void 0,[0],27,0,!0),u(s.Tekker,"Tekker","Tekker","Tekker",void 0,!1,void 0,[0],28,0,!0),u(s.GuildLady,"Guild Lady","Guild Lady","Guild Lady",void 0,!1,void 0,[0],29,0,!0),u(s.Scientist,"Scientist","Scientist","Scientist",void 0,!1,void 0,[0],30,0,!0),u(s.Nurse,"Nurse","Nurse","Nurse",void 0,!1,void 0,[0],31,0,!0),u(s.Irene,"Irene","Irene","Irene",void 0,!1,void 0,[0],32,0,!0),u(s.ItemShop,"Item Shop","Item Shop","Item Shop",void 0,!1,void 0,[0],241,0,!0),u(s.Nurse2,"Nurse (Ep. II)","Nurse","Nurse",2,!1,void 0,[0],254,0,!0),u(s.Hildebear,"Hildebear","Hildebear","Hildelt",1,!0,s.Hildeblue,[1,2],64,0,!0),u(s.Hildeblue,"Hildeblue","Hildeblue","Hildetorr",1,!0,void 0,[1,2],64,1,!0),u(s.RagRappy,"Rag Rappy","Rag Rappy","El Rappy",1,!0,s.AlRappy,[1,2],65,0,!0),u(s.AlRappy,"Al Rappy","Al Rappy","Pal Rappy",1,!0,void 0,[1,2],65,1,!0),u(s.Monest,"Monest","Monest","Mothvist",1,!0,void 0,[1,2],66,0,!0),u(s.Mothmant,"Mothmant","Mothmant","Mothvert",1,!0,void 0,[],void 0,void 0,void 0),u(s.SavageWolf,"Savage Wolf","Savage Wolf","Gulgus",1,!0,void 0,[1,2],67,0,!0),u(s.BarbarousWolf,"Barbarous Wolf","Barbarous Wolf","Gulgus-Gue",1,!0,void 0,[1,2],67,0,!1),u(s.Booma,"Booma","Booma","Bartle",1,!0,void 0,[1,2],68,0,!0),u(s.Gobooma,"Gobooma","Gobooma","Barble",1,!0,void 0,[1,2],68,1,!0),u(s.Gigobooma,"Gigobooma","Gigobooma","Tollaw",1,!0,void 0,[1,2],68,2,!0),u(s.Dragon,"Dragon","Dragon","Sil Dragon",1,!0,void 0,[11],192,0,!0),u(s.GrassAssassin,"Grass Assassin","Grass Assassin","Crimson Assassin",1,!0,void 0,[3,4,5],96,0,!0),u(s.PoisonLily,"Poison Lily","Poison Lily","Ob Lily",1,!0,s.NarLily,[3,4,5],97,0,!0),u(s.NarLily,"Nar Lily","Nar Lily","Mil Lily",1,!0,void 0,[3,4,5],97,1,!0),u(s.NanoDragon,"Nano Dragon","Nano Dragon","Nano Dragon",1,!0,void 0,[3,4,5],98,0,!0),u(s.EvilShark,"Evil Shark","Evil Shark","Vulmer",1,!0,void 0,[3,4,5],99,0,!0),u(s.PalShark,"Pal Shark","Pal Shark","Govulmer",1,!0,void 0,[3,4,5],99,1,!0),u(s.GuilShark,"Guil Shark","Guil Shark","Melqueek",1,!0,void 0,[3,4,5],99,2,!0),u(s.PofuillySlime,"Pofuilly Slime","Pofuilly Slime","Pofuilly Slime",1,!0,s.PouillySlime,[3,4,5],100,0,!0),u(s.PouillySlime,"Pouilly Slime","Pouilly Slime","Pouilly Slime",1,!0,void 0,[3,4,5],100,0,!1),u(s.PanArms,"Pan Arms","Pan Arms","Pan Arms",1,!0,void 0,[3,4,5],101,0,!0),u(s.Migium,"Migium","Migium","Migium",1,!0,void 0,[],void 0,void 0,void 0),u(s.Hidoom,"Hidoom","Hidoom","Hidoom",1,!0,void 0,[],void 0,void 0,void 0),u(s.DeRolLe,"De Rol Le","De Rol Le","Dal Ra Lie",1,!0,void 0,[12],193,0,!0),u(s.Dubchic,"Dubchic","Dubchic","Dubchich",1,!0,void 0,[6,7],128,0,!0),u(s.Gilchic,"Gilchic","Gilchic","Gilchich",1,!0,void 0,[6,7],128,1,!0),u(s.Garanz,"Garanz","Garanz","Baranz",1,!0,void 0,[6,7],129,0,!0),u(s.SinowBeat,"Sinow Beat","Sinow Beat","Sinow Blue",1,!0,void 0,[6,7],130,0,!0),u(s.SinowGold,"Sinow Gold","Sinow Gold","Sinow Red",1,!0,void 0,[6,7],130,0,!1),u(s.Canadine,"Canadine","Canadine","Canabin",1,!0,void 0,[6,7],131,0,!0),u(s.Canane,"Canane","Canane","Canune",1,!0,void 0,[6,7],132,0,!0),u(s.Dubswitch,"Dubswitch","Dubswitch","Dubswitch",1,!0,void 0,[6,7],133,0,!0),u(s.VolOptPart1,"Vol Opt (Part 1)","Vol Opt","Vol Opt ver.2",1,!0,void 0,[13],194,0,!0),u(s.VolOptPart2,"Vol Opt (Part 2)","Vol Opt","Vol Opt ver.2",1,!0,void 0,[13],197,0,!0),u(s.Delsaber,"Delsaber","Delsaber","Delsaber",1,!0,void 0,[8,9,10],160,0,!0),u(s.ChaosSorcerer,"Chaos Sorcerer","Chaos Sorcerer","Gran Sorcerer",1,!0,void 0,[8,9,10],161,0,!0),u(s.DarkGunner,"Dark Gunner","Dark Gunner","Dark Gunner",1,!0,void 0,[8,9,10],162,0,!0),u(s.DeathGunner,"Death Gunner","Death Gunner","Death Gunner",1,!0,void 0,[],void 0,void 0,void 0),u(s.ChaosBringer,"Chaos Bringer","Chaos Bringer","Dark Bringer",1,!0,void 0,[8,9,10],164,0,!0),u(s.DarkBelra,"Dark Belra","Dark Belra","Indi Belra",1,!0,void 0,[8,9,10],165,0,!0),u(s.Dimenian,"Dimenian","Dimenian","Arlan",1,!0,void 0,[8,9,10],166,0,!0),u(s.LaDimenian,"La Dimenian","La Dimenian","Merlan",1,!0,void 0,[8,9,10],166,1,!0),u(s.SoDimenian,"So Dimenian","So Dimenian","Del-D",1,!0,void 0,[8,9,10],166,2,!0),u(s.Bulclaw,"Bulclaw","Bulclaw","Bulclaw",1,!0,void 0,[8,9,10],167,0,!0),u(s.Bulk,"Bulk","Bulk","Bulk",1,!0,void 0,[],void 0,void 0,void 0),u(s.Claw,"Claw","Claw","Claw",1,!0,void 0,[8,9,10],168,0,!0),u(s.DarkFalz,"Dark Falz","Dark Falz","Dark Falz",1,!0,void 0,[14],200,0,!0),u(s.Hildebear2,"Hildebear (Ep. II)","Hildebear","Hildelt",2,!0,s.Hildeblue2,[1,2],64,0,!0),u(s.Hildeblue2,"Hildeblue (Ep. II)","Hildeblue","Hildetorr",2,!0,void 0,[1,2],64,1,!0),u(s.RagRappy2,"Rag Rappy (Ep. II)","Rag Rappy","El Rappy",2,!0,s.LoveRappy,[1,2],65,0,!0),u(s.LoveRappy,"Love Rappy","Love Rappy","Love Rappy",2,!0,void 0,[1,2],65,1,!0),u(s.StRappy,"St. Rappy","St. Rappy","St. Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.HalloRappy,"Hallo Rappy","Hallo Rappy","Hallo Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.EggRappy,"Egg Rappy","Egg Rappy","Egg Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.Monest2,"Monest (Ep. II)","Monest","Mothvist",2,!0,void 0,[1,2],66,0,!0),u(s.Mothmant2,"Mothmant","Mothmant","Mothvert",2,!0,void 0,[],void 0,void 0,void 0),u(s.PoisonLily2,"Poison Lily (Ep. II)","Poison Lily","Ob Lily",2,!0,s.NarLily2,[1,2],97,0,!0),u(s.NarLily2,"Nar Lily (Ep. II)","Nar Lily","Mil Lily",2,!0,void 0,[1,2],97,1,!0),u(s.GrassAssassin2,"Grass Assassin (Ep. II)","Grass Assassin","Crimson Assassin",2,!0,void 0,[1,2],96,0,!0),u(s.Dimenian2,"Dimenian (Ep. II)","Dimenian","Arlan",2,!0,void 0,[1,2],166,0,!0),u(s.LaDimenian2,"La Dimenian (Ep. II)","La Dimenian","Merlan",2,!0,void 0,[1,2],166,1,!0),u(s.SoDimenian2,"So Dimenian (Ep. II)","So Dimenian","Del-D",2,!0,void 0,[1,2],166,2,!0),u(s.DarkBelra2,"Dark Belra (Ep. II)","Dark Belra","Indi Belra",2,!0,void 0,[1,2],165,0,!0),u(s.BarbaRay,"Barba Ray","Barba Ray","Barba Ray",2,!0,void 0,[14],203,0,!0),u(s.SavageWolf2,"Savage Wolf (Ep. II)","Savage Wolf","Gulgus",2,!0,void 0,[3,4],67,0,!0),u(s.BarbarousWolf2,"Barbarous Wolf (Ep. II)","Barbarous Wolf","Gulgus-Gue",2,!0,void 0,[3,4],67,0,!1),u(s.PanArms2,"Pan Arms (Ep. II)","Pan Arms","Pan Arms",2,!0,void 0,[3,4],101,0,!0),u(s.Migium2,"Migium (Ep. II)","Migium","Migium",2,!0,void 0,[],void 0,void 0,void 0),u(s.Hidoom2,"Hidoom (Ep. II)","Hidoom","Hidoom",2,!0,void 0,[],void 0,void 0,void 0),u(s.Dubchic2,"Dubchic (Ep. II)","Dubchic","Dubchich",2,!0,void 0,[3,4],128,0,!0),u(s.Gilchic2,"Gilchic (Ep. II)","Gilchic","Gilchich",2,!0,void 0,[3,4],128,1,!0),u(s.Garanz2,"Garanz (Ep. II)","Garanz","Baranz",2,!0,void 0,[3,4],129,0,!0),u(s.Dubswitch2,"Dubswitch (Ep. II)","Dubswitch","Dubswitch",2,!0,void 0,[3,4],133,0,!0),u(s.Delsaber2,"Delsaber (Ep. II)","Delsaber","Delsaber",2,!0,void 0,[3,4],160,0,!0),u(s.ChaosSorcerer2,"Chaos Sorcerer (Ep. II)","Chaos Sorcerer","Gran Sorcerer",2,!0,void 0,[3,4],161,0,!0),u(s.GolDragon,"Gol Dragon","Gol Dragon","Gol Dragon",2,!0,void 0,[15],204,0,!0),u(s.SinowBerill,"Sinow Berill","Sinow Berill","Sinow Berill",2,!0,void 0,[5,6,7,8,9,16],212,0,!0),u(s.SinowSpigell,"Sinow Spigell","Sinow Spigell","Sinow Spigell",2,!0,void 0,[5,6,7,8,9,16],212,1,!0),u(s.Merillia,"Merillia","Merillia","Merillia",2,!0,void 0,[5,6,7,8,9,16],213,0,!0),u(s.Meriltas,"Meriltas","Meriltas","Meriltas",2,!0,void 0,[5,6,7,8,9,16],213,1,!0),u(s.Mericarol,"Mericarol","Mericarol","Mericarol",2,!0,void 0,[5,6,7,8,9,16,17],214,0,!0),u(s.Mericus,"Mericus","Mericus","Mericus",2,!0,void 0,[5,6,7,8,9,16,17],214,1,!0),u(s.Merikle,"Merikle","Merikle","Merikle",2,!0,void 0,[5,6,7,8,9,16,17],214,2,!0),u(s.UlGibbon,"Ul Gibbon","Ul Gibbon","Ul Gibbon",2,!0,void 0,[5,6,7,8,9,16],215,0,!0),u(s.ZolGibbon,"Zol Gibbon","Zol Gibbon","Zol Gibbon",2,!0,void 0,[5,6,7,8,9,16],215,1,!0),u(s.Gibbles,"Gibbles","Gibbles","Gibbles",2,!0,void 0,[5,6,7,8,9,16,17],216,0,!0),u(s.Gee,"Gee","Gee","Gee",2,!0,void 0,[5,6,7,8,9,16],217,0,!0),u(s.GiGue,"Gi Gue","Gi Gue","Gi Gue",2,!0,void 0,[5,6,7,8,9,16,17],218,0,!0),u(s.IllGill,"Ill Gill","Ill Gill","Ill Gill",2,!0,void 0,[17],225,0,!0),u(s.DelLily,"Del Lily","Del Lily","Del Lily",2,!0,void 0,[17],97,0,!0),u(s.Epsilon,"Epsilon","Epsilon","Epsilon",2,!0,void 0,[17],224,0,!0),u(s.GalGryphon,"Gal Gryphon","Gal Gryphon","Gal Gryphon",2,!0,void 0,[12],192,0,!0),u(s.Deldepth,"Deldepth","Deldepth","Deldepth",2,!0,void 0,[10,11],219,0,!0),u(s.Delbiter,"Delbiter","Delbiter","Delbiter",2,!0,void 0,[10,11,17],220,0,!0),u(s.Dolmolm,"Dolmolm","Dolmolm","Dolmolm",2,!0,void 0,[10,11],221,0,!0),u(s.Dolmdarl,"Dolmdarl","Dolmdarl","Dolmdarl",2,!0,void 0,[10,11],221,1,!0),u(s.Morfos,"Morfos","Morfos","Morfos",2,!0,void 0,[10,11],222,0,!0),u(s.Recobox,"Recobox","Recobox","Recobox",2,!0,void 0,[10,11,17],223,0,!0),u(s.Recon,"Recon","Recon","Recon",2,!0,void 0,[],void 0,void 0,void 0),u(s.SinowZoa,"Sinow Zoa","Sinow Zoa","Sinow Zoa",2,!0,void 0,[10,11],224,0,!0),u(s.SinowZele,"Sinow Zele","Sinow Zele","Sinow Zele",2,!0,void 0,[10,11],224,1,!0),u(s.OlgaFlow,"Olga Flow","Olga Flow","Olga Flow",2,!0,void 0,[13],202,0,!0),u(s.SandRappy,"Sand Rappy","Sand Rappy","Sand Rappy",4,!0,s.DelRappy,[1,2,3,4,5,6,7,8],65,0,!0),u(s.DelRappy,"Del Rappy","Del Rappy","Del Rappy",4,!0,void 0,[1,2,3,4,5,6,7,8],65,1,!0),u(s.Astark,"Astark","Astark","Astark",4,!0,void 0,[1,2,3,4,5,6,7,8],272,0,!0),u(s.SatelliteLizard,"Satellite Lizard","Satellite Lizard","Satellite Lizard",4,!0,void 0,[1,2,3,4,5,6,7,8],273,0,!0),u(s.Yowie,"Yowie","Yowie","Yowie",4,!0,void 0,[1,2,3,4,5,6,7,8],273,0,!1),u(s.MerissaA,"Merissa A","Merissa A","Merissa A",4,!0,s.MerissaAA,[6,7,8],274,0,!0),u(s.MerissaAA,"Merissa AA","Merissa AA","Merissa AA",4,!0,void 0,[6,7,8],274,1,!0),u(s.Girtablulu,"Girtablulu","Girtablulu","Girtablulu",4,!0,void 0,[6,7,8],275,0,!0),u(s.Zu,"Zu","Zu","Zu",4,!0,s.Pazuzu,[1,2,3,4,5,6,7,8],276,0,!0),u(s.Pazuzu,"Pazuzu","Pazuzu","Pazuzu",4,!0,void 0,[1,2,3,4,5,6,7,8],276,1,!0),u(s.Boota,"Boota","Boota","Boota",4,!0,void 0,[1,2,3,4,5],277,0,!0),u(s.ZeBoota,"Ze Boota","Ze Boota","Ze Boota",4,!0,void 0,[1,2,3,4,5],277,1,!0),u(s.BaBoota,"Ba Boota","Ba Boota","Ba Boota",4,!0,void 0,[1,2,3,4,5],277,2,!0),u(s.Dorphon,"Dorphon","Dorphon","Dorphon",4,!0,s.DorphonEclair,[1,2,3,4,5],278,0,!0),u(s.DorphonEclair,"Dorphon Eclair","Dorphon Eclair","Dorphon Eclair",4,!0,void 0,[1,2,3,4,5],278,1,!0),u(s.Goran,"Goran","Goran","Goran",4,!0,void 0,[6,7,8],279,0,!0),u(s.PyroGoran,"Pyro Goran","Pyro Goran","Pyro Goran",4,!0,void 0,[6,7,8],279,1,!0),u(s.GoranDetonator,"Goran Detonator","Goran Detonator","Goran Detonator",4,!0,void 0,[6,7,8],279,2,!0),u(s.SaintMilion,"Saint-Milion","Saint-Milion","Saint-Milion",4,!0,s.Kondrieu,[9],281,0,!0),u(s.Shambertin,"Shambertin","Shambertin","Shambertin",4,!0,s.Kondrieu,[9],281,1,!0),u(s.Kondrieu,"Kondrieu","Kondrieu","Kondrieu",4,!0,void 0,[9],281,0,!1),Object.freeze(n),Object.freeze(o),Object.freeze(l)},sv1z:function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var s=i("sDu+"),n=i("FXpb"),o=(i("6MRE"),i("jJhE")),r=i("KVVN"),a=i("4VsB"),l=i("LSoc"),u=i("ouMO");class d extends s.a{constructor(e){var t;super(e),this.element=Object(n.h)({className:"core_Select"}),this.button_mousedown=e=>{e.stopPropagation(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{switch(e.key){case"Enter":case" ":e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next();break;case"ArrowUp":{if(void 0===this._selected.val)break;const e=this.items.val.indexOf(this._selected.val)-1;if(e<0)break;this._selected.set_val(this.items.val[e],{silent:!1})}break;case"ArrowDown":{if(void 0===this._selected.val)break;const e=this.items.val.indexOf(this._selected.val)+1;if(e>=this.items.val.length)break;this._selected.set_val(this.items.val[e],{silent:!1})}}},this.preferred_label_position="left",this.items=Object(o.a)(e.items)?e.items:Object(u.e)(e.items),this.to_label=null!=(t=e.to_label)?t:String,this.button=this.disposable(new r.a({text:" ",icon_right:n.a.TriangleDown})),this.menu=this.disposable(new l.a({items:this.items,to_label:this.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._selected=new a.a(this,void 0,this.set_selected),this.selected=this._selected,this.just_opened=!1,this.disposables(Object(n.g)(this.button.element,"mousedown",this.button_mousedown),this.button.mouseup.observe(this.button_mouseup),this.button.keydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{this._selected.set_val(e,{silent:!1})})),e&&(Object(o.a)(e.selected)?this.selected.bind_to(e.selected):e.selected&&(this.selected.val=e.selected)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}set_selected(e){this.button.text.val=void 0!==e?this.to_label(e):" ",this.menu.selected.val=e}}},uiJh:function(e,t,i){"use strict";function s(e){const t=Object.values(e),i=t.filter(e=>"number"==typeof e);return i.length?i:t}function n(e,t){if(""===t)return;const i=t.charCodeAt(0);return 48<=i&&i<=57?void 0:e[t]}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return n}))},wtpc:function(e,t,i){"use strict";function s(e,t,i=((e,t)=>e===t)){const s=e.length;if(s!==t.length)return!1;for(let n=0;n1?e.slice(0,t):e}function l(e){const t=e.lastIndexOf(".");return t>1?e.slice(t+1):e}function u(e,t){if(!e){let e="Assertion Error";throw t&&(e+=": "+(t instanceof Function?t():t)),new Error(e)}}function d(e,t){u(null!=e,()=>`${t} should not be null or undefined (was ${e}).`)}function h(e,t){u(Number.isFinite(e),()=>`${t} should be a finite number (was ${e}).`)}function c(e,t){u(Number.isInteger(e),()=>`${t} should be an integer (was ${e}).`)}function p(e,t){u(Number.isInteger(e)&&e>=0,()=>`${t} should be a non-negative integer (was ${e}).`)}function v(e,t){u(Array.isArray(e),()=>`${t} should be an array (was ${e}).`)}function _(e,t=8){return e.toString(16).padStart(t,"0")}i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"h",(function(){return r})),i.d(t,"e",(function(){return a})),i.d(t,"g",(function(){return l})),i.d(t,"d",(function(){return u})),i.d(t,"f",(function(){return d})),i.d(t,"k",(function(){return h})),i.d(t,"l",(function(){return c})),i.d(t,"m",(function(){return p})),i.d(t,"j",(function(){return v})),i.d(t,"i",(function(){return _}))},xs7i:function(e,t,i){"use strict";var s;i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return n})),i.d(t,"c",(function(){return o})),function(e){e[e.I=1]="I",e[e.II=2]="II",e[e.IV=4]="IV"}(s||(s={}));const n=[s.I,s.II,s.IV];function o(e){if(null==s[e])throw new Error(`Invalid episode ${e}.`)}},zsIO:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("6Fug");class n extends s.a{constructor(){super(...arguments),this.width=0,this.height=0}resize(e,t){this.width=e,this.height=t,this.element.style.width=`${e}px`,this.element.style.height=`${t}px`}}}},[["/7QA",4,0,1]]]); \ No newline at end of file diff --git a/main.b0be83b1e294ee64c730.js b/main.b0be83b1e294ee64c730.js new file mode 100644 index 00000000..c971e37c --- /dev/null +++ b/main.b0be83b1e294ee64c730.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"+LO4":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));const s=i("rwco").a.get("core/observable/property/AbstractMinimalProperty");class n{constructor(){this.is_property=!0,this.observers=[]}observe(e,t){return this.observers.push(e),t&&t.call_now&&this.call_observer(e,this.val),{dispose:()=>{const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}}}emit(){const e=this.val;for(const t of this.observers)this.call_observer(t,e)}call_observer(e,t){try{e({value:t})}catch(e){s.error("Observer threw error.",e)}}}},"/7QA":function(e,t,i){"use strict";i.r(t);i("LSZE"),i("8UJ8"),i("XtFL"),i("tjRy"),i("3oCa"),i("OP0w");var s=i("4SjJ");i("ouMO");class n{constructor(e,t,i,s,n,o,r){this.id=e,this.name=t,this.min_atp=i,this.max_atp=s,this.ata=n,this.max_grind=o,this.required_atp=r}}class o{constructor(e,t,i,s,n,o,r,a,l,u,d){this.id=e,this.name=t,this.atp=i,this.ata=s,this.min_evp=n,this.max_evp=o,this.min_dfp=r,this.max_dfp=a,this.mst=l,this.hp=u,this.lck=d}}class r{constructor(e,t,i,s,n,o,r,a,l,u,d){this.id=e,this.name=t,this.atp=i,this.ata=s,this.min_evp=n,this.max_evp=o,this.min_dfp=r,this.max_dfp=a,this.mst=l,this.hp=u,this.lck=d}}class a{constructor(e,t){this.id=e,this.name=t}}class l{constructor(e,t){this.id=e,this.name=t}}var u=i("nsCy"),d=i("Ya0R"),c=i("kcKQ"),h=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};function p(e,t){return new d.a(t,function(e){return t=>h(this,void 0,void 0,(function*(){const i=yield e.get(`/item_types.${u.g[t].toLowerCase()}.json`).json(),s=[],d=[];for(const e of i){let t;switch(e.class){case"weapon":t=new n(e.id,e.name,e.min_atp,e.max_atp,e.ata,e.max_grind,e.required_atp);break;case"armor":t=new o(e.id,e.name,e.atp,e.ata,e.min_evp,e.max_evp,e.min_dfp,e.max_dfp,e.mst,e.hp,e.lck);break;case"shield":t=new r(e.id,e.name,e.atp,e.ata,e.min_evp,e.max_evp,e.min_dfp,e.max_dfp,e.mst,e.hp,e.lck);break;case"unit":t=new a(e.id,e.name);break;case"tool":t=new l(e.id,e.name);break;default:continue}d[t.id]=t,s.push(t)}return new v(s,d)}))}(e))}class v extends c.a{constructor(e,t){super(),this.id_to_item_type=t,this.get_by_id=e=>this.id_to_item_type[e],this.item_types=e}}var _=i("sZ1+");class b{constructor(e,t,i,s,n,o){this.difficulty=e,this.section_id=t,this.npc_type=i,this.item_type=s,this.anything_rate=n,this.rare_rate=o,this.rate=n*o}}var m=i("rwco"),f=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};const g=m.a.get("stores/ItemDropStore");function w(e,t,i){return new d.a(t,function(e,t){return i=>f(this,void 0,void 0,(function*(){const s=yield t.get(i),n=yield e.get(`/enemy_drops.${u.g[i].toLowerCase()}.json`).json(),o=new D;for(const e of n){const t=_.c[e.enemy];if(!t){g.warning(`Couldn't determine NpcType of episode ${e.episode} ${e.enemy}.`);continue}const i=u.b[e.difficulty],n=s.get_by_id(e.item_type_id);if(!n){g.warning(`Couldn't find item kind ${e.item_type_id}.`);continue}const r=u.e[e.section_id];null!=r?o.set_drop(i,r,t,new b(i,r,t,n,e.drop_rate,e.rare_rate)):g.warning(`Couldn't find section ID ${e.section_id}.`)}return new y(o)}))}(e,i))}class y extends c.a{constructor(e){super(),this.enemy_drops=e}}class D{constructor(){this.table=[],this.item_type_to_drops=[];for(let e=0;e[e,this.add(new G(e,t))])),this.server_select=this.add(new M.a({label:"Server:",items:["Ephinea"],to_label:e=>e,enabled:!1,selected:"Ephinea",tooltip:"Only Ephinea is supported at the moment"})),this.element=Object(S.h)({className:"application_NavigationView"},...[...this.buttons.values()].map(e=>e.element),Object(S.h)({className:"application_NavigationView_spacer"}),Object(S.s)({className:"application_NavigationView_server"},this.server_select.label.element,this.server_select.element),Object(S.b)({className:"application_NavigationView_github",href:"https://github.com/DaanVandenBosch/phantasmal-world",title:"GitHub"},Object(S.k)(S.a.GitHub))),this.height=30,this.mousedown=e=>{e.target instanceof HTMLLabelElement&&e.target.control instanceof HTMLInputElement&&this.gui_store.set_tool(s.b[e.target.control.value])},this.mark_tool_button=e=>{const t=this.buttons.get(e);t&&(t.checked=!0)},this.element.style.height=`${this.height}px`,this.element.onmousedown=this.mousedown,this.disposables(e.tool.observe(({value:e})=>this.mark_tool_button(e),{call_now:!0})),this.finalize_construction()}}var R=i("39ZU"),B=i("zsIO");class z extends B.a{constructor(e,t){super(),this.element=Object(S.h)({className:"application_MainContentView"}),this.tool_views=new Map(t.map(([e,t])=>[e,this.add(new R.a(t))]));for(const e of this.tool_views.values())this.element.append(e.element);this.disposables(e.tool.observe(({value:e})=>this.set_current_tool(e),{call_now:!0})),this.finalize_construction()}resize(e,t){super.resize(e,t);for(const i of this.tool_views.values())i.resize(e,t);return this}set_current_tool(e){this.current_tool_view&&(this.current_tool_view.visible.val=!1,this.current_tool_view.deactivate()),this.current_tool_view=this.tool_views.get(e),this.current_tool_view&&(this.current_tool_view.visible.val=!0,this.current_tool_view.activate())}}i("Pjoc");class j extends B.a{constructor(e,t){super(),this.menu_view=this.add(new L(e)),this.main_content_view=this.add(new z(e,t)),this.element=Object(S.h)({className:"application_ApplicationView"},this.menu_view.element,this.main_content_view.element),this.element.id="root",this.finalize_construction()}resize(e,t){return super.resize(e,t),this.main_content_view.resize(e,t-this.menu_view.height),this}}var E=i("LvDl"),P=i("Tpfs"),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};function A(e){const t=e;"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||e.preventDefault()}function C(e){const t=e;t.ctrlKey&&!t.altKey&&"Z"===t.key.toUpperCase()&&t.preventDefault()}function N(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none")}function H(e){N(e)}function F(e){N(e)}var V=i("4eU9");var T=i("Womt");!function(e,t,n){const o=new P.a;o.add(Object(S.f)(document,"beforeinput",A)),o.add(Object(S.g)(document,"keydown",C)),o.add_all(Object(S.g)(document,"dragenter",N),Object(S.g)(document,"dragover",H),Object(S.g)(document,"drop",F));const r=o.add(new s.a),a=o.add(p(e,r)),l=o.add(w(e,r,a)),u=o.add(new j(r,[[s.b.Viewer,()=>I(this,void 0,void 0,(function*(){const{initialize_viewer:s}=yield Promise.all([i.e(0),i.e(1),i.e(2),i.e(5)]).then(i.bind(null,"U6CM"));return o.add(s(e,t,r,n)).view}))],[s.b.QuestEditor,()=>I(this,void 0,void 0,(function*(){const{initialize_quest_editor:t}=yield Promise.all([i.e(0),i.e(1),i.e(2),i.e(7)]).then(i.bind(null,"4aaK"));return o.add(t(e,r,n)).view}))],[s.b.HuntOptimizer,()=>I(this,void 0,void 0,(function*(){const{initialize_hunt_optimizer:t}=yield Promise.all([i.e(0),i.e(1),i.e(9)]).then(i.bind(null,"Ix/i"));return o.add(t(e,r,a,l)).view}))]])),d=Object(E.throttle)(()=>{u.resize(window.innerWidth,window.innerHeight)},100,{leading:!0,trailing:!0});d(),document.body.append(u.element),u.activate(),o.add(Object(S.g)(window,"resize",d))}(new class{get(e){const t=new AbortController,i=fetch("/assets"+e,{signal:t.signal});return{json:()=>new V.a((e,t)=>{i.then(e=>e.json()).then(t=>e(t),e=>t(e))},()=>t.abort()),array_buffer:()=>new V.a((e,t)=>{i.then(e=>e.arrayBuffer()).then(t=>e(t),e=>t(e))},()=>t.abort())}}},new class{constructor(e=Math.random){this.random_number=e}integer(e,t){return e+Math.floor(this.random_number()*(t-e))}sample_array(e){return e[this.integer(0,e.length)]}},(function(){const e=new T.WebGLRenderer({antialias:!0,alpha:!0});return e.setPixelRatio(window.devicePixelRatio),e}))},"0CzU":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("hUhj"),n=i("jJhE");class o extends s.a{constructor(e){super(),this._val=e}get val(){return this.get_val()}set val(e){this.set_val(e)}get_val(){return this._val}set_val(e,t={}){e!==this._val&&(this._val=e,t.silent||this.emit())}update(e){this.val=e(this.val)}bind_to(e){return Object(n.a)(e)&&(this.val=e.val),e.observe(e=>this.val=e.value)}}},"39ZU":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("nN8q"),n=i("FXpb");class o extends s.a{constructor(e){super(),this.create_view=e,this.initialized=!1,this.element=Object(n.h)({className:"core_LazyView"}),this.visible.val=!1}get children(){return this.view?[this.view]:[]}resize(e,t){return super.resize(e,t),this.view&&this.view.resize(e,t),this}set_visible(e){super.set_visible(e),e&&!this.initialized&&(this.initialized=!0,this.create_view().then(e=>{this.disposed?e.dispose():(this.view=this.disposable(e),this.view.resize(this.width,this.height),this.element.append(e.element),this.view.activate())})),this.finalize_construction()}}},"4SjJ":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return c}));var s,n=i("ouMO"),o=i("nsCy"),r=i("kcKQ"),a=i("FXpb"),l=i("wtpc");!function(e){e[e.Viewer=0]="Viewer",e[e.QuestEditor=1]="QuestEditor",e[e.HuntOptimizer=2]="HuntOptimizer"}(s||(s={}));const u=new Map([[s.Viewer,"viewer"],[s.QuestEditor,"quest_editor"],[s.HuntOptimizer,"hunt_optimizer"]]),d=new Map([...u.entries()].map(([e,t])=>[t,e]));class c extends r.a{constructor(){var e;super(),this._tool=Object(n.e)(s.Viewer),this._path=Object(n.e)(""),this.parameters=new Map,this._server=Object(n.e)(o.g.Ephinea),this.global_keydown_handlers=new Map,this.features=new Set,this.tool=this._tool,this.path=this._path,this.server=this._server,this.dispatch_global_keydown=e=>{const t=[];e.ctrlKey&&t.push("Ctrl"),e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt"),t.push(e.key.toUpperCase());const i=t.join("-"),s=this.global_keydown_handlers.get(this.handler_key(this.tool.val,i));s&&(e.preventDefault(),s(e))};const t=window.location.hash.slice(1),[i,r]=t.split("?"),l=i.indexOf("/",1),u=null!=(e=function(e){return d.get(e)}(-1===l?i:i.slice(1,l)))?e:s.Viewer,c=-1===l?"":i.slice(l);if(r){const e=new Map;for(const[t,i]of r.split("&").map(e=>e.split("=",2)))if("features"===t)for(const e of i.split(","))this.features.add(e);else e.set(t,i);this.parameters.set(i,e)}this.disposables(Object(a.g)(window,"keydown",this.dispatch_global_keydown)),this.set_tool(u,c)}get full_path(){return`/${h(this.tool.val)}${this.path.val}`}set_tool(e,t=""){this._path.val=t,this._tool.val=e,this.update_location()}set_path_prefix(e){this.path.val.startsWith(e)||(this._path.val=e,this.update_location())}get_parameter(e,t,i){return Object(l.h)(this.parameters,`/${h(e)}${t}`,()=>new Map).get(i)}bind_parameter(e,t,i,s){Object(l.d)("features"!==i,"features can't be bound because it is a global parameter.");const n=Object(l.h)(this.parameters,this.full_path,()=>new Map);return s.observe(({value:s})=>{this.tool.val===e&&this.path.val===t&&(void 0===s?n.delete(i):n.set(i,s),this.update_location())})}update_location(){const e=[],t=this.parameters.get(this.full_path);if(t)for(const[i,s]of t.entries())e.push([i,s]);this.features.size&&e.push(["features",[...this.features].join(",")]);const i=0===e.length?"":"?"+e.map(e=>e.join("=")).join("&");window.location.hash=`#${this.full_path}${i}`}on_global_keydown(e,t,i){const s=this.handler_key(e,t);return this.global_keydown_handlers.set(s,i),{dispose:()=>{this.global_keydown_handlers.delete(s)}}}feature_active(e){return this.features.has(e)}handler_key(e,t){return`${s[e]} -> ${t}`}}function h(e){const t=u.get(e);if(t)return t;throw new Error(`To string not implemented for ${s[e]}.`)}},"4VsB":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("0CzU");class n extends s.a{constructor(e,t,i){super(t),this.widget=e,this.set_value=i}set_val(e,t){this.set_value.call(this.widget,e),super.set_val(e,Object.assign({silent:!0},t))}}},"4eU9":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s extends Promise{constructor(e,t){let i,s;super((e,t)=>{i=e,s=t}),this.disposed=!1,this.disposal_handler=t,e(e=>{this.disposed||i(e)},e=>{this.disposed||s(e)})}static resolve(e){return new s((t,i)=>{void 0===e?new s(()=>void 0):"then"in e?e.then(t,i):t(e)})}static wrap(e,t){return e instanceof s?e:new s((t,i)=>{e.then(t).catch(i)},t)}then(e,t){return s.wrap(super.then(e,t),()=>this.dispose())}catch(e){return s.wrap(super.catch(e),()=>this.dispose())}finally(e){return s.wrap(super.finally(e),()=>this.dispose())}dispose(){var e;this.disposed||(this.disposed=!0,null===(e=this.disposal_handler)||void 0===e||e.call(this))}}},"52VV":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Ge8H"),n=i("nEgy");class o extends n.a{constructor(e,t){super(e),this.compute=t}get_val(){return this.should_recompute()||!this.computed_property?super.get_val():this.computed_property.val}observe(e,t){const i=super.observe(e,t);return{dispose:()=>{var e;i.dispose(),0===this.observers.length&&(null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_disposable=void 0,this.computed_property=void 0)}}}map(e){return new s.a([this],()=>e(this.val))}flat_map(e){return new o([this],()=>e(this.val))}compute_value(){var e;return null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_property=this.compute(),this.computed_disposable=this.computed_property.observe(()=>{this.emit()}),this.computed_property.val}}},"5cb6":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return a}));var s,n=i("uiJh"),o=i("wtpc");!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Off=5]="Off"}(s||(s={}));const r=Object(n.a)(s);function a(e){const t=s[e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()];return Object(o.d)(null!=t,()=>`"${e}" is not a valid severity.`),t}},"6Fug":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("TRid"),n=i("wtpc");class o extends s.a{constructor(){super(...arguments),this._children=[]}get children(){return this._children}dispose(){this._children.splice(0),super.dispose()}add(e){return this._children.push(e),this.disposable(e)}remove(e){Object(n.b)(this._children,e),this.remove_disposable(e)}}},"7ZX1":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("TRid"),n=(i("ku4b"),i("4VsB")),o=i("FXpb");class r extends s.a{constructor(e,t){super(t),this._text=new n.a(this,"",this.set_text),this.element=Object(o.n)({className:"core_Label"}),this.children=[],this.text=this._text,"string"==typeof e?this.set_text(e):this.disposable(this._text.bind_to(e)),this.finalize_construction()}set for(e){this.element.htmlFor=e}set_text(e){this.element.textContent=e}}},FXpb:function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"e",(function(){return u})),i.d(t,"h",(function(){return d})),i.d(t,"i",(function(){return c})),i.d(t,"j",(function(){return h})),i.d(t,"m",(function(){return p})),i.d(t,"l",(function(){return v})),i.d(t,"n",(function(){return _})),i.d(t,"o",(function(){return b})),i.d(t,"p",(function(){return m})),i.d(t,"q",(function(){return f})),i.d(t,"s",(function(){return g})),i.d(t,"t",(function(){return w})),i.d(t,"u",(function(){return y})),i.d(t,"v",(function(){return D})),i.d(t,"w",(function(){return S})),i.d(t,"x",(function(){return k})),i.d(t,"y",(function(){return G})),i.d(t,"z",(function(){return M})),i.d(t,"A",(function(){return x})),i.d(t,"B",(function(){return O})),i.d(t,"c",(function(){return R})),i.d(t,"a",(function(){return B})),i.d(t,"k",(function(){return z})),i.d(t,"r",(function(){return j})),i.d(t,"g",(function(){return E})),i.d(t,"f",(function(){return P})),i.d(t,"d",(function(){return I}));var s=i("jJhE"),n=i("nsCy"),o=i("oxtq"),r=i("Tpfs");const a=i("rwco").a.get("core/gui/dom");function l(e,...t){const i=L("a",e,...t);return e&&e.href&&e.href.trimLeft().startsWith("http")&&(i.target="_blank",i.rel="noopener noreferrer"),i}function u(e,...t){return L("button",e,...t)}function d(e,...t){return L("div",e,...t)}function c(e,...t){return L("h1",e,...t)}function h(e,...t){return L("h2",e,...t)}function p(e,...t){return L("input",e,...t)}function v(e,...t){return L("img",e,...t)}function _(e,...t){return L("label",e,...t)}function b(e,...t){return L("li",e,...t)}function m(e,...t){return L("p",e,...t)}function f(e,...t){return L("section",e,...t)}function g(e,...t){return L("span",e,...t)}function w(e,...t){return L("table",e,...t)}function y(e,...t){return L("tbody",e,...t)}function D(e,...t){return L("td",e,...t)}function S(e,...t){return L("textarea",e,...t)}function k(e,...t){return L("tfoot",e,...t)}function G(e,...t){return L("th",e,...t)}function M(e,...t){return L("thead",e,...t)}function x(e,...t){return L("tr",e,...t)}function O(e,...t){return L("ul",e,...t)}function L(e,t,...i){const s=document.createElement(e);if(t)if(t instanceof Node||"string"==typeof t)s.append(t);else{const e=t.data;if(delete t.data,Object.assign(s,t),e)for(const[t,i]of Object.entries(e))s.dataset[t]=i}return s.append(...i),s}function R(e,t,i){return Object(s.a)(i)&&(e[t]=i.val),i.observe(({value:i})=>e[t]=i)}var B;function z(e){let t;switch(e){case B.ArrowDown:t="fas fa-arrow-down";break;case B.Eye:t="far fa-eye";break;case B.File:t="fas fa-file";break;case B.GitHub:t="fab fa-github";break;case B.LevelDown:t="fas fa-level-down-alt";break;case B.LevelUp:t="fas fa-level-up-alt";break;case B.LongArrowRight:t="fas fa-long-arrow-alt-right";break;case B.NewFile:t="fas fa-file-medical";break;case B.Play:t="fas fa-play";break;case B.Plus:t="fas fa-plus";break;case B.Redo:t="fas fa-redo";break;case B.Remove:t="fas fa-trash-alt";break;case B.Save:t="fas fa-save";break;case B.Stop:t="fas fa-stop";break;case B.SquareArrowRight:t="far fa-caret-square-right";break;case B.TriangleDown:t="fas fa-caret-down";break;case B.TriangleUp:t="fas fa-caret-up";break;case B.Undo:t="fas fa-undo"}return g(g({className:t}))}function j(e,t){const i=g(),s=t&&t.size;return i.style.display="inline-block",i.style.width=`${s}px`,i.style.height=`${s}px`,i.style.backgroundImage=`url(/assets/images/sectionids/${n.e[e]}.png)`,i.style.backgroundSize=`${s}px`,i.title=n.e[e],i}function E(e,t,i,s){return e.addEventListener(t,i,s),{dispose(){e.removeEventListener(t,i)}}}function P(e,t,i,s){return e.addEventListener(t,i,s),{dispose(){e.removeEventListener(t,i)}}}function I(e,t,i,s){const n=new r.a,l=t.observe_list(t=>{var r,l,u;t.type===o.a.ListChange?function(t){for(let i=0;i{const o=i(e,t.index+s);return Array.isArray(o)?(n.insert(t.index+s,o[1]),o[0]):o});if(t.index>=e.childElementCount)e.append(...s);else for(let i=0;i"),t.join("")}!function(e){e[e.ArrowDown=0]="ArrowDown",e[e.Eye=1]="Eye",e[e.File=2]="File",e[e.GitHub=3]="GitHub",e[e.LevelDown=4]="LevelDown",e[e.LevelUp=5]="LevelUp",e[e.LongArrowRight=6]="LongArrowRight",e[e.NewFile=7]="NewFile",e[e.Play=8]="Play",e[e.Plus=9]="Plus",e[e.Redo=10]="Redo",e[e.Remove=11]="Remove",e[e.Save=12]="Save",e[e.SquareArrowRight=13]="SquareArrowRight",e[e.Stop=14]="Stop",e[e.TriangleDown=15]="TriangleDown",e[e.TriangleUp=16]="TriangleUp",e[e.Undo=17]="Undo"}(B||(B={}))},Ge8H:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("52VV"),n=i("nEgy");class o extends n.a{constructor(e,t){super(e),this.compute_value=t}map(e){return new o([this],()=>e(this.val))}flat_map(e){return new s.a([this],()=>e(this.val))}}},KVVN:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var s=i("FXpb"),n=(i("Tp1L"),i("ouMO")),o=i("QmPX"),r=i("4VsB");class a extends o.a{constructor(e){var t,i,o,a;super(e),this._onmouseup=Object(n.a)(),this._onclick=Object(n.a)(),this._onkeydown=Object(n.a)(),this.element=Object(s.e)({className:"core_Button"}),this.onmouseup=this._onmouseup,this.onclick=this._onclick,this.onkeydown=this._onkeydown;const l=Object(s.s)({className:"core_Button_inner"});null!=(null===(t=e)||void 0===t?void 0:t.icon_left)&&l.append(Object(s.s)({className:"core_Button_left"},Object(s.k)(e.icon_left))),this.center_element=Object(s.s)({className:"core_Button_center"}),l.append(this.center_element),null!=(null===(i=e)||void 0===i?void 0:i.icon_right)&&l.append(Object(s.s)({className:"core_Button_right"},Object(s.k)(e.icon_right))),this.element.onmouseup=e=>this._onmouseup.emit({value:e}),this.element.onclick=e=>this._onclick.emit({value:e}),this.element.onkeydown=e=>this._onkeydown.emit({value:e}),this._text=new r.a(this,"",this.set_text),this.text=this._text,"string"==typeof(null===(o=e)||void 0===o?void 0:o.text)?this.text.val=e.text:(null===(a=e)||void 0===a?void 0:a.text)?this.text.bind_to(e.text):this.text.val="",this.element.append(l),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.element.disabled=!e}set_text(e){this.center_element.textContent=e,this.center_element.hidden=""===e}}},LSoc:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var s=i("FXpb"),n=i("TRid"),o=i("jJhE"),r=i("ouMO"),a=i("4VsB");i("/xfa");class l extends n.a{constructor(e){var t;super(),this.element=Object(s.h)({className:"core_Menu",tabIndex:-1}),this.children=[],this.inner_element=Object(s.h)({className:"core_Menu_inner"}),this.mouseup=e=>{if(!(e.target instanceof HTMLElement))return;const t=e.target.dataset.index;null!=t&&this.select_item(parseInt(t,10))},this.keydown=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.hover_next();break;case"ArrowUp":e.preventDefault(),this.hover_prev();break;case"Enter":e.preventDefault(),this.select_hovered()}},this.blur=()=>{this.visible.val=!1},this.inner_mouseover=e=>{if(e.target&&e.target instanceof HTMLElement){const t=e.target.dataset.index;null!=t&&this.hover_item(parseInt(t,10))}},this.document_mousedown=e=>{!this.visible.val||this.element.contains(e.target)||this.related_element.contains(e.target)||this.visible.set_val(!1,{silent:!1})},this.document_keydown=e=>{"Escape"===e.key&&this.visible.set_val(!1,{silent:!1})},this.visible.val=!1,this.element.onmouseup=this.mouseup,this.element.onkeydown=this.keydown,this.element.onblur=this.blur,this.inner_element.onmouseover=this.inner_mouseover,this.element.append(this.inner_element),this.to_label=null!=(t=e.to_label)?t:e=>String(e),this.items=Object(o.a)(e.items)?e.items:Object(r.e)(e.items),this.related_element=e.related_element,this._selected=new a.a(this,void 0,this.set_selected),this.selected=this._selected,this.disposables(this.items.observe(({value:e})=>{this.inner_element.innerHTML="",this.inner_element.append(...e.map((e,t)=>Object(s.h)({data:{index:t.toString()}},this.to_label(e)))),this.hover_item()},{call_now:!0}),Object(s.g)(document,"mousedown",this.document_mousedown,{capture:!0}),Object(s.g)(document,"keydown",this.document_keydown)),this.finalize_construction()}focus(){var e;this.previously_focused_element=null!=(e=document.activeElement)?e:void 0,this.element.focus()}hover_next(){this.visible.set_val(!0,{silent:!1}),this.hover_item(null!=this.hovered_index?(this.hovered_index+1)%this.items.val.length:0)}hover_prev(){this.visible.set_val(!0,{silent:!1}),this.hover_item(this.hovered_index?this.hovered_index-1:this.items.val.length-1)}select_hovered(){null!=this.hovered_index&&this.select_item(this.hovered_index)}set_visible(e){super.set_visible(e),this.visible.val!=e&&(this.hover_item(),this.inner_element.scrollTop=0,!e&&this.previously_focused_element instanceof HTMLElement&&this.previously_focused_element.focus())}set_selected(){}hover_item(e){this.hovered_element&&this.hovered_element.classList.remove("core_Menu_hovered"),null==e?(this.hovered_index=void 0,this.hovered_element=void 0):(this.hovered_element=this.inner_element.children.item(e),this.hovered_element&&(this.hovered_index=e,this.hovered_element.classList.add("core_Menu_hovered"),this.hovered_element.scrollIntoView({block:"nearest"})))}select_item(e){const t=this.items.val[e];void 0!==t&&(this.selected.set_val(t,{silent:!1}),this.visible.set_val(!1,{silent:!1}))}}},QmPX:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("TRid");class n extends s.a{constructor(){super(...arguments),this.children=[]}}},TRid:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Tpfs"),n=i("4VsB");const o=i("rwco").a.get("core/gui/Widget");class r{constructor(e={}){this.disposer=new s.a,this._active=!1,this._visible=new n.a(this,!0,this.set_visible),this._enabled=new n.a(this,!0,this.set_enabled),this._tooltip=new n.a(this,"",this.set_tooltip),this.construction_finalized=!1,this.visible=this._visible,this.enabled=this._enabled,this.tooltip=this._tooltip,this.options=e,setTimeout(()=>{this.construction_finalized||o.error(`finalize_construction is never called for ${Object.getPrototypeOf(this).constructor.name}.`)},0)}get id(){return this.element.id}set id(e){this.element.id=e}get active(){return this._active}get disposed(){return this.disposer.disposed}activate(){this._active=!0;for(const e of this.children)e.activate()}deactivate(){this._active=!1;for(const e of this.children)e.deactivate()}focus(){this.element.focus()}dispose(){this.element.remove(),this.disposer.dispose()}finalize_construction(){Object.getPrototypeOf(this)===this.constructor.prototype&&(this.options.id&&(this.element.id=this.options.id),this.options.class&&this.element.classList.add(this.options.class),"boolean"==typeof this.options.enabled?this.enabled.val=this.options.enabled:this.options.enabled&&this.enabled.bind_to(this.options.enabled),"string"==typeof this.options.tooltip?this.tooltip.val=this.options.tooltip:this.options.tooltip&&this.tooltip.bind_to(this.options.tooltip),this.construction_finalized=!0)}set_visible(e){this.element.hidden=!e}set_enabled(e){e?this.element.classList.remove("disabled"):this.element.classList.add("disabled")}set_tooltip(e){this.element.title=e}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}remove_disposable(e){this.disposer.remove(e)}}},Tpfs:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("rwco"),n=i("wtpc");const o=s.a.get("core/observable/Disposer");class r{constructor(...e){this._disposed=!1,this.disposables=e}get length(){return this.disposables.length}get disposed(){return this._disposed}add(e){return this.disposed?e.dispose():this.disposables.push(e),e}insert(e,t){return this._disposed||this.disposables.splice(e,0,t),t}add_all(...e){return this._disposed||this.disposables.push(...e),this}remove(e){Object(n.b)(this.disposables,e),e.dispose()}dispose_all(){this.dispose_at(0,this.disposables.length)}dispose(){this.dispose_all(),this._disposed=!0}dispose_at(e,t=1){for(const i of this.disposables.splice(e,t))try{i.dispose()}catch(e){o.warning("Error while disposing.",e)}}}},Ya0R:function(e,t,i){"use strict";var s=i("LvDl");class n{constructor(e,t){this.gui_store=e,this.get_value=Object(s.memoize)(t)}get current(){return this._current||(this._current=this.gui_store.server.map(e=>this.get(e))),this._current}get(e){return this.get_value(e)}}var o=i("Tpfs");i.d(t,"a",(function(){return a}));var r=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))};class a extends n{constructor(e,t){super(e,e=>r(this,void 0,void 0,(function*(){const i=yield t(e);return this.disposer.disposed?i.dispose():this.disposer.add(i),i}))),this.disposer=new o.a}dispose(){this.disposer.dispose()}}},hUhj:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var s=i("Ge8H"),n=i("52VV"),o=i("+LO4");class r extends o.a{map(e){return new s.a([this],()=>e(this.val))}flat_map(e){return new n.a([this],()=>e(this.val))}}},jJhE:function(e,t,i){"use strict";function s(e){return null!=e&&e.is_property}i.d(t,"a",(function(){return s}))},kcKQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("Tpfs");class n{constructor(){this.disposer=new s.a}dispose(){this.disposer.dispose()}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}}},nEgy:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("Tpfs"),n=i("+LO4");class o extends n.a{constructor(e){super(),this.dependencies=e,this.dependency_disposer=new s.a}get val(){return this.get_val()}get_val(){return this.should_recompute()&&(this._val=this.compute_value()),this._val}observe(e,t){0===this.dependency_disposer.length&&(this._val=this.compute_value(),this.dependency_disposer.add_all(...this.dependencies.map(e=>e.observe(()=>{const e=this._val;this._val=this.compute_value(),this._val!==e&&this.emit()}))));const i=super.observe(e,t);return{dispose:()=>{i.dispose(),0===this.observers.length&&this.dependency_disposer.dispose_all()}}}should_recompute(){return 0===this.dependency_disposer.length}}},nN8q:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("TRid");class n extends s.a{constructor(){super(...arguments),this.width=0,this.height=0}resize(e,t){this.width=e,this.height=t,this.element.style.width=`${e}px`,this.element.style.height=`${t}px`}}},nsCy:function(e,t,i){"use strict";i.d(t,"d",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"g",(function(){return r})),i.d(t,"e",(function(){return a})),i.d(t,"f",(function(){return l})),i.d(t,"b",(function(){return u})),i.d(t,"a",(function(){return d}));var s=i("uiJh");const n=1/512,o=.1;var r;!function(e){e.Ephinea="Ephinea"}(r||(r={}));Object(s.a)(r);var a;!function(e){e[e.Viridia=0]="Viridia",e[e.Greenill=1]="Greenill",e[e.Skyly=2]="Skyly",e[e.Bluefull=3]="Bluefull",e[e.Purplenum=4]="Purplenum",e[e.Pinkal=5]="Pinkal",e[e.Redria=6]="Redria",e[e.Oran=7]="Oran",e[e.Yellowboze=8]="Yellowboze",e[e.Whitill=9]="Whitill"}(a||(a={}));const l=Object(s.a)(a);var u;!function(e){e[e.Normal=0]="Normal",e[e.Hard=1]="Hard",e[e.VHard=2]="VHard",e[e.Ultimate=3]="Ultimate"}(u||(u={}));const d=Object(s.a)(u)},ouMO:function(e,t,i){"use strict";var s=i("rwco");const n=s.a.get("core/observable/SimpleEmitter");class o{constructor(){this.observers=[]}emit(e){for(const t of this.observers)try{t(e)}catch(e){n.error("Observer threw error.",e)}}observe(e){return this.observers.includes(e)||this.observers.push(e),{dispose:()=>{const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}}}}var r=i("0CzU"),a=i("Ge8H"),l=i("jJhE"),u=i("oxtq"),d=i("hUhj");const c=s.a.get("core/observable/property/list/AbstractListProperty");class h extends d.a{constructor(e){super(),this.compute_length=e,this.length=0}get val(){return this.get_val()}get_val(){return this.length=this.compute_length()}update(){const e=this.length,t=this.compute_length();e!==t&&(this.length=t,this.emit())}}class p extends d.a{constructor(e){super(),this.is_list_property=!0,this.value_observers=[],this.list_observers=[],this._length=new h(()=>this.compute_length()),this.length=this._length,this.extract_observables=e}get(e){return this.val[e]}observe_list(e,t){return 0===this.value_observers.length&&this.extract_observables&&this.replace_element_observers(0,1/0,this.val),this.list_observers.includes(e)||this.list_observers.push(e),t&&t.call_now&&this.call_list_observer(e,{type:u.a.ListChange,index:0,removed:[],inserted:this.val.slice()}),{dispose:()=>{const t=this.list_observers.indexOf(e);if(-1!==t&&this.list_observers.splice(t,1),0===this.list_observers.length){for(const{disposables:e}of this.value_observers)for(const t of e)t.dispose();this.value_observers.splice(0,1/0)}}}}[Symbol.iterator](){return this.val[Symbol.iterator]()}finalize_update(e){this.list_observers.length&&this.extract_observables&&e.type===u.a.ListChange&&this.replace_element_observers(e.index,e.removed.length,e.inserted),this._length.update();for(const t of this.list_observers)this.call_list_observer(t,e);this.emit()}call_list_observer(e,t){try{e(t)}catch(e){c.error("Observer threw error.",e)}}replace_element_observers(e,t,i){let s=e;const n=this.value_observers.splice(e,t,...i.map(e=>{const t={index:s,disposables:this.extract_observables(e).map(i=>i.observe(()=>{this.finalize_update({type:u.a.ValueChange,updated:[e],index:t.index})}))};return s++,t}));for(const{disposables:e}of n)for(const t of e)t.dispose();for(;s{i.dispose(),this.dispose_dependency_disposables()}}}observe_list(e,t){const i=super.observe_list(e,t);return this.init_dependency_disposables(),{dispose:()=>{i.dispose(),this.dispose_dependency_disposables()}}}should_recompute(){return 0===this.dependency_disposer.length}compute_length(){return this.should_recompute()&&(this.values=this.compute_values()),this.values.length}recompute_and_emit(){const e=this.values.slice();this.values=this.compute_values(),this.finalize_update({type:u.a.ListChange,index:0,removed:e,inserted:this.values.slice()})}init_dependency_disposables(){0===this.dependency_disposer.length&&(this.values=this.compute_values(),this.dependency_disposer.add_all(...this.dependencies.map(e=>e.observe(()=>{this.recompute_and_emit()}))))}dispose_dependency_disposables(){0===this.observers.length&&0===this.list_observers.length&&this.dependency_disposer.dispose_all()}}class b extends _{constructor(e,t){super(e),this.compute_values=t}filtered(e){return Object(l.a)(e)?new b([this,e],()=>this.val.filter(e.val)):new b([this],()=>this.val.filter(e))}}class m extends p{constructor(e,...t){super(e),this.values=t||[]}get val(){return this.get_val()}set val(e){this.set_val(e)}get_val(){return this.values}set_val(e){const t=this.values.splice(0,this.values.length,...e);return this.finalize_update({type:u.a.ListChange,index:0,removed:t,inserted:e.slice()}),t}filtered(e){return Object(l.a)(e)?new b([this,e],()=>this.val.filter(e.val)):new b([this],()=>this.val.filter(e))}bind_to(e){return Object(u.b)(e)?(this.set_val(e.val),e.observe_list(e=>{e.type===u.a.ListChange&&this.splice(e.index,e.removed.length,...e.inserted)})):(Object(l.a)(e)&&this.set_val(e.val),e.observe(({value:e})=>this.set_val(e)))}update(e){this.splice(0,this.values.length,...e(this.values))}set(e,t){const i=[this.values[e]];this.values[e]=t,this.finalize_update({type:u.a.ListChange,index:e,removed:i,inserted:[t]})}push(...e){const t=this.values.length;return this.values.push(...e),this.finalize_update({type:u.a.ListChange,index:t,removed:[],inserted:e.slice()}),this.length.val}remove(...e){for(const t of e){const e=this.values.indexOf(t);e>-1&&(this.values.splice(e,1),this.finalize_update({type:u.a.ListChange,index:e,removed:[t],inserted:[]}))}}clear(){const e=this.values.splice(0,this.values.length);this.finalize_update({type:u.a.ListChange,index:0,removed:e,inserted:[]})}splice(e,t,...i){let s;return s=null==t?this.values.splice(e):this.values.splice(e,t,...i),this.finalize_update({type:u.a.ListChange,index:e,removed:s,inserted:i.slice()}),s}sort(e){const t=this.values.slice();this.values.sort(e),this.finalize_update({type:u.a.ListChange,index:0,removed:t,inserted:this.values.slice()})}compute_length(){return this.values.length}}var f=i("52VV");class g extends _{constructor(e,t){super(e),this.compute=t}get_val(){return this.should_recompute()||!this.computed_property?super.get_val():this.computed_property.val}observe(e,t){const i=super.observe(e,t);return{dispose:()=>{var e;i.dispose(),0===this.observers.length&&(null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_disposable=void 0,this.computed_property=void 0)}}}observe_list(e,t){const i=super.observe_list(e,t);return{dispose:()=>{i.dispose()}}}map(e){return new a.a([this],()=>e(this.val))}flat_map(e){return new f.a([this],()=>e(this.val))}filtered(e){return Object(l.a)(e)?new b([this,e],()=>this.val.filter(e.val)):new b([this],()=>this.val.filter(e))}compute_values(){var e;return null===(e=this.computed_disposable)||void 0===e||e.dispose(),this.computed_property=this.compute(),this.computed_disposable=this.computed_property.observe_list(e=>{e.type===u.a.ListChange&&this.values.splice(e.index,e.removed.length,...e.inserted),this.finalize_update(e)}),this.computed_property.val.slice()}}function w(){return new o}function y(e){return new r.a(e)}function D(e,...t){return new m(e,...t)}function S(e,...t){return new a.a(t,()=>e(...t.map(e=>e.val)))}function k(e,...t){return new g(t,()=>e(...t.map(e=>e.val)))}i.d(t,"a",(function(){return w})),i.d(t,"e",(function(){return y})),i.d(t,"c",(function(){return D})),i.d(t,"d",(function(){return S})),i.d(t,"b",(function(){return k}))},oxtq:function(e,t,i){"use strict";var s;function n(e){return null!=e&&e.is_list_property}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return n})),function(e){e[e.ListChange=0]="ListChange",e[e.ValueChange=1]="ValueChange"}(s||(s={}))},rwco:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return a}));var s=i("5cb6");function n(e){return`${o(e.getHours(),2)}:${o(e.getMinutes(),2)}:${o(e.getSeconds(),2)}.${o(e.getMilliseconds(),3)}`}function o(e,t){return e.toString().padStart(t,"0")}class r{constructor(e){this.name=e,this.trace=(e,t)=>{this.log(s.b.Trace,e,t)},this.debug=(e,t)=>{this.log(s.b.Debug,e,t)},this.info=(e,t)=>{this.log(s.b.Info,e,t)},this.warning=(e,t)=>{this.log(s.b.Warning,e,t)},this.error=(e,t)=>{this.log(s.b.Error,e,t)}}get severity(){var e;return null!=(e=this._severity)?e:a.default_severity}set severity(e){this._severity=e}get handler(){var e;return null!=(e=this._handler)?e:a.default_handler}set handler(e){this._handler=e}log(e,t,i){e>=this.severity&&this.handler({time:new Date,message:t,severity:e,logger:this,cause:i},this.name)}}class a{static get(e){let t=this.loggers.get(e);return t||(t=new r(e),this.loggers.set(e,t)),t}static with_default_handler(e,t){const i=this.default_handler;let s=!1;try{this.default_handler=e;const n=t();return n instanceof Promise?(s=!0,n.finally(()=>this.default_handler=i)):n}finally{s||(this.default_handler=i)}}}a.loggers=new Map,a.default_severity=Object(s.c)("Info"),a.default_handler=function({time:e,message:t,severity:i,logger:o,cause:r}){const a=`${n(e)} [${s.b[i]}] ${o.name} - ${t}`;let l;switch(i){case s.b.Trace:l=console.trace;break;case s.b.Debug:l=console.debug;break;case s.b.Info:l=console.info;break;case s.b.Warning:l=console.warn;break;case s.b.Error:l=console.error;break;default:l=console.log}null==r?l.call(console,a):l.call(console,a,r)}},"sDu+":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("7ZX1"),n=i("QmPX");class o extends n.a{constructor(e){super(e),this._label_text=e&&e.label}get label(){return this._label||null==this._label_text||(this._label=this.disposable(new s.a(this._label_text,{enabled:this.enabled.val,tooltip:this.tooltip.val})),this.id||(this.id="core_LabelledControl_id_"+String(r++)),this._label.for=this.id),this._label}set_enabled(e){super.set_enabled(e),this._label&&(this._label.enabled.val=e)}set_tooltip(e){super.set_tooltip(e),this._label&&(this._label.tooltip.val=e)}}let r=0},"sZ1+":function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"d",(function(){return r}));var s;i("xs7i");!function(e){e[e.Unknown=0]="Unknown",e[e.FemaleFat=1]="FemaleFat",e[e.FemaleMacho=2]="FemaleMacho",e[e.FemaleTall=3]="FemaleTall",e[e.MaleDwarf=4]="MaleDwarf",e[e.MaleFat=5]="MaleFat",e[e.MaleMacho=6]="MaleMacho",e[e.MaleOld=7]="MaleOld",e[e.BlueSoldier=8]="BlueSoldier",e[e.RedSoldier=9]="RedSoldier",e[e.Principal=10]="Principal",e[e.Tekker=11]="Tekker",e[e.GuildLady=12]="GuildLady",e[e.Scientist=13]="Scientist",e[e.Nurse=14]="Nurse",e[e.Irene=15]="Irene",e[e.ItemShop=16]="ItemShop",e[e.Nurse2=17]="Nurse2",e[e.Hildebear=18]="Hildebear",e[e.Hildeblue=19]="Hildeblue",e[e.RagRappy=20]="RagRappy",e[e.AlRappy=21]="AlRappy",e[e.Monest=22]="Monest",e[e.Mothmant=23]="Mothmant",e[e.SavageWolf=24]="SavageWolf",e[e.BarbarousWolf=25]="BarbarousWolf",e[e.Booma=26]="Booma",e[e.Gobooma=27]="Gobooma",e[e.Gigobooma=28]="Gigobooma",e[e.Dragon=29]="Dragon",e[e.GrassAssassin=30]="GrassAssassin",e[e.PoisonLily=31]="PoisonLily",e[e.NarLily=32]="NarLily",e[e.NanoDragon=33]="NanoDragon",e[e.EvilShark=34]="EvilShark",e[e.PalShark=35]="PalShark",e[e.GuilShark=36]="GuilShark",e[e.PofuillySlime=37]="PofuillySlime",e[e.PouillySlime=38]="PouillySlime",e[e.PanArms=39]="PanArms",e[e.Migium=40]="Migium",e[e.Hidoom=41]="Hidoom",e[e.DeRolLe=42]="DeRolLe",e[e.Dubchic=43]="Dubchic",e[e.Gilchic=44]="Gilchic",e[e.Garanz=45]="Garanz",e[e.SinowBeat=46]="SinowBeat",e[e.SinowGold=47]="SinowGold",e[e.Canadine=48]="Canadine",e[e.Canane=49]="Canane",e[e.Dubswitch=50]="Dubswitch",e[e.VolOptPart1=51]="VolOptPart1",e[e.VolOptPart2=52]="VolOptPart2",e[e.Delsaber=53]="Delsaber",e[e.ChaosSorcerer=54]="ChaosSorcerer",e[e.DarkGunner=55]="DarkGunner",e[e.DeathGunner=56]="DeathGunner",e[e.ChaosBringer=57]="ChaosBringer",e[e.DarkBelra=58]="DarkBelra",e[e.Dimenian=59]="Dimenian",e[e.LaDimenian=60]="LaDimenian",e[e.SoDimenian=61]="SoDimenian",e[e.Bulclaw=62]="Bulclaw",e[e.Bulk=63]="Bulk",e[e.Claw=64]="Claw",e[e.DarkFalz=65]="DarkFalz",e[e.Hildebear2=66]="Hildebear2",e[e.Hildeblue2=67]="Hildeblue2",e[e.RagRappy2=68]="RagRappy2",e[e.LoveRappy=69]="LoveRappy",e[e.StRappy=70]="StRappy",e[e.HalloRappy=71]="HalloRappy",e[e.EggRappy=72]="EggRappy",e[e.Monest2=73]="Monest2",e[e.Mothmant2=74]="Mothmant2",e[e.PoisonLily2=75]="PoisonLily2",e[e.NarLily2=76]="NarLily2",e[e.GrassAssassin2=77]="GrassAssassin2",e[e.Dimenian2=78]="Dimenian2",e[e.LaDimenian2=79]="LaDimenian2",e[e.SoDimenian2=80]="SoDimenian2",e[e.DarkBelra2=81]="DarkBelra2",e[e.BarbaRay=82]="BarbaRay",e[e.SavageWolf2=83]="SavageWolf2",e[e.BarbarousWolf2=84]="BarbarousWolf2",e[e.PanArms2=85]="PanArms2",e[e.Migium2=86]="Migium2",e[e.Hidoom2=87]="Hidoom2",e[e.Dubchic2=88]="Dubchic2",e[e.Gilchic2=89]="Gilchic2",e[e.Garanz2=90]="Garanz2",e[e.Dubswitch2=91]="Dubswitch2",e[e.Delsaber2=92]="Delsaber2",e[e.ChaosSorcerer2=93]="ChaosSorcerer2",e[e.GolDragon=94]="GolDragon",e[e.SinowBerill=95]="SinowBerill",e[e.SinowSpigell=96]="SinowSpigell",e[e.Merillia=97]="Merillia",e[e.Meriltas=98]="Meriltas",e[e.Mericarol=99]="Mericarol",e[e.Mericus=100]="Mericus",e[e.Merikle=101]="Merikle",e[e.UlGibbon=102]="UlGibbon",e[e.ZolGibbon=103]="ZolGibbon",e[e.Gibbles=104]="Gibbles",e[e.Gee=105]="Gee",e[e.GiGue=106]="GiGue",e[e.IllGill=107]="IllGill",e[e.DelLily=108]="DelLily",e[e.Epsilon=109]="Epsilon",e[e.GalGryphon=110]="GalGryphon",e[e.Deldepth=111]="Deldepth",e[e.Delbiter=112]="Delbiter",e[e.Dolmolm=113]="Dolmolm",e[e.Dolmdarl=114]="Dolmdarl",e[e.Morfos=115]="Morfos",e[e.Recobox=116]="Recobox",e[e.Recon=117]="Recon",e[e.SinowZoa=118]="SinowZoa",e[e.SinowZele=119]="SinowZele",e[e.OlgaFlow=120]="OlgaFlow",e[e.SandRappy=121]="SandRappy",e[e.DelRappy=122]="DelRappy",e[e.Astark=123]="Astark",e[e.SatelliteLizard=124]="SatelliteLizard",e[e.Yowie=125]="Yowie",e[e.MerissaA=126]="MerissaA",e[e.MerissaAA=127]="MerissaAA",e[e.Girtablulu=128]="Girtablulu",e[e.Zu=129]="Zu",e[e.Pazuzu=130]="Pazuzu",e[e.Boota=131]="Boota",e[e.ZeBoota=132]="ZeBoota",e[e.BaBoota=133]="BaBoota",e[e.Dorphon=134]="Dorphon",e[e.DorphonEclair=135]="DorphonEclair",e[e.Goran=136]="Goran",e[e.PyroGoran=137]="PyroGoran",e[e.GoranDetonator=138]="GoranDetonator",e[e.SaintMilion=139]="SaintMilion",e[e.Shambertin=140]="Shambertin",e[e.Kondrieu=141]="Kondrieu"}(s||(s={}));const n=[],o=[];function r(e){return l[e]}const a=[void 0,new Map,new Map,void 0,new Map],l=[];function u(e,t,i,s,r,u,d,c,h,p,v){if(n.push(e),u&&o.push(e),l[e]=Object.freeze({name:t,simple_name:i,ultimate_name:s,episode:r,enemy:u,rare_type:d,area_ids:c,pso_type_id:h,pso_roaming:p,pso_regular:v}),r){const t=a[r];t&&(t.set(i,e),t.set(s,e))}}u(s.Unknown,"Unknown","Unknown","Unknown",void 0,!1,void 0,[],void 0,void 0,void 0),u(s.FemaleFat,"Female Fat","Female Fat","Female Fat",void 0,!1,void 0,[0],4,0,!0),u(s.FemaleMacho,"Female Macho","Female Macho","Female Macho",void 0,!1,void 0,[0],5,0,!0),u(s.FemaleTall,"Female Tall","Female Tall","Female Tall",void 0,!1,void 0,[0],7,0,!0),u(s.MaleDwarf,"Male Dwarf","Male Dwarf","Male Dwarf",void 0,!1,void 0,[0],10,0,!0),u(s.MaleFat,"Male Fat","Male Fat","Male Fat",void 0,!1,void 0,[0],11,0,!0),u(s.MaleMacho,"Male Macho","Male Macho","Male Macho",void 0,!1,void 0,[0],12,0,!0),u(s.MaleOld,"Male Old","Male Old","Male Old",void 0,!1,void 0,[0],13,0,!0),u(s.BlueSoldier,"Blue Soldier","Blue Soldier","Blue Soldier",void 0,!1,void 0,[0],25,0,!0),u(s.RedSoldier,"Red Soldier","Red Soldier","Red Soldier",void 0,!1,void 0,[0],26,0,!0),u(s.Principal,"Principal","Principal","Principal",void 0,!1,void 0,[0],27,0,!0),u(s.Tekker,"Tekker","Tekker","Tekker",void 0,!1,void 0,[0],28,0,!0),u(s.GuildLady,"Guild Lady","Guild Lady","Guild Lady",void 0,!1,void 0,[0],29,0,!0),u(s.Scientist,"Scientist","Scientist","Scientist",void 0,!1,void 0,[0],30,0,!0),u(s.Nurse,"Nurse","Nurse","Nurse",void 0,!1,void 0,[0],31,0,!0),u(s.Irene,"Irene","Irene","Irene",void 0,!1,void 0,[0],32,0,!0),u(s.ItemShop,"Item Shop","Item Shop","Item Shop",void 0,!1,void 0,[0],241,0,!0),u(s.Nurse2,"Nurse (Ep. II)","Nurse","Nurse",2,!1,void 0,[0],254,0,!0),u(s.Hildebear,"Hildebear","Hildebear","Hildelt",1,!0,s.Hildeblue,[1,2],64,0,!0),u(s.Hildeblue,"Hildeblue","Hildeblue","Hildetorr",1,!0,void 0,[1,2],64,1,!0),u(s.RagRappy,"Rag Rappy","Rag Rappy","El Rappy",1,!0,s.AlRappy,[1,2],65,0,!0),u(s.AlRappy,"Al Rappy","Al Rappy","Pal Rappy",1,!0,void 0,[1,2],65,1,!0),u(s.Monest,"Monest","Monest","Mothvist",1,!0,void 0,[1,2],66,0,!0),u(s.Mothmant,"Mothmant","Mothmant","Mothvert",1,!0,void 0,[],void 0,void 0,void 0),u(s.SavageWolf,"Savage Wolf","Savage Wolf","Gulgus",1,!0,void 0,[1,2],67,0,!0),u(s.BarbarousWolf,"Barbarous Wolf","Barbarous Wolf","Gulgus-Gue",1,!0,void 0,[1,2],67,0,!1),u(s.Booma,"Booma","Booma","Bartle",1,!0,void 0,[1,2],68,0,!0),u(s.Gobooma,"Gobooma","Gobooma","Barble",1,!0,void 0,[1,2],68,1,!0),u(s.Gigobooma,"Gigobooma","Gigobooma","Tollaw",1,!0,void 0,[1,2],68,2,!0),u(s.Dragon,"Dragon","Dragon","Sil Dragon",1,!0,void 0,[11],192,0,!0),u(s.GrassAssassin,"Grass Assassin","Grass Assassin","Crimson Assassin",1,!0,void 0,[3,4,5],96,0,!0),u(s.PoisonLily,"Poison Lily","Poison Lily","Ob Lily",1,!0,s.NarLily,[3,4,5],97,0,!0),u(s.NarLily,"Nar Lily","Nar Lily","Mil Lily",1,!0,void 0,[3,4,5],97,1,!0),u(s.NanoDragon,"Nano Dragon","Nano Dragon","Nano Dragon",1,!0,void 0,[3,4,5],98,0,!0),u(s.EvilShark,"Evil Shark","Evil Shark","Vulmer",1,!0,void 0,[3,4,5],99,0,!0),u(s.PalShark,"Pal Shark","Pal Shark","Govulmer",1,!0,void 0,[3,4,5],99,1,!0),u(s.GuilShark,"Guil Shark","Guil Shark","Melqueek",1,!0,void 0,[3,4,5],99,2,!0),u(s.PofuillySlime,"Pofuilly Slime","Pofuilly Slime","Pofuilly Slime",1,!0,s.PouillySlime,[3,4,5],100,0,!0),u(s.PouillySlime,"Pouilly Slime","Pouilly Slime","Pouilly Slime",1,!0,void 0,[3,4,5],100,0,!1),u(s.PanArms,"Pan Arms","Pan Arms","Pan Arms",1,!0,void 0,[3,4,5],101,0,!0),u(s.Migium,"Migium","Migium","Migium",1,!0,void 0,[],void 0,void 0,void 0),u(s.Hidoom,"Hidoom","Hidoom","Hidoom",1,!0,void 0,[],void 0,void 0,void 0),u(s.DeRolLe,"De Rol Le","De Rol Le","Dal Ra Lie",1,!0,void 0,[12],193,0,!0),u(s.Dubchic,"Dubchic","Dubchic","Dubchich",1,!0,void 0,[6,7],128,0,!0),u(s.Gilchic,"Gilchic","Gilchic","Gilchich",1,!0,void 0,[6,7],128,1,!0),u(s.Garanz,"Garanz","Garanz","Baranz",1,!0,void 0,[6,7],129,0,!0),u(s.SinowBeat,"Sinow Beat","Sinow Beat","Sinow Blue",1,!0,void 0,[6,7],130,0,!0),u(s.SinowGold,"Sinow Gold","Sinow Gold","Sinow Red",1,!0,void 0,[6,7],130,0,!1),u(s.Canadine,"Canadine","Canadine","Canabin",1,!0,void 0,[6,7],131,0,!0),u(s.Canane,"Canane","Canane","Canune",1,!0,void 0,[6,7],132,0,!0),u(s.Dubswitch,"Dubswitch","Dubswitch","Dubswitch",1,!0,void 0,[6,7],133,0,!0),u(s.VolOptPart1,"Vol Opt (Part 1)","Vol Opt","Vol Opt ver.2",1,!0,void 0,[13],194,0,!0),u(s.VolOptPart2,"Vol Opt (Part 2)","Vol Opt","Vol Opt ver.2",1,!0,void 0,[13],197,0,!0),u(s.Delsaber,"Delsaber","Delsaber","Delsaber",1,!0,void 0,[8,9,10],160,0,!0),u(s.ChaosSorcerer,"Chaos Sorcerer","Chaos Sorcerer","Gran Sorcerer",1,!0,void 0,[8,9,10],161,0,!0),u(s.DarkGunner,"Dark Gunner","Dark Gunner","Dark Gunner",1,!0,void 0,[8,9,10],162,0,!0),u(s.DeathGunner,"Death Gunner","Death Gunner","Death Gunner",1,!0,void 0,[],void 0,void 0,void 0),u(s.ChaosBringer,"Chaos Bringer","Chaos Bringer","Dark Bringer",1,!0,void 0,[8,9,10],164,0,!0),u(s.DarkBelra,"Dark Belra","Dark Belra","Indi Belra",1,!0,void 0,[8,9,10],165,0,!0),u(s.Dimenian,"Dimenian","Dimenian","Arlan",1,!0,void 0,[8,9,10],166,0,!0),u(s.LaDimenian,"La Dimenian","La Dimenian","Merlan",1,!0,void 0,[8,9,10],166,1,!0),u(s.SoDimenian,"So Dimenian","So Dimenian","Del-D",1,!0,void 0,[8,9,10],166,2,!0),u(s.Bulclaw,"Bulclaw","Bulclaw","Bulclaw",1,!0,void 0,[8,9,10],167,0,!0),u(s.Bulk,"Bulk","Bulk","Bulk",1,!0,void 0,[],void 0,void 0,void 0),u(s.Claw,"Claw","Claw","Claw",1,!0,void 0,[8,9,10],168,0,!0),u(s.DarkFalz,"Dark Falz","Dark Falz","Dark Falz",1,!0,void 0,[14],200,0,!0),u(s.Hildebear2,"Hildebear (Ep. II)","Hildebear","Hildelt",2,!0,s.Hildeblue2,[1,2],64,0,!0),u(s.Hildeblue2,"Hildeblue (Ep. II)","Hildeblue","Hildetorr",2,!0,void 0,[1,2],64,1,!0),u(s.RagRappy2,"Rag Rappy (Ep. II)","Rag Rappy","El Rappy",2,!0,s.LoveRappy,[1,2],65,0,!0),u(s.LoveRappy,"Love Rappy","Love Rappy","Love Rappy",2,!0,void 0,[1,2],65,1,!0),u(s.StRappy,"St. Rappy","St. Rappy","St. Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.HalloRappy,"Hallo Rappy","Hallo Rappy","Hallo Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.EggRappy,"Egg Rappy","Egg Rappy","Egg Rappy",2,!0,void 0,[],void 0,void 0,void 0),u(s.Monest2,"Monest (Ep. II)","Monest","Mothvist",2,!0,void 0,[1,2],66,0,!0),u(s.Mothmant2,"Mothmant","Mothmant","Mothvert",2,!0,void 0,[],void 0,void 0,void 0),u(s.PoisonLily2,"Poison Lily (Ep. II)","Poison Lily","Ob Lily",2,!0,s.NarLily2,[1,2],97,0,!0),u(s.NarLily2,"Nar Lily (Ep. II)","Nar Lily","Mil Lily",2,!0,void 0,[1,2],97,1,!0),u(s.GrassAssassin2,"Grass Assassin (Ep. II)","Grass Assassin","Crimson Assassin",2,!0,void 0,[1,2],96,0,!0),u(s.Dimenian2,"Dimenian (Ep. II)","Dimenian","Arlan",2,!0,void 0,[1,2],166,0,!0),u(s.LaDimenian2,"La Dimenian (Ep. II)","La Dimenian","Merlan",2,!0,void 0,[1,2],166,1,!0),u(s.SoDimenian2,"So Dimenian (Ep. II)","So Dimenian","Del-D",2,!0,void 0,[1,2],166,2,!0),u(s.DarkBelra2,"Dark Belra (Ep. II)","Dark Belra","Indi Belra",2,!0,void 0,[1,2],165,0,!0),u(s.BarbaRay,"Barba Ray","Barba Ray","Barba Ray",2,!0,void 0,[14],203,0,!0),u(s.SavageWolf2,"Savage Wolf (Ep. II)","Savage Wolf","Gulgus",2,!0,void 0,[3,4],67,0,!0),u(s.BarbarousWolf2,"Barbarous Wolf (Ep. II)","Barbarous Wolf","Gulgus-Gue",2,!0,void 0,[3,4],67,0,!1),u(s.PanArms2,"Pan Arms (Ep. II)","Pan Arms","Pan Arms",2,!0,void 0,[3,4],101,0,!0),u(s.Migium2,"Migium (Ep. II)","Migium","Migium",2,!0,void 0,[],void 0,void 0,void 0),u(s.Hidoom2,"Hidoom (Ep. II)","Hidoom","Hidoom",2,!0,void 0,[],void 0,void 0,void 0),u(s.Dubchic2,"Dubchic (Ep. II)","Dubchic","Dubchich",2,!0,void 0,[3,4],128,0,!0),u(s.Gilchic2,"Gilchic (Ep. II)","Gilchic","Gilchich",2,!0,void 0,[3,4],128,1,!0),u(s.Garanz2,"Garanz (Ep. II)","Garanz","Baranz",2,!0,void 0,[3,4],129,0,!0),u(s.Dubswitch2,"Dubswitch (Ep. II)","Dubswitch","Dubswitch",2,!0,void 0,[3,4],133,0,!0),u(s.Delsaber2,"Delsaber (Ep. II)","Delsaber","Delsaber",2,!0,void 0,[3,4],160,0,!0),u(s.ChaosSorcerer2,"Chaos Sorcerer (Ep. II)","Chaos Sorcerer","Gran Sorcerer",2,!0,void 0,[3,4],161,0,!0),u(s.GolDragon,"Gol Dragon","Gol Dragon","Gol Dragon",2,!0,void 0,[15],204,0,!0),u(s.SinowBerill,"Sinow Berill","Sinow Berill","Sinow Berill",2,!0,void 0,[5,6,7,8,9,16],212,0,!0),u(s.SinowSpigell,"Sinow Spigell","Sinow Spigell","Sinow Spigell",2,!0,void 0,[5,6,7,8,9,16],212,1,!0),u(s.Merillia,"Merillia","Merillia","Merillia",2,!0,void 0,[5,6,7,8,9,16],213,0,!0),u(s.Meriltas,"Meriltas","Meriltas","Meriltas",2,!0,void 0,[5,6,7,8,9,16],213,1,!0),u(s.Mericarol,"Mericarol","Mericarol","Mericarol",2,!0,void 0,[5,6,7,8,9,16,17],214,0,!0),u(s.Mericus,"Mericus","Mericus","Mericus",2,!0,void 0,[5,6,7,8,9,16,17],214,1,!0),u(s.Merikle,"Merikle","Merikle","Merikle",2,!0,void 0,[5,6,7,8,9,16,17],214,2,!0),u(s.UlGibbon,"Ul Gibbon","Ul Gibbon","Ul Gibbon",2,!0,void 0,[5,6,7,8,9,16],215,0,!0),u(s.ZolGibbon,"Zol Gibbon","Zol Gibbon","Zol Gibbon",2,!0,void 0,[5,6,7,8,9,16],215,1,!0),u(s.Gibbles,"Gibbles","Gibbles","Gibbles",2,!0,void 0,[5,6,7,8,9,16,17],216,0,!0),u(s.Gee,"Gee","Gee","Gee",2,!0,void 0,[5,6,7,8,9,16],217,0,!0),u(s.GiGue,"Gi Gue","Gi Gue","Gi Gue",2,!0,void 0,[5,6,7,8,9,16,17],218,0,!0),u(s.IllGill,"Ill Gill","Ill Gill","Ill Gill",2,!0,void 0,[17],225,0,!0),u(s.DelLily,"Del Lily","Del Lily","Del Lily",2,!0,void 0,[17],97,0,!0),u(s.Epsilon,"Epsilon","Epsilon","Epsilon",2,!0,void 0,[17],224,0,!0),u(s.GalGryphon,"Gal Gryphon","Gal Gryphon","Gal Gryphon",2,!0,void 0,[12],192,0,!0),u(s.Deldepth,"Deldepth","Deldepth","Deldepth",2,!0,void 0,[10,11],219,0,!0),u(s.Delbiter,"Delbiter","Delbiter","Delbiter",2,!0,void 0,[10,11,17],220,0,!0),u(s.Dolmolm,"Dolmolm","Dolmolm","Dolmolm",2,!0,void 0,[10,11],221,0,!0),u(s.Dolmdarl,"Dolmdarl","Dolmdarl","Dolmdarl",2,!0,void 0,[10,11],221,1,!0),u(s.Morfos,"Morfos","Morfos","Morfos",2,!0,void 0,[10,11],222,0,!0),u(s.Recobox,"Recobox","Recobox","Recobox",2,!0,void 0,[10,11,17],223,0,!0),u(s.Recon,"Recon","Recon","Recon",2,!0,void 0,[],void 0,void 0,void 0),u(s.SinowZoa,"Sinow Zoa","Sinow Zoa","Sinow Zoa",2,!0,void 0,[10,11],224,0,!0),u(s.SinowZele,"Sinow Zele","Sinow Zele","Sinow Zele",2,!0,void 0,[10,11],224,1,!0),u(s.OlgaFlow,"Olga Flow","Olga Flow","Olga Flow",2,!0,void 0,[13],202,0,!0),u(s.SandRappy,"Sand Rappy","Sand Rappy","Sand Rappy",4,!0,s.DelRappy,[1,2,3,4,5,6,7,8],65,0,!0),u(s.DelRappy,"Del Rappy","Del Rappy","Del Rappy",4,!0,void 0,[1,2,3,4,5,6,7,8],65,1,!0),u(s.Astark,"Astark","Astark","Astark",4,!0,void 0,[1,2,3,4,5,6,7,8],272,0,!0),u(s.SatelliteLizard,"Satellite Lizard","Satellite Lizard","Satellite Lizard",4,!0,void 0,[1,2,3,4,5,6,7,8],273,0,!0),u(s.Yowie,"Yowie","Yowie","Yowie",4,!0,void 0,[1,2,3,4,5,6,7,8],273,0,!1),u(s.MerissaA,"Merissa A","Merissa A","Merissa A",4,!0,s.MerissaAA,[6,7,8],274,0,!0),u(s.MerissaAA,"Merissa AA","Merissa AA","Merissa AA",4,!0,void 0,[6,7,8],274,1,!0),u(s.Girtablulu,"Girtablulu","Girtablulu","Girtablulu",4,!0,void 0,[6,7,8],275,0,!0),u(s.Zu,"Zu","Zu","Zu",4,!0,s.Pazuzu,[1,2,3,4,5,6,7,8],276,0,!0),u(s.Pazuzu,"Pazuzu","Pazuzu","Pazuzu",4,!0,void 0,[1,2,3,4,5,6,7,8],276,1,!0),u(s.Boota,"Boota","Boota","Boota",4,!0,void 0,[1,2,3,4,5],277,0,!0),u(s.ZeBoota,"Ze Boota","Ze Boota","Ze Boota",4,!0,void 0,[1,2,3,4,5],277,1,!0),u(s.BaBoota,"Ba Boota","Ba Boota","Ba Boota",4,!0,void 0,[1,2,3,4,5],277,2,!0),u(s.Dorphon,"Dorphon","Dorphon","Dorphon",4,!0,s.DorphonEclair,[1,2,3,4,5],278,0,!0),u(s.DorphonEclair,"Dorphon Eclair","Dorphon Eclair","Dorphon Eclair",4,!0,void 0,[1,2,3,4,5],278,1,!0),u(s.Goran,"Goran","Goran","Goran",4,!0,void 0,[6,7,8],279,0,!0),u(s.PyroGoran,"Pyro Goran","Pyro Goran","Pyro Goran",4,!0,void 0,[6,7,8],279,1,!0),u(s.GoranDetonator,"Goran Detonator","Goran Detonator","Goran Detonator",4,!0,void 0,[6,7,8],279,2,!0),u(s.SaintMilion,"Saint-Milion","Saint-Milion","Saint-Milion",4,!0,s.Kondrieu,[9],281,0,!0),u(s.Shambertin,"Shambertin","Shambertin","Shambertin",4,!0,s.Kondrieu,[9],281,1,!0),u(s.Kondrieu,"Kondrieu","Kondrieu","Kondrieu",4,!0,void 0,[9],281,0,!1),Object.freeze(n),Object.freeze(o),Object.freeze(l)},sv1z:function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var s=i("sDu+"),n=i("FXpb"),o=(i("6MRE"),i("jJhE")),r=i("KVVN"),a=i("4VsB"),l=i("LSoc"),u=i("ouMO");class d extends s.a{constructor(e){var t;super(e),this.element=Object(n.h)({className:"core_Select"}),this.button_mousedown=e=>{e.stopPropagation(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{switch(e.key){case"Enter":case" ":e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next();break;case"ArrowUp":{if(void 0===this._selected.val)break;const e=this.items.val.indexOf(this._selected.val)-1;if(e<0)break;this._selected.set_val(this.items.val[e],{silent:!1})}break;case"ArrowDown":{if(void 0===this._selected.val)break;const e=this.items.val.indexOf(this._selected.val)+1;if(e>=this.items.val.length)break;this._selected.set_val(this.items.val[e],{silent:!1})}}},this.preferred_label_position="left",this.items=Object(o.a)(e.items)?e.items:Object(u.e)(e.items),this.to_label=null!=(t=e.to_label)?t:String,this.button=this.disposable(new r.a({text:" ",icon_right:n.a.TriangleDown})),this.menu=this.disposable(new l.a({items:this.items,to_label:this.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._selected=new a.a(this,void 0,this.set_selected),this.selected=this._selected,this.just_opened=!1,this.disposables(Object(n.g)(this.button.element,"mousedown",this.button_mousedown),this.button.onmouseup.observe(this.button_mouseup),this.button.onkeydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{this._selected.set_val(e,{silent:!1})})),e&&(Object(o.a)(e.selected)?this.selected.bind_to(e.selected):e.selected&&(this.selected.val=e.selected)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}set_selected(e){this.button.text.val=void 0!==e?this.to_label(e):" ",this.menu.selected.val=e}}},uiJh:function(e,t,i){"use strict";function s(e){const t=Object.values(e),i=t.filter(e=>"number"==typeof e);return i.length?i:t}function n(e,t){if(""===t)return;const i=t.charCodeAt(0);return 48<=i&&i<=57?void 0:e[t]}i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return n}))},wtpc:function(e,t,i){"use strict";function s(e,t,i=((e,t)=>e===t)){const s=e.length;if(s!==t.length)return!1;for(let n=0;n1?e.slice(0,t):e}function l(e){const t=e.lastIndexOf(".");return t>1?e.slice(t+1):e}function u(e,t){if(!e){let e="Assertion Error";throw t&&(e+=": "+(t instanceof Function?t():t)),new Error(e)}}function d(e,t){u(null!=e,()=>`${t} should not be null or undefined (was ${e}).`)}function c(e,t){u(Number.isFinite(e),()=>`${t} should be a finite number (was ${e}).`)}function h(e,t){u(Number.isInteger(e),()=>`${t} should be an integer (was ${e}).`)}function p(e,t){u(Number.isInteger(e)&&e>=0,()=>`${t} should be a non-negative integer (was ${e}).`)}function v(e,t){u(Array.isArray(e),()=>`${t} should be an array (was ${e}).`)}function _(e,t=8){return e.toString(16).padStart(t,"0")}i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"h",(function(){return r})),i.d(t,"e",(function(){return a})),i.d(t,"g",(function(){return l})),i.d(t,"d",(function(){return u})),i.d(t,"f",(function(){return d})),i.d(t,"k",(function(){return c})),i.d(t,"l",(function(){return h})),i.d(t,"m",(function(){return p})),i.d(t,"j",(function(){return v})),i.d(t,"i",(function(){return _}))},xs7i:function(e,t,i){"use strict";var s;i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return n})),i.d(t,"c",(function(){return o})),function(e){e[e.I=1]="I",e[e.II=2]="II",e[e.IV=4]="IV"}(s||(s={}));const n=[s.I,s.II,s.IV];function o(e){if(null==s[e])throw new Error(`Invalid episode ${e}.`)}},zsIO:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var s=i("6Fug");class n extends s.a{constructor(){super(...arguments),this.width=0,this.height=0}resize(e,t){this.width=e,this.height=t,this.element.style.width=`${e}px`,this.element.style.height=`${t}px`}}}},[["/7QA",4,0,1]]]); \ No newline at end of file diff --git a/runtime.ac99347ea364f42024a3.js b/runtime.ac99347ea364f42024a3.js deleted file mode 100644 index 090f417a..00000000 --- a/runtime.ac99347ea364f42024a3.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function r(r){for(var n,c,f=r[0],u=r[1],i=r[2],d=0,p=[];d