UNPKG

gdal_info.js

Version:

This is a fork of gdal3.js that includes gdal_location info. gdal3.js is a port of Gdal applications (**gdal_translate**, **ogr2ogr**, **gdal_rasterize**, **gdalwarp**, **gdaltransform**) to Webassembly. It allows you to convert raster and vector geospati

1 lines 186 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("fs"),require("path"),require("string_decoder")):"function"==typeof define&&define.amd?define(["fs","path","string_decoder"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).initGdalJs=e(t.require$$0,t.require$$1,t.require$$0$1)}(this,function(t,e,r){"use strict";function P(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var xr=P(t),Br=P(e),M=P(r),o="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);function k(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function s(n){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?k(Object(a),!0).forEach(function(t){var e,r;e=n,r=a[t=t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):k(Object(a)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(a,t))})}return n}function kr(t){return(kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,e)||U(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t){return function(t){if(Array.isArray(t))return K(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(r="Object"===r&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ir,t={exports:{}},e=t;function z(M){var k,I,x,B,U,K,z,u,W,Y,c=void 0!==(M=M||{})?M:{};function V(){function n(t,e){if(!t)throw e+(new Error).stack}function a(t,e,r){this.start=t,this.end=e,this.audio=r}c.FS_createPath("/","usr",!0,!0),c.FS_createPath("/usr","share",!0,!0),c.FS_createPath("/usr/share","gdal",!0,!0),c.FS_createPath("/usr/share","proj",!0,!0),a.prototype={requests:{},open:function(t,e){this.name=e,this.requests[e]=this,c.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var t=this.byteArray.subarray(this.start,this.end);this.finish(t)},finish:function(t){c.FS_createDataFile(this.name,null,t,!0,!0,!0),c.removeRunDependency("fp "+this.name),this.requests[this.name]=null}};for(var t=x.files,e=0;e<t.length;++e)new a(t[e].start,t[e].end,t[e].audio||0).open("GET",t[e].filename);function r(t){n(t,"Loading data file failed."),n(t instanceof ArrayBuffer,"bad input to processPackageData");for(var t=new Uint8Array(t),e=(a.prototype.byteArray=t,x.files),r=0;r<e.length;++r)a.prototype.requests[e[r].filename].onload();c.removeRunDependency("datafile_/home/daniel/gdal3.js/build/package/gdal3WebAssembly.data")}c.addRunDependency("datafile_/home/daniel/gdal3.js/build/package/gdal3WebAssembly.data"),c.preloadResults||(c.preloadResults={}),c.preloadResults["/home/daniel/gdal3.js/build/package/gdal3WebAssembly.data"]={fromCache:!1},Y?(r(Y),Y=null):W=r}c.ready=new Promise(function(t,e){k=t,I=e}),c.expectedDataFileDownloads||(c.expectedDataFileDownloads=0),c.expectedDataFileDownloads++,c.ENVIRONMENT_IS_PTHREAD||(x={files:[{filename:"/usr/share/gdal/tms_MapML_CBMTILE.json",start:0,end:7797},{filename:"/usr/share/gdal/jpfgdgml_SBBdry.gfs",start:7797,end:9050},{filename:"/usr/share/gdal/jpfgdgml_WL.gfs",start:9050,end:10549},{filename:"/usr/share/gdal/grib2_table_4_2_0_1.csv",start:10549,end:26286},{filename:"/usr/share/gdal/grib2_table_4_2_10_1.csv",start:26286,end:35884},{filename:"/usr/share/gdal/bag_template.xml",start:35884,end:44904},{filename:"/usr/share/gdal/pci_datum.txt",start:44904,end:80009},{filename:"/usr/share/gdal/grib2_table_4_2_4_1.csv",start:80009,end:89695},{filename:"/usr/share/gdal/esri_StatePlane_extra.wkt",start:89695,end:422241},{filename:"/usr/share/gdal/pds4_template.xml",start:422241,end:425674},{filename:"/usr/share/gdal/jpfgdgml_AdmArea.gfs",start:425674,end:427314},{filename:"/usr/share/gdal/grib2_table_4_2_0_19.csv",start:427314,end:439188},{filename:"/usr/share/gdal/grib2_table_4_2_4_8.csv",start:439188,end:448874},{filename:"/usr/share/gdal/grib2_table_4_2_1_2.csv",start:448874,end:458672},{filename:"/usr/share/gdal/eedaconf.json",start:458672,end:459051},{filename:"/usr/share/gdal/ogrvrt.xsd",start:459051,end:484800},{filename:"/usr/share/gdal/jpfgdgml_RdEdg.gfs",start:484800,end:486442},{filename:"/usr/share/gdal/GDALLogoColor.svg",start:486442,end:498747},{filename:"/usr/share/gdal/pdfcomposition.xsd",start:498747,end:533081},{filename:"/usr/share/gdal/s57objectclasses.csv",start:533081,end:586408},{filename:"/usr/share/gdal/gml_registry.xml",start:586408,end:593051},{filename:"/usr/share/gdal/gdalvrt.xsd",start:593051,end:620622},{filename:"/usr/share/gdal/grib2_table_4_2_0_14.csv",start:620622,end:630173},{filename:"/usr/share/gdal/grib2_table_4_2_0_191.csv",start:630173,end:639793},{filename:"/usr/share/gdal/inspire_cp_CadastralBoundary.gfs",start:639793,end:641443},{filename:"/usr/share/gdal/grib2_table_4_2_4_5.csv",start:641443,end:650939},{filename:"/usr/share/gdal/grib2_table_4_2_3_6.csv",start:650939,end:651758},{filename:"/usr/share/gdal/grib2_table_4_2_4_9.csv",start:651758,end:661294},{filename:"/usr/share/gdal/jpfgdgml_RailCL.gfs",start:661294,end:662801},{filename:"/usr/share/gdal/GDALLogoGS.svg",start:662801,end:675106},{filename:"/usr/share/gdal/netcdf_config.xsd",start:675106,end:682597},{filename:"/usr/share/gdal/tms_MapML_APSTILE.json",start:682597,end:688870},{filename:"/usr/share/gdal/osmconf.ini",start:688870,end:694065},{filename:"/usr/share/gdal/grib2_table_4_2_0_190.csv",start:694065,end:703572},{filename:"/usr/share/gdal/plscenesconf.json",start:703572,end:738885},{filename:"/usr/share/gdal/ruian_vf_v1.gfs",start:738885,end:806219},{filename:"/usr/share/gdal/grib2_table_4_2_10_2.csv",start:806219,end:816099},{filename:"/usr/share/gdal/grib2_table_4_2_0_13.csv",start:816099,end:825695},{filename:"/usr/share/gdal/gt_datum.csv",start:825695,end:841499},{filename:"/usr/share/gdal/ruian_vf_ob_v1.gfs",start:841499,end:888274},{filename:"/usr/share/gdal/gt_ellips.csv",start:888274,end:889993},{filename:"/usr/share/gdal/grib2_table_4_2_local_NDFD.csv",start:889993,end:892652},{filename:"/usr/share/gdal/grib2_table_4_2_0_20.csv",start:892652,end:904778},{filename:"/usr/share/gdal/grib2_table_4_2_0_4.csv",start:904778,end:915089},{filename:"/usr/share/gdal/grib2_table_4_2_2_5.csv",start:915089,end:924602},{filename:"/usr/share/gdal/trailer.dxf",start:924602,end:926877},{filename:"/usr/share/gdal/grib2_table_4_2_3_3.csv",start:926877,end:927661},{filename:"/usr/share/gdal/grib2_subcenter.csv",start:927661,end:929989},{filename:"/usr/share/gdal/grib2_table_4_2_4_10.csv",start:929989,end:939690},{filename:"/usr/share/gdal/grib2_table_4_2_4_2.csv",start:939690,end:949350},{filename:"/usr/share/gdal/default.rsc",start:949350,end:1412982},{filename:"/usr/share/gdal/ruian_vf_st_v1.gfs",start:1412982,end:1458954},{filename:"/usr/share/gdal/inspire_cp_CadastralZoning.gfs",start:1458954,end:1463766},{filename:"/usr/share/gdal/jpfgdgml_GCP.gfs",start:1463766,end:1466289},{filename:"/usr/share/gdal/jpfgdgml_RvrMgtBdry.gfs",start:1466289,end:1467677},{filename:"/usr/share/gdal/jpfgdgml_WStrA.gfs",start:1467677,end:1469180},{filename:"/usr/share/gdal/grib2_center.csv",start:1469180,end:1473351},{filename:"/usr/share/gdal/gdalicon.png",start:1473351,end:1475372},{filename:"/usr/share/gdal/grib2_table_4_2_1_1.csv",start:1475372,end:1485027},{filename:"/usr/share/gdal/grib2_table_4_2_0_18.csv",start:1485027,end:1495251},{filename:"/usr/share/gdal/jpfgdgml_AdmBdry.gfs",start:1495251,end:1496633},{filename:"/usr/share/gdal/grib2_table_4_2_local_index.csv",start:1496633,end:1496884},{filename:"/usr/share/gdal/s57expectedinput.csv",start:1496884,end:1517769},{filename:"/usr/share/gdal/ruian_vf_st_uvoh_v1.gfs",start:1517769,end:1520369},{filename:"/usr/share/gdal/jpfgdgml_RdArea.gfs",start:1520369,end:1521884},{filename:"/usr/share/gdal/grib2_table_4_2_0_7.csv",start:1521884,end:1532375},{filename:"/usr/share/gdal/jpfgdgml_CommPt.gfs",start:1532375,end:1534010},{filename:"/usr/share/gdal/vicar.json",start:1534010,end:1536417},{filename:"/usr/share/gdal/grib2_table_4_2_local_NCEP.csv",start:1536417,end:1564394},{filename:"/usr/share/gdal/grib2_table_4_2_10_4.csv",start:1564394,end:1574587},{filename:"/usr/share/gdal/jpfgdgml_RdCompt.gfs",start:1574587,end:1576233},{filename:"/usr/share/gdal/vdv452.xml",start:1576233,end:1602049},{filename:"/usr/share/gdal/grib2_table_4_2_4_3.csv",start:1602049,end:1611771},{filename:"/usr/share/gdal/seed_3d.dgn",start:1611771,end:1613819},{filename:"/usr/share/gdal/jpfgdgml_Cntr.gfs",start:1613819,end:1615320},{filename:"/usr/share/gdal/template_tiles.mapml",start:1615320,end:1617267},{filename:"/usr/share/gdal/nitf_spec.xsd",start:1617267,end:1624954},{filename:"/usr/share/gdal/jpfgdgml_BldL.gfs",start:1624954,end:1626457},{filename:"/usr/share/gdal/jpfgdgml_RdASL.gfs",start:1626457,end:1627708},{filename:"/usr/share/gdal/grib2_table_4_5.csv",start:1627708,end:1637721},{filename:"/usr/share/gdal/stateplane.csv",start:1637721,end:1648081},{filename:"/usr/share/gdal/jpfgdgml_Cstline.gfs",start:1648081,end:1649590},{filename:"/usr/share/gdal/grib2_table_4_2_0_15.csv",start:1649590,end:1659436},{filename:"/usr/share/gdal/grib2_table_4_2_4_0.csv",start:1659436,end:1668989},{filename:"/usr/share/gdal/grib2_table_4_2_4_7.csv",start:1668989,end:1678545},{filename:"/usr/share/gdal/grib2_process.csv",start:1678545,end:1683471},{filename:"/usr/share/gdal/jpfgdgml_WStrL.gfs",start:1683471,end:1684976},{filename:"/usr/share/gdal/vdv452.xsd",start:1684976,end:1687830},{filename:"/usr/share/gdal/ecw_cs.wkt",start:1687830,end:2051547},{filename:"/usr/share/gdal/grib2_table_4_2_0_3.csv",start:2051547,end:2061881},{filename:"/usr/share/gdal/grib2_table_4_2_20_1.csv",start:2061881,end:2071735},{filename:"/usr/share/gdal/s57agencies.csv",start:2071735,end:2085039},{filename:"/usr/share/gdal/pci_ellips.txt",start:2085039,end:2088505},{filename:"/usr/share/gdal/grib2_table_4_2_4_6.csv",start:2088505,end:2098139},{filename:"/usr/share/gdal/seed_2d.dgn",start:2098139,end:2107355},{filename:"/usr/share/gdal/header.dxf",start:2107355,end:2113927},{filename:"/usr/share/gdal/cubewerx_extra.wkt",start:2113927,end:2125904},{filename:"/usr/share/gdal/grib2_table_4_2_0_16.csv",start:2125904,end:2135575},{filename:"/usr/share/gdal/grib2_table_4_2_2_0.csv",start:2135575,end:2147776},{filename:"/usr/share/gdal/grib2_table_4_2_10_0.csv",start:2147776,end:2159549},{filename:"/usr/share/gdal/grib2_table_4_2_local_MRMS.csv",start:2159549,end:2175136},{filename:"/usr/share/gdal/grib2_table_4_2_4_4.csv",start:2175136,end:2184825},{filename:"/usr/share/gdal/jpfgdgml_ElevPt.gfs",start:2184825,end:2186325},{filename:"/usr/share/gdal/grib2_table_4_2_2_3.csv",start:2186325,end:2196959},{filename:"/usr/share/gdal/jpfgdgml_LeveeEdge.gfs",start:2196959,end:2198345},{filename:"/usr/share/gdal/grib2_table_4_2_10_191.csv",start:2198345,end:2207979},{filename:"/usr/share/gdal/epsg.wkt",start:2207979,end:2208006},{filename:"/usr/share/gdal/gmlasconf.xml",start:2208006,end:2215438},{filename:"/usr/share/gdal/grib2_table_4_2_0_6.csv",start:2215438,end:2227080},{filename:"/usr/share/gdal/grib2_table_4_2_1_0.csv",start:2227080,end:2237222},{filename:"/usr/share/gdal/grib2_table_4_2_0_2.csv",start:2237222,end:2248025},{filename:"/usr/share/gdal/grib2_table_4_2_2_4.csv",start:2248025,end:2259253},{filename:"/usr/share/gdal/grib2_table_4_2_20_0.csv",start:2259253,end:2268799},{filename:"/usr/share/gdal/s57attributes.csv",start:2268799,end:2288800},{filename:"/usr/share/gdal/jpfgdgml_AdmPt.gfs",start:2288800,end:2290433},{filename:"/usr/share/gdal/grib2_table_4_2_0_0.csv",start:2290433,end:2300796},{filename:"/usr/share/gdal/nitf_spec.xml",start:2300796,end:2449651},{filename:"/usr/share/gdal/jpfgdgml_RdMgtBdry.gfs",start:2449651,end:2451037},{filename:"/usr/share/gdal/jpfgdgml_SBAPt.gfs",start:2451037,end:2452412},{filename:"/usr/share/gdal/grib2_table_4_2_0_17.csv",start:2452412,end:2453268},{filename:"/usr/share/gdal/ozi_datum.csv",start:2453268,end:2461750},{filename:"/usr/share/gdal/inspire_cp_BasicPropertyUnit.gfs",start:2461750,end:2463490},{filename:"/usr/share/gdal/jpfgdgml_BldA.gfs",start:2463490,end:2464991},{filename:"/usr/share/gdal/gmlasconf.xsd",start:2464991,end:2513645},{filename:"/usr/share/gdal/jpfgdgml_SBArea.gfs",start:2513645,end:2515152},{filename:"/usr/share/gdal/jpfgdgml_WA.gfs",start:2515152,end:2516649},{filename:"/usr/share/gdal/grib2_table_versions.csv",start:2516649,end:2516689},{filename:"/usr/share/gdal/grib2_table_4_2_3_4.csv",start:2516689,end:2517740},{filename:"/usr/share/gdal/grib2_table_4_2_20_2.csv",start:2517740,end:2527246},{filename:"/usr/share/gdal/tms_LINZAntarticaMapTileGrid.json",start:2527246,end:2531373},{filename:"/usr/share/gdal/inspire_cp_CadastralParcel.gfs",start:2531373,end:2533823},{filename:"/usr/share/gdal/grib2_table_4_2_3_2.csv",start:2533823,end:2537656},{filename:"/usr/share/gdal/grib2_table_4_2_0_5.csv",start:2537656,end:2547482},{filename:"/usr/share/gdal/jpfgdgml_RdSgmtA.gfs",start:2547482,end:2549126},{filename:"/usr/share/gdal/LICENSE.TXT",start:2549126,end:2568940},{filename:"/usr/share/gdal/GDALLogoBW.svg",start:2568940,end:2581962},{filename:"/usr/share/gdal/grib2_table_4_2_10_3.csv",start:2581962,end:2591738},{filename:"/usr/share/gdal/grib2_table_4_2_local_Canada.csv",start:2591738,end:2592071},{filename:"/usr/share/gdal/ozi_ellips.csv",start:2592071,end:2593420},{filename:"/usr/share/gdal/jpfgdgml_CommBdry.gfs",start:2593420,end:2594804},{filename:"/usr/share/gdal/grib2_table_4_2_3_1.csv",start:2594804,end:2605467},{filename:"/usr/share/gdal/grib2_table_4_2_local_HPC.csv",start:2605467,end:2605554},{filename:"/usr/share/gdal/grib2_table_4_2_3_5.csv",start:2605554,end:2606474},{filename:"/usr/share/gdal/gdalmdiminfo_output.schema.json",start:2606474,end:2611935},{filename:"/usr/share/gdal/tms_NZTM2000.json",start:2611935,end:2617152},{filename:"/usr/share/gdal/grib2_table_4_2_3_0.csv",start:2617152,end:2628103},{filename:"/usr/share/proj/world",start:2628103,end:2635182},{filename:"/usr/share/proj/proj.ini",start:2635182,end:2636232},{filename:"/usr/share/proj/nad27",start:2636232,end:2655767},{filename:"/usr/share/proj/other.extra",start:2655767,end:2659682},{filename:"/usr/share/proj/nad83",start:2659682,end:2676275},{filename:"/usr/share/proj/deformation_model.schema.json",start:2676275,end:2693946},{filename:"/usr/share/proj/ITRF2014",start:2693946,end:2697435},{filename:"/usr/share/proj/projjson.schema.json",start:2697435,end:2734713},{filename:"/usr/share/proj/ITRF2000",start:2734713,end:2736812},{filename:"/usr/share/proj/ITRF2008",start:2736812,end:2742492},{filename:"/usr/share/proj/CH",start:2742492,end:2743589},{filename:"/usr/share/proj/proj.db",start:2743589,end:11021605},{filename:"/usr/share/proj/GL27",start:11021605,end:11022333},{filename:"/usr/share/proj/nad.lst",start:11022333,end:11028718},{filename:"/usr/share/proj/triangulation.schema.json",start:11028718,end:11037121}],remote_package_size:11037121,package_uuid:"bc2dbb24-f60d-4b0a-bcd2-d906b22ac43a"},"object"===("undefined"==typeof window?"undefined":kr(window))?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"),t="gdal3WebAssembly.data","function"!=typeof c.locateFilePackage||c.locateFile||(c.locateFile=c.locateFilePackage,s("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")),t=c.locateFile?c.locateFile(t,""):t,e=x.remote_package_size,x.package_uuid,W=null,(Y=c.getPreloadedPackage?c.getPreloadedPackage(t,e):null)||(B=t,U=e,K=function(t){W?(W(t),W=null):Y=t},z=function(t){console.error("package error:",t)},"object"===("undefined"==typeof process?"undefined":kr(process))&&"object"===kr(process.versions)&&"string"==typeof process.versions.node?xr.default.readFile(B,function(t,e){t?z(t):K(e.buffer)}):((u=new XMLHttpRequest).open("GET",B,!0),u.responseType="arraybuffer",u.onprogress=function(t){var e=B,r=U;if(t.total&&(r=t.total),t.loaded){u.addedTotal?c.dataFileDownloads[e].loaded=t.loaded:(u.addedTotal=!0,c.dataFileDownloads||(c.dataFileDownloads={}),c.dataFileDownloads[e]={loaded:t.loaded,total:r});var n,a=0,o=0,i=0;for(n in c.dataFileDownloads){var s=c.dataFileDownloads[n];a+=s.total,o+=s.loaded,i++}a=Math.ceil(a*c.expectedDataFileDownloads/i),c.setStatus&&c.setStatus("Downloading data... ("+o+"/"+a+")")}else c.dataFileDownloads||c.setStatus&&c.setStatus("Downloading data...")},u.onerror=function(t){throw new Error("NetworkError for: "+B)},u.onload=function(t){if(!(200==u.status||304==u.status||206==u.status||0==u.status&&u.response))throw new Error(u.statusText+" : "+u.responseURL);var e=u.response;K(e)},u.send(null))),c.calledRun?V():(c.preRun||(c.preRun=[]),c.preRun.push(V)));var H,X,q,o,a,Q,t=Object.assign({},c),Z="./this.program",J=function(t,e){throw e},$="object"==("undefined"==typeof window?"undefined":kr(window)),l="function"==typeof importScripts,tt="object"==("undefined"==typeof process?"undefined":kr(process))&&"object"==kr(process.versions)&&"string"==typeof process.versions.node,e="",et=(tt?(e=l?Br.default.dirname(e)+"/":__dirname+"/",Q=function(){a||(o=xr.default,a=Br.default)},H=function(t,e){return Q(),t=a.normalize(t),o.readFileSync(t,e?void 0:"utf8")},q=function(t){t=H(t,!0);return t=t.buffer?t:new Uint8Array(t)},X=function(t,r,n){Q(),t=a.normalize(t),o.readFile(t,function(t,e){t?n(t):r(e.buffer)})},1<process.argv.length&&(Z=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(t){if(!(t instanceof Pr))throw t}),process.on("unhandledRejection",function(t){throw t}),J=function(t,e){if(Tt())throw process.exitCode=t,e;(e=e)instanceof Pr||s("exiting due to exception: "+e),process.exit(t)},c.inspect=function(){return"[Emscripten Module object]"}):($||l)&&(l?e=self.location.href:"undefined"!=typeof document&&document.currentScript&&(e=document.currentScript.src),e=0!==(e=Ir?Ir:e).indexOf("blob:")?e.substr(0,e.replace(/[?#].*/,"").lastIndexOf("/")+1):"",H=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},l&&(q=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),X=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)}),c.print||console.log.bind(console)),s=c.printErr||console.warn.bind(console);Object.assign(c,t),c.arguments,c.thisProgram&&(Z=c.thisProgram),c.quit&&(J=c.quit);var f,rt=[];function i(t){ot=t}var nt,at,ot=0,it=(c.wasmBinary&&(nt=c.wasmBinary),c.noExitRuntime||!0),st=("object"!=("undefined"==typeof WebAssembly?"undefined":kr(WebAssembly))&&b("no native wasm support detected"),!1);function _(t,e){t||b(e)}function ut(t){return c["_"+t]}function ct(t,e,r,n,a){var o={string:function(t){var e,r=0;return null!=t&&0!==t&&(e=1+(t.length<<2),yt(t,r=de(e),e)),r},array:function(t){var e=de(t.length);return Et(t,e),e}};var t=ut(t),i=[],s=0;if(n)for(var u=0;u<n.length;u++){var c=o[r[u]];c?(0===s&&(s=j()),i[u]=c(n[u])):i[u]=n[u]}t=t.apply(null,i);return t=t,0!==s&&P(s),t=t,"string"===e?E(t):"boolean"===e?Boolean(t):t}var lt,d,p,ft,g,dt,pt,m,mt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function h(t,e,r){for(var n=e+r,a=e;t[a]&&!(n<=a);)++a;if(16<a-e&&t.subarray&&mt)return mt.decode(t.subarray(e,a));for(var o="";e<a;){var i,s,u=t[e++];128&u?(s=63&t[e++],192==(224&u)?o+=String.fromCharCode((31&u)<<6|s):(i=63&t[e++],(u=224==(240&u)?(15&u)<<12|s<<6|i:(7&u)<<18|s<<12|i<<6|63&t[e++])<65536?o+=String.fromCharCode(u):(s=u-65536,o+=String.fromCharCode(55296|s>>10,56320|1023&s)))):o+=String.fromCharCode(u)}return o}function E(t,e){return t?h(p,t,e):""}function ht(t,e,r,n){if(!(0<n))return 0;for(var a=r,o=r+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if((s=55296<=s&&s<=57343?65536+((1023&s)<<10)|1023&t.charCodeAt(++i):s)<=127){if(o<=r)break;e[r++]=s}else if(s<=2047){if(o<=r+1)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(o<=r+2)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(o<=r+3)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-a}function yt(t,e,r){return ht(t,p,e,r)}function _t(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);(n=55296<=n&&n<=57343?65536+((1023&n)<<10)|1023&t.charCodeAt(++r):n)<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function gt(t){var e=_t(t)+1,r=ce(e);return r&&ht(t,d,r,e),r}function Et(t,e){d.set(t,e)}function wt(t){lt=t,c.HEAP8=d=new Int8Array(t),c.HEAP16=ft=new Int16Array(t),c.HEAP32=g=new Int32Array(t),c.HEAPU8=p=new Uint8Array(t),c.HEAPU16=new Uint16Array(t),c.HEAPU32=new Uint32Array(t),c.HEAPF32=dt=new Float32Array(t),c.HEAPF64=pt=new Float64Array(t)}c.INITIAL_MEMORY;var vt=[],bt=[],Dt=[],At=0;function Tt(){return it||0<At}function Lt(){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)t=c.preRun.shift(),vt.unshift(t);var t;jt(vt)}function Ct(){if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;)t=c.postRun.shift(),Dt.unshift(t);var t;jt(Dt)}var y,w,v,r=0,St=null;function Gt(t){r++,c.monitorRunDependencies&&c.monitorRunDependencies(r)}function Ot(t){var e;r--,c.monitorRunDependencies&&c.monitorRunDependencies(r),0==r&&St&&(e=St,St=null,e())}function b(t){c.onAbort&&c.onAbort(t),s(t="Aborted("+t+")"),st=!0,t+=". Build with -s ASSERTIONS=1 for more info.";t=new WebAssembly.RuntimeError(t);throw I(t),t}function Nt(t){return t.startsWith("data:application/octet-stream;base64,")}function Ft(t){return t.startsWith("file://")}function Rt(t){try{if(t==y&&nt)return new Uint8Array(nt);if(q)return q(t);throw"both async and sync fetching of the wasm failed"}catch(t){b(t)}}function jt(t){for(;0<t.length;){var e,r=t.shift();"function"==typeof r?r(c):"number"==typeof(e=r.func)?void 0===r.arg?L(e)():L(e)(r.arg):e(void 0===r.arg?null:r.arg)}}c.preloadedImages={},c.preloadedAudios={},Nt(y="gdal3WebAssembly.wasm")||(Xt=y,y=c.locateFile?c.locateFile(Xt,e):e+Xt);var Pt=[];function L(t){var e=Pt[t];return e||(t>=Pt.length&&(Pt.length=t+1),Pt[t]=e=m.get(t)),e}function Mt(t,e){m.set(t,e),Pt[t]=e}function kt(t){this.excPtr=t,this.ptr=t-16,this.set_type=function(t){g[this.ptr+4>>2]=t},this.get_type=function(){return g[this.ptr+4>>2]},this.set_destructor=function(t){g[this.ptr+8>>2]=t},this.get_destructor=function(){return g[this.ptr+8>>2]},this.set_refcount=function(t){g[this.ptr>>2]=t},this.set_caught=function(t){d[this.ptr+12>>0]=t=t?1:0},this.get_caught=function(){return 0!=d[this.ptr+12>>0]},this.set_rethrown=function(t){d[this.ptr+13>>0]=t=t?1:0},this.get_rethrown=function(){return 0!=d[this.ptr+13>>0]},this.init=function(t,e){this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=g[this.ptr>>2];g[this.ptr>>2]=t+1},this.release_ref=function(){var t=g[this.ptr>>2];return g[this.ptr>>2]=t-1,1===t}}function It(t){this.free=function(){le(this.ptr),this.ptr=0},this.set_base_ptr=function(t){g[this.ptr>>2]=t},this.get_base_ptr=function(){return g[this.ptr>>2]},this.set_adjusted_ptr=function(t){g[this.ptr+4>>2]=t},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return g[this.ptr+4>>2]},this.get_exception_ptr=function(){if(me(this.get_exception_info().get_type()))return g[this.get_base_ptr()>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.get_base_ptr()},this.get_exception_info=function(){return new kt(this.get_base_ptr())},void 0===t?(this.ptr=ce(8),this.set_adjusted_ptr(0)):this.ptr=t}var xt=[],Bt=0,D=0;function Ut(t){return le(new kt(t).ptr)}var A={splitPath:function(t){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1)},normalizeArray:function(t,e){for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:function(t){var e="/"===t.charAt(0),r="/"===t.substr(-1);return(t=(t=A.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"))||e?t:".")&&r&&(t+="/"),(e?"/":"")+t},dirname:function(t){var t=A.splitPath(t),e=t[0],t=t[1];return e||t?e+(t=t&&t.substr(0,t.length-1)):"."},basename:function(t){if("/"===t)return"/";var e=(t=(t=A.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},extname:function(t){return A.splitPath(t)[3]},join:function(){var t=Array.prototype.slice.call(arguments,0);return A.normalize(t.join("/"))},join2:function(t,e){return A.normalize(t+"/"+e)}};function Kt(){var t;if("object"==("undefined"==typeof crypto?"undefined":kr(crypto))&&"function"==typeof crypto.getRandomValues)return t=new Uint8Array(1),function(){return crypto.getRandomValues(t),t[0]};if(tt)try{var e=require("crypto");return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){b("randomDevice")}}var T={resolve:function(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:O.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e="/"===n.charAt(0)}return(e?"/":"")+(t=A.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"))||"."},relative:function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return r<e?[]:t.slice(e,r-e+1)}t=T.resolve(t).substr(1),e=T.resolve(e).substr(1);for(var n=r(t.split("/")),a=r(e.split("/")),o=Math.min(n.length,a.length),i=o,s=0;s<o;s++)if(n[s]!==a[s]){i=s;break}for(var u=[],s=i;s<n.length;s++)u.push("..");return(u=u.concat(a.slice(i))).join("/")}},n={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){n.ttys[t]={input:[],output:[],ops:e},O.registerDevice(t,n.stream_ops)},stream_ops:{open:function(t){var e=n.ttys[t.node.rdev];if(!e)throw new O.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,a){if(!t.tty||!t.tty.ops.get_char)throw new O.ErrnoError(60);for(var o,i=0,s=0;s<n;s++){try{o=t.tty.ops.get_char(t.tty)}catch(t){throw new O.ErrnoError(29)}if(void 0===o&&0===i)throw new O.ErrnoError(6);if(null==o)break;i++,e[r+s]=o}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,a){if(!t.tty||!t.tty.ops.put_char)throw new O.ErrnoError(60);try{for(var o=0;o<n;o++)t.tty.ops.put_char(t.tty,e[r+o])}catch(t){throw new O.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(tt){var r=Buffer.alloc(256),n=0;try{n=o.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=0<n?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=oe(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(et(h(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(et(h(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(s(h(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(s(h(t.output,0)),t.output=[])}}};function zt(t){r=t,e=65536,t=Math.ceil(r/e)*e;var e,r=fe(65536,t);return r?(e=t,p.fill(0,r,r+e),r):0}var C={ops_table:null,mount:function(t){return C.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(O.isBlkdev(r)||O.isFIFO(r))throw new O.ErrnoError(63);C.ops_table||(C.ops_table={dir:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,lookup:C.node_ops.lookup,mknod:C.node_ops.mknod,rename:C.node_ops.rename,unlink:C.node_ops.unlink,rmdir:C.node_ops.rmdir,readdir:C.node_ops.readdir,symlink:C.node_ops.symlink},stream:{llseek:C.stream_ops.llseek}},file:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:{llseek:C.stream_ops.llseek,read:C.stream_ops.read,write:C.stream_ops.write,allocate:C.stream_ops.allocate,mmap:C.stream_ops.mmap,msync:C.stream_ops.msync}},link:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr,readlink:C.node_ops.readlink},stream:{}},chrdev:{node:{getattr:C.node_ops.getattr,setattr:C.node_ops.setattr},stream:O.chrdev_stream_ops}});r=O.createNode(t,e,r,n);return O.isDir(r.mode)?(r.node_ops=C.ops_table.dir.node,r.stream_ops=C.ops_table.dir.stream,r.contents={}):O.isFile(r.mode)?(r.node_ops=C.ops_table.file.node,r.stream_ops=C.ops_table.file.stream,r.usedBytes=0,r.contents=null):O.isLink(r.mode)?(r.node_ops=C.ops_table.link.node,r.stream_ops=C.ops_table.link.stream):O.isChrdev(r.mode)&&(r.node_ops=C.ops_table.chrdev.node,r.stream_ops=C.ops_table.chrdev.stream),r.timestamp=Date.now(),t&&(t.contents[e]=r,t.timestamp=r.timestamp),r},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;e<=r||(e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256)),r=t.contents,t.contents=new Uint8Array(e),0<t.usedBytes&&t.contents.set(r.subarray(0,t.usedBytes),0))},resizeFileStorage:function(t,e){var r;t.usedBytes!=e&&(0==e?(t.contents=null,t.usedBytes=0):(r=t.contents,t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e))},node_ops:{getattr:function(t){var e={};return e.dev=O.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,O.isDir(t.mode)?e.size=4096:O.isFile(t.mode)?e.size=t.usedBytes:O.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&C.resizeFileStorage(t,e.size)},lookup:function(t,e){throw O.genericErrors[44]},mknod:function(t,e,r,n){return C.createNode(t,e,r,n)},rename:function(t,e,r){if(O.isDir(t.mode)){var n;try{n=O.lookupNode(e,r)}catch(t){}if(n)for(var a in n.contents)throw new O.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){for(var r in O.lookupNode(t,e).contents)throw new O.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e,r=[".",".."];for(e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,e,r){t=C.createNode(t,e,41471,0);return t.link=r,t},readlink:function(t){if(O.isLink(t.mode))return t.link;throw new O.ErrnoError(28)}},stream_ops:{read:function(t,e,r,n,a){var o=t.node.contents;if(a>=t.node.usedBytes)return 0;var i=Math.min(t.node.usedBytes-a,n);if(8<i&&o.subarray)e.set(o.subarray(a,a+i),r);else for(var s=0;s<i;s++)e[r+s]=o[a+s];return i},write:function(t,e,r,n,a,o){if(e.buffer===d.buffer&&(o=!1),!n)return 0;var i=t.node;if(i.timestamp=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(o)return i.contents=e.subarray(r,r+n),i.usedBytes=n;if(0===i.usedBytes&&0===a)return i.contents=e.slice(r,r+n),i.usedBytes=n;if(a+n<=i.usedBytes)return i.contents.set(e.subarray(r,r+n),a),n}if(C.expandFileStorage(i,a+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(r,r+n),a);else for(var s=0;s<n;s++)i.contents[a+s]=e[r+s];return i.usedBytes=Math.max(i.usedBytes,a+n),n},llseek:function(t,e,r){if(1===r?e+=t.position:2===r&&O.isFile(t.node.mode)&&(e+=t.node.usedBytes),e<0)throw new O.ErrnoError(28);return e},allocate:function(t,e,r){C.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,a,o){if(0!==e)throw new O.ErrnoError(28);if(!O.isFile(t.node.mode))throw new O.ErrnoError(43);var i,s,e=t.node.contents;if(2&o||e.buffer!==lt){if((0<n||n+r<e.length)&&(e=e.subarray?e.subarray(n,n+r):Array.prototype.slice.call(e,n,n+r)),s=!0,!(i=zt(r)))throw new O.ErrnoError(48);d.set(e,i)}else s=!1,i=e.byteOffset;return{ptr:i,allocated:s}},msync:function(t,e,r,n,a){if(O.isFile(t.node.mode))return 2&a||C.stream_ops.write(t,e,0,n,r,!1),0;throw new O.ErrnoError(43)}}},Wt={},S={isWindows:!1,staticInit:function(){S.isWindows=!!process.platform.match(/^win/);var t=process.binding("constants");t.fs&&(t=t.fs),S.flagsForNodeMap={1024:t.O_APPEND,64:t.O_CREAT,128:t.O_EXCL,256:t.O_NOCTTY,0:t.O_RDONLY,2:t.O_RDWR,4096:t.O_SYNC,512:t.O_TRUNC,1:t.O_WRONLY,131072:t.O_NOFOLLOW}},convertNodeCode:function(t){t=t.code;return Wt[t]},mount:function(t){return S.createNode(null,"/",S.getMode(t.opts.root),0)},createNode:function(t,e,r,n){if(!O.isDir(r)&&!O.isFile(r)&&!O.isLink(r))throw new O.ErrnoError(28);t=O.createNode(t,e,r);return t.node_ops=S.node_ops,t.stream_ops=S.stream_ops,t},getMode:function(t){var e;try{e=o.lstatSync(t),S.isWindows&&(e.mode=e.mode|(292&e.mode)>>2)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return e.mode},realPath:function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),A.join.apply(null,e)},flagsForNode:function(t){t=-2097153&t&-2049&-32769&-524289&-65537;var e,r=0;for(e in S.flagsForNodeMap)t&e&&(r|=S.flagsForNodeMap[e],t^=e);if(t)throw new O.ErrnoError(28);return r},node_ops:{getattr:function(t){var e,t=S.realPath(t);try{e=o.lstatSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return S.isWindows&&!e.blksize&&(e.blksize=4096),S.isWindows&&!e.blocks&&(e.blocks=(e.size+e.blksize-1)/e.blksize|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},setattr:function(t,e){var r,n=S.realPath(t);try{void 0!==e.mode&&(o.chmodSync(n,e.mode),t.mode=e.mode),void 0!==e.timestamp&&(r=new Date(e.timestamp),o.utimesSync(n,r,r)),void 0!==e.size&&o.truncateSync(n,e.size)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},lookup:function(t,e){var r=A.join2(S.realPath(t),e),r=S.getMode(r);return S.createNode(t,e,r)},mknod:function(t,e,r,n){t=S.createNode(t,e,r,n),e=S.realPath(t);try{O.isDir(t.mode)?o.mkdirSync(e,t.mode):o.writeFileSync(e,"",{mode:t.mode})}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}return t},rename:function(t,e,r){var n=S.realPath(t),e=A.join2(S.realPath(e),r);try{o.renameSync(n,e)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}t.name=r},unlink:function(t,e){t=A.join2(S.realPath(t),e);try{o.unlinkSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},rmdir:function(t,e){t=A.join2(S.realPath(t),e);try{o.rmdirSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},readdir:function(t){t=S.realPath(t);try{return o.readdirSync(t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},symlink:function(t,e,r){t=A.join2(S.realPath(t),e);try{o.symlinkSync(r,t)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},readlink:function(t){var e=S.realPath(t);try{return e=o.readlinkSync(e),a.relative(a.resolve(t.mount.opts.root),e)}catch(t){if(!t.code)throw t;if("UNKNOWN"===t.code)throw new O.ErrnoError(28);throw new O.ErrnoError(S.convertNodeCode(t))}}},stream_ops:{open:function(t){var e=S.realPath(t.node);try{O.isFile(t.node.mode)&&(t.nfd=o.openSync(e,S.flagsForNode(t.flags)))}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},close:function(t){try{O.isFile(t.node.mode)&&t.nfd&&o.closeSync(t.nfd)}catch(t){if(t.code)throw new O.ErrnoError(S.convertNodeCode(t));throw t}},read:function(t,e,r,n,a){if(0===n)return 0;try{return o.readSync(t.nfd,Buffer.from(e.buffer),r,n,a)}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}},write:function(t,e,r,n,a){try{return o.writeSync(t.nfd,Buffer.from(e.buffer),r,n,a)}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}},llseek:function(t,e,r){if(1===r)e+=t.position;else if(2===r&&O.isFile(t.node.mode))try{e+=o.fstatSync(t.nfd).size}catch(t){throw new O.ErrnoError(S.convertNodeCode(t))}if(e<0)throw new O.ErrnoError(28);return e},mmap:function(t,e,r,n,a,o){if(0!==e)throw new O.ErrnoError(28);if(!O.isFile(t.node.mode))throw new O.ErrnoError(43);e=zt(r);return S.stream_ops.read(t,d,e,r,n),{ptr:e,allocated:!0}},msync:function(t,e,r,n,a){if(O.isFile(t.node.mode))return 2&a||S.stream_ops.write(t,e,0,n,r,!1),0;throw new O.ErrnoError(43)}}},G={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(t){_(l),G.reader||(G.reader=new FileReaderSync);var o=G.createNode(null,"/",G.DIR_MODE,0),i={};function n(t){for(var e=t.split("/"),r=o,n=0;n<e.length-1;n++){var a=e.slice(0,n+1).join("/");i[a]||(i[a]=G.createNode(r,e[n],G.DIR_MODE,0)),r=i[a]}return r}function a(t){t=t.split("/");return t[t.length-1]}return Array.prototype.forEach.call(t.opts.files||[],function(t){G.createNode(n(t.name),a(t.name),G.FILE_MODE,0,t,t.lastModifiedDate)}),(t.opts.blobs||[]).forEach(function(t){G.createNode(n(t.name),a(t.name),G.FILE_MODE,0,t.data)}),(t.opts.packages||[]).forEach(function(r){r.metadata.files.forEach(function(t){var e=t.filename.substr(1);G.createNode(n(e),a(e),G.FILE_MODE,0,r.blob.slice(t.start,t.end))})}),o},createNode:function(t,e,r,n,a,o){var i=O.createNode(t,e,r);return i.mode=r,i.node_ops=G.node_ops,i.stream_ops=G.stream_ops,i.timestamp=(o||new Date).getTime(),_(G.FILE_MODE!==G.DIR_MODE),r===G.FILE_MODE?(i.size=a.size,i.contents=a):(i.size=4096,i.contents={}),t&&(t.contents[e]=i),i},node_ops:{getattr:function(t){return{dev:1,ino:t.id,mode:t.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:t.size,atime:new Date(t.timestamp),mtime:new Date(t.timestamp),ctime:new Date(t.timestamp),blksize:4096,blocks:Math.ceil(t.size/4096)}},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp)},lookup:function(t,e){throw new O.ErrnoError(44)},mknod:function(t,e,r,n){throw new O.ErrnoError(63)},rename:function(t,e,r){throw new O.ErrnoError(63)},unlink:function(t,e){throw new O.ErrnoError(63)},rmdir:function(t,e){throw new O.ErrnoError(63)},readdir:function(t){var e,r=[".",".."];for(e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,e,r){throw new O.ErrnoError(63)},readlink:function(t){throw new O.ErrnoError(63)}},stream_ops:{read:function(t,e,r,n,a){if(a>=t.node.size)return 0;t=t.node.contents.slice(a,a+n),a=G.reader.readAsArrayBuffer(t);return e.set(new Uint8Array(a),r),t.size},write:function(t,e,r,n,a){throw new O.ErrnoError(29)},llseek:function(t,e,r){if(1===r?e+=t.position:2===r&&O.isFile(t.node.mode)&&(e+=t.node.size),e<0)throw new O.ErrnoError(28);return e}}},O={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!(t=T.resolve(O.cwd(),t)))return{path:"",node:null};if(8<(e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count)throw new O.ErrnoError(32);for(var r=A.normalizeArray(t.split("/").filter(function(t){return!!t}),!1),n=O.root,a="/",o=0;o<r.length;o++){var i=o===r.length-1;if(i&&e.parent)break;if(n=O.lookupNode(n,r[o]),a=A.join2(a,r[o]),!O.isMountpoint(n)||i&&!e.follow_mount||(n=n.mounted.root),!i||e.follow)for(var s=0;O.isLink(n.mode);){var u=O.readlink(a),a=T.resolve(A.dirname(a),u),n=O.lookupPath(a,{recurse_count:e.recurse_count+1}).node;if(40<s++)throw new O.ErrnoError(32)}}return{path:a,node:n}},getPath:function(t){for(var e,r;;){if(O.isRoot(t))return r=t.mount.mountpoint,e?"/"!==r[r.length-1]?r+"/"+e:r+e:r;e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:function(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%O.nameTable.length},hashAddNode:function(t){var e=O.hashName(t.parent.id,t.name);t.name_next=O.nameTable[e],O.nameTable[e]=t},hashRemoveNode:function(t){var e=O.hashName(t.parent.id,t.name);if(O.nameTable[e]===t)O.nameTable[e]=t.name_next;else for(var r=O.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:function(t,e){var r=O.mayLookup(t);if(r)throw new O.ErrnoError(r,t);for(var r=O.hashName(t.id,e),n=O.nameTable[r];n;n=n.name_next){var a=n.name;if(n.parent.id===t.id&&a===e)return n}return O.lookup(t,e)},createNode:function(t,e,r,n){t=new O.FSNode(t,e,r,n);return O.hashAddNode(t),t},destroyNode:function(t){O.hashRemoveNode(t)},isRoot:function(t){return t===t.parent},isMountpoint:function(t){return!!t.mounted},isFile:function(t){return 32768==(61440&t)},isDir:function(t){return 16384==(61440&t)},isLink:function(t){return 40960==(61440&t)},isChrdev:function(t){return 8192==(61440&t)},isBlkdev:function(t){return 24576==(61440&t)},isFIFO:function(t){return 4096==(61440&t)},isSocket:function(t){return 49152==(49152&t)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(t){var e=O.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:function(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:function(t,e){return O.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2},mayLookup:function(t){var e=O.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:function(t,e){try{O.lookupNode(t,e);return 20}catch(t){}return O.nodePermissions(t,"wx")},mayDelete:function(t,e,r){var n;try{n=O.lookupNode(t,e)}catch(t){return t.errno}e=O.nodePermissions(t,"wx");if(e)return e;if(r){if(!O.isDir(n.mode))return 54;if(O.isRoot(n)||O.getPath(n)===O.cwd())return 10}else if(O.isDir(n.mode))return 31;return 0},mayOpen:function(t,e){return t?O.isLink(t.mode)?32:O.isDir(t.mode)&&("r"!==O.flagsToPermissionString(e)||512&e)?31:O.nodePermissions(t,O.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:O.MAX_OPEN_FDS,r=t;r<=e;r++)if(!O.streams[r])return r;throw new O.ErrnoError(33)},getStream:function(t){return O.streams[t]},createStream:function(t,e,r){O.FSStream||(O.FSStream=function(){},O.FSStream.prototype={object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),t=Object.assign(new O.FSStream,t);e=O.nextfd(e,r);return t.fd=e,O.streams[e]=t},closeStream:function(t){O.streams[t]=null},chrdev_stream_ops:{open:function(t){var e=O.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:function(){throw new O.ErrnoError(70)}},major:function(t){return t>>8},minor:function(t){return 255&t},makedev:function(t,e){return t<<8|e},registerDevice:function(t,e){O.devices[t]={stream_ops:e}},getDevice:function(t){return O.devices[t]},getMounts:function(t){for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:function(e,r){"function"==typeof e&&(r=e,e=!1),O.syncFSRequests++,1<O.syncFSRequests&&s("warning: "+O.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=O.getMounts(O.root.mount),a=0;function o(t){return O.syncFSRequests--,r(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++a>=n.length&&o(null)}n.forEach(function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:function(t,e,r){var n,a="/"===r,o=!r;if(a&&O.root)throw new O.ErrnoError(10);if(!a&&!o){o=O.lookupPath(r,{follow_mount:!1});if(r=o.path,n=o.node,O.isMountpoint(n))throw new O.ErrnoError(10);if(!O.isDir(n.mode))throw new O.ErrnoError(54)}o={type:t,opts:e,mountpoint:r,mounts:[]},e=t.mount(o);return(e.mount=o).root=e,a?O.root=e:n&&(n.mounted=o,n.mount&&n.mount.mounts.push(o)),e},unmount:function(t){t=O.lookupPath(t,{follow_mount:!1});if(!O.isMountpoint(t.node))throw new O.ErrnoError(28);var t=t.node,e=t.mounted,n=O.getMounts(e),e=(Object.keys(O.nameTable).forEach(function(t){for(var e=O.nameTable[t];e;){var r=e.name_next;n.includes(e.mount)&&O.destroyNode(e),e=r}}),t.mounted=null,t.mount.mounts.indexOf(e));t.mount.mounts.splice(e,1)},lookup:function(t,e){return t.node_ops.lookup(t,e)},mknod:function(t,e,r){var n=O.lookupPath(t,{parent:!0}).node,t=A.basename(t);if(!t||"."===t||".."===t)throw new O.ErrnoError(28);var a=O.mayCreate(n,t);if(a)throw new O.ErrnoError(a);if(n.node_ops.mknod)return n.node_ops.mknod(n,t,e,r);throw new O.ErrnoError(63)},create:function(t,e){return O.mknod(t,e=(e=void 0!==e?e:438)&4095|32768,0)},mkdir:function(t,e){return O.mknod(t,e=(e=void 0!==e?e:511)&1023|16384,0)},mkdirTree:function(t,e){for(var r=t.split("/"),n="",a=0;a<r.length;++a)if(r[a]){n+="/"+r[a];try{O.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:function(t,e,r){return void 0===r&&(r=e,e=438),O.mknod(t,e|=8192,r)},symlink:function(t,e){if(!T.resolve(t))throw new O.ErrnoError(44);var r=O.lookupPath(e,{parent:!0}).node;if(!r)throw new O.ErrnoError(44);var e=A.basename(e),n=O.mayCreate(r,e);if(n)throw new O.ErrnoError(n);if(r.node_ops.symlink)return r.node_ops.symlink(r,e,t);throw new O.ErrnoError(63)},rename:function(t,e){var r=A.dirname(t),n=A.dirname(e),a=A.basename(t),o=A.basename(e),i=O.lookupPath(t,{parent:!0}),i=i.node,s=O.lookupPath(e,{parent:!0}).node;if(!i||!s)throw new O.ErrnoError(44);if(i.mount!==s.mount)throw new O.ErrnoError(75);var u,c=O.lookupNode(i,a),t=T.relative(t,n);if("."!==t.charAt(0))throw new O.ErrnoError(28);if("."!==(t=T.relative(e,r)).charAt(0))throw new O.ErrnoError(55);try{u=O.lookupNode(s,o)}catch(t){}if(c!==u){n=O.isDir(c.mode),e=O.mayDelete(i,a,n);if(e)throw new O.ErrnoError(e);if(e=u?O.mayDelete(s,o,n):O.mayCreate(s,o))throw new O.ErrnoError(e);if(!i.node_ops.rename)throw new O.ErrnoError(63);if(O.isMountpoint(c)||u&&O.isMountpoint(u))throw new O.ErrnoError(10);if(s!==i&&(e=O.nodePermissions(i,"w")))throw new O.ErrnoError(e);O.hashRemoveNode(c);try{i.node_ops.rename(c,s,o)}catch(t){throw t}finally{O.hashAddNode(c)}}},rmdir:function(t){var e=O.lookupPath(t,{parent:!0}).node,t=A.basename(t),r=O.lookupNode(e,t),n=O.mayDelete(e,t,!0);if(n)throw new O.ErrnoError(n);if(!e.node_ops.rmdir)throw new O.ErrnoError(63);if(O.isMountpoint(r))throw new O.ErrnoError(10);e.node_ops.rmdir(e,t),O.destroyNode(r)},readdir:function(t){t=O.lookupPath(t,{follow:!0}).node;if(t.node_ops.readdir)return t.node_ops.readdir(t);throw new O.ErrnoError(54)},unlink:function(t){var e=O.lookupPath(t,{parent:!0}).node;if(!e)throw new O.ErrnoError(44);var t=A.basename(t),r=O.lookupNode(e,t),n=O.mayDelete(e,t,!1);if(n)throw new O.ErrnoError(n);if(!e.node_ops.unlink)throw new O.ErrnoError(63);if(O.isMountpoint(r))throw new O.ErrnoError(10);e.node_ops.unlink(e,t),O.destroyNode(r)},readlink:function(t){t=O.lookupPath(t).node;if(!t)throw new O.ErrnoError(44);if(t.node_ops.readlink)return T.resolve(O.getPath(t.parent),t.node_ops.readlink(t));throw new O.ErrnoError(28)},stat:function(t,e){t=O.lookupPath(t,{follow:!e}).node;if(!t)throw new O.ErrnoError(44);if(t.node_ops.getattr)return t.node_ops.getattr(t);throw new O.ErrnoError(63)},lstat:function(t){return O.stat(t,!0)},chmod:function(t,e,r){if(!(r="string"==typeof t?O.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new O.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&e|-4096&r.mode,timestamp:Date.now()})},lchmod:function(t,e){O.chmod(t,e,!0)},fchmod:function(t,e){t=O.getStream(t);if(!t)throw new O.ErrnoError(8);O.chmod(t.node,e)},chown:function(t,e,r,n){if(!(n="string"==typeof t?O.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new O.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:function(t,e,r){O.chown(t,e,r,!0)},fchown:function(t,e,r){t=O.getStream(t);if(!t)throw new O.Err