varModule=typeofModule!="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){if(Module["ENVIRONMENT_IS_PTHREAD"]||Module["$ww"])return;varloadPackage=function(metadata){varPACKAGE_PATH="";if(typeofwindow==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}elseif(typeofprocess==="undefined"&&typeoflocation!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}varPACKAGE_NAME="pge.data";varREMOTE_PACKAGE_BASE="pge.data";if(typeofModule["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)")}varREMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;varREMOTE_PACKAGE_SIZE=metadata["remote_package_size"];functionfetchRemotePackage(packageName,packageSize,callback,errback){if(typeofprocess==="object"&&typeofprocess.versions==="object"&&typeofprocess.versions.node==="string"){require("fs").readFile(packageName,function(err,contents){if(err){errback(err)}else{callback(contents.buffer)}});return}varxhr=newXMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){varurl=packageName;varsize=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}vartotal=0;varloaded=0;varnum=0;for(vardownloadinModule.dataFileDownloads){vardata=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})`)}elseif(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){thrownewError("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){varpackageData=xhr.response;callback(packageData)}else{thrownewError(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}functionhandleError(error){console.error("package error:",error)}varfetchedCallback=null;varfetched=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);functionrunWithFS(){functionassert(check,msg){if(!check)throwmsg+(newError).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","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","themes",true,true);functionDataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.proto