The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'!
https://forums.lestoria.net
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
200 KiB
1 lines
200 KiB
var Module=typeof Module!="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){if(Module["ENVIRONMENT_IS_PTHREAD"]||Module["$ww"])return;var loadPackage=function(metadata){var PACKAGE_PATH="";if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof process==="undefined"&&typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var PACKAGE_NAME="pge.data";var REMOTE_PACKAGE_BASE="pge.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];function fetchRemotePackage(packageName,packageSize,callback,errback){if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){require("fs").readFile(packageName,function(err,contents){if(err){errback(err)}else{callback(contents.buffer)}});return}var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"](`Downloading data... (${loaded}/${total})`)}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","assets",true,true);Module["FS_createPath"]("/assets","Ability Icons",true,true);Module["FS_createPath"]("/assets","Campaigns",true,true);Module["FS_createPath"]("/assets","backgrounds",true,true);Module["FS_createPath"]("/assets","characters",true,true);Module["FS_createPath"]("/assets","config",true,true);Module["FS_createPath"]("/assets/config","classes",true,true);Module["FS_createPath"]("/assets/config","gfx",true,true);Module["FS_createPath"]("/assets/config","items",true,true);Module["FS_createPath"]("/assets/config","shops",true,true);Module["FS_createPath"]("/assets/config","story",true,true);Module["FS_createPath"]("/assets","items",true,true);Module["FS_createPath"]("/assets","maps",true,true);Module["FS_createPath"]("/assets/maps","commercial_assets",true,true);Module["FS_createPath"]("/assets","menus",true,true);Module["FS_createPath"]("/assets","monsters",true,true);Module["FS_createPath"]("/assets","saves",true,true);Module["FS_createPath"]("/assets","themes",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"](`fp ${this.name}`)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"](`fp ${that.name}`);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i<files.length;++i){new DataRequest(files[i]["start"],files[i]["end"],files[i]["audio"]||0).open("GET",files[i]["filename"])}function processPackageData(arrayBuffer){assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);DataRequest.prototype.byteArray=byteArray;var files=metadata["files"];for(var i=0;i<files.length;++i){DataRequest.prototype.requests[files[i].filename].onload()}Module["removeRunDependency"]("datafile_pge.data")}Module["addRunDependency"]("datafile_pge.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}};loadPackage({"files":[{"filename":"/assets/Ability Icons/backstep.png","start":0,"end":4493},{"filename":"/assets/Ability Icons/battlecry.png","start":4493,"end":9260},{"filename":"/assets/Ability Icons/block.png","start":9260,"end":14001},{"filename":"/assets/Ability Icons/chargedshot.png","start":14001,"end":18624},{"filename":"/assets/Ability Icons/firebolt.png","start":18624,"end":23216},{"filename":"/assets/Ability Icons/groundslam.png","start":23216,"end":27775},{"filename":"/assets/Ability Icons/lightningbolt.png","start":27775,"end":32311},{"filename":"/assets/Ability Icons/meteor.png","start":32311,"end":36914},{"filename":"/assets/Ability Icons/multishot.png","start":36914,"end":41393},{"filename":"/assets/Ability Icons/rapidfire.png","start":41393,"end":45805},{"filename":"/assets/Ability Icons/sonicslash.png","start":45805,"end":50365},{"filename":"/assets/Ability Icons/teleport.png","start":50365,"end":54894},{"filename":"/assets/Campaigns/1_1.tmx","start":54894,"end":519603},{"filename":"/assets/Campaigns/1_1_test.tmx","start":519603,"end":598779},{"filename":"/assets/Campaigns/1_1_test2.tmx","start":598779,"end":800373},{"filename":"/assets/Campaigns/1_1_v2.png","start":800373,"end":3236526},{"filename":"/assets/Campaigns/1_1_v2.tmx","start":3236526,"end":3824845},{"filename":"/assets/Campaigns/1_2.tmx","start":3824845,"end":4070366},{"filename":"/assets/Campaigns/1_3.tmx","start":4070366,"end":4341540},{"filename":"/assets/Campaigns/1_4.tmx","start":4341540,"end":4526176},{"filename":"/assets/Campaigns/1_5.tmx","start":4526176,"end":4985742},{"filename":"/assets/Campaigns/1_6.tmx","start":4985742,"end":5291686},{"filename":"/assets/Campaigns/1_7.tmx","start":5291686,"end":5599513},{"filename":"/assets/Campaigns/1_8.tmx","start":5599513,"end":5828857},{"filename":"/assets/Campaigns/Boss_1.tmx","start":5828857,"end":5865052},{"filename":"/assets/Campaigns/Boss_1_v2.tmx","start":5865052,"end":5913428},{"filename":"/assets/Campaigns/Hub.tmx","start":5913428,"end":6051826},{"filename":"/assets/Campaigns/World_Map.png","start":6051826,"end":6158947},{"filename":"/assets/Campaigns/World_Map.tmx","start":6158947,"end":6554319},{"filename":"/assets/Habbo.ttf","start":6554319,"end":6564627},{"filename":"/assets/RetroMenu.png","start":6564627,"end":6566773},{"filename":"/assets/Unknown.ttf","start":6566773,"end":6580409},{"filename":"/assets/arrow.png","start":6580409,"end":6581079},{"filename":"/assets/backgrounds/cave.png","start":6581079,"end":6593941},{"filename":"/assets/backgrounds/cave_dark.png","start":6593941,"end":6595796},{"filename":"/assets/backgrounds/rest.png","start":6595796,"end":6601298},{"filename":"/assets/backgrounds/sea.png","start":6601298,"end":6602838},{"filename":"/assets/battlecry_effect.png","start":6602838,"end":6605889},{"filename":"/assets/block.png","start":6605889,"end":6606557},{"filename":"/assets/c30010.png","start":6606557,"end":6713536},{"filename":"/assets/c64esque.ttf","start":6713536,"end":6748520},{"filename":"/assets/chain_lightning.png","start":6748520,"end":6749091},{"filename":"/assets/characters/Greg.png","start":6749091,"end":6753681},{"filename":"/assets/characters/Player_F.png","start":6753681,"end":6758275},{"filename":"/assets/characters/Player_M.png","start":6758275,"end":6762866},{"filename":"/assets/characters/Red Stone.png","start":6762866,"end":6763870},{"filename":"/assets/characters/Sherman.png","start":6763870,"end":6768458},{"filename":"/assets/charged_shot_arrow.png","start":6768458,"end":6776657},{"filename":"/assets/circle.png","start":6776657,"end":6777199},{"filename":"/assets/circle_outline.png","start":6777199,"end":6777736},{"filename":"/assets/config/MonsterStrategies.txt","start":6777736,"end":6781897},{"filename":"/assets/config/Monsters.txt","start":6781897,"end":6786318},{"filename":"/assets/config/Player.txt","start":6786318,"end":6789686},{"filename":"/assets/config/classes/Ranger.txt","start":6789686,"end":6794157},{"filename":"/assets/config/classes/Thief.txt","start":6794157,"end":6796546},{"filename":"/assets/config/classes/Trapper.txt","start":6796546,"end":6798939},{"filename":"/assets/config/classes/Warrior.txt","start":6798939,"end":6803686},{"filename":"/assets/config/classes/Witch.txt","start":6803686,"end":6806075},{"filename":"/assets/config/classes/Wizard.txt","start":6806075,"end":6815208},{"filename":"/assets/config/configuration.txt","start":6815208,"end":6818026},{"filename":"/assets/config/gfx/gfx.txt","start":6818026,"end":6820661},{"filename":"/assets/config/gfx/themes.txt","start":6820661,"end":6822626},{"filename":"/assets/config/items/Accessories.txt","start":6822626,"end":6823123},{"filename":"/assets/config/items/Equipment.txt","start":6823123,"end":6850523},{"filename":"/assets/config/items/ItemCategory.txt","start":6850523,"end":6851163},{"filename":"/assets/config/items/ItemDatabase.txt","start":6851163,"end":6854965},{"filename":"/assets/config/items/ItemScript.txt","start":6854965,"end":6856333},{"filename":"/assets/config/items/ItemSets.txt","start":6856333,"end":6858355},{"filename":"/assets/config/items/ItemStats.txt","start":6858355,"end":6859552},{"filename":"/assets/config/items/Weapons.txt","start":6859552,"end":6880950},{"filename":"/assets/config/items/items.txt","start":6880950,"end":6882113},{"filename":"/assets/config/levels.txt","start":6882113,"end":6882407},{"filename":"/assets/config/shops/Chapter 1 Merchants.txt","start":6882407,"end":6883494},{"filename":"/assets/config/shops/Chapter 2 Merchants.txt","start":6883494,"end":6883532},{"filename":"/assets/config/shops/Chapter 3 Merchants.txt","start":6883532,"end":6883570},{"filename":"/assets/config/shops/Chapter 4 Merchants.txt","start":6883570,"end":6883608},{"filename":"/assets/config/shops/Chapter 5 Merchants.txt","start":6883608,"end":6883646},{"filename":"/assets/config/shops/Chapter 6 Merchants.txt","start":6883646,"end":6883684},{"filename":"/assets/config/story/Chapter 1.txt","start":6883684,"end":6892679},{"filename":"/assets/config/story/Chapter 2.txt","start":6892679,"end":6892679},{"filename":"/assets/config/story/Chapter 3.txt","start":6892679,"end":6892679},{"filename":"/assets/config/story/Chapter 4.txt","start":6892679,"end":6892679},{"filename":"/assets/config/story/Chapter 5.txt","start":6892679,"end":6892679},{"filename":"/assets/config/story/Chapter 6.txt","start":6892679,"end":6892679},{"filename":"/assets/currency_coin.png","start":6892679,"end":6893448},{"filename":"/assets/discordAPI.txt","start":6893448,"end":6893533},{"filename":"/assets/energy_bolt.png","start":6893533,"end":6894269},{"filename":"/assets/energy_particle.png","start":6894269,"end":6894833},{"filename":"/assets/finishring.png","start":6894833,"end":6918078},{"filename":"/assets/finishring_green.png","start":6918078,"end":6941245},{"filename":"/assets/fire_ring0.png","start":6941245,"end":6941872},{"filename":"/assets/fire_ring1.png","start":6941872,"end":6942578},{"filename":"/assets/fire_ring2.png","start":6942578,"end":6943261},{"filename":"/assets/fire_ring3.png","start":6943261,"end":6943942},{"filename":"/assets/fire_ring4.png","start":6943942,"end":6944614},{"filename":"/assets/ground-slam-attack-back.png","start":6944614,"end":6955376},{"filename":"/assets/ground-slam-attack-front.png","start":6955376,"end":6965768},{"filename":"/assets/heart.ico","start":6965768,"end":6966150},{"filename":"/assets/heart.png","start":6966150,"end":6966839},{"filename":"/assets/heart_512.png","start":6966839,"end":6973166},{"filename":"/assets/items/Bandages.png","start":6973166,"end":6974108},{"filename":"/assets/items/Bear Blood.png","start":6974108,"end":6978639},{"filename":"/assets/items/Bear Claw.png","start":6978639,"end":6979282},{"filename":"/assets/items/Berries.png","start":6979282,"end":6980107},{"filename":"/assets/items/Blue Slime Remains.png","start":6980107,"end":6980789},{"filename":"/assets/items/Bone Armor.png","start":6980789,"end":6985509},{"filename":"/assets/items/Bone Bow.png","start":6985509,"end":6986328},{"filename":"/assets/items/Bone Gloves.png","start":6986328,"end":6995252},{"filename":"/assets/items/Bone Helmet.png","start":6995252,"end":7002746},{"filename":"/assets/items/Bone Pants.png","start":7002746,"end":7009897},{"filename":"/assets/items/Bone Shoes.png","start":7009897,"end":7019130},{"filename":"/assets/items/Bone Staff.png","start":7019130,"end":7028444},{"filename":"/assets/items/Bone Sword.png","start":7028444,"end":7029249},{"filename":"/assets/items/Copper Armor.png","start":7029249,"end":7034180},{"filename":"/assets/items/Copper Gloves.png","start":7034180,"end":7043e3},{"filename":"/assets/items/Copper Helmet.png","start":7043e3,"end":7050671},{"filename":"/assets/items/Copper Pants.png","start":7050671,"end":7058404},{"filename":"/assets/items/Copper Shoes.png","start":7058404,"end":7067168},{"filename":"/assets/items/Dummy Item 1.png","start":7067168,"end":7067789},{"filename":"/assets/items/Dummy Item 10.png","start":7067789,"end":7068458},{"filename":"/assets/items/Dummy Item 11.png","start":7068458,"end":7069084},{"filename":"/assets/items/Dummy Item 12.png","start":7069084,"end":7069767},{"filename":"/assets/items/Dummy Item 13.png","start":7069767,"end":7070448},{"filename":"/assets/items/Dummy Item 14.png","start":7070448,"end":7071114},{"filename":"/assets/items/Dummy Item 15.png","start":7071114,"end":7071785},{"filename":"/assets/items/Dummy Item 16.png","start":7071785,"end":7072476},{"filename":"/assets/items/Dummy Item 17.png","start":7072476,"end":7073133},{"filename":"/assets/items/Dummy Item 18.png","start":7073133,"end":7073828},{"filename":"/assets/items/Dummy Item 19.png","start":7073828,"end":7074512},{"filename":"/assets/items/Dummy Item 2.png","start":7074512,"end":7075169},{"filename":"/assets/items/Dummy Item 20.png","start":7075169,"end":7075868},{"filename":"/assets/items/Dummy Item 3.png","start":7075868,"end":7076519},{"filename":"/assets/items/Dummy Item 4.png","start":7076519,"end":7077161},{"filename":"/assets/items/Dummy Item 5.png","start":7077161,"end":7077810},{"filename":"/assets/items/Dummy Item 6.png","start":7077810,"end":7078483},{"filename":"/assets/items/Dummy Item 7.png","start":7078483,"end":7079120},{"filename":"/assets/items/Dummy Item 8.png","start":7079120,"end":7079788},{"filename":"/assets/items/Dummy Item 9.png","start":7079788,"end":7080459},{"filename":"/assets/items/Elixir of Bear Strength.png","start":7080459,"end":7089535},{"filename":"/assets/items/Flower Petals.png","start":7089535,"end":7090272},{"filename":"/assets/items/Frog Skin.png","start":7090272,"end":7091011},{"filename":"/assets/items/Green Gemstone.png","start":7091011,"end":7091889},{"filename":"/assets/items/Green Slime Remains.png","start":7091889,"end":7092566},{"filename":"/assets/items/High-Quality Logs.png","start":7092566,"end":7104043},{"filename":"/assets/items/Large Health Potion.png","start":7104043,"end":7112456},{"filename":"/assets/items/Large Mana Potion.png","start":7112456,"end":7120875},{"filename":"/assets/items/Laser Sword.png","start":7120875,"end":7121668},{"filename":"/assets/items/Leather Armor.png","start":7121668,"end":7126147},{"filename":"/assets/items/Leather Gloves.png","start":7126147,"end":7126893},{"filename":"/assets/items/Leather Helmet.png","start":7126893,"end":7127560},{"filename":"/assets/items/Leather Pants.png","start":7127560,"end":7128270},{"filename":"/assets/items/Leather Shoes.png","start":7128270,"end":7128984},{"filename":"/assets/items/Logs.png","start":7128984,"end":7129843},{"filename":"/assets/items/Medium Health Potion.png","start":7129843,"end":7130664},{"filename":"/assets/items/Medium Mana Potion.png","start":7130664,"end":7138974},{"filename":"/assets/items/Minor Health Potion.png","start":7138974,"end":7139763},{"filename":"/assets/items/Minor Mana Potion.png","start":7139763,"end":7140561},{"filename":"/assets/items/Minor Recovery Potion.png","start":7140561,"end":7148254},{"filename":"/assets/items/Pile of Coins.png","start":7148254,"end":7149099},{"filename":"/assets/items/Plasma Bow.png","start":7149099,"end":7149936},{"filename":"/assets/items/Red Slime Remains.png","start":7149936,"end":7150623},{"filename":"/assets/items/Ring of the Bear.png","start":7150623,"end":7151431},{"filename":"/assets/items/Ring of the Slime King.png","start":7151431,"end":7152262},{"filename":"/assets/items/Ring.png","start":7152262,"end":7152992},{"filename":"/assets/items/Shell Armor.png","start":7152992,"end":7157698},{"filename":"/assets/items/Shell Bow.png","start":7157698,"end":7158546},{"filename":"/assets/items/Shell Gloves.png","start":7158546,"end":7167001},{"filename":"/assets/items/Shell Helmet.png","start":7167001,"end":7174718},{"filename":"/assets/items/Shell Pants.png","start":7174718,"end":7182176},{"filename":"/assets/items/Shell Shoes.png","start":7182176,"end":7191672},{"filename":"/assets/items/Shell Staff.png","start":7191672,"end":7200483},{"filename":"/assets/items/Shell Sword.png","start":7200483,"end":7201287},{"filename":"/assets/items/Steel Bow.png","start":7201287,"end":7202085},{"filename":"/assets/items/Steel Staff.png","start":7202085,"end":7202861},{"filename":"/assets/items/Steel Sword.png","start":7202861,"end":7203659},{"filename":"/assets/items/Unknown Staff.png","start":7203659,"end":7213133},{"filename":"/assets/items/Wolf Skin.png","start":7213133,"end":7214002},{"filename":"/assets/items/Wooden Bow.png","start":7214002,"end":7214861},{"filename":"/assets/items/Wooden Staff.png","start":7214861,"end":7215739},{"filename":"/assets/items/Wooden Sword.png","start":7215739,"end":7216531},{"filename":"/assets/items/Yellow Slime Remains.png","start":7216531,"end":7217232},{"filename":"/assets/kiwami64-v1-1x.png","start":7217232,"end":7217587},{"filename":"/assets/knight_full.png","start":7217587,"end":7223862},{"filename":"/assets/knight_full2.png","start":7223862,"end":7230099},{"filename":"/assets/knight_full3.png","start":7230099,"end":7236550},{"filename":"/assets/knight_full_render1.png","start":7236550,"end":7243421},{"filename":"/assets/laser.png","start":7243421,"end":7244003},{"filename":"/assets/lightning_bolt.png","start":7244003,"end":7254116},{"filename":"/assets/lightning_bolt_part1.png","start":7254116,"end":7254663},{"filename":"/assets/lightning_bolt_part2.png","start":7254663,"end":7255205},{"filename":"/assets/lightning_bolt_part3.png","start":7255205,"end":7255742},{"filename":"/assets/lightning_bolt_part4.png","start":7255742,"end":7256281},{"filename":"/assets/lightning_splash_effect.png","start":7256281,"end":7266806},{"filename":"/assets/mana.png","start":7266806,"end":7267503},{"filename":"/assets/maps/24x24_Waterfall.tsx","start":7267503,"end":7271535},{"filename":"/assets/maps/Decorations_c1_No_Shadow24x24.tsx","start":7271535,"end":7326441},{"filename":"/assets/maps/Forge_No_Shadow_24x24.tsx","start":7326441,"end":7328275},{"filename":"/assets/maps/Minifantasy_TinyOverworldAllProps.tsx","start":7328275,"end":7328575},{"filename":"/assets/maps/Minifantasy_TinyOverworldAllTiles.tsx","start":7328575,"end":7328876},{"filename":"/assets/maps/Minifantasy_TinyOverworldConstructions.tsx","start":7328876,"end":7329187},{"filename":"/assets/maps/No_Shadow_Campfire_24x24.tsx","start":7329187,"end":7332509},{"filename":"/assets/maps/Stage_Plate.png","start":7332509,"end":7333619},{"filename":"/assets/maps/Stage_Plate.tsx","start":7333619,"end":7333855},{"filename":"/assets/maps/Tile_Presets.tmx","start":7333855,"end":7576897},{"filename":"/assets/maps/Tilesheet_No_Shadow24x24.tsx","start":7576897,"end":7712595},{"filename":"/assets/maps/commercial_assets/112x96_Forge_No_Shadow_24x24.png","start":7712595,"end":7726741},{"filename":"/assets/maps/commercial_assets/16x16px_grid_Props_No_Shadow_24x24.png","start":7726741,"end":7935689},{"filename":"/assets/maps/commercial_assets/24x24_Waterfall.png","start":7935689,"end":7952683},{"filename":"/assets/maps/commercial_assets/64x64px_No_Shadow_Campfire_24x24.png","start":7952683,"end":7962306},{"filename":"/assets/maps/commercial_assets/Decorations_c1_No_Shadow24x24.png","start":7962306,"end":8106841},{"filename":"/assets/maps/commercial_assets/Minifantasy_TinyOverworldAllProps.png","start":8106841,"end":8112859},{"filename":"/assets/maps/commercial_assets/Minifantasy_TinyOverworldAllTiles.png","start":8112859,"end":8167843},{"filename":"/assets/maps/commercial_assets/Minifantasy_TinyOverworldConstructions.png","start":8167843,"end":8174267},{"filename":"/assets/maps/commercial_assets/README.txt","start":8174267,"end":8174408},{"filename":"/assets/maps/commercial_assets/Tilesheet_No_Shadow24x24.png","start":8174408,"end":8358265},{"filename":"/assets/maps/grid_Props_No_Shadow_24x24.tsx","start":8358265,"end":8358564},{"filename":"/assets/memoryleak.txt","start":8358564,"end":15731615},{"filename":"/assets/menus/Character_Info.png","start":15731615,"end":15757506},{"filename":"/assets/meteor.png","start":15757506,"end":15771534},{"filename":"/assets/meteor.xcf","start":15771534,"end":15812592},{"filename":"/assets/money.png","start":15812592,"end":15813402},{"filename":"/assets/monsters/Blue Slime.png","start":15813402,"end":15819536},{"filename":"/assets/monsters/Flower Turret.png","start":15819536,"end":15830389},{"filename":"/assets/monsters/Flower Turret.xcf","start":15830389,"end":15848470},{"filename":"/assets/monsters/Green Slime.png","start":15848470,"end":15854733},{"filename":"/assets/monsters/Red Slime.png","start":15854733,"end":15861150},{"filename":"/assets/monsters/Slime King - Cast.png","start":15861150,"end":15862905},{"filename":"/assets/monsters/Slime King.png","start":15862905,"end":15870154},{"filename":"/assets/monsters/Slime King.xcf","start":15870154,"end":15889903},{"filename":"/assets/monsters/Yellow Slime.png","start":15889903,"end":15896315},{"filename":"/assets/nico-Ranger_512.png","start":15896315,"end":15899703},{"filename":"/assets/nico-Thief_512.png","start":15899703,"end":15902702},{"filename":"/assets/nico-Trapper_512.png","start":15902702,"end":15905701},{"filename":"/assets/nico-Warrior_512.png","start":15905701,"end":15908700},{"filename":"/assets/nico-Witch_512.png","start":15908700,"end":15911699},{"filename":"/assets/nico-Wizard_512.png","start":15911699,"end":15918568},{"filename":"/assets/nico-ranger.png","start":15918568,"end":15937847},{"filename":"/assets/nico-ranger.xcf","start":15937847,"end":15953128},{"filename":"/assets/nico-ranger2.xcf","start":15953128,"end":15977425},{"filename":"/assets/nico-warrior.png","start":15977425,"end":15998911},{"filename":"/assets/nico-warrior.xcf","start":15998911,"end":16031648},{"filename":"/assets/nico-wizard.png","start":16031648,"end":16049906},{"filename":"/assets/nico-wizard.xcf","start":16049906,"end":16079315},{"filename":"/assets/palette.css","start":16079315,"end":16081863},{"filename":"/assets/palette.txt","start":16081863,"end":16082374},{"filename":"/assets/propertytypes.xml","start":16082374,"end":16083648},{"filename":"/assets/range_indicator.png","start":16083648,"end":16092683},{"filename":"/assets/saves/metadata.dat","start":16092683,"end":16092876},{"filename":"/assets/saves/save.0001","start":16092876,"end":16097053},{"filename":"/assets/saves/save.0002","start":16097053,"end":16101231},{"filename":"/assets/saves/save.0003","start":16101231,"end":16105412},{"filename":"/assets/saves/save.0004","start":16105412,"end":16108887},{"filename":"/assets/saves/save.0005","start":16108887,"end":16112829},{"filename":"/assets/skill_overlay_icon.png","start":16112829,"end":16113656},{"filename":"/assets/skill_overlay_icon_overlay.png","start":16113656,"end":16121442},{"filename":"/assets/slime.png","start":16121442,"end":16134863},{"filename":"/assets/sonicslash.png","start":16134863,"end":16136185},{"filename":"/assets/splash_effect.png","start":16136185,"end":16137260},{"filename":"/assets/square_skill_overlay_icon.png","start":16137260,"end":16141762},{"filename":"/assets/square_skill_overlay_icon_empty.png","start":16141762,"end":16146408},{"filename":"/assets/themes/9patch.png","start":16146408,"end":16147026},{"filename":"/assets/themes/9patch_2.png","start":16147026,"end":16151458},{"filename":"/assets/themes/9patch_3.png","start":16151458,"end":16156395},{"filename":"/assets/themes/9patch_4.png","start":16156395,"end":16161332},{"filename":"/assets/themes/testback.png","start":16161332,"end":16402968},{"filename":"/assets/themes/testtiledback.png","start":16402968,"end":16403588},{"filename":"/assets/unknown_full_render.png","start":16403588,"end":16404762},{"filename":"/assets/wizard_full.png","start":16404762,"end":16409470},{"filename":"/assets/wizard_full_render.png","start":16409470,"end":16414166},{"filename":"/assets/wizard_full_render.xcf","start":16414166,"end":16433715}],"remote_package_size":16433715})})();var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);if(typeof module!="undefined"){module["exports"]=Module}process.on("uncaughtException",ex=>{if(ex!=="unwind"&&!(ex instanceof ExitStatus)&&!(ex.context instanceof ExitStatus)){throw ex}});var nodeMajor=process.versions.node.split(".")[0];if(nodeMajor<15){process.on("unhandledRejection",reason=>{throw reason})}quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=()=>"[Emscripten Module object]"}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="pge.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(()=>getBinary(binaryFile))}else{if(readAsync){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}}}return Promise.resolve().then(()=>getBinary(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>{return WebAssembly.instantiate(binary,imports)}).then(instance=>{return instance}).then(receiver,reason=>{err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}else{return instantiateArrayBuffer(binaryFile,imports,callback)}}function createWasm(){var info={"env":wasmImports,"wasi_snapshot_preview1":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["memory"];updateMemoryViews();wasmTable=Module["asm"]["__indirect_function_table"];addOnInit(Module["asm"]["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return exports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult);return{}}var tempDouble;var tempI64;var ASM_CONSTS={350664:()=>{window.onunload=Module._olc_OnPageUnload},350708:($0,$1)=>{Module.olc_AspectRatio=$0/$1;Module.olc_AssumeDefaultShells=document.querySelectorAll(".emscripten").length>=3?true:false;oncontextmenu=function(e){return false};var olc_ResizeHandler=function(){let isFullscreen=document.fullscreenElement!=null;let width=isFullscreen?window.innerWidth:Module.canvas.parentNode.clientWidth;let height=isFullscreen?window.innerHeight:Module.canvas.parentNode.clientHeight;let viewWidth=width;let viewHeight=width/Module.olc_AspectRatio;if(viewHeight>height){viewWidth=height*Module.olc_AspectRatio;viewHeight=height}viewWidth=parseInt(viewWidth);viewHeight=parseInt(viewHeight);setTimeout(function(){if(Module.olc_AssumeDefaultShells)Module.canvas.parentNode.setAttribute("style","width: 100%; height: 70vh; margin-left: auto; margin-right: auto;");Module.canvas.setAttribute("width",viewWidth);Module.canvas.setAttribute("height",viewHeight);Module.canvas.setAttribute("style",`width: ${viewWidth}px; height: ${viewHeight}px;`);Module._olc_PGE_UpdateWindowSize(viewWidth,viewHeight);Module.canvas.focus()},200)};var olc_Init=function(){if(Module.olc_AspectRatio===undefined){setTimeout(function(){Module.olc_Init()},50);return}let resizeObserver=new ResizeObserver(function(entries){Module.olc_ResizeHandler()}).observe(Module.canvas.parentNode);let mutationObserver=new MutationObserver(function(mutationsList,observer){setTimeout(function(){Module.olc_ResizeHandler()},200)}).observe(Module.canvas.parentNode,{attributes:false,childList:true,subtree:false});window.addEventListener("fullscreenchange",function(e){setTimeout(function(){Module.olc_ResizeHandler()},200)})};Module.olc_ResizeHandler=Module.olc_ResizeHandler!=undefined?Module.olc_ResizeHandler:olc_ResizeHandler;Module.olc_Init=Module.olc_Init!=undefined?Module.olc_Init:olc_Init;Module.olc_Init()},352681:()=>{return window.scrollX},352705:()=>{return window.scrollY},352729:()=>{return window.scrollX},352753:()=>{return window.scrollY},352777:()=>{return window.scrollX},352801:()=>{return window.scrollY},352825:()=>{return Module.canvas.getBoundingClientRect().left},352877:()=>{return Module.canvas.getBoundingClientRect().top},352928:()=>{return Module.canvas.getBoundingClientRect().left},352980:()=>{return Module.canvas.getBoundingClientRect().top}};function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(!Browser.mainLoop.running){Browser.mainLoop.running=true}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof setImmediate=="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";var Browser_setImmediate_messageHandler=event=>{if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}};addEventListener("message",Browser_setImmediate_messageHandler,true);setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){global.performance=require("perf_hooks").performance}_emscripten_get_now=()=>performance.now();function setMainLoop(browserIterationFunc,fps,simulateInfiniteLoop,arg,noSetTiming){assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=browserIterationFunc;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;function checkIsRunning(){if(thisMainLoopId<Browser.mainLoop.currentlyRunningMainloop){return false}return true}Browser.mainLoop.running=false;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}out('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();if(!checkIsRunning())return;setTimeout(Browser.mainLoop.runner,0);return}if(!checkIsRunning())return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}Browser.mainLoop.runIter(browserIterationFunc);if(!checkIsRunning())return;if(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData)SDL.audio.queueNewAudioData();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0){_emscripten_set_main_loop_timing(0,1e3/fps)}else{_emscripten_set_main_loop_timing(1,1)}Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"unwind"}}function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)}function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>{return PATH.normalize(l+"/"+r)}};function initRandomFill(){if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")}function randomFill(view){return(randomFill=initRandomFill())(view)}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}};function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open:function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close:function(stream){stream.tty.ops.fsync(stream.tty)},fsync:function(stream){stream.tty.ops.fsync(stream.tty)},read:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60)}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i])}}catch(e){throw new FS.ErrnoError(29)}if(length){stream.node.timestamp=Date.now()}return i}},default_tty_ops:{get_char:function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;try{bytesRead=fs.readSync(process.stdin.fd,buf,0,BUFSIZE,-1)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){abort()}var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray:function(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage:function(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size},write:function(stream,buffer,offset,length,position,canOwn){if(buffer.buffer===HEAP8.buffer){canOwn=false}if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position)}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(28)}return position},allocate:function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)},mmap:function(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}HEAP8.set(contents,ptr)}return{ptr:ptr,allocated:allocated}},msync:function(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0}}};function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,`Loading data file "${url}" failed (no arrayBuffer).`);onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)}var preloadPlugins=Module["preloadPlugins"]||[];function FS_handledByPreloadPlugin(byteArray,fullname,finish,onerror){if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled}function FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}}function FS_modeStringToFlags(str){var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags}function FS_getMode(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(path,opts={})=>{path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:node=>{var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName:(parentid,name)=>{var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length},hashAddNode:node=>{var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:node=>{var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:(parent,name)=>{var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:(parent,name,mode,rdev)=>{var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:node=>{FS.hashRemoveNode(node)},isRoot:node=>{return node===node.parent},isMountpoint:node=>{return!!node.mounted},isFile:mode=>{return(mode&61440)===32768},isDir:mode=>{return(mode&61440)===16384},isLink:mode=>{return(mode&61440)===40960},isChrdev:mode=>{return(mode&61440)===8192},isBlkdev:mode=>{return(mode&61440)===24576},isFIFO:mode=>{return(mode&61440)===4096},isSocket:mode=>{return(mode&49152)===49152},flagsToPermissionString:flag=>{var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:(node,perms)=>{if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:dir=>{var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:(dir,name)=>{try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:(dir,name,isdir)=>{var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:(node,flags)=>{if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:()=>{for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:fd=>FS.streams[fd],createStream:(stream,fd=-1)=>{if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(val){this.shared.flags=val}},position:{get:function(){return this.shared.position},set:function(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:fd=>{FS.streams[fd]=null},chrdev_stream_ops:{open:stream=>{var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:()=>{throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice:(dev,ops)=>{FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts:mount=>{var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:(populate,callback)=>{if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:(type,opts,mountpoint)=>{var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:mountpoint=>{var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:(parent,name)=>{return parent.node_ops.lookup(parent,name)},mknod:(path,mode,dev)=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:(path,mode)=>{mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:(path,mode)=>{mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:(path,mode)=>{var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}},mkdev:(path,mode,dev)=>{if(typeof dev=="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)},symlink:(oldpath,newpath)=>{if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63)}return parent.node_ops.symlink(parent,newname,oldpath)},rename:(old_path,new_path)=>{var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28)}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode)}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10)}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode)}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}},rmdir:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node)},readdir:path=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54)}return node.node_ops.readdir(node)},unlink:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.unlink(parent,name);FS.destroyNode(node)},readlink:path=>{var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44)}if(!link.node_ops.readlink){throw new FS.ErrnoError(28)}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))},stat:(path,dontFollow)=>{var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44)}if(!node.node_ops.getattr){throw new FS.ErrnoError(63)}return node.node_ops.getattr(node)},lstat:path=>{return FS.stat(path,true)},chmod:(path,mode,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})},lchmod:(path,mode)=>{FS.chmod(path,mode,true)},fchmod:(fd,mode)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chmod(stream.node,mode)},chown:(path,uid,gid,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{timestamp:Date.now()})},lchown:(path,uid,gid)=>{FS.chown(path,uid,gid,true)},fchown:(fd,uid,gid)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chown(stream.node,uid,gid)},truncate:(path,len)=>{if(len<0){throw new FS.ErrnoError(28)}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28)}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})},ftruncate:(fd,len)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(28)}FS.truncate(stream.node,len)},utime:(path,atime,mtime)=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})},open:(path,flags,mode)=>{if(path===""){throw new FS.ErrnoError(44)}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path=="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(44)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode)}}if(flags&512&&!created){FS.truncate(node,0)}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1}}return stream},close:stream=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed:stream=>{return stream.fd===null},llseek:(stream,offset,whence)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70)}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position},read:(stream,buffer,offset,length,position)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.read){throw new FS.ErrnoError(28)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead},write:(stream,buffer,offset,length,position,canOwn)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.write){throw new FS.ErrnoError(28)}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten},allocate:(stream,offset,length)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(offset<0||length<=0){throw new FS.ErrnoError(28)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138)}stream.stream_ops.allocate(stream,offset,length)},mmap:(stream,length,position,prot,flags)=>{if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43)}return stream.stream_ops.mmap(stream,length,position,prot,flags)},msync:(stream,buffer,offset,length,mmapFlags)=>{if(!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)},munmap:stream=>0,ioctl:(stream,cmd,arg)=>{if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile:(path,opts={})=>{opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile:(path,data,opts={})=>{opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir:path=>{var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories:()=>{FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices:()=>{FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:()=>{var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup:(parent,name)=>{var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams:()=>{if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError:()=>{if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.name="ErrnoError";this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"})},staticInit:()=>{FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS}},init:(input,output,error)=>{FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit:()=>{FS.init.initialized=false;for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}},findObject:(path,dontResolveLastLink)=>{var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null}return ret.object},analyzePath:(path,dontResolveLastLink)=>{try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret},createPath:(parent,path,canRead,canWrite)=>{parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current},createFile:(parent,name,properties,canRead,canWrite)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode)},createDataFile:(parent,name,data,canRead,canWrite,canOwn)=>{var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node},createDevice:(parent,name,input,output)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:stream=>{stream.seekable=false},close:stream=>{if(output&&output.buffer&&output.buffer.length){output(10)}},read:(stream,buffer,offset,length,pos)=>{var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:(stream,buffer,offset,length,pos)=>{for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(29)}}if(length){stream.node.timestamp=Date.now()}return i}});return FS.mkdev(path,mode,dev)},forceLoadFile:obj=>{if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length}catch(e){throw new FS.ErrnoError(29)}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}},createLazyFile:(parent,name,url,canRead,canWrite)=>{function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size}stream_ops.read=(stream,buffer,offset,length,position)=>{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat:function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAPU32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];HEAPU32[buf+96>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+104>>2]=tempI64[0],HEAP32[buf+108>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream}};function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))}function exitJS(status,implicit){EXITSTATUS=status;_proc_exit(status)}var _exit=exitJS;function maybeExit(){if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}}function callUserCallback(func){if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}}function safeSetTimeout(func,timeout){return setTimeout(()=>{callUserCallback(func)},timeout)}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}}var Browser={mainLoop:{running:false,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;setMainLoop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus:function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining<expected){Module["setStatus"](message+" ("+(expected-remaining)+"/"+expected+")")}else{Module["setStatus"](message)}}else{Module["setStatus"]("")}}},runIter:function(func){if(ABORT)return;if(Module["preMainLoop"]){var preRet=Module["preMainLoop"]();if(preRet===false){return}}callUserCallback(func);if(Module["postMainLoop"])Module["postMainLoop"]()}},isFullscreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Browser.initted)return;Browser.initted=true;var imagePlugin={};imagePlugin["canHandle"]=function imagePlugin_canHandle(name){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(name)};imagePlugin["handle"]=function imagePlugin_handle(byteArray,name,onload,onerror){var b=new Blob([byteArray],{type:Browser.getMimetype(name)});if(b.size!==byteArray.length){b=new Blob([new Uint8Array(byteArray).buffer],{type:Browser.getMimetype(name)})}var url=URL.createObjectURL(b);var img=new Image;img.onload=()=>{assert(img.complete,"Image "+name+" could not be decoded");var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);preloadedImages[name]=canvas;URL.revokeObjectURL(url);if(onload)onload(byteArray)};img.onerror=event=>{out("Image "+url+" could not be decoded");if(onerror)onerror()};img.src=url};preloadPlugins.push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;preloadedAudios[name]=audio;if(onload)onload(byteArray)}var b=new Blob([byteArray],{type:Browser.getMimetype(name)});var url=URL.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",()=>finish(audio),false);audio.onerror=function audio_onerror(event){if(done)return;err("warning: browser could not fully decode audio "+name+", trying slower base64 approach");function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i<data.length;i++){leftchar=leftchar<<8|data[i];leftbits+=8;while(leftbits>=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;safeSetTimeout(()=>{finish(audio)},1e4)};preloadPlugins.push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(()=>{});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(()=>{});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",ev=>{if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}},false)}}},createContext:function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:2};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!="undefined"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(callback=>callback());Browser.init()}return ctx},destroyContext:function(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:function(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer=="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas=="undefined")Browser.resizeCanvas=false;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?()=>canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"]):null)||(canvasContainer["webkitRequestFullScreen"]?()=>canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]):null);canvasContainer.requestFullscreen()},exitFullscreen:function(){if(!Browser.isFullscreen){return false}var CFS=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(()=>{});CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame:function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame:function(func){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(func);return}var RAF=Browser.fakeRequestAnimationFrame;RAF(func)},safeSetTimeout:function(func,timeout){return safeSetTimeout(func,timeout)},safeRequestAnimationFrame:function(func){return Browser.requestAnimationFrame(()=>{callUserCallback(func)})},getMimetype:function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]},getUserMedia:function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)},getMovementX:function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0},getMovementY:function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0},getMouseWheelDelta:function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail/3;break;case"mousewheel":delta=event.wheelDelta/120;break;case"wheel":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw"unrecognized mouse wheel delta mode: "+event.deltaMode}break;default:throw"unrecognized mouse wheel event: "+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}},resizeListeners:[],updateResizeListeners:function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach(listener=>listener(canvas.width,canvas.height))},setCanvasSize:function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},updateCanvasDimensions:function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h<Module["forcedAspectRatio"]){w=Math.round(h*Module["forcedAspectRatio"])}else{h=Math.round(w/Module["forcedAspectRatio"])}}if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvas.parentNode&&typeof screen!="undefined"){var factor=Math.min(screen.width/w,screen.height/h);w=Math.round(w*factor);h=Math.round(h*factor)}if(Browser.resizeCanvas){if(canvas.width!=w)canvas.width=w;if(canvas.height!=h)canvas.height=h;if(typeof canvas.style!="undefined"){canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}else{if(canvas.width!=wNative)canvas.width=wNative;if(canvas.height!=hNative)canvas.height=hNative;if(typeof canvas.style!="undefined"){if(w!=wNative||h!=hNative){canvas.style.setProperty("width",w+"px","important");canvas.style.setProperty("height",h+"px","important")}else{canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function ___assert_fail(condition,filename,line,func){abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var exceptionCaught=[];var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_rethrow(){var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw exceptionLast}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.createStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 5:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_fstat64(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function ___syscall_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx<stream.getdents.length&&pos+struct_size<=count){var id;var type;var name=stream.getdents[idx];if(name==="."){id=stream.node.id;type=4}else if(name===".."){var lookup=FS.lookupPath(stream.path,{parent:true});id=lookup.node.id;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}tempI64=[id>>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function __emscripten_fetch_free(id){if(Fetch.xhrs.has(id)){var xhr=Fetch.xhrs.get(id);Fetch.xhrs.free(id);if(xhr.readyState>0&&xhr.readyState<4){xhr.abort()}}}var nowIsMonotonic=true;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function __emscripten_throw_longjmp(){throw Infinity}function _abort(){abort("")}var EGL={errorCode:12288,defaultDisplayInitialized:false,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:false,depth:false,stencil:false,antialias:false},stringCache:{},setErrorCode:function(code){EGL.errorCode=code},chooseConfig:function(display,attribList,config,config_size,numConfigs){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(attribList){for(;;){var param=HEAP32[attribList>>2];if(param==12321){var alphaSize=HEAP32[attribList+4>>2];EGL.contextAttributes.alpha=alphaSize>0}else if(param==12325){var depthSize=HEAP32[attribList+4>>2];EGL.contextAttributes.depth=depthSize>0}else if(param==12326){var stencilSize=HEAP32[attribList+4>>2];EGL.contextAttributes.stencil=stencilSize>0}else if(param==12337){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples>0}else if(param==12338){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples==1}else if(param==12544){var requestedPriority=HEAP32[attribList+4>>2];EGL.contextAttributes.lowLatency=requestedPriority!=12547}else if(param==12344){break}attribList+=8}}if((!config||!config_size)&&!numConfigs){EGL.setErrorCode(12300);return 0}if(numConfigs){HEAP32[numConfigs>>2]=1}if(config&&config_size>0){HEAP32[config>>2]=62002}EGL.setErrorCode(12288);return 1}};function _eglChooseConfig(display,attrib_list,configs,config_size,numConfigs){return EGL.chooseConfig(display,attrib_list,configs,config_size,numConfigs)}function webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance(ctx){return!!(ctx.dibvbi=ctx.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance(ctx){return!!(ctx.mdibvbi=ctx.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i<ret;i++){table[i]=null}return ret},getSource:function(shader,count,string,length){var source="";for(var i=0;i<count;++i){var len=length?HEAP32[length+i*4>>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;function fixedGetContext(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}canvas.getContext=fixedGetContext}var ctx=canvas.getContext("webgl2",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=GL.getNewId(GL.contexts);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault=="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents=="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance(GLctx);webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance(GLctx);if(context.version>=2){GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query_webgl2")}if(context.version<2||!GLctx.disjointTimerQueryExt){GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};function _eglCreateContext(display,config,hmm,contextAttribs){if(display!=62e3){EGL.setErrorCode(12296);return 0}var glesContextVersion=1;for(;;){var param=HEAP32[contextAttribs>>2];if(param==12440){glesContextVersion=HEAP32[contextAttribs+4>>2]}else if(param==12344){break}else{EGL.setErrorCode(12292);return 0}contextAttribs+=8}if(glesContextVersion<2||glesContextVersion>3){EGL.setErrorCode(12293);return 0}EGL.contextAttributes.majorVersion=glesContextVersion-1;EGL.contextAttributes.minorVersion=0;EGL.context=GL.createContext(Module["canvas"],EGL.contextAttributes);if(EGL.context!=0){EGL.setErrorCode(12288);GL.makeContextCurrent(EGL.context);Module.useWebGL=true;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback()});GL.makeContextCurrent(null);return 62004}else{EGL.setErrorCode(12297);return 0}}function _eglCreateWindowSurface(display,config,win,attrib_list){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(config!=62002){EGL.setErrorCode(12293);return 0}EGL.setErrorCode(12288);return 62006}function _eglDestroyContext(display,context){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=62004){EGL.setErrorCode(12294);return 0}GL.deleteContext(EGL.context);EGL.setErrorCode(12288);if(EGL.currentContext==context){EGL.currentContext=0}return 1}function _eglDestroySurface(display,surface){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(surface!=62006){EGL.setErrorCode(12301);return 1}if(EGL.currentReadSurface==surface){EGL.currentReadSurface=0}if(EGL.currentDrawSurface==surface){EGL.currentDrawSurface=0}EGL.setErrorCode(12288);return 1}function _eglGetDisplay(nativeDisplayType){EGL.setErrorCode(12288);return 62e3}function _eglInitialize(display,majorVersion,minorVersion){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(majorVersion){HEAP32[majorVersion>>2]=1}if(minorVersion){HEAP32[minorVersion>>2]=4}EGL.defaultDisplayInitialized=true;EGL.setErrorCode(12288);return 1}function _eglMakeCurrent(display,draw,read,context){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=0&&context!=62004){EGL.setErrorCode(12294);return 0}if(read!=0&&read!=62006||draw!=0&&draw!=62006){EGL.setErrorCode(12301);return 0}GL.makeContextCurrent(context?EGL.context:null);EGL.currentContext=context;EGL.currentDrawSurface=draw;EGL.currentReadSurface=read;EGL.setErrorCode(12288);return 1}function _eglSwapBuffers(dpy,surface){if(Browser.doSwapBuffers)Browser.doSwapBuffers();if(!EGL.defaultDisplayInitialized){EGL.setErrorCode(12289)}else if(!Module.ctx){EGL.setErrorCode(12290)}else if(Module.ctx.isContextLost()){EGL.setErrorCode(12302)}else{EGL.setErrorCode(12288);return 1}return 0}function _eglSwapInterval(display,interval){if(display!=62e3){EGL.setErrorCode(12296);return 0}if(interval==0)_emscripten_set_main_loop_timing(0,0);else _emscripten_set_main_loop_timing(1,interval);EGL.setErrorCode(12288);return 1}function _eglTerminate(display){if(display!=62e3){EGL.setErrorCode(12296);return 0}EGL.currentContext=0;EGL.currentReadSurface=0;EGL.currentDrawSurface=0;EGL.defaultDisplayInitialized=false;EGL.setErrorCode(12288);return 1}var readEmAsmArgsArray=[];function readEmAsmArgs(sigPtr,buf){readEmAsmArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){buf+=ch!=105&buf;readEmAsmArgsArray.push(ch==105?HEAP32[buf]:HEAPF64[buf++>>1]);++buf}return readEmAsmArgsArray}function runEmAsmFunction(code,sigPtr,argbuf){var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_asm_const_int(code,sigPtr,argbuf){return runEmAsmFunction(code,sigPtr,argbuf)}function _emscripten_cancel_main_loop(){Browser.mainLoop.pause();Browser.mainLoop.func=null}function _emscripten_date_now(){return Date.now()}function _emscripten_is_main_browser_thread(){return!ENVIRONMENT_IS_WORKER}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){var b=wasmMemory.buffer;try{wasmMemory.grow(size-b.byteLength+65535>>>16);updateMemoryViews();return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence<y.precedence})},removeDeferredCalls:function(targetFunction){for(var i=0;i<JSEvents.deferredCalls.length;++i){if(JSEvents.deferredCalls[i].targetFunction==targetFunction){JSEvents.deferredCalls.splice(i,1);--i}}},canPerformEventHandlerRequests:function(){return JSEvents.inEventHandler&&JSEvents.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!JSEvents.canPerformEventHandlerRequests()){return}for(var i=0;i<JSEvents.deferredCalls.length;++i){var call=JSEvents.deferredCalls[i];JSEvents.deferredCalls.splice(i,1);--i;call.targetFunction.apply(null,call.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(target,eventTypeString){for(var i=0;i<JSEvents.eventHandlers.length;++i){if(JSEvents.eventHandlers[i].target==target&&(!eventTypeString||eventTypeString==JSEvents.eventHandlers[i].eventTypeString)){JSEvents._removeHandler(i--)}}},_removeHandler:function(i){var h=JSEvents.eventHandlers[i];h.target.removeEventListener(h.eventTypeString,h.eventListenerFunc,h.useCapture);JSEvents.eventHandlers.splice(i,1)},registerOrRemoveHandler:function(eventHandler){if(!eventHandler.target){return-4}var jsEventHandler=function jsEventHandler(event){++JSEvents.inEventHandler;JSEvents.currentEventHandler=eventHandler;JSEvents.runDeferredCalls();eventHandler.handlerFunc(event);JSEvents.runDeferredCalls();--JSEvents.inEventHandler};if(eventHandler.callbackfunc){eventHandler.eventListenerFunc=jsEventHandler;eventHandler.target.addEventListener(eventHandler.eventTypeString,jsEventHandler,eventHandler.useCapture);JSEvents.eventHandlers.push(eventHandler);JSEvents.registerRemoveEventListeners()}else{for(var i=0;i<JSEvents.eventHandlers.length;++i){if(JSEvents.eventHandlers[i].target==eventHandler.target&&JSEvents.eventHandlers[i].eventTypeString==eventHandler.eventTypeString){JSEvents._removeHandler(i--)}}}return 0},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!="undefined"?document.querySelector(target):undefined);return domElement}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function registerFocusEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.focusEvent)JSEvents.focusEvent=_malloc(256);var focusEventHandlerFunc=function(e=event){var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";var focusEvent=JSEvents.focusEvent;stringToUTF8(nodeName,focusEvent+0,128);stringToUTF8(id,focusEvent+128,128);if(getWasmTableEntry(callbackfunc)(eventTypeId,focusEvent,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:focusEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_blur_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerFocusEventCallback(target,userData,useCapture,callbackfunc,12,"blur",targetThread)}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;canvas.width=width;canvas.height=height;return 0}function _emscripten_set_focus_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerFocusEventCallback(target,userData,useCapture,callbackfunc,13,"focus",targetThread)}function registerKeyEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(176);var keyEventHandlerFunc=function(e){var keyEventData=JSEvents.keyEvent;HEAPF64[keyEventData>>3]=e.timeStamp;var idx=keyEventData>>2;HEAP32[idx+2]=e.location;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;HEAP32[idx+7]=e.repeat;HEAP32[idx+8]=e.charCode;HEAP32[idx+9]=e.keyCode;HEAP32[idx+10]=e.which;stringToUTF8(e.key||"",keyEventData+44,32);stringToUTF8(e.code||"",keyEventData+76,32);stringToUTF8(e.char||"",keyEventData+108,32);stringToUTF8(e.locale||"",keyEventData+140,32);if(getWasmTableEntry(callbackfunc)(eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_keydown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread)}function _emscripten_set_keyup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread)}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop){var browserIterationFunc=getWasmTableEntry(func);setMainLoop(browserIterationFunc,fps,simulateInfiniteLoop)}function getBoundingClientRect(e){return specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{"left":0,"top":0}}function fillMouseEventData(eventStruct,e,target){HEAPF64[eventStruct>>3]=e.timeStamp;var idx=eventStruct>>2;HEAP32[idx+2]=e.screenX;HEAP32[idx+3]=e.screenY;HEAP32[idx+4]=e.clientX;HEAP32[idx+5]=e.clientY;HEAP32[idx+6]=e.ctrlKey;HEAP32[idx+7]=e.shiftKey;HEAP32[idx+8]=e.altKey;HEAP32[idx+9]=e.metaKey;HEAP16[idx*2+20]=e.button;HEAP16[idx*2+21]=e.buttons;HEAP32[idx+11]=e["movementX"];HEAP32[idx+12]=e["movementY"];var rect=getBoundingClientRect(target);HEAP32[idx+13]=e.clientX-rect.left;HEAP32[idx+14]=e.clientY-rect.top}function registerMouseEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=findEventTarget(target);var mouseEventHandlerFunc=function(e=event){fillMouseEventData(JSEvents.mouseEvent,e,target);if(getWasmTableEntry(callbackfunc)(eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_mousedown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread)}function _emscripten_set_mousemove_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread)}function _emscripten_set_mouseup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread)}function registerTouchEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.touchEvent)JSEvents.touchEvent=_malloc(1696);target=findEventTarget(target);var touchEventHandlerFunc=function(e){var t,touches={},et=e.touches;for(var i=0;i<et.length;++i){t=et[i];t.isChanged=t.onTarget=0;touches[t.identifier]=t}for(var i=0;i<e.changedTouches.length;++i){t=e.changedTouches[i];t.isChanged=1;touches[t.identifier]=t}for(var i=0;i<e.targetTouches.length;++i){touches[e.targetTouches[i].identifier].onTarget=1}var touchEvent=JSEvents.touchEvent;HEAPF64[touchEvent>>3]=e.timeStamp;var idx=touchEvent>>2;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;idx+=7;var targetRect=getBoundingClientRect(target);var numTouches=0;for(var i in touches){t=touches[i];HEAP32[idx+0]=t.identifier;HEAP32[idx+1]=t.screenX;HEAP32[idx+2]=t.screenY;HEAP32[idx+3]=t.clientX;HEAP32[idx+4]=t.clientY;HEAP32[idx+5]=t.pageX;HEAP32[idx+6]=t.pageY;HEAP32[idx+7]=t.isChanged;HEAP32[idx+8]=t.onTarget;HEAP32[idx+9]=t.clientX-targetRect.left;HEAP32[idx+10]=t.clientY-targetRect.top;idx+=13;if(++numTouches>31){break}}HEAP32[touchEvent+8>>2]=numTouches;if(getWasmTableEntry(callbackfunc)(eventTypeId,touchEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:touchEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_touchend_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerTouchEventCallback(target,userData,useCapture,callbackfunc,23,"touchend",targetThread)}function _emscripten_set_touchmove_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerTouchEventCallback(target,userData,useCapture,callbackfunc,24,"touchmove",targetThread)}function _emscripten_set_touchstart_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){return registerTouchEventCallback(target,userData,useCapture,callbackfunc,22,"touchstart",targetThread)}function registerWheelEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(104);var wheelHandlerFunc=function(e=event){var wheelEvent=JSEvents.wheelEvent;fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+72>>3]=e["deltaX"];HEAPF64[wheelEvent+80>>3]=e["deltaY"];HEAPF64[wheelEvent+88>>3]=e["deltaZ"];HEAP32[wheelEvent+96>>2]=e["deltaMode"];if(getWasmTableEntry(callbackfunc)(eventTypeId,wheelEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:wheelHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_wheel_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){target=findEventTarget(target);if(!target)return-4;if(typeof target.onwheel!="undefined"){return registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"wheel",targetThread)}else{return-1}}function _emscripten_set_window_title(title){setWindowTitle(UTF8ToString(title))}function HandleAllocator(){this.allocated=[undefined];this.freelist=[];this.get=function(id){return this.allocated[id]};this.has=function(id){return this.allocated[id]!==undefined};this.allocate=function(handle){var id=this.freelist.pop()||this.allocated.length;this.allocated[id]=handle;return id};this.free=function(id){this.allocated[id]=undefined;this.freelist.push(id)}}var Fetch={openDatabase:function(dbname,dbversion,onsuccess,onerror){try{var openRequest=indexedDB.open(dbname,dbversion)}catch(e){return onerror(e)}openRequest.onupgradeneeded=event=>{var db=event.target.result;if(db.objectStoreNames.contains("FILES")){db.deleteObjectStore("FILES")}db.createObjectStore("FILES")};openRequest.onsuccess=event=>onsuccess(event.target.result);openRequest.onerror=error=>onerror(error)},init:function(){Fetch.xhrs=new HandleAllocator;var onsuccess=db=>{Fetch.dbInstance=db;removeRunDependency("library_fetch_init")};var onerror=()=>{Fetch.dbInstance=false;removeRunDependency("library_fetch_init")};addRunDependency("library_fetch_init");Fetch.openDatabase("emscripten_filesystem",1,onsuccess,onerror)}};function fetchXHR(fetch,onsuccess,onerror,onprogress,onreadystatechange){var url=HEAPU32[fetch+8>>2];if(!url){onerror(fetch,0,"no url specified!");return}var url_=UTF8ToString(url);var fetch_attr=fetch+112;var requestMethod=UTF8ToString(fetch_attr+0);if(!requestMethod)requestMethod="GET";var timeoutMsecs=HEAPU32[fetch_attr+56>>2];var userName=HEAPU32[fetch_attr+68>>2];var password=HEAPU32[fetch_attr+72>>2];var requestHeaders=HEAPU32[fetch_attr+76>>2];var overriddenMimeType=HEAPU32[fetch_attr+80>>2];var dataPtr=HEAPU32[fetch_attr+84>>2];var dataLength=HEAPU32[fetch_attr+88>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var fetchAttrLoadToMemory=!!(fetchAttributes&1);var fetchAttrStreamData=!!(fetchAttributes&2);var fetchAttrSynchronous=!!(fetchAttributes&64);var userNameStr=userName?UTF8ToString(userName):undefined;var passwordStr=password?UTF8ToString(password):undefined;var xhr=new XMLHttpRequest;xhr.withCredentials=!!HEAPU8[fetch_attr+60>>0];xhr.open(requestMethod,url_,!fetchAttrSynchronous,userNameStr,passwordStr);if(!fetchAttrSynchronous)xhr.timeout=timeoutMsecs;xhr.url_=url_;xhr.responseType="arraybuffer";if(overriddenMimeType){var overriddenMimeTypeStr=UTF8ToString(overriddenMimeType);xhr.overrideMimeType(overriddenMimeTypeStr)}if(requestHeaders){for(;;){var key=HEAPU32[requestHeaders>>2];if(!key)break;var value=HEAPU32[requestHeaders+4>>2];if(!value)break;requestHeaders+=8;var keyStr=UTF8ToString(key);var valueStr=UTF8ToString(value);xhr.setRequestHeader(keyStr,valueStr)}}var id=Fetch.xhrs.allocate(xhr);HEAPU32[fetch>>2]=id;var data=dataPtr&&dataLength?HEAPU8.slice(dataPtr,dataPtr+dataLength):null;function saveResponseAndStatus(){var ptr=0;var ptrLen=0;if(xhr.response&&fetchAttrLoadToMemory&&HEAPU32[fetch+12>>2]===0){ptrLen=xhr.response.byteLength}if(ptrLen>0){ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;writeI53ToI64(fetch+16,ptrLen);writeI53ToI64(fetch+24,0);var len=xhr.response?xhr.response.byteLength:0;if(len){writeI53ToI64(fetch+32,len)}HEAPU16[fetch+40>>1]=xhr.readyState;HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64)}xhr.onload=e=>{if(!Fetch.xhrs.has(id)){return}saveResponseAndStatus();if(xhr.status>=200&&xhr.status<300){if(onsuccess)onsuccess(fetch,xhr,e)}else{if(onerror)onerror(fetch,xhr,e)}};xhr.onerror=e=>{if(!Fetch.xhrs.has(id)){return}saveResponseAndStatus();if(onerror)onerror(fetch,xhr,e)};xhr.ontimeout=e=>{if(!Fetch.xhrs.has(id)){return}if(onerror)onerror(fetch,xhr,e)};xhr.onprogress=e=>{if(!Fetch.xhrs.has(id)){return}var ptrLen=fetchAttrLoadToMemory&&fetchAttrStreamData&&xhr.response?xhr.response.byteLength:0;var ptr=0;if(ptrLen>0&&fetchAttrLoadToMemory&&fetchAttrStreamData){ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;writeI53ToI64(fetch+16,ptrLen);writeI53ToI64(fetch+24,e.loaded-ptrLen);writeI53ToI64(fetch+32,e.total);HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=3&&xhr.status===0&&e.loaded>0)xhr.status=200;HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64);if(onprogress)onprogress(fetch,xhr,e);if(ptr){_free(ptr)}};xhr.onreadystatechange=e=>{if(!Fetch.xhrs.has(id)){return}HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=2){HEAPU16[fetch+42>>1]=xhr.status}if(onreadystatechange)onreadystatechange(fetch,xhr,e)};try{xhr.send(data)}catch(e){if(onerror)onerror(fetch,xhr,e)}}function writeI53ToI64(ptr,num){HEAPU32[ptr>>2]=num;HEAPU32[ptr+4>>2]=(num-HEAPU32[ptr>>2])/4294967296}function fetchCacheData(db,fetch,data,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var destinationPath=HEAPU32[fetch_attr+64>>2];if(!destinationPath)destinationPath=HEAPU32[fetch+8>>2];var destinationPathStr=UTF8ToString(destinationPath);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var putRequest=packages.put(data,destinationPathStr);putRequest.onsuccess=event=>{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,destinationPathStr)};putRequest.onerror=error=>{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=413;stringToUTF8("Payload Too Large",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function fetchLoadCachedData(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readonly");var packages=transaction.objectStore("FILES");var getRequest=packages.get(pathStr);getRequest.onsuccess=event=>{if(event.target.result){var value=event.target.result;var len=value.byteLength||value.length;var ptr=_malloc(len);HEAPU8.set(new Uint8Array(value),ptr);HEAPU32[fetch+12>>2]=ptr;writeI53ToI64(fetch+16,len);writeI53ToI64(fetch+24,0);writeI53ToI64(fetch+32,len);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)}else{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,"no data")}};getRequest.onerror=error=>{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function fetchDeleteCachedData(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var request=packages.delete(pathStr);request.onsuccess=event=>{var value=event.target.result;HEAPU32[fetch+12>>2]=0;writeI53ToI64(fetch+16,0);writeI53ToI64(fetch+24,0);writeI53ToI64(fetch+32,0);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)};request.onerror=error=>{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function _emscripten_start_fetch(fetch,successcb,errorcb,progresscb,readystatechangecb){var fetch_attr=fetch+112;var onsuccess=HEAPU32[fetch_attr+36>>2];var onerror=HEAPU32[fetch_attr+40>>2];var onprogress=HEAPU32[fetch_attr+44>>2];var onreadystatechange=HEAPU32[fetch_attr+48>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var fetchAttrSynchronous=!!(fetchAttributes&64);function doCallback(f){if(fetchAttrSynchronous){f()}else{callUserCallback(f)}}var reportSuccess=(fetch,xhr,e)=>{doCallback(()=>{if(onsuccess)getWasmTableEntry(onsuccess)(fetch);else if(successcb)successcb(fetch)})};var reportProgress=(fetch,xhr,e)=>{doCallback(()=>{if(onprogress)getWasmTableEntry(onprogress)(fetch);else if(progresscb)progresscb(fetch)})};var reportError=(fetch,xhr,e)=>{doCallback(()=>{if(onerror)getWasmTableEntry(onerror)(fetch);else if(errorcb)errorcb(fetch)})};var reportReadyStateChange=(fetch,xhr,e)=>{doCallback(()=>{if(onreadystatechange)getWasmTableEntry(onreadystatechange)(fetch);else if(readystatechangecb)readystatechangecb(fetch)})};var performUncachedXhr=(fetch,xhr,e)=>{fetchXHR(fetch,reportSuccess,reportError,reportProgress,reportReadyStateChange)};var cacheResultAndReportSuccess=(fetch,xhr,e)=>{var storeSuccess=(fetch,xhr,e)=>{doCallback(()=>{if(onsuccess)getWasmTableEntry(onsuccess)(fetch);else if(successcb)successcb(fetch)})};var storeError=(fetch,xhr,e)=>{doCallback(()=>{if(onsuccess)getWasmTableEntry(onsuccess)(fetch);else if(successcb)successcb(fetch)})};fetchCacheData(Fetch.dbInstance,fetch,xhr.response,storeSuccess,storeError)};var performCachedXhr=(fetch,xhr,e)=>{fetchXHR(fetch,cacheResultAndReportSuccess,reportError,reportProgress,reportReadyStateChange)};var requestMethod=UTF8ToString(fetch_attr+0);var fetchAttrReplace=!!(fetchAttributes&16);var fetchAttrPersistFile=!!(fetchAttributes&4);var fetchAttrNoDownload=!!(fetchAttributes&32);if(requestMethod==="EM_IDB_STORE"){var ptr=HEAPU32[fetch_attr+84>>2];var size=HEAPU32[fetch_attr+88>>2];fetchCacheData(Fetch.dbInstance,fetch,HEAPU8.slice(ptr,ptr+size),reportSuccess,reportError)}else if(requestMethod==="EM_IDB_DELETE"){fetchDeleteCachedData(Fetch.dbInstance,fetch,reportSuccess,reportError)}else if(!fetchAttrReplace){fetchLoadCachedData(Fetch.dbInstance,fetch,reportSuccess,fetchAttrNoDownload?reportError:fetchAttrPersistFile?performCachedXhr:performUncachedXhr)}else if(!fetchAttrNoDownload){fetchXHR(fetch,fetchAttrPersistFile?cacheResultAndReportSuccess:reportSuccess,reportError,reportProgress,reportReadyStateChange)}else{return 0}return fetch}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings}function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}HEAP8[buffer>>0]=0}function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!=="undefined"){offset+=curr}}return ret}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function convertI32PairToI53Checked(lo,hi){return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var offset=convertI32PairToI53Checked(offset_low,offset_high);if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function _getentropy(buffer,size){randomFill(HEAPU8.subarray(buffer,buffer+size));return 0}function _glAttachShader(program,shader){GLctx.attachShader(GL.programs[program],GL.shaders[shader])}function _glBindBuffer(target,buffer){if(target==35051){GLctx.currentPixelPackBufferBinding=buffer}else if(target==35052){GLctx.currentPixelUnpackBufferBinding=buffer}GLctx.bindBuffer(target,GL.buffers[buffer])}function _glBindTexture(target,texture){GLctx.bindTexture(target,GL.textures[texture])}function _glBindVertexArray(vao){GLctx.bindVertexArray(GL.vaos[vao])}var _glBindVertexArrayOES=_glBindVertexArray;function _glBlendFunc(x0,x1){GLctx.blendFunc(x0,x1)}function _glBufferData(target,size,data,usage){if(true){if(data&&size){GLctx.bufferData(target,HEAPU8,usage,data,size)}else{GLctx.bufferData(target,size,usage)}}else{GLctx.bufferData(target,data?HEAPU8.subarray(data,data+size):size,usage)}}function _glClear(x0){GLctx.clear(x0)}function _glClearColor(x0,x1,x2,x3){GLctx.clearColor(x0,x1,x2,x3)}function _glCompileShader(shader){GLctx.compileShader(GL.shaders[shader])}function _glCreateProgram(){var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;program.maxUniformLength=program.maxAttributeLength=program.maxUniformBlockNameLength=0;program.uniformIdCounter=1;GL.programs[id]=program;return id}function _glCreateShader(shaderType){var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id}function _glDeleteProgram(id){if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null}function _glDeleteShader(id){if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null}function _glDeleteTextures(n,textures){for(var i=0;i<n;i++){var id=HEAP32[textures+i*4>>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}}function _glDrawArrays(mode,first,count){GLctx.drawArrays(mode,first,count)}function _glEnable(x0){GLctx.enable(x0)}function _glEnableVertexAttribArray(index){GLctx.enableVertexAttribArray(index)}function __glGenObject(n,buffers,createFunction,objectTable){for(var i=0;i<n;i++){var buffer=GLctx[createFunction]();var id=buffer&&GL.getNewId(objectTable);if(buffer){buffer.name=id;objectTable[id]=buffer}else{GL.recordError(1282)}HEAP32[buffers+i*4>>2]=id}}function _glGenBuffers(n,buffers){__glGenObject(n,buffers,"createBuffer",GL.buffers)}function _glGenTextures(n,textures){__glGenObject(n,textures,"createTexture",GL.textures)}function _glGenVertexArrays(n,arrays){__glGenObject(n,arrays,"createVertexArray",GL.vaos)}var _glGenVertexArraysOES=_glGenVertexArrays;function _glGetShaderInfoLog(shader,maxLength,length,infoLog){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull}function _glLinkProgram(program){program=GL.programs[program];GLctx.linkProgram(program);program.uniformLocsById=0;program.uniformSizeAndIdsByName={}}function computeUnpackAlignedImageSize(width,height,sizePerPixel,alignment){function roundedToNextMultipleOf(x,y){return x+y-1&-y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height*alignedRowSize}function colorChannelsInGlTextureFormat(format){var colorChannels={5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4};return colorChannels[format-6402]||1}function heapObjectForWebGLType(type){type-=5120;if(type==0)return HEAP8;if(type==1)return HEAPU8;if(type==2)return HEAP16;if(type==4)return HEAP32;if(type==6)return HEAPF32;if(type==5||type==28922||type==28520||type==30779||type==30782)return HEAPU32;return HEAPU16}function heapAccessShiftForWebGLHeap(heap){return 31-Math.clz32(heap.BYTES_PER_ELEMENT)}function emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat){var heap=heapObjectForWebGLType(type);var shift=heapAccessShiftForWebGLHeap(heap);var byteSize=1<<shift;var sizePerPixel=colorChannelsInGlTextureFormat(format)*byteSize;var bytes=computeUnpackAlignedImageSize(width,height,sizePerPixel,GL.unpackAlignment);return heap.subarray(pixels>>shift,pixels+bytes>>shift)}function _glReadPixels(x,y,width,height,format,type,pixels){if(true){if(GLctx.currentPixelPackBufferBinding){GLctx.readPixels(x,y,width,height,format,type,pixels)}else{var heap=heapObjectForWebGLType(type);GLctx.readPixels(x,y,width,height,format,type,heap,pixels>>heapAccessShiftForWebGLHeap(heap))}return}var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)}function _glShaderSource(shader,count,string,length){var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)}function _glTexImage2D(target,level,internalFormat,width,height,border,format,type,pixels){if(true){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels)}else if(pixels){var heap=heapObjectForWebGLType(type);GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,heap,pixels>>heapAccessShiftForWebGLHeap(heap))}else{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,null)}return}GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels?emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat):null)}function _glTexParameteri(x0,x1,x2){GLctx.texParameteri(x0,x1,x2)}function _glUseProgram(program){program=GL.programs[program];GLctx.useProgram(program);GLctx.currentProgram=program}function _glVertexAttribPointer(index,size,type,normalized,stride,ptr){GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)}function _glViewport(x0,x1,x2,x3){GLctx.viewport(x0,x1,x2,x3)}function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length<digits){str=character[0]+str}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,"0")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+arraySum(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}return"PM"},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":function(date){var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":function(date){return date.tm_wday},"%W":function(date){var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":function(date){return(date.tm_year+1900).toString().substring(2)},"%Y":function(date){return date.tm_year+1900},"%z":function(date){var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm,loc){return _strftime(s,maxsize,format,tm)}Module["requestFullscreen"]=function Module_requestFullscreen(lockPointer,resizeCanvas){Browser.requestFullscreen(lockPointer,resizeCanvas)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};var preloadedImages={};var preloadedAudios={};var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_unlink"]=FS.unlink;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;var GLctx;Fetch.init();var decodeBase64=typeof atob=="function"?atob:function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i<input.length);return output};function intArrayFromBase64(s){if(typeof ENVIRONMENT_IS_NODE=="boolean"&&ENVIRONMENT_IS_NODE){var buf=Buffer.from(s,"base64");return new Uint8Array(buf["buffer"],buf["byteOffset"],buf["byteLength"])}try{var decoded=decodeBase64(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i)}return bytes}catch(_){throw new Error("Converting base64 string to bytes failed.")}}var wasmImports={"__assert_fail":___assert_fail,"__cxa_rethrow":___cxa_rethrow,"__cxa_throw":___cxa_throw,"__syscall_fcntl64":___syscall_fcntl64,"__syscall_fstat64":___syscall_fstat64,"__syscall_getdents64":___syscall_getdents64,"__syscall_ioctl":___syscall_ioctl,"__syscall_lstat64":___syscall_lstat64,"__syscall_newfstatat":___syscall_newfstatat,"__syscall_openat":___syscall_openat,"__syscall_stat64":___syscall_stat64,"_emscripten_fetch_free":__emscripten_fetch_free,"_emscripten_get_now_is_monotonic":__emscripten_get_now_is_monotonic,"_emscripten_throw_longjmp":__emscripten_throw_longjmp,"abort":_abort,"eglChooseConfig":_eglChooseConfig,"eglCreateContext":_eglCreateContext,"eglCreateWindowSurface":_eglCreateWindowSurface,"eglDestroyContext":_eglDestroyContext,"eglDestroySurface":_eglDestroySurface,"eglGetDisplay":_eglGetDisplay,"eglInitialize":_eglInitialize,"eglMakeCurrent":_eglMakeCurrent,"eglSwapBuffers":_eglSwapBuffers,"eglSwapInterval":_eglSwapInterval,"eglTerminate":_eglTerminate,"emscripten_asm_const_int":_emscripten_asm_const_int,"emscripten_cancel_main_loop":_emscripten_cancel_main_loop,"emscripten_date_now":_emscripten_date_now,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_blur_callback_on_thread":_emscripten_set_blur_callback_on_thread,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_focus_callback_on_thread":_emscripten_set_focus_callback_on_thread,"emscripten_set_keydown_callback_on_thread":_emscripten_set_keydown_callback_on_thread,"emscripten_set_keyup_callback_on_thread":_emscripten_set_keyup_callback_on_thread,"emscripten_set_main_loop":_emscripten_set_main_loop,"emscripten_set_mousedown_callback_on_thread":_emscripten_set_mousedown_callback_on_thread,"emscripten_set_mousemove_callback_on_thread":_emscripten_set_mousemove_callback_on_thread,"emscripten_set_mouseup_callback_on_thread":_emscripten_set_mouseup_callback_on_thread,"emscripten_set_touchend_callback_on_thread":_emscripten_set_touchend_callback_on_thread,"emscripten_set_touchmove_callback_on_thread":_emscripten_set_touchmove_callback_on_thread,"emscripten_set_touchstart_callback_on_thread":_emscripten_set_touchstart_callback_on_thread,"emscripten_set_wheel_callback_on_thread":_emscripten_set_wheel_callback_on_thread,"emscripten_set_window_title":_emscripten_set_window_title,"emscripten_start_fetch":_emscripten_start_fetch,"environ_get":_environ_get,"environ_sizes_get":_environ_sizes_get,"fd_close":_fd_close,"fd_read":_fd_read,"fd_seek":_fd_seek,"fd_write":_fd_write,"getentropy":_getentropy,"glAttachShader":_glAttachShader,"glBindBuffer":_glBindBuffer,"glBindTexture":_glBindTexture,"glBindVertexArrayOES":_glBindVertexArrayOES,"glBlendFunc":_glBlendFunc,"glBufferData":_glBufferData,"glClear":_glClear,"glClearColor":_glClearColor,"glCompileShader":_glCompileShader,"glCreateProgram":_glCreateProgram,"glCreateShader":_glCreateShader,"glDeleteProgram":_glDeleteProgram,"glDeleteShader":_glDeleteShader,"glDeleteTextures":_glDeleteTextures,"glDrawArrays":_glDrawArrays,"glEnable":_glEnable,"glEnableVertexAttribArray":_glEnableVertexAttribArray,"glGenBuffers":_glGenBuffers,"glGenTextures":_glGenTextures,"glGenVertexArraysOES":_glGenVertexArraysOES,"glGetShaderInfoLog":_glGetShaderInfoLog,"glLinkProgram":_glLinkProgram,"glReadPixels":_glReadPixels,"glShaderSource":_glShaderSource,"glTexImage2D":_glTexImage2D,"glTexParameteri":_glTexParameteri,"glUseProgram":_glUseProgram,"glVertexAttribPointer":_glVertexAttribPointer,"glViewport":_glViewport,"invoke_ii":invoke_ii,"invoke_iii":invoke_iii,"invoke_iiii":invoke_iiii,"invoke_iiiii":invoke_iiiii,"invoke_vi":invoke_vi,"invoke_vii":invoke_vii,"invoke_viii":invoke_viii,"invoke_viiii":invoke_viiii,"invoke_viiiiii":invoke_viiiiii,"strftime_l":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=function(){return(___wasm_call_ctors=Module["asm"]["__wasm_call_ctors"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["main"]).apply(null,arguments)};var _olc_OnPageUnload=Module["_olc_OnPageUnload"]=function(){return(_olc_OnPageUnload=Module["_olc_OnPageUnload"]=Module["asm"]["olc_OnPageUnload"]).apply(null,arguments)};var _olc_PGE_UpdateWindowSize=Module["_olc_PGE_UpdateWindowSize"]=function(){return(_olc_PGE_UpdateWindowSize=Module["_olc_PGE_UpdateWindowSize"]=Module["asm"]["olc_PGE_UpdateWindowSize"]).apply(null,arguments)};var _malloc=function(){return(_malloc=Module["asm"]["malloc"]).apply(null,arguments)};var ___errno_location=function(){return(___errno_location=Module["asm"]["__errno_location"]).apply(null,arguments)};var _free=function(){return(_free=Module["asm"]["free"]).apply(null,arguments)};var _ma_malloc_emscripten=Module["_ma_malloc_emscripten"]=function(){return(_ma_malloc_emscripten=Module["_ma_malloc_emscripten"]=Module["asm"]["ma_malloc_emscripten"]).apply(null,arguments)};var _ma_free_emscripten=Module["_ma_free_emscripten"]=function(){return(_ma_free_emscripten=Module["_ma_free_emscripten"]=Module["asm"]["ma_free_emscripten"]).apply(null,arguments)};var _ma_device_process_pcm_frames_capture__webaudio=Module["_ma_device_process_pcm_frames_capture__webaudio"]=function(){return(_ma_device_process_pcm_frames_capture__webaudio=Module["_ma_device_process_pcm_frames_capture__webaudio"]=Module["asm"]["ma_device_process_pcm_frames_capture__webaudio"]).apply(null,arguments)};var _ma_device_process_pcm_frames_playback__webaudio=Module["_ma_device_process_pcm_frames_playback__webaudio"]=function(){return(_ma_device_process_pcm_frames_playback__webaudio=Module["_ma_device_process_pcm_frames_playback__webaudio"]=Module["asm"]["ma_device_process_pcm_frames_playback__webaudio"]).apply(null,arguments)};var _setThrew=function(){return(_setThrew=Module["asm"]["setThrew"]).apply(null,arguments)};var stackSave=function(){return(stackSave=Module["asm"]["stackSave"]).apply(null,arguments)};var stackRestore=function(){return(stackRestore=Module["asm"]["stackRestore"]).apply(null,arguments)};var stackAlloc=function(){return(stackAlloc=Module["asm"]["stackAlloc"]).apply(null,arguments)};var ___cxa_is_pointer_type=function(){return(___cxa_is_pointer_type=Module["asm"]["__cxa_is_pointer_type"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["dynCall_viijii"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["dynCall_jiji"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["dynCall_iiiiij"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["dynCall_iiiiijj"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["dynCall_iiiiiijj"]).apply(null,arguments)};function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}if(ENVIRONMENT_IS_WORKER){function WebGLBuffer(id){this.what="buffer";this.id=id}function WebGLProgram(id){this.what="program";this.id=id;this.shaders=[];this.attributes={};this.attributeVec=[];this.nextAttributes={};this.nextAttributeVec=[]}function WebGLFramebuffer(id){this.what="frameBuffer";this.id=id}function WebGLRenderbuffer(id){this.what="renderBuffer";this.id=id}function WebGLTexture(id){this.what="texture";this.id=id;this.binding=0}function WebGLWorker(){this.DEPTH_BUFFER_BIT=256;this.STENCIL_BUFFER_BIT=1024;this.COLOR_BUFFER_BIT=16384;this.POINTS=0;this.LINES=1;this.LINE_LOOP=2;this.LINE_STRIP=3;this.TRIANGLES=4;this.TRIANGLE_STRIP=5;this.TRIANGLE_FAN=6;this.ZERO=0;this.ONE=1;this.SRC_COLOR=768;this.ONE_MINUS_SRC_COLOR=769;this.SRC_ALPHA=770;this.ONE_MINUS_SRC_ALPHA=771;this.DST_ALPHA=772;this.ONE_MINUS_DST_ALPHA=773;this.DST_COLOR=774;this.ONE_MINUS_DST_COLOR=775;this.SRC_ALPHA_SATURATE=776;this.FUNC_ADD=32774;this.BLEND_EQUATION=32777;this.BLEND_EQUATION_RGB=32777;this.BLEND_EQUATION_ALPHA=34877;this.FUNC_SUBTRACT=32778;this.FUNC_REVERSE_SUBTRACT=32779;this.BLEND_DST_RGB=32968;this.BLEND_SRC_RGB=32969;this.BLEND_DST_ALPHA=32970;this.BLEND_SRC_ALPHA=32971;this.CONSTANT_COLOR=32769;this.ONE_MINUS_CONSTANT_COLOR=32770;this.CONSTANT_ALPHA=32771;this.ONE_MINUS_CONSTANT_ALPHA=32772;this.BLEND_COLOR=32773;this.ARRAY_BUFFER=34962;this.ELEMENT_ARRAY_BUFFER=34963;this.ARRAY_BUFFER_BINDING=34964;this.ELEMENT_ARRAY_BUFFER_BINDING=34965;this.STREAM_DRAW=35040;this.STATIC_DRAW=35044;this.DYNAMIC_DRAW=35048;this.BUFFER_SIZE=34660;this.BUFFER_USAGE=34661;this.CURRENT_VERTEX_ATTRIB=34342;this.FRONT=1028;this.BACK=1029;this.FRONT_AND_BACK=1032;this.CULL_FACE=2884;this.BLEND=3042;this.DITHER=3024;this.STENCIL_TEST=2960;this.DEPTH_TEST=2929;this.SCISSOR_TEST=3089;this.POLYGON_OFFSET_FILL=32823;this.SAMPLE_ALPHA_TO_COVERAGE=32926;this.SAMPLE_COVERAGE=32928;this.NO_ERROR=0;this.INVALID_ENUM=1280;this.INVALID_VALUE=1281;this.INVALID_OPERATION=1282;this.OUT_OF_MEMORY=1285;this.CW=2304;this.CCW=2305;this.LINE_WIDTH=2849;this.ALIASED_POINT_SIZE_RANGE=33901;this.ALIASED_LINE_WIDTH_RANGE=33902;this.CULL_FACE_MODE=2885;this.FRONT_FACE=2886;this.DEPTH_RANGE=2928;this.DEPTH_WRITEMASK=2930;this.DEPTH_CLEAR_VALUE=2931;this.DEPTH_FUNC=2932;this.STENCIL_CLEAR_VALUE=2961;this.STENCIL_FUNC=2962;this.STENCIL_FAIL=2964;this.STENCIL_PASS_DEPTH_FAIL=2965;this.STENCIL_PASS_DEPTH_PASS=2966;this.STENCIL_REF=2967;this.STENCIL_VALUE_MASK=2963;this.STENCIL_WRITEMASK=2968;this.STENCIL_BACK_FUNC=34816;this.STENCIL_BACK_FAIL=34817;this.STENCIL_BACK_PASS_DEPTH_FAIL=34818;this.STENCIL_BACK_PASS_DEPTH_PASS=34819;this.STENCIL_BACK_REF=36003;this.STENCIL_BACK_VALUE_MASK=36004;this.STENCIL_BACK_WRITEMASK=36005;this.VIEWPORT=2978;this.SCISSOR_BOX=3088;this.COLOR_CLEAR_VALUE=3106;this.COLOR_WRITEMASK=3107;this.UNPACK_ALIGNMENT=3317;this.PACK_ALIGNMENT=3333;this.MAX_TEXTURE_SIZE=3379;this.MAX_VIEWPORT_DIMS=3386;this.SUBPIXEL_BITS=3408;this.RED_BITS=3410;this.GREEN_BITS=3411;this.BLUE_BITS=3412;this.ALPHA_BITS=3413;this.DEPTH_BITS=3414;this.STENCIL_BITS=3415;this.POLYGON_OFFSET_UNITS=10752;this.POLYGON_OFFSET_FACTOR=32824;this.TEXTURE_BINDING_2D=32873;this.SAMPLE_BUFFERS=32936;this.SAMPLES=32937;this.SAMPLE_COVERAGE_VALUE=32938;this.SAMPLE_COVERAGE_INVERT=32939;this.COMPRESSED_TEXTURE_FORMATS=34467;this.DONT_CARE=4352;this.FASTEST=4353;this.NICEST=4354;this.GENERATE_MIPMAP_HINT=33170;this.BYTE=5120;this.UNSIGNED_BYTE=5121;this.SHORT=5122;this.UNSIGNED_SHORT=5123;this.INT=5124;this.UNSIGNED_INT=5125;this.FLOAT=5126;this.DEPTH_COMPONENT=6402;this.ALPHA=6406;this.RGB=6407;this.RGBA=6408;this.LUMINANCE=6409;this.LUMINANCE_ALPHA=6410;this.UNSIGNED_SHORT_4_4_4_4=32819;this.UNSIGNED_SHORT_5_5_5_1=32820;this.UNSIGNED_SHORT_5_6_5=33635;this.FRAGMENT_SHADER=35632;this.VERTEX_SHADER=35633;this.MAX_VERTEX_ATTRIBS=34921;this.MAX_VERTEX_UNIFORM_VECTORS=36347;this.MAX_VARYING_VECTORS=36348;this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661;this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660;this.MAX_TEXTURE_IMAGE_UNITS=34930;this.MAX_FRAGMENT_UNIFORM_VECTORS=36349;this.SHADER_TYPE=35663;this.DELETE_STATUS=35712;this.LINK_STATUS=35714;this.VALIDATE_STATUS=35715;this.ATTACHED_SHADERS=35717;this.ACTIVE_UNIFORMS=35718;this.ACTIVE_ATTRIBUTES=35721;this.SHADING_LANGUAGE_VERSION=35724;this.CURRENT_PROGRAM=35725;this.NEVER=512;this.LESS=513;this.EQUAL=514;this.LEQUAL=515;this.GREATER=516;this.NOTEQUAL=517;this.GEQUAL=518;this.ALWAYS=519;this.KEEP=7680;this.REPLACE=7681;this.INCR=7682;this.DECR=7683;this.INVERT=5386;this.INCR_WRAP=34055;this.DECR_WRAP=34056;this.VENDOR=7936;this.RENDERER=7937;this.VERSION=7938;this.NEAREST=9728;this.LINEAR=9729;this.NEAREST_MIPMAP_NEAREST=9984;this.LINEAR_MIPMAP_NEAREST=9985;this.NEAREST_MIPMAP_LINEAR=9986;this.LINEAR_MIPMAP_LINEAR=9987;this.TEXTURE_MAG_FILTER=10240;this.TEXTURE_MIN_FILTER=10241;this.TEXTURE_WRAP_S=10242;this.TEXTURE_WRAP_T=10243;this.TEXTURE_2D=3553;this.TEXTURE=5890;this.TEXTURE_CUBE_MAP=34067;this.TEXTURE_BINDING_CUBE_MAP=34068;this.TEXTURE_CUBE_MAP_POSITIVE_X=34069;this.TEXTURE_CUBE_MAP_NEGATIVE_X=34070;this.TEXTURE_CUBE_MAP_POSITIVE_Y=34071;this.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072;this.TEXTURE_CUBE_MAP_POSITIVE_Z=34073;this.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074;this.MAX_CUBE_MAP_TEXTURE_SIZE=34076;this.TEXTURE0=33984;this.TEXTURE1=33985;this.TEXTURE2=33986;this.TEXTURE3=33987;this.TEXTURE4=33988;this.TEXTURE5=33989;this.TEXTURE6=33990;this.TEXTURE7=33991;this.TEXTURE8=33992;this.TEXTURE9=33993;this.TEXTURE10=33994;this.TEXTURE11=33995;this.TEXTURE12=33996;this.TEXTURE13=33997;this.TEXTURE14=33998;this.TEXTURE15=33999;this.TEXTURE16=34e3;this.TEXTURE17=34001;this.TEXTURE18=34002;this.TEXTURE19=34003;this.TEXTURE20=34004;this.TEXTURE21=34005;this.TEXTURE22=34006;this.TEXTURE23=34007;this.TEXTURE24=34008;this.TEXTURE25=34009;this.TEXTURE26=34010;this.TEXTURE27=34011;this.TEXTURE28=34012;this.TEXTURE29=34013;this.TEXTURE30=34014;this.TEXTURE31=34015;this.ACTIVE_TEXTURE=34016;this.REPEAT=10497;this.CLAMP_TO_EDGE=33071;this.MIRRORED_REPEAT=33648;this.FLOAT_VEC2=35664;this.FLOAT_VEC3=35665;this.FLOAT_VEC4=35666;this.INT_VEC2=35667;this.INT_VEC3=35668;this.INT_VEC4=35669;this.BOOL=35670;this.BOOL_VEC2=35671;this.BOOL_VEC3=35672;this.BOOL_VEC4=35673;this.FLOAT_MAT2=35674;this.FLOAT_MAT3=35675;this.FLOAT_MAT4=35676;this.SAMPLER_2D=35678;this.SAMPLER_3D=35679;this.SAMPLER_CUBE=35680;this.VERTEX_ATTRIB_ARRAY_ENABLED=34338;this.VERTEX_ATTRIB_ARRAY_SIZE=34339;this.VERTEX_ATTRIB_ARRAY_STRIDE=34340;this.VERTEX_ATTRIB_ARRAY_TYPE=34341;this.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922;this.VERTEX_ATTRIB_ARRAY_POINTER=34373;this.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975;this.IMPLEMENTATION_COLOR_READ_TYPE=35738;this.IMPLEMENTATION_COLOR_READ_FORMAT=35739;this.COMPILE_STATUS=35713;this.LOW_FLOAT=36336;this.MEDIUM_FLOAT=36337;this.HIGH_FLOAT=36338;this.LOW_INT=36339;this.MEDIUM_INT=36340;this.HIGH_INT=36341;this.FRAMEBUFFER=36160;this.RENDERBUFFER=36161;this.RGBA4=32854;this.RGB5_A1=32855;this.RGB565=36194;this.DEPTH_COMPONENT16=33189;this.STENCIL_INDEX=6401;this.STENCIL_INDEX8=36168;this.DEPTH_STENCIL=34041;this.RENDERBUFFER_WIDTH=36162;this.RENDERBUFFER_HEIGHT=36163;this.RENDERBUFFER_INTERNAL_FORMAT=36164;this.RENDERBUFFER_RED_SIZE=36176;this.RENDERBUFFER_GREEN_SIZE=36177;this.RENDERBUFFER_BLUE_SIZE=36178;this.RENDERBUFFER_ALPHA_SIZE=36179;this.RENDERBUFFER_DEPTH_SIZE=36180;this.RENDERBUFFER_STENCIL_SIZE=36181;this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048;this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049;this.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050;this.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051;this.COLOR_ATTACHMENT0=36064;this.DEPTH_ATTACHMENT=36096;this.STENCIL_ATTACHMENT=36128;this.DEPTH_STENCIL_ATTACHMENT=33306;this.NONE=0;this.FRAMEBUFFER_COMPLETE=36053;this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054;this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055;this.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057;this.FRAMEBUFFER_UNSUPPORTED=36061;this.ACTIVE_TEXTURE=34016;this.FRAMEBUFFER_BINDING=36006;this.RENDERBUFFER_BINDING=36007;this.MAX_RENDERBUFFER_SIZE=34024;this.INVALID_FRAMEBUFFER_OPERATION=1286;this.UNPACK_FLIP_Y_WEBGL=37440;this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441;this.CONTEXT_LOST_WEBGL=37442;this.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443;this.BROWSER_DEFAULT_WEBGL=37444;var commandBuffer=[];var nextId=1;var bindings={texture2D:null,arrayBuffer:null,elementArrayBuffer:null,program:null,framebuffer:null,activeTexture:this.TEXTURE0,generateMipmapHint:this.DONT_CARE,blendSrcRGB:this.ONE,blendSrcAlpha:this.ONE,blendDstRGB:this.ZERO,blendDstAlpha:this.ZERO,blendEquationRGB:this.FUNC_ADD,blendEquationAlpha:this.FUNC_ADD,enabledState:{}};var stateDisabledByDefault=[this.BLEND,this.CULL_FACE,this.DEPTH_TEST,this.DITHER,this.POLYGON_OFFSET_FILL,this.SAMPLE_ALPHA_TO_COVERAGE,this.SAMPLE_COVERAGE,this.SCISSOR_TEST,this.STENCIL_TEST];for(var i in stateDisabledByDefault){bindings.enabledState[stateDisabledByDefault[i]]=false}var that=this;this.onmessage=function(msg){switch(msg.op){case"setPrefetched":{WebGLWorker.prototype.prefetchedParameters=msg.parameters;WebGLWorker.prototype.prefetchedExtensions=msg.extensions;WebGLWorker.prototype.prefetchedPrecisions=msg.precisions;removeRunDependency("gl-prefetch");break}default:throw"weird gl onmessage "+JSON.stringify(msg)}};function revname(name){for(var x in that)if(that[x]===name)return x;return null}this.getParameter=function(name){assert(name);if(name in this.prefetchedParameters)return this.prefetchedParameters[name];switch(name){case this.TEXTURE_BINDING_2D:{return bindings.texture2D}case this.ARRAY_BUFFER_BINDING:{return bindings.arrayBuffer}case this.ELEMENT_ARRAY_BUFFER_BINDING:{return bindings.elementArrayBuffer}case this.CURRENT_PROGRAM:{return bindings.program}case this.FRAMEBUFFER_BINDING:{return bindings.framebuffer}case this.ACTIVE_TEXTURE:{return bindings.activeTexture}case this.GENERATE_MIPMAP_HINT:{return bindings.generateMipmapHint}case this.BLEND_SRC_RGB:{return bindings.blendSrcRGB}case this.BLEND_SRC_ALPHA:{return bindings.blendSrcAlpha}case this.BLEND_DST_RGB:{return bindings.blendDstRGB}case this.BLEND_DST_ALPHA:{return bindings.blendDstAlpha}case this.BLEND_EQUATION_RGB:{return bindings.blendEquationRGB}case this.BLEND_EQUATION_ALPHA:{return bindings.blendEquationAlpha}default:{if(bindings.enabledState[name]!==undefined)return bindings.enabledState[name];throw"TODO: get parameter "+name+" : "+revname(name)}}};this.getExtension=function(name){var i=this.prefetchedExtensions.indexOf(name);if(i<0)return null;commandBuffer.push(1,name);switch(name){case"EXT_texture_filter_anisotropic":{return{TEXTURE_MAX_ANISOTROPY_EXT:34046,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}}case"WEBGL_draw_buffers":{return{COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,drawBuffersWEBGL:function(buffers){that.drawBuffersWEBGL(buffers)}}}case"OES_standard_derivatives":{return{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723}}}return true};this.getSupportedExtensions=function(){return this.prefetchedExtensions};this.getShaderPrecisionFormat=function(shaderType,precisionType){return this.prefetchedPrecisions[shaderType][precisionType]};this.enable=function(cap){commandBuffer.push(2,cap);bindings.enabledState[cap]=true};this.isEnabled=function(cap){return bindings.enabledState[cap]};this.disable=function(cap){commandBuffer.push(3,cap);bindings.enabledState[cap]=false};this.clear=function(mask){commandBuffer.push(4,mask)};this.clearColor=function(r,g,b,a){commandBuffer.push(5,r,g,b,a)};this.createShader=function(type){var id=nextId++;commandBuffer.push(6,type,id);return{id:id,what:"shader",type:type}};this.deleteShader=function(shader){if(!shader)return;commandBuffer.push(7,shader.id)};this.shaderSource=function(shader,source){shader.source=source;commandBuffer.push(8,shader.id,source)};this.compileShader=function(shader){commandBuffer.push(9,shader.id)};this.getShaderInfoLog=function(shader){return""};this.createProgram=function(){var id=nextId++;commandBuffer.push(10,id);return new WebGLProgram(id)};this.deleteProgram=function(program){if(!program)return;commandBuffer.push(11,program.id)};this.attachShader=function(program,shader){program.shaders.push(shader);commandBuffer.push(12,program.id,shader.id)};this.bindAttribLocation=function(program,index,name){program.nextAttributes[name]={what:"attribute",name:name,size:-1,location:index,type:"?"};program.nextAttributeVec[index]=name;commandBuffer.push(13,program.id,index,name)};this.getAttribLocation=function(program,name){if(name in program.attributes)return program.attributes[name].location;return-1};this.linkProgram=function(program){function getTypeId(text){switch(text){case"bool":return that.BOOL;case"int":return that.INT;case"uint":return that.UNSIGNED_INT;case"float":return that.FLOAT;case"vec2":return that.FLOAT_VEC2;case"vec3":return that.FLOAT_VEC3;case"vec4":return that.FLOAT_VEC4;case"ivec2":return that.INT_VEC2;case"ivec3":return that.INT_VEC3;case"ivec4":return that.INT_VEC4;case"bvec2":return that.BOOL_VEC2;case"bvec3":return that.BOOL_VEC3;case"bvec4":return that.BOOL_VEC4;case"mat2":return that.FLOAT_MAT2;case"mat3":return that.FLOAT_MAT3;case"mat4":return that.FLOAT_MAT4;case"sampler2D":return that.SAMPLER_2D;case"sampler3D":return that.SAMPLER_3D;case"samplerCube":return that.SAMPLER_CUBE;default:throw"not yet recognized type text: "+text}}function parseElementType(shader,type,obj,vec){var source=shader.source;source=source.replace(/\n/g,"|\n");var newItems=source.match(new RegExp(type+"\\s+\\w+\\s+[\\w,\\s[\\]]+;","g"));if(!newItems)return;newItems.forEach(function(item){var m=new RegExp(type+"\\s+(\\w+)\\s+([\\w,\\s[\\]]+);").exec(item);assert(m);m[2].split(",").map(function(name){name=name.trim();return name.search(/\s/)>=0?"":name}).filter(function(name){return!!name}).forEach(function(name){var size=1;var open=name.indexOf("[");var fullname=name;if(open>=0){var close=name.indexOf("]");size=parseInt(name.substring(open+1,close));name=name.substr(0,open);fullname=name+"[0]"}if(!obj[name]){obj[name]={what:type,name:fullname,size:size,location:-1,type:getTypeId(m[1])};if(vec)vec.push(name)}})})}program.uniforms={};program.uniformVec=[];program.attributes=program.nextAttributes;program.attributeVec=program.nextAttributeVec;program.nextAttributes={};program.nextAttributeVec=[];var existingAttributes={};program.shaders.forEach(function(shader){parseElementType(shader,"uniform",program.uniforms,program.uniformVec);parseElementType(shader,"attribute",existingAttributes,null)});for(var attr in existingAttributes){if(!(attr in program.attributes)){var index=program.attributeVec.length;program.attributes[attr]={what:"attribute",name:attr,size:-1,location:index,type:"?"};program.attributeVec[index]=attr;commandBuffer.push(13,program.id,index,attr)}program.attributes[attr].size=existingAttributes[attr].size;program.attributes[attr].type=existingAttributes[attr].type}commandBuffer.push(14,program.id)};this.getProgramParameter=function(program,name){switch(name){case this.ACTIVE_UNIFORMS:return program.uniformVec.length;case this.ACTIVE_ATTRIBUTES:return program.attributeVec.length;case this.LINK_STATUS:{commandBuffer.push(15,program.id,name);return true}default:throw"bad getProgramParameter "+revname(name)}};this.getActiveAttrib=function(program,index){var name=program.attributeVec[index];if(!name)return null;return program.attributes[name]};this.getActiveUniform=function(program,index){var name=program.uniformVec[index];if(!name)return null;return program.uniforms[name]};this.getUniformLocation=function(program,name){var fullname=name;var index=-1;var open=name.indexOf("[");if(open>=0){var close=name.indexOf("]");index=parseInt(name.substring(open+1,close));name=name.substr(0,open)}if(!(name in program.uniforms))return null;var id=nextId++;commandBuffer.push(16,program.id,fullname,id);return{what:"location",uniform:program.uniforms[name],id:id,index:index}};this.getProgramInfoLog=function(shader){return""};this.useProgram=function(program){commandBuffer.push(17,program?program.id:0);bindings.program=program};this.uniform1i=function(location,data){if(!location)return;commandBuffer.push(18,location.id,data)};this.uniform1f=function(location,data){if(!location)return;commandBuffer.push(19,location.id,data)};this.uniform3fv=function(location,data){if(!location)return;commandBuffer.push(20,location.id,new Float32Array(data))};this.uniform4f=function(location,x,y,z,w){if(!location)return;commandBuffer.push(21,location.id,new Float32Array([x,y,z,w]))};this.uniform4fv=function(location,data){if(!location)return;commandBuffer.push(21,location.id,new Float32Array(data))};this.uniformMatrix4fv=function(location,transpose,data){if(!location)return;commandBuffer.push(22,location.id,transpose,new Float32Array(data))};this.vertexAttrib4fv=function(index,values){commandBuffer.push(23,index,new Float32Array(values))};this.createBuffer=function(){var id=nextId++;commandBuffer.push(24,id);return new WebGLBuffer(id)};this.deleteBuffer=function(buffer){if(!buffer)return;commandBuffer.push(25,buffer.id)};this.bindBuffer=function(target,buffer){commandBuffer.push(26,target,buffer?buffer.id:0);switch(target){case this.ARRAY_BUFFER_BINDING:{bindings.arrayBuffer=buffer;break}case this.ELEMENT_ARRAY_BUFFER_BINDING:{bindings.elementArrayBuffer=buffer;break}}};function duplicate(something){if(!something||typeof something=="number")return something;if(something.slice)return something.slice(0);return new something.constructor(something)}this.bufferData=function(target,something,usage){commandBuffer.push(27,target,duplicate(something),usage)};this.bufferSubData=function(target,offset,something){commandBuffer.push(28,target,offset,duplicate(something))};this.viewport=function(x,y,w,h){commandBuffer.push(29,x,y,w,h)};this.vertexAttribPointer=function(index,size,type,normalized,stride,offset){commandBuffer.push(30,index,size,type,normalized,stride,offset)};this.enableVertexAttribArray=function(index){commandBuffer.push(31,index)};this.disableVertexAttribArray=function(index){commandBuffer.push(32,index)};this.drawArrays=function(mode,first,count){commandBuffer.push(33,mode,first,count)};this.drawElements=function(mode,count,type,offset){commandBuffer.push(34,mode,count,type,offset)};this.getError=function(){commandBuffer.push(35);return this.NO_ERROR};this.createTexture=function(){var id=nextId++;commandBuffer.push(36,id);return new WebGLTexture(id)};this.deleteTexture=function(texture){if(!texture)return;commandBuffer.push(37,texture.id);texture.id=0};this.isTexture=function(texture){return texture&&texture.what==="texture"&&texture.id>0&&texture.binding};this.bindTexture=function(target,texture){switch(target){case that.TEXTURE_2D:{bindings.texture2D=texture;break}}if(texture)texture.binding=target;commandBuffer.push(38,target,texture?texture.id:0)};this.texParameteri=function(target,pname,param){commandBuffer.push(39,target,pname,param)};this.texImage2D=function(target,level,internalformat,width,height,border,format,type,pixels){if(pixels===undefined){format=width;type=height;pixels=border;assert(pixels instanceof Image);assert(internalformat===format&&format===this.RGBA);assert(type===this.UNSIGNED_BYTE);var data=pixels.data;width=data.width;height=data.height;border=0;pixels=new Uint8Array(data.data)}commandBuffer.push(40,target,level,internalformat,width,height,border,format,type,duplicate(pixels))};this.compressedTexImage2D=function(target,level,internalformat,width,height,border,pixels){commandBuffer.push(41,target,level,internalformat,width,height,border,duplicate(pixels))};this.activeTexture=function(texture){commandBuffer.push(42,texture);bindings.activeTexture=texture};this.getShaderParameter=function(shader,pname){switch(pname){case this.SHADER_TYPE:return shader.type;case this.COMPILE_STATUS:{commandBuffer.push(43,shader.id,pname);return true}default:throw"unsupported getShaderParameter "+pname}};this.clearDepth=function(depth){commandBuffer.push(44,depth)};this.depthFunc=function(depth){commandBuffer.push(45,depth)};this.frontFace=function(depth){commandBuffer.push(46,depth)};this.cullFace=function(depth){commandBuffer.push(47,depth)};this.readPixels=function(depth){abort("readPixels is impossible, we are async GL")};this.pixelStorei=function(pname,param){commandBuffer.push(48,pname,param)};this.depthMask=function(flag){commandBuffer.push(49,flag)};this.depthRange=function(near,far){commandBuffer.push(50,near,far)};this.blendFunc=function(sfactor,dfactor){commandBuffer.push(51,sfactor,dfactor);bindings.blendSrcRGB=bindings.blendSrcAlpha=sfactor;bindings.blendDstRGB=bindings.blendDstAlpha=dfactor};this.scissor=function(x,y,width,height){commandBuffer.push(52,x,y,width,height)};this.colorMask=function(red,green,blue,alpha){commandBuffer.push(53,red,green,blue,alpha)};this.lineWidth=function(width){commandBuffer.push(54,width)};this.createFramebuffer=function(){var id=nextId++;commandBuffer.push(55,id);return new WebGLFramebuffer(id)};this.deleteFramebuffer=function(framebuffer){if(!framebuffer)return;commandBuffer.push(56,framebuffer.id)};this.bindFramebuffer=function(target,framebuffer){commandBuffer.push(57,target,framebuffer?framebuffer.id:0);bindings.framebuffer=framebuffer};this.framebufferTexture2D=function(target,attachment,textarget,texture,level){commandBuffer.push(58,target,attachment,textarget,texture?texture.id:0,level)};this.checkFramebufferStatus=function(target){return this.FRAMEBUFFER_COMPLETE};this.createRenderbuffer=function(){var id=nextId++;commandBuffer.push(59,id);return new WebGLRenderbuffer(id)};this.deleteRenderbuffer=function(renderbuffer){if(!renderbuffer)return;commandBuffer.push(60,renderbuffer.id)};this.bindRenderbuffer=function(target,renderbuffer){commandBuffer.push(61,target,renderbuffer?renderbuffer.id:0)};this.renderbufferStorage=function(target,internalformat,width,height){commandBuffer.push(62,target,internalformat,width,height)};this.framebufferRenderbuffer=function(target,attachment,renderbuffertarget,renderbuffer){commandBuffer.push(63,target,attachment,renderbuffertarget,renderbuffer?renderbuffer.id:0)};this.debugPrint=function(text){commandBuffer.push(64,text)};this.hint=function(target,mode){commandBuffer.push(65,target,mode);if(target==this.GENERATE_MIPMAP_HINT)bindings.generateMipmapHint=mode};this.blendEquation=function(mode){commandBuffer.push(66,mode);bindings.blendEquationRGB=bindings.blendEquationAlpha=mode};this.generateMipmap=function(target){commandBuffer.push(67,target)};this.uniformMatrix3fv=function(location,transpose,data){if(!location)return;commandBuffer.push(68,location.id,transpose,new Float32Array(data))};this.stencilMask=function(mask){commandBuffer.push(69,mask)};this.clearStencil=function(s){commandBuffer.push(70,s)};this.texSubImage2D=function(target,level,xoffset,yoffset,width,height,format,type,pixels){if(pixels===undefined){var formatTemp=format;format=width;type=height;pixels=formatTemp;assert(pixels instanceof Image);assert(format===this.RGBA);assert(type===this.UNSIGNED_BYTE);var data=pixels.data;width=data.width;height=data.height;pixels=new Uint8Array(data.data)}commandBuffer.push(71,target,level,xoffset,yoffset,width,height,format,type,duplicate(pixels))};this.uniform3f=function(location,x,y,z){if(!location)return;commandBuffer.push(72,location.id,x,y,z)};this.blendFuncSeparate=function(srcRGB,dstRGB,srcAlpha,dstAlpha){commandBuffer.push(73,srcRGB,dstRGB,srcAlpha,dstAlpha);bindings.blendSrcRGB=srcRGB;bindings.blendSrcAlpha=srcAlpha;bindings.blendDstRGB=dstRGB;bindings.blendDstAlpha=dstAlpha};this.uniform2fv=function(location,data){if(!location)return;commandBuffer.push(74,location.id,new Float32Array(data))};this.texParameterf=function(target,pname,param){commandBuffer.push(75,target,pname,param)};this.isContextLost=function(){commandBuffer.push(76);return false};this.isProgram=function(program){return program&&program.what==="program"};this.blendEquationSeparate=function(rgb,alpha){commandBuffer.push(77,rgb,alpha);bindings.blendEquationRGB=rgb;bindings.blendEquationAlpha=alpha};this.stencilFuncSeparate=function(face,func,ref,mask){commandBuffer.push(78,face,func,ref,mask)};this.stencilOpSeparate=function(face,fail,zfail,zpass){commandBuffer.push(79,face,fail,zfail,zpass)};this.drawBuffersWEBGL=function(buffers){commandBuffer.push(80,buffers)};this.uniform1iv=function(location,data){if(!location)return;commandBuffer.push(81,location.id,new Int32Array(data))};this.uniform1fv=function(location,data){if(!location)return;commandBuffer.push(82,location.id,new Float32Array(data))};var theoreticalTracker=new FPSTracker("server (theoretical)");var throttledTracker=new FPSTracker("server (client-throttled)");function preRAF(){if(Math.abs(frameId-clientFrameId)>=4){return false}}var postRAFed=false;function postRAF(){if(commandBuffer.length>0){postMessage({target:"gl",op:"render",commandBuffer:commandBuffer});commandBuffer=[]}postRAFed=true}assert(!Browser.doSwapBuffers);Browser.doSwapBuffers=postRAF;var trueRAF=window.requestAnimationFrame;window.requestAnimationFrame=function(func){trueRAF(function(){if(preRAF()===false){window.requestAnimationFrame(func);return}postRAFed=false;func();if(!postRAFed){postRAF()}})}}WebGLWorker.prototype.prefetchedParameters={};WebGLWorker.prototype.prefetchedExtensions={};WebGLWorker.prototype.prefetchedPrecisions={};if(typeof console=="undefined"){var console={log:function(x){if(typeof dump=="function")dump(`log: ${x}\n`)},debug:function(x){if(typeof dump=="function")dump(`debug: ${x}\n`)},info:function(x){if(typeof dump=="function")dump(`info: ${x}\n`)},warn:function(x){if(typeof dump=="function")dump(`warn: ${x}\n`)},error:function(x){if(typeof dump=="function")dump(`error: ${x}\n`)}}}function FPSTracker(text){var last=0;var mean=0;var counter=0;this.tick=function(){var now=Date.now();if(last>0){var diff=now-last;mean=.99*mean+.01*diff;if(counter++===60){counter=0;dump(text+" fps: "+(1e3/mean).toFixed(2)+"\n")}}last=now}}function Element(){throw"TODO: Element"}function PropertyBag(){this.addProperty=function(){};this.removeProperty=function(){};this.setProperty=function(){}}var IndexedObjects={nextId:1,cache:{},add:function(object){object.id=this.nextId++;this.cache[object.id]=object}};function EventListener(){this.listeners={};this.addEventListener=function addEventListener(event,func){if(!this.listeners[event])this.listeners[event]=[];this.listeners[event].push(func)};this.removeEventListener=function(event,func){var list=this.listeners[event];if(!list)return;var me=list.indexOf(func);if(me<0)return;list.splice(me,1)};this.fireEvent=function fireEvent(event){event.preventDefault=function(){};if(event.type in this.listeners){this.listeners[event.type].forEach(listener=>listener(event))}}}function Image(){IndexedObjects.add(this);EventListener.call(this);var src="";Object.defineProperty(this,"src",{set:function(value){src=value;assert(this.id);postMessage({target:"Image",method:"src",src:src,id:this.id})},get:function(){return src}})}Image.prototype.onload=function(){};Image.prototype.onerror=function(){};var window=this;var windowExtra=new EventListener;for(var x in windowExtra)window[x]=windowExtra[x];window.close=function window_close(){postMessage({target:"window",method:"close"})};window.alert=function(text){err("alert forever: "+text);while(1){}};window.scrollX=window.scrollY=0;window.WebGLRenderingContext=WebGLWorker;window.requestAnimationFrame=function(){var nextRAF=0;return function(func){var now=Date.now();if(nextRAF===0){nextRAF=now+1e3/60}else{while(now+2>=nextRAF){nextRAF+=1e3/60}}var delay=Math.max(nextRAF-now,0);setTimeout(func,delay)}}();var webGLWorker=new WebGLWorker;var document=new EventListener;document.createElement=function document_createElement(what){switch(what){case"canvas":{var canvas=new EventListener;canvas.ensureData=function canvas_ensureData(){if(!canvas.data||canvas.data.width!==canvas.width||canvas.data.height!==canvas.height){canvas.data={width:canvas.width,height:canvas.height,data:new Uint8Array(canvas.width*canvas.height*4)};if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"resize",width:canvas.width,height:canvas.height})}}};canvas.getContext=function canvas_getContext(type,attributes){if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"getContext",type:type,attributes:attributes})}if(type==="2d"){return{getImageData:function(x,y,w,h){assert(x==0&&y==0&&w==canvas.width&&h==canvas.height);canvas.ensureData();return{width:canvas.data.width,height:canvas.data.height,data:new Uint8Array(canvas.data.data)}},putImageData:function(image,x,y){canvas.ensureData();assert(x==0&&y==0&&image.width==canvas.width&&image.height==canvas.height);canvas.data.data.set(image.data);if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"render",image:canvas.data})}},drawImage:function(image,x,y,w,h,ox,oy,ow,oh){assert(!x&&!y&&!ox&&!oy);assert(w===ow&&h===oh);assert(canvas.width===w||w===undefined);assert(canvas.height===h||h===undefined);assert(image.width===canvas.width&&image.height===canvas.height);canvas.ensureData();canvas.data.data.set(image.data.data);if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"render",image:canvas.data})}}}}else{return webGLWorker}};canvas.boundingClientRect={};canvas.getBoundingClientRect=function canvas_getBoundingClientRect(){return{width:canvas.boundingClientRect.width,height:canvas.boundingClientRect.height,top:canvas.boundingClientRect.top,left:canvas.boundingClientRect.left,bottom:canvas.boundingClientRect.bottom,right:canvas.boundingClientRect.right}};canvas.style=new PropertyBag;canvas.exitPointerLock=function(){};canvas.width_=canvas.width_||0;canvas.height_=canvas.height_||0;Object.defineProperty(canvas,"width",{set:function(value){canvas.width_=value;if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"resize",width:canvas.width_,height:canvas.height_})}},get:function(){return canvas.width_}});Object.defineProperty(canvas,"height",{set:function(value){canvas.height_=value;if(canvas===Module["canvas"]){postMessage({target:"canvas",op:"resize",width:canvas.width_,height:canvas.height_})}},get:function(){return canvas.height_}});var style={parentCanvas:canvas,removeProperty:function(){},setProperty:function(){}};Object.defineProperty(style,"cursor",{set:function(value){if(!style.cursor_||style.cursor_!==value){style.cursor_=value;if(style.parentCanvas===Module["canvas"]){postMessage({target:"canvas",op:"setObjectProperty",object:"style",property:"cursor",value:style.cursor_})}}},get:function(){return style.cursor_}});canvas.style=style;return canvas}default:throw"document.createElement "+what}};document.getElementById=function(id){if(id==="canvas"||id==="application-canvas"){return Module.canvas}throw"document.getElementById failed on "+id};document.querySelector=function(id){if(id==="#canvas"||id==="#application-canvas"||id==="canvas"||id==="application-canvas"){return Module.canvas}throw"document.querySelector failed on "+id};document.documentElement={};document.styleSheets=[{cssRules:[],insertRule:function(rule,i){this.cssRules.splice(i,0,rule)}}];document.URL="http://worker.not.yet.ready.wait.for.window.onload?fake";function Audio(){warnOnce("faking Audio elements, no actual sound will play")}Audio.prototype=new EventListener;Object.defineProperty(Audio.prototype,"src",{set:function(value){if(value[0]==="d")return;this.onerror()}});Audio.prototype.play=function(){};Audio.prototype.pause=function(){};Audio.prototype.cloneNode=function(){return new Audio};var screen={width:0,height:0};Module.canvas=document.createElement("canvas");Module.setStatus=function(){};out=function Module_print(x){postMessage({target:"stdout",content:x})};err=function Module_printErr(x){postMessage({target:"stderr",content:x})};var frameId=0;var clientFrameId=0;var postMainLoop=Module["postMainLoop"];Module["postMainLoop"]=function(){if(postMainLoop)postMainLoop();postMessage({target:"tick",id:frameId++});commandBuffer=[]};addRunDependency("gl-prefetch");addRunDependency("worker-init");var messageBuffer=null;var messageResenderTimeout=null;var calledMain=false;if(!Module["postRun"])Module["postRun"]=[];if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];Module["postRun"].push(()=>{calledMain=true});function messageResender(){if(calledMain){assert(messageBuffer&&messageBuffer.length>0);messageResenderTimeout=null;messageBuffer.forEach(message=>onmessage(message));messageBuffer=null}else{messageResenderTimeout=setTimeout(messageResender,100)}}function onMessageFromMainEmscriptenThread(message){if(!calledMain&&!message.data.preMain){if(!messageBuffer){messageBuffer=[];messageResenderTimeout=setTimeout(messageResender,100)}messageBuffer.push(message);return}if(calledMain&&messageResenderTimeout){clearTimeout(messageResenderTimeout);messageResender()}switch(message.data.target){case"document":{document.fireEvent(message.data.event);break}case"window":{window.fireEvent(message.data.event);break}case"canvas":{if(message.data.event){Module.canvas.fireEvent(message.data.event)}else if(message.data.boundingClientRect){Module.canvas.boundingClientRect=message.data.boundingClientRect}else throw"ey?";break}case"gl":{webGLWorker.onmessage(message.data);break}case"tock":{clientFrameId=message.data.id;break}case"Image":{var img=IndexedObjects.cache[message.data.id];switch(message.data.method){case"onload":{img.width=message.data.width;img.height=message.data.height;img.data={width:img.width,height:img.height,data:message.data.data};img.complete=true;img.onload();break}case"onerror":{img.onerror({srcElement:img});break}}break}case"IDBStore":{assert(message.data.method==="response");assert(IDBStore.pending);IDBStore.pending(message.data);break}case"worker-init":{Module.canvas=document.createElement("canvas");screen.width=Module.canvas.width_=message.data.width;screen.height=Module.canvas.height_=message.data.height;Module.canvas.boundingClientRect=message.data.boundingClientRect;document.URL=message.data.URL;window.fireEvent({type:"load"});removeRunDependency("worker-init");break}case"custom":{if(Module["onCustomMessage"]){Module["onCustomMessage"](message)}else{throw"Custom message received but worker Module.onCustomMessage not implemented."}break}case"setimmediate":{if(Module["setImmediates"])Module["setImmediates"].shift()();break}default:throw"wha? "+message.data.target}}onmessage=onMessageFromMainEmscriptenThread;if(typeof specialHTMLTargets!="undefined"){specialHTMLTargets=[0,document,window]}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(){var entryFunction=_main;var argc=0;var argv=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run();
|
|
|