itowns
Version:
A JS/WebGL framework for 3D geospatial data visualization
1 lines • 98.5 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("itowns_lasworker",[],t):"object"==typeof exports?exports.itowns_lasworker=t():e.itowns_lasworker=t()}(self,(()=>(()=>{var e={50329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hierarchyItemLength=t.infoLength=void 0,t.infoLength=160,t.hierarchyItemLength=32},86601:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Copc=void 0;const a=o(r(30549)),s=r(876),u=r(98363),c=r(15690);async function l(e,{pointDataRecordFormat:t,pointDataRecordLength:r},n,i){const o=await async function(e,{pointDataOffset:t,pointDataLength:r}){return s.Getter.create(e)(t,t+r)}(e,n),{pointCount:u}=n;return a.PointData.decompressChunk(o,{pointCount:u,pointDataRecordFormat:t,pointDataRecordLength:r},i)}t.Copc={create:async function(e){const t=s.Getter.create(e),r=t(0,65536);async function n(e,n){return n>=65536?t(e,n):(await r).slice(e,n)}const i=a.Header.parse(await n(0,a.Constants.minHeaderLength)),o=await a.Vlr.walk(n,i),u=a.Vlr.find(o,"copc",1);if(!u)throw new Error("COPC info VLR is required");const l=c.Info.parse(await a.Vlr.fetch(n,u));let d;const f=a.Vlr.find(o,"LASF_Projection",2112);f&&f.contentLength&&(d=s.Binary.toCString(await a.Vlr.fetch(n,f)),""===d&&(d=void 0));let p=[];const h=a.Vlr.find(o,"LASF_Spec",4);return h&&(p=a.ExtraBytes.parse(await a.Vlr.fetch(n,h))),{header:i,vlrs:o,info:l,wkt:d,eb:p}},loadHierarchyPage:async function(e,t){const r=s.Getter.create(e);return u.Hierarchy.load(r,t)},loadPointDataBuffer:l,loadPointDataView:async function(e,t,r,{lazPerf:n,include:i}={}){const o=await l(e,t.header,r,n);return a.View.create(o,t.header,t.eb,i)}}},98363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0;const n=r(876),i=r(50329);function o(e){const t=n.Binary.toDataView(e);if(t.byteLength%i.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${t.byteLength}`);const r={},o={};for(let e=0;e<t.byteLength;e+=i.hierarchyItemLength){const i=t.getInt32(e+0,!0),a=t.getInt32(e+4,!0),s=t.getInt32(e+8,!0),u=t.getInt32(e+12,!0),c=(0,n.parseBigInt)((0,n.getBigUint64)(t,e+16,!0)),l=t.getInt32(e+24,!0),d=t.getInt32(e+28,!0),f=n.Key.toString([i,a,s,u]);if(d<-1)throw new Error(`Invalid hierarchy point count at key: ${f}`);-1===d?o[f]={pageOffset:c,pageLength:l}:r[f]={pointCount:d,pointDataOffset:c,pointDataLength:l}}return{nodes:r,pages:o}}t.Hierarchy={parse:o,load:async function(e,t){const r=n.Getter.create(e);return o(await r(t.pageOffset,t.pageOffset+t.pageLength))}}},36564:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Info=t.Hierarchy=t.Copc=t.Constants=void 0,t.Constants=o(r(50329));var a=r(86601);Object.defineProperty(t,"Copc",{enumerable:!0,get:function(){return a.Copc}});var s=r(98363);Object.defineProperty(t,"Hierarchy",{enumerable:!0,get:function(){return s.Hierarchy}});var u=r(15690);Object.defineProperty(t,"Info",{enumerable:!0,get:function(){return u.Info}})},15690:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Info=void 0;const n=r(876),i=r(50329);t.Info={parse:function(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${i.infoLength}): ${t.byteLength}`);const r=[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)],o=t.getFloat64(24,!0);return{cube:[r[0]-o,r[1]-o,r[2]-o,r[0]+o,r[1]+o,r[2]+o],spacing:t.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,n.parseBigInt)((0,n.getBigUint64)(t,40,!0)),pageLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,48,!0))},gpsTimeRange:[t.getFloat64(56,!0),t.getFloat64(64,!0)]}}}},69545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},24305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hierarchy=void 0,t.Hierarchy={parse:function(e){return Object.entries(e).reduce(((e,[t,r])=>(-1===r?e.pages[t]={}:r&&(e.nodes[t]={pointCount:r}),e)),{nodes:{},pages:{}})}}},68962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69545),t),i(r(24305),t)},15234:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Las=t.Ept=void 0,t.Ept=o(r(68962)),a(r(36564),t),t.Las=o(r(30549)),a(r(876),t)},48300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evlrHeaderLength=t.vlrHeaderLength=t.minHeaderLength=void 0,t.minHeaderLength=375,t.vlrHeaderLength=54,t.evlrHeaderLength=60},51652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimensions=void 0;const n=r(876),i=r(94553);t.Dimensions={create:function(e,t=[]){return Object.keys(e).reduce(((e,r)=>{const n=a[r];if(n)return{...e,[r]:n};const o=t.find((e=>e.name===r)),s=o&&i.ExtraBytes.getDimension(o);if(s)return{...e,[r]:s};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:o}=n.Dimension,a={X:o.float64,Y:o.float64,Z:o.float64,Intensity:o.uint16,ReturnNumber:o.uint8,NumberOfReturns:o.uint8,ScanDirectionFlag:o.boolean,EdgeOfFlightLine:o.boolean,Classification:o.uint8,Synthetic:o.boolean,KeyPoint:o.boolean,Withheld:o.boolean,Overlap:o.boolean,ScanAngle:o.float32,UserData:o.uint8,PointSourceId:o.uint16,GpsTime:o.float64,Red:o.uint16,Green:o.uint16,Blue:o.uint16,ScannerChannel:o.uint8,Infrared:o.uint16}},94553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtraBytes=void 0;const n=r(876);t.ExtraBytes={getDimension:function({type:e,length:t}){switch(e){case"signed":case"unsigned":switch(t){case 1:case 2:case 4:case 8:return{type:e,size:t}}case"float":switch(t){case 4:case 8:return{type:e,size:t}}}},parse:function(e){if(e.byteLength%i!=0)throw new Error(`Invalid extra bytes VLR length: ${e.byteLength}`);const t=[];for(let r=0;r<e.byteLength;r+=i)t.push(o(e.slice(r,r+i)));return t},parseOne:o};const i=192;function o(e){if(e.byteLength!==i)throw new Error(`Invalid extra bytes entry length: ${e.byteLength}`);const t=n.Binary.toDataView(e),r=n.Binary.toCString(e.slice(4,36)),o=n.Binary.toCString(e.slice(60,192)),a=t.getUint8(2),s=t.getUint8(3);if(a>=11)throw new Error(`Invalid extra bytes "type" value: ${a}`);if(0===a)return{name:r,description:o,length:s};const u=(c=s,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const l=function(e){switch(e){case 1:return n.Dimension.Type.uint8;case 2:return n.Dimension.Type.int8;case 3:return n.Dimension.Type.uint16;case 4:return n.Dimension.Type.int16;case 5:return n.Dimension.Type.uint32;case 6:return n.Dimension.Type.int32;case 7:return n.Dimension.Type.uint64;case 8:return n.Dimension.Type.int64;case 9:return n.Dimension.Type.float32;case 10:return n.Dimension.Type.float64}}(a);if(!l)throw new Error(`Failed to extract dimension type: ${a}`);const{type:d,size:f}=l;function p(e){switch(d){case"signed":return(0,n.parseBigInt)(t.getBigInt64(e,!0));case"unsigned":return(0,n.parseBigInt)((0,n.getBigUint64)(t,e,!0));case"float":return t.getFloat64(e,!0)}}const h={name:r,description:o,type:d,length:f};return u.hasNodata&&(h.nodata=p(40)),u.hasMin&&(h.min=p(64)),u.hasMax&&(h.max=p(88)),u.hasScale&&(h.scale=t.getFloat64(112)),u.hasOffset&&(h.offset=t.getFloat64(136)),h}},11677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extractor=void 0;const n=r(876);function i(e){const{scale:t,offset:r}=e,i=s(e);function o(e,t){return e.getUint8(i(t)+14)}function a(e,t){return e.getUint8(i(t)+15)}function u(e,t){return 31&a(e,t)}return{X:(e,o)=>n.Scale.unapply(e.getInt32(i(o),!0),t[0],r[0]),Y:(e,o)=>n.Scale.unapply(e.getInt32(i(o)+4,!0),t[1],r[1]),Z:(e,o)=>n.Scale.unapply(e.getInt32(i(o)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>7&o(e,t),NumberOfReturns:(e,t)=>(56&o(e,t))>>3,ScanDirectionFlag:(e,t)=>(64&o(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&o(e,t))>>7,Classification:(e,t)=>{const r=u(e,t);return 12===r?0:r},Synthetic:(e,t)=>(32&a(e,t))>>5,KeyPoint:(e,t)=>(64&a(e,t))>>6,Withheld:(e,t)=>(128&a(e,t))>>7,Overlap:(e,t)=>12===u(e,t)?1:0,ScanAngle:(e,t)=>e.getInt8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),PointSourceId:(e,t)=>e.getUint16(i(t)+18,!0)}}function o(e){const{scale:t,offset:r}=e,i=s(e);function o(e,t){return e.getUint8(i(t)+15)}return{X:(e,o)=>n.Scale.unapply(e.getInt32(i(o),!0),t[0],r[0]),Y:(e,o)=>n.Scale.unapply(e.getInt32(i(o)+4,!0),t[1],r[1]),Z:(e,o)=>n.Scale.unapply(e.getInt32(i(o)+8,!0),t[2],r[2]),Intensity:(e,t)=>e.getUint16(i(t)+12,!0),ReturnNumber:(e,t)=>15&e.getUint16(i(t)+14,!0),NumberOfReturns:(e,t)=>(240&e.getUint16(i(t)+14,!0))>>4,Synthetic:(e,t)=>1&o(e,t),KeyPoint:(e,t)=>(2&o(e,t))>>1,Withheld:(e,t)=>(4&o(e,t))>>2,Overlap:(e,t)=>(8&o(e,t))>>3,ScannerChannel:(e,t)=>(48&o(e,t))>>4,ScanDirectionFlag:(e,t)=>(64&o(e,t))>>6,EdgeOfFlightLine:(e,t)=>(128&o(e,t))>>7,Classification:(e,t)=>e.getUint8(i(t)+16),UserData:(e,t)=>e.getUint8(i(t)+17),ScanAngle:(e,t)=>.006*e.getInt16(i(t)+18,!0),PointSourceId:(e,t)=>e.getUint16(i(t)+20,!0),GpsTime:(e,t)=>e.getFloat64(i(t)+22,!0)}}function a(e){const t=s(e);return{...o(e),Red:(e,r)=>e.getUint16(t(r)+30,!0),Green:(e,r)=>e.getUint16(t(r)+32,!0),Blue:(e,r)=>e.getUint16(t(r)+34,!0)}}function s(e){const{pointDataRecordLength:t}=e;return function(e){return e*t}}t.Extractor={create:function(e,t=[]){const r=function(e,t){let r=function(e){switch(e){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${e}`)}}(e.pointDataRecordFormat);return t.reduce(((t,i)=>{const o=r;r+=i.length;const a=function(e,t,{type:r,length:i}){const o=s(e);switch(r){case"signed":switch(i){case 1:return(e,r)=>e.getInt8(o(r)+t);case 2:return(e,r)=>e.getInt16(o(r)+t,!0);case 4:return(e,r)=>e.getInt32(o(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)(e.getBigInt64(o(r)+t,!0))}case"unsigned":switch(i){case 1:return(e,r)=>e.getUint8(o(r)+t);case 2:return(e,r)=>e.getUint16(o(r)+t,!0);case 4:return(e,r)=>e.getUint32(o(r)+t,!0);case 8:return(e,r)=>(0,n.parseBigInt)((0,n.getBigUint64)(e,o(r)+t,!0))}case"float":switch(i){case 4:return(e,r)=>e.getFloat32(o(r)+t,!0);case 8:return(e,r)=>e.getFloat64(o(r)+t,!0)}}}(e,o,i);if(!a)return t;return{...t,[i.name]:(e,t)=>n.Scale.unapply(a(e,t),i.scale,i.offset)}}),{})}(e,t);return{...(()=>{const{pointDataRecordFormat:t}=e;switch(t){case 0:return i(e);case 1:return function(e){const t=s(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0)}}(e);case 2:return function(e){const t=s(e);return{...i(e),Red:(e,r)=>e.getUint16(t(r)+20,!0),Green:(e,r)=>e.getUint16(t(r)+22,!0),Blue:(e,r)=>e.getUint16(t(r)+24,!0)}}(e);case 3:return function(e){const t=s(e);return{...i(e),GpsTime:(e,r)=>e.getFloat64(t(r)+20,!0),Red:(e,r)=>e.getUint16(t(r)+28,!0),Green:(e,r)=>e.getUint16(t(r)+30,!0),Blue:(e,r)=>e.getUint16(t(r)+32,!0)}}(e);case 6:return o(e);case 7:return a(e);case 8:return function(e){const t=s(e);return{...a(e),Infrared:(e,r)=>e.getUint16(t(r)+36,!0)}}(e);default:throw new Error(`Unsupported point data record format: ${t}`)}})(),...r}}}},68916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const n=r(876),i=r(48300),o=r(47952);function a(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<120;e+=8)r.push((0,n.getBigUint64)(t,e,!0));return r.map((e=>(0,n.parseBigInt)(e)))}function s(e){const t=n.Binary.toDataView(e),r=[];for(let e=0;e<20;e+=4)r.push(t.getUint32(e,!0));return r}t.Header={parse:function(e){if(e.byteLength<i.minHeaderLength)throw new Error(`Invalid header: must be at least ${i.minHeaderLength} bytes`);const t=n.Binary.toDataView(e),r=n.Binary.toCString(e.slice(0,4));if("LASF"!==r)throw new Error(`Invalid file signature: ${r}`);const u=t.getUint8(24),c=t.getUint8(25);if(1!==u||2!==c&&4!==c)throw new Error(`Invalid version (only 1.2 and 1.4 supported): ${u}.${c}`);const l={fileSignature:r,fileSourceId:t.getUint16(4,!0),globalEncoding:t.getUint16(6,!0),projectId:(0,o.formatGuid)(e.slice(8,24)),majorVersion:u,minorVersion:c,systemIdentifier:n.Binary.toCString(e.slice(26,58)),generatingSoftware:n.Binary.toCString(e.slice(58,90)),fileCreationDayOfYear:t.getUint16(90,!0),fileCreationYear:t.getUint16(92,!0),headerLength:t.getUint16(94,!0),pointDataOffset:t.getUint32(96,!0),vlrCount:t.getUint32(100,!0),pointDataRecordFormat:15&t.getUint8(104),pointDataRecordLength:t.getUint16(105,!0),pointCount:t.getUint32(107,!0),pointCountByReturn:s(e.slice(111,131)),scale:(0,o.parsePoint)(e.slice(131,155)),offset:(0,o.parsePoint)(e.slice(155,179)),min:[t.getFloat64(187,!0),t.getFloat64(203,!0),t.getFloat64(219,!0)],max:[t.getFloat64(179,!0),t.getFloat64(195,!0),t.getFloat64(211,!0)],waveformDataOffset:0,evlrOffset:0,evlrCount:0};return 2==c?l:{...l,pointCount:(0,n.parseBigInt)((0,n.getBigUint64)(t,247,!0)),pointCountByReturn:a(e.slice(255,375)),waveformDataOffset:(0,n.parseBigInt)((0,n.getBigUint64)(t,227,!0)),evlrOffset:(0,n.parseBigInt)((0,n.getBigUint64)(t,235,!0)),evlrCount:t.getUint32(243,!0)}}}},30549:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Vlr=t.View=t.PointData=t.Header=t.Extractor=t.ExtraBytes=t.Dimensions=t.Constants=void 0,t.Constants=o(r(48300));var a=r(51652);Object.defineProperty(t,"Dimensions",{enumerable:!0,get:function(){return a.Dimensions}});var s=r(94553);Object.defineProperty(t,"ExtraBytes",{enumerable:!0,get:function(){return s.ExtraBytes}});var u=r(11677);Object.defineProperty(t,"Extractor",{enumerable:!0,get:function(){return u.Extractor}});var c=r(68916);Object.defineProperty(t,"Header",{enumerable:!0,get:function(){return c.Header}});var l=r(90380);Object.defineProperty(t,"PointData",{enumerable:!0,get:function(){return l.PointData}});var d=r(58148);Object.defineProperty(t,"View",{enumerable:!0,get:function(){return d.View}});var f=r(32101);Object.defineProperty(t,"Vlr",{enumerable:!0,get:function(){return f.Vlr}})},90380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompressFile=t.decompressChunk=t.PointData=void 0;const n=r(26977),i=r(68916);let o;async function a(e){return e||(o||(o=(0,n.createLazPerf)()),o)}async function s(e,{pointCount:t,pointDataRecordFormat:r,pointDataRecordLength:n},i){const o=await a(i),s=new Uint8Array(t*n),u=o._malloc(e.byteLength),c=o._malloc(n),l=new o.ChunkDecoder;try{o.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),u),l.open(r,n,u);for(let e=0;e<t;++e)l.getPoint(c),s.set(new Uint8Array(o.HEAPU8.buffer,c,n),e*n)}finally{o._free(u),o._free(c),l.delete()}return s}async function u(e,t){const r=await a(t),n=i.Header.parse(e),{pointCount:o,pointDataRecordLength:s}=n,u=new Uint8Array(o*s),c=r._malloc(e.byteLength),l=r._malloc(s),d=new r.LASZip;try{r.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),c),d.open(c,e.byteLength);for(let e=0;e<o;++e)d.getPoint(l),u.set(new Uint8Array(r.HEAPU8.buffer,l,s),e*s)}finally{d.delete()}return u}t.PointData={createLazPerf:n.createLazPerf,decompressChunk:s,decompressFile:u},t.decompressChunk=s,t.decompressFile=u},47952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatGuid=t.parsePoint=void 0;const n=r(876);t.parsePoint=function(e){const t=n.Binary.toDataView(e);if(24!==t.byteLength)throw new Error(`Invalid tuple buffer length: ${t.byteLength}`);return[t.getFloat64(0,!0),t.getFloat64(8,!0),t.getFloat64(16,!0)]},t.formatGuid=function(e){const t=n.Binary.toDataView(e);if(16!==t.byteLength)throw new Error(`Invalid GUID buffer length: ${t.byteLength}`);let r="";for(let e=0;e<t.byteLength;e+=4)r+=t.getUint32(e,!0).toString(16).padStart(8,"0");return[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,32)].join("-")}},58148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.View=void 0;const n=r(876),i=r(51652),o=r(11677);t.View={create:function(e,t,r=[],a){let s=o.Extractor.create(t,r);if(a){const e=new Set([...a]);s=Object.entries(s).reduce(((t,[r,n])=>(e.has(r)&&(t[r]=n),t)),{})}const u=i.Dimensions.create(s,r),c=n.Binary.toDataView(e),l=t.pointDataRecordLength;if(c.byteLength%l!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${l}`);const d=c.byteLength/t.pointDataRecordLength;return{pointCount:d,dimensions:u,getter:function(e){const t=s[e];if(!t)throw new Error(`No extractor for dimension: ${e}`);return function(e){if(e>=d)throw new RangeError(`View index (${e}) out of range: ${d}`);return t(c,e)}}}}}},32101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Vlr=void 0;const n=r(876),i=r(48300);function o(e,t,r){return e.find((e=>e.userId===t&&e.recordId===r))}function a(e,t){return(t?u:s)(e)}function s(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${i.vlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:t.getUint16(20,!0),description:n.Binary.toCString(e.slice(22,54)),isExtended:!1}}function u(e){const t=n.Binary.toDataView(e);if(t.byteLength!==i.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${i.evlrHeaderLength}): ${t.byteLength}`);return{userId:n.Binary.toCString(e.slice(2,18)),recordId:t.getUint16(18,!0),contentLength:(0,n.parseBigInt)((0,n.getBigUint64)(t,20,!0)),description:n.Binary.toCString(e.slice(28,60)),isExtended:!0}}async function c({get:e,startOffset:t,count:r,isExtended:n}){const o=[];let s=t;const u=n?i.evlrHeaderLength:i.vlrHeaderLength;for(let t=0;t<r;++t){const t=u?await e(s,s+u):new Uint8Array,{userId:r,recordId:i,contentLength:c,description:l}=a(t,n);o.push({userId:r,recordId:i,contentOffset:s+u,contentLength:c,description:l,isExtended:n}),s+=u+c}return o}t.Vlr={walk:async function(e,t){const r=n.Getter.create(e);return[...await c({get:r,startOffset:t.headerLength,count:t.vlrCount,isExtended:!1}),...await c({get:r,startOffset:t.evlrOffset,count:t.evlrCount,isExtended:!0})]},parse:a,find:o,at:function(e,t,r){const n=o(e,t,r);if(!n)throw new Error(`VLR not found: ${t}/${r}`);return n},fetch:function(e,{contentOffset:t,contentLength:r}){return 0===r?new Uint8Array:n.Getter.create(e)(t,t+r)}}},16882:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBigUint64=t.parseBigInt=void 0,t.parseBigInt=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(-Number.MAX_SAFE_INTEGER))throw new Error(`Cannot convert bigint to number: ${e}`);return Number(e)},t.getBigUint64=function(e,t,r){if(e.getBigUint64)return e.getBigUint64(t,r);const[n,i]=r?[4,0]:[0,4],o=BigInt(e.getUint32(t+n,r)),a=BigInt(e.getUint32(t+i,r));return(o<<BigInt(32))+a}},33359:(e,t)=>{"use strict";function r(e){return new DataView(e.buffer,e.byteOffset,e.length)}function n(e){const t=r(e);let n="";for(let e=0;e<t.byteLength;++e){const r=t.getInt8(e);if(0===r)return n;n+=String.fromCharCode(r)}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.toCString=t.toDataView=t.Binary=void 0,t.Binary={toDataView:r,toCString:n},t.toDataView=r,t.toCString=n},19459:(e,t)=>{"use strict";function r([e,t,r,n,i,o]){return[e+(n-e)/2,t+(i-t)/2,r+(o-r)/2]}function n(e){return e[3]-e[0]}function i(e){return e[4]-e[1]}function o(e){return e[5]-e[2]}function a(e,[t,n,i]){const[o,a,s,u,c,l]=e,[d,f,p]=r(e);return[t?d:o,n?f:a,i?p:s,t?u:d,n?c:f,i?l:p]}Object.defineProperty(t,"__esModule",{value:!0}),t.Bounds=void 0,t.Bounds={min:function(e){return[e[0],e[1],e[2]]},max:function(e){return[e[3],e[4],e[5]]},mid:r,width:n,depth:i,height:o,cube:function(e){const t=r(e),a=Math.max(n(e),i(e),o(e))/2;return[t[0]-a,t[1]-a,t[2]-a,t[0]+a,t[1]+a,t[2]+a]},step:a,stepTo:function(e,[t,r,n,i]){for(let o=t-1;o>=0;--o)e=a(e,[r>>o&1,n>>o&1,i>>o&1]);return e},intersection:function(e,t){return[Math.max(e[0],t[0]),Math.max(e[1],t[1]),Math.max(e[2],t[2]),Math.min(e[3],t[3]),Math.min(e[4],t[4]),Math.min(e[5],t[5])]}}},44324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dimension=void 0,t.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:e,size:t}){switch(e){case"signed":switch(t){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(t){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(t){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${e}/${t}`)}}},27201:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Getter=void 0;const s=a(r(74945));function u(e){return async function(t,r){if(t<0||r<0||t>r)throw new Error("Invalid range");const n=await(0,s.default)(e,{headers:{Range:`bytes=${t}-${r-1}`}}),i=await n.arrayBuffer();return new Uint8Array(i)}}function c(e){return async function(t,n){const i=await Promise.resolve().then((()=>o(r(10539))));return async function(t=0,r=1/0){if(t<0||r<0||t>r)throw new Error("Invalid range");return await i.promises.access(e),async function(e){return await new Promise(((t,r)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("error",r),e.on("end",(()=>t(Buffer.concat(n))))}))}(i.createReadStream(e,{start:t,end:r-1,autoClose:!0}))}(t,n)}}t.Getter={create:function(e){return"function"==typeof e?e:e.startsWith("http://")||e.startsWith("https://")?u(e):c(e)},http:u,file:c}},876:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Step=t.Scale=t.Key=t.Getter=t.Dimension=t.Bounds=t.Binary=void 0,i(r(16882),t);var o=r(33359);Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return o.Binary}});var a=r(19459);Object.defineProperty(t,"Bounds",{enumerable:!0,get:function(){return a.Bounds}});var s=r(44324);Object.defineProperty(t,"Dimension",{enumerable:!0,get:function(){return s.Dimension}});var u=r(27201);Object.defineProperty(t,"Getter",{enumerable:!0,get:function(){return u.Getter}});var c=r(54623);Object.defineProperty(t,"Key",{enumerable:!0,get:function(){return c.Key}});var l=r(66838);Object.defineProperty(t,"Scale",{enumerable:!0,get:function(){return l.Scale}});var d=r(95192);Object.defineProperty(t,"Step",{enumerable:!0,get:function(){return d.Step}})},54623:(e,t)=>{"use strict";function r(e){if("string"!=typeof e)return e;const[t,r,n,i,...o]=e.split("-").map((e=>parseInt(e,10))),a=[t,r,n,i];if(0!==o.length||a.some((e=>"number"!=typeof e||Number.isNaN(e))))throw new Error(`Invalid key: ${e}`);return a}Object.defineProperty(t,"__esModule",{value:!0}),t.Key=void 0,t.Key={create:function(e,t=0,n=0,i=0){return"number"!=typeof e?r(e):[e,t,n,i]},parse:r,toString:function(e){return"string"==typeof e?e:e.join("-")},step:function(e,[r,n,i]){const[o,a,s,u]=t.Key.create(e);return[o+1,2*a+r,2*s+n,2*u+i]},up:function(e,r=1){const[n,i,o,a]=t.Key.create(e);return[n-r,i>>r,o>>r,a>>r]},compare:function(e,t){for(let r=0;r<e.length;++r){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},depth:function(e){return e[0]}}},66838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scale=void 0,t.Scale={apply:(e,t=1,r=0)=>(e-r)/t,unapply:(e,t=1,r=0)=>e*t+r}},95192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Step=void 0,t.Step={fromIndex:function(e){if(e<0||e>=8)throw new Error(`Invalid step index: ${e}`);return[1&e?1:0,e>>1&1?1:0,e>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},74945:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),v.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];w.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function P(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}P.polyfill=!0,e.fetch||(e.fetch=P,e.Headers=f,e.Request=b,e.Response=w),t.Headers=f,t.Request=b,t.Response=w,t.fetch=P,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},95409:e=>{"use strict";e.exports=e=>!!e&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},26977:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LazPerf=t.create=t.createLazPerf=void 0;const i=n(r(67316));t.createLazPerf=i.default,t.create=i.default,t.LazPerf={create:i.default}},67316:e=>{var t,r=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var r,n,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,t){r=e,n=t})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>H("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>H("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var o=Object.assign({},i),a=[],s="./this.program";if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var u="";if("undefined"!=typeof document&&document.currentScript&&(u=document.currentScript.src),t&&(u=t),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var c,l,d,f=i.print||console.log.bind(console),p=i.printErr||console.warn.bind(console);function h(e,t){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get:function(){H("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function g(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}Object.assign(i,o),o=null,c="fetchSettings",Object.getOwnPropertyDescriptor(i,c)&&H("`Module."+c+"` was supplied but `"+c+"` not included in INCOMING_MODULE_JS_API"),i.arguments&&(a=i.arguments),h("arguments","arguments_"),i.thisProgram&&(s=i.thisProgram),h("thisProgram","thisProgram"),i.quit&&i.quit,h("quit","quit_"),m(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),m(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),m(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),m(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),m(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),m(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),m(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),m(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),m(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),h("read","read_"),h("readAsync","readAsync"),h("readBinary","readBinary"),h("setWindowTitle","setWindowTitle"),m(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),m(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),m(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(l=i.wasmBinary),h("wasmBinary","wasmBinary"),i.noExitRuntime,h("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&H("no native wasm support detected");var y=!1;function m(e,t){e||H("Assertion failed"+(t?": "+t:""))}var v,b,_,w,T,P,E,C,S,O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&O)return O.decode(e.subarray(t,i));for(var o="";t<i;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&Q("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|u<<6|63&e[t++]),a<65536)o+=String.fromCharCode(a);else{var c=a-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function D(e,t){return e?I(_,e,t):""}function F(e,t,r,n){if(!(n>0))return 0;for(var i=r,o=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=o)break;s>1114111&&Q("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-i}function M(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t}function A(e){v=e,i.HEAP8=b=new Int8Array(e),i.HEAP16=w=new Int16Array(e),i.HEAP32=P=new Int32Array(e),i.HEAPU8=_=new Uint8Array(e),i.HEAPU16=T=new Uint16Array(e),i.HEAPU32=E=new Uint32Array(e),i.HEAPF32=C=new Float32Array(e),i.HEAPF64=S=new Float64Array(e)}var L=65536;i.TOTAL_STACK&&m(L===i.TOTAL_STACK,"the stack size can no longer be determined at runtime");var U,R=i.INITIAL_MEMORY||262144;function k(){if(!y){var e=wt(),t=E[e>>2],r=E[e+4>>2];34821223==t&&2310721022==r||H("Stack overflow! Stack cookie has been overwritten at 0x"+e.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==E[0]&&H("Runtime error: The application has corrupted its heap memory area (address zero)!")}}h("INITIAL_MEMORY","INITIAL_MEMORY"),m(R>=L,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+R+"! (TOTAL_STACK="+L+")"),m("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),m(!i.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),m(262144==R,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var j=[],x=[],B=[],$=!1;m(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),m(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),m(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),m(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var W=0,z=null,N=null,V={};function H(e){i.onAbort&&i.onAbort(e),p(e="Aborted("+e+")"),y=!0;var t=new WebAssembly.RuntimeError(e);throw n(t),t}var G,Y,q={error:function(){H("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){q.error()},createDataFile:function(){q.error()},createPreloadedFile:function(){q.error()},createLazyFile:function(){q.error()},open:function(){q.error()},mkdev:function(){q.error()},registerDevice:function(){q.error()},analyzePath:function(){q.error()},loadFilesFromDB:function(){q.error()},ErrnoError:function(){q.error()}};function J(e){return e.startsWith("data:application/octet-stream;base64,")}function K(e,t){return function(){var r=e,n=t;return t||(n=i.asm),m($,"native function `"+r+"` called before runtime initialization"),n[e]||m(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function X(e){try{if(e==G&&l)return new Uint8Array(l);throw"both async and sync fetching of the wasm failed"}catch(e){H(e)}}function Z(e){for(;e.length>0;)e.shift()(i)}function Q(e){Q.shown||(Q.shown={}),Q.shown[e]||(Q.shown[e]=1,p(e))}function ee(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_refcount=function(e){P[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,b[this.ptr+12|0]=e},this.get_caught=function(){return 0!=b[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,b[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=b[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=P[this.ptr>>2];P[this.ptr>>2]=e+1},this.release_ref=function(){var e=P[this.ptr>>2];return P[this.ptr>>2]=e-1,m(e>0),1===e},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Tt(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function te(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}i.FS_createDataFile=q.createDataFile,i.FS_createPreloadedFile=q.createPreloadedFile,J(G="laz-perf.wasm")||(Y=G,G=i.locateFile?i.locateFile(Y,u):u+Y);var re=void 0;function ne(e){for(var t="",r=e;_[r];)t+=re[_[r++]];return t}var ie={},oe={},ae={};function se(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function ue(e,t){return e=se(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function ce(e,t){var r=ue(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var le=void 0;function de(e){throw new le(e)}var fe=void 0;function pe(e){throw new fe(e)}function he(e,t,r){function n(t){var n=r(t);n.length!==e.length&&pe("Mismatched type converter count");for(var i=0;i<e.length;++i)ge(e[i],n[i])}e.forEach((function(e){ae[e]=t}));var i=new Array(t.length),o=[],a=0;t.forEach(((e,t)=>{oe.hasOwnProperty(e)?i[t]=oe[e]:(o.push(e),ie.hasOwnProperty(e)||(ie[e]=[]),ie[e].push((()=>{i[t]=oe[e],++a===o.length&&n(i)})))})),0===o.length&&n(i)}function ge(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||de('type "'+n+'" must have a positive integer typeid pointer'),oe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;de("Cannot register type '"+n+"' twice")}if(oe[e]=t,delete ae[e],ie.hasOwnProperty(e)){var i=ie[e];delete ie[e],i.forEach((e=>e()))}}function ye(e){de(e.$$.ptrType.registeredClass.name+" instance already deleted")}var me=!1;function ve(e){}function be(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function _e(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=_e(e,t,r.baseClass);return null===n?null:r.downcast(n)}var we={};var Te=[];function Pe(){for(;Te.length;){var e=Te.pop();e.$$.deleteScheduled=!1,e.delete()}}var Ee=void 0;var Ce={};function Se(e,t){return t.ptrType&&t.ptr||pe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&pe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ie(Object.create(e,{$$:{value:t}}))}function Oe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=function(e,t){return t=function(e,t){for(void 0===t&&de("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Ce[t]}(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Se(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Se(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,a=this.registeredClass.getActualType(t),s=