Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/draco

Package Overview
Dependencies
Maintainers
9
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/draco - npm Package Compare versions

Comparing version 3.4.0 to 3.4.1

2

dist/dist.min.js

@@ -1,4 +0,4 @@

(()=>{var Xt=Object.create;var U=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ct=r=>U(r,"__esModule",{value:!0});var l=(r,t)=>()=>(r&&(t=r(r=0)),t);var dt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ee=(r,t)=>{ct(r);for(var e in t)U(r,e,{get:t[e],enumerable:!0})},re=(r,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zt(t))!te.call(r,o)&&o!=="default"&&U(r,o,{get:()=>t[o],enumerable:!(e=Jt(t,o))||e.enumerable});return r},oe=r=>re(ct(U(r!=null?Xt(Kt(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ae,q,ut=l(()=>{ae="beta",q=typeof __VERSION__!="undefined"?__VERSION__:ae;typeof __VERSION__=="undefined"&&console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.")});function lt(r,t){if(!r)throw new Error(t||"loaders.gl assertion failed.")}var mt=l(()=>{});var f,Ke,tr,pt,er,b,w,rr,yt,or,V=l(()=>{f={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},Ke=f.self||f.window||f.global||{},tr=f.window||f.self||f.global||{},pt=f.global||f.self||f.window||{},er=f.document||{},b=typeof process!="object"||String(process)!=="[object process]"||process.browser,w=typeof importScripts=="function",rr=typeof window!="undefined"&&typeof window.orientation!="undefined",yt=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),or=yt&&parseFloat(yt[1])||0});var ht=dt(()=>{});async function _(r,t=null,e={}){return t&&(r=ft(r,t,e)),Q[r]=Q[r]||se(r),await Q[r]}function ft(r,t,e){if(r.startsWith("http"))return r;let o=e.modules||{};return o[r]?o[r]:b?e.CDN?(lt(e.CDN.startsWith("http")),`${e.CDN}/${t}@${ie}/dist/libs/${r}`):w?`../src/libs/${r}`:`modules/${t}/src/libs/${r}`:`modules/${t}/dist/libs/${r}`}async function se(r){if(r.endsWith("wasm"))return await(await fetch(r)).arrayBuffer();if(!b)try{return O&&O.requireFromFile&&await O.requireFromFile(r)}catch{return null}if(w)return importScripts(r);let e=await(await fetch(r)).text();return ce(e,r)}function ce(r,t){if(!b)return O.requireFromString&&O.requireFromString(r,t);if(w)return eval.call(pt,r),null;let e=document.createElement("script");e.id=t;try{e.appendChild(document.createTextNode(r))}catch{e.text=r}return document.body.appendChild(e),null}var O,ne,ie,Q,bt=l(()=>{V();O=oe(ht());mt();ut();ne="beta",ie=typeof q!="undefined"?q:ne,Q={}});var v=l(()=>{V();bt()});var I,z=l(()=>{I=typeof __VERSION__!="undefined"?__VERSION__:"latest"});var de,Y,gt=l(()=>{v();z();de={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Y={name:"Draco",id:b?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:I,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:de}});function H(r){let t=1/0,e=1/0,o=1/0,a=-1/0,i=-1/0,s=-1/0,c=r.POSITION?r.POSITION.value:[],u=c&&c.length;for(let m=0;m<u;m+=3){let h=c[m],D=c[m+1],M=c[m+2];t=h<t?h:t,e=D<e?D:e,o=M<o?M:o,a=h>a?h:a,i=D>i?D:i,s=M>s?M:s}return[[t,e,o],[a,i,s]]}var At=l(()=>{});function Dt(r,t){if(!r)throw new Error(t||"loader assertion failed.")}var Mt=l(()=>{});function ue(r){let t={};for(let e of r)t[e.name]&&console.warn("Schema: duplicated field name",e.name,e),t[e.name]=!0}function _t(r,t){return new Map([...r||new Map,...t||new Map])}var y,It=l(()=>{Mt();y=class{constructor(t,e){Dt(Array.isArray(t)),ue(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){let e=Object.create(null);for(let a of t)e[a]=!0;let o=this.fields.filter(a=>e[a.name]);return new y(o,this.metadata)}selectAt(...t){let e=t.map(o=>this.fields[o]).filter(Boolean);return new y(e,this.metadata)}assign(t){let e,o=this.metadata;if(t instanceof y){let s=t;e=s.fields,o=_t(_t(new Map,this.metadata),s.metadata)}else e=t;let a=Object.create(null);for(let s of this.fields)a[s.name]=s;for(let s of e)a[s.name]=s;let i=Object.values(a);return new y(i,o)}}});var g,wt=l(()=>{g=class{constructor(t,e,o=!1,a=new Map){this.name=t,this.type=e,this.nullable=o,this.metadata=a}get typeId(){return this.type&&this.type.typeId}clone(){return new g(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}});var d,Ot=l(()=>{(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"})(d||(d={}))});var p,X,J,A,T,x,S,E,F,N,Tt,L,B,P,Z,K,le,tt,xt,et,rt,me,ot,R,at,St=l(()=>{Ot();p=class{static isNull(t){return t&&t.typeId===d.Null}static isInt(t){return t&&t.typeId===d.Int}static isFloat(t){return t&&t.typeId===d.Float}static isBinary(t){return t&&t.typeId===d.Binary}static isUtf8(t){return t&&t.typeId===d.Utf8}static isBool(t){return t&&t.typeId===d.Bool}static isDecimal(t){return t&&t.typeId===d.Decimal}static isDate(t){return t&&t.typeId===d.Date}static isTime(t){return t&&t.typeId===d.Time}static isTimestamp(t){return t&&t.typeId===d.Timestamp}static isInterval(t){return t&&t.typeId===d.Interval}static isList(t){return t&&t.typeId===d.List}static isStruct(t){return t&&t.typeId===d.Struct}static isUnion(t){return t&&t.typeId===d.Union}static isFixedSizeBinary(t){return t&&t.typeId===d.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===d.FixedSizeList}static isMap(t){return t&&t.typeId===d.Map}static isDictionary(t){return t&&t.typeId===d.Dictionary}get typeId(){return d.NONE}compareTo(t){return this===t}},X=class extends p{get typeId(){return d.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},J=class extends p{get typeId(){return d.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},A=class extends p{constructor(t,e){super();this.isSigned=t,this.bitWidth=e}get typeId(){return d.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},T=class extends A{constructor(){super(!0,8)}},x=class extends A{constructor(){super(!0,16)}},S=class extends A{constructor(){super(!0,32)}},E=class extends A{constructor(){super(!1,8)}},F=class extends A{constructor(){super(!1,16)}},N=class extends A{constructor(){super(!1,32)}},Tt={HALF:16,SINGLE:32,DOUBLE:64},L=class extends p{constructor(t){super();this.precision=t}get typeId(){return d.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}},B=class extends L{constructor(){super(Tt.SINGLE)}},P=class extends L{constructor(){super(Tt.DOUBLE)}},Z=class extends p{constructor(){super()}get typeId(){return d.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},K=class extends p{get typeId(){return d.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},le={DAY:0,MILLISECOND:1},tt=class extends p{constructor(t){super();this.unit=t}get typeId(){return d.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${le[this.unit]}>`}},xt={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},et=class extends p{constructor(t,e){super();this.unit=t,this.bitWidth=e}get typeId(){return d.Time}toString(){return`Time${this.bitWidth}<${xt[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}},rt=class extends p{constructor(t,e=null){super();this.unit=t,this.timezone=e}get typeId(){return d.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${xt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}},me={DAY_TIME:0,YEAR_MONTH:1},ot=class extends p{constructor(t){super();this.unit=t}get typeId(){return d.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${me[this.unit]}>`}},R=class extends p{constructor(t,e){super();this.listSize=t,this.children=[e]}get typeId(){return d.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},at=class extends p{constructor(t){super();this.children=t}get typeId(){return d.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}}});var W=l(()=>{It();wt();St()});function Et(r){switch(r.constructor){case Int8Array:return new T;case Uint8Array:return new E;case Int16Array:return new x;case Uint16Array:return new F;case Int32Array:return new S;case Uint32Array:return new N;case Float32Array:return new B;case Float64Array:return new P;default:throw new Error("array type not supported")}}var Ft=l(()=>{W()});function nt(r,t,e){let o=Et(t.value),a=e||Nt(t);return new g(r,new R(t.size,new g("value",o)),!1,a)}function Nt(r){let t=new Map;return"byteOffset"in r&&t.set("byteOffset",r.byteOffset.toString(10)),"byteStride"in r&&t.set("byteStride",r.byteStride.toString(10)),"normalized"in r&&t.set("normalized",r.normalized.toString()),t}var Lt=l(()=>{W();Ft()});var $=l(()=>{At();Lt();W()});function Bt(r,t,e){let o=Rt(t.metadata),a=[],i=Te(t.attributes);for(let s in r){let c=r[s],u=Pt(s,c,i[s]);a.push(u)}if(e){let s=Pt("indices",e);a.push(s)}return new y(a,o)}function Te(r){let t={};for(let e in r){let o=r[e];t[o.name||"undefined"]=o}return t}function Pt(r,t,e){let o=e?Rt(e.metadata):void 0;return nt(r,t,o)}function Rt(r){let t=new Map;for(let e in r)t.set(`${e}.string`,JSON.stringify(r[e]));return t}var Ct=l(()=>{$();$()});function Ee(r,t){switch(t){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function Fe(r){let t=r.size(),e=new Int32Array(t);for(let o=0;o<t;o++)e[o]=r.GetValue(o);return e}function Ne(r){let t=r.size(),e=new Int32Array(t);for(let o=0;o<t;o++)e[o]=r.GetValue(o);return e}var kt,xe,Se,G,Ut=l(()=>{$();Ct();kt={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},xe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Se=4,G=class{constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){let o=new this.draco.DecoderBuffer;o.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);let a=this.decoder.GetEncodedGeometryType(o),i=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(a){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(o,i);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(o,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!i.ptr){let M=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(M)}let c=this._getDracoLoaderData(i,a,e),u=this._getMeshData(i,c,e),m=H(u.attributes),h=Bt(u.attributes,c,u.indices);return{loader:"draco",loaderData:c,header:{vertexCount:i.num_points(),boundingBox:m},...u,schema:h}}finally{this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(t,e,o){let a=this._getTopLevelMetadata(t),i=this._getDracoAttributes(t,o);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:a,attributes:i}}_getDracoAttributes(t,e){let o={};for(let a=0;a<t.num_attributes();a++){let i=this.decoder.GetAttribute(t,a),s=this._getAttributeMetadata(t,a);o[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:a,metadata:s};let c=this._getQuantizationTransform(i,e);c&&(o[i.unique_id()].quantization_transform=c);let u=this._getOctahedronTransform(i,e);u&&(o[i.unique_id()].octahedron_transform=u)}return o}_getMeshData(t,e,o){let a=this._getMeshAttributes(e,t,o);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(o.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(t,e,o){let a={};for(let i of Object.values(t.attributes)){let s=this._deduceAttributeName(i,o);i.name=s;let{value:c,size:u}=this._getAttributeValues(e,i);a[s]={value:c,size:u,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return a}_getTriangleListIndices(t){let o=t.num_faces()*3,a=o*Se,i=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(t,a,i),new Uint32Array(this.draco.HEAPF32.buffer,i,o).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(t){let e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),Ne(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){let o=xe[e.data_type],a=e.num_components,s=t.num_points()*a,c=s*o.BYTES_PER_ELEMENT,u=Ee(this.draco,o),m,h=this.draco._malloc(c);try{let D=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,D,u,c,h),m=new o(this.draco.HEAPF32.buffer,h,s).slice()}finally{this.draco._free(h)}return{value:m,size:a}}_deduceAttributeName(t,e){let o=t.unique_id;for(let[s,c]of Object.entries(e.extraAttributes||{}))if(c===o)return s;let a=t.attribute_type;for(let s in kt)if(this.draco[s]===a)return kt[s];let i=e.attributeNameEntry||"name";return t.metadata[i]?t.metadata[i].string:`CUSTOM_ATTRIBUTE_${o}`}_getTopLevelMetadata(t){let e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){let o=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(o)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let e={},o=this.metadataQuerier.NumEntries(t);for(let a=0;a<o;a++){let i=this.metadataQuerier.GetEntryName(t,a);e[i]=this._getDracoMetadataField(t,i)}return e}_getDracoMetadataField(t,e){let o=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,o);let a=Fe(o);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:a}}finally{this.draco.destroy(o)}}_disableAttributeTransforms(t){let{quantizedAttributes:e=[],octahedronAttributes:o=[]}=t,a=[...e,...o];for(let i of a)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(t,e){let{quantizedAttributes:o=[]}=e,a=t.attribute_type();if(o.map(s=>this.decoder[s]).includes(a)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(c=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,e){let{octahedronAttributes:o=[]}=e,a=t.attribute_type();if(o.map(s=>this.decoder[s]).includes(a)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function vt(r){let t=r.modules||{};return t.draco3d?C=C||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):C=C||Ue(r),await C}async function zt(r){let t=r.modules||{};return t.draco3d?k=k||t.draco3d.createEncoderModule({}).then(e=>({draco:e})):k=k||ze(r),await k}async function Ue(r){let t,e;switch(r.draco&&r.draco.decoderType){case"js":t=await _(Pe,"draco",r);break;case"wasm":default:[t,e]=await Promise.all([await _(Re,"draco",r),await _(Ce,"draco",r)])}return t=t||globalThis.DracoDecoderModule,await ve(t,e)}function ve(r,t){let e={};return t&&(e.wasmBinary=t),new Promise(o=>{r({...e,onModuleLoaded:a=>o({draco:a})})})}async function ze(r){let t=await _(ke,"draco",r);return t=t||globalThis.DracoEncoderModule,new Promise(e=>{t({onModuleLoaded:o=>e({draco:o})})})}var Le,Be,it,Pe,Re,Ce,ke,C,k,st=l(()=>{v();Le="1.5.5",Be="1.4.1",it=`https://www.gstatic.com/draco/versioned/decoders/${Le}`,Pe=`${it}/draco_decoder.js`,Re=`${it}/draco_wasm_wrapper.js`,Ce=`${it}/draco_decoder.wasm`,ke=`https://raw.githubusercontent.com/google/draco/${Be}/javascript/draco_encoder.js`});function $t(r){let t=r.size(),e=new ArrayBuffer(t),o=new Int8Array(e);for(let a=0;a<t;++a)o[a]=r.GetValue(a);return e}function $e(r){return r.entries&&!r.hasOwnProperty("entries")?r.entries():Object.entries(r)}var Wt,We,j,Gt=l(()=>{Wt={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},We=()=>{},j=class{constructor(t){this.draco=t,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(t){t&&this.draco.destroy(t)}encodeSync(t,e={}){return this.log=We,this._setOptions(e),e.pointcloud?this._encodePointCloud(t,e):this._encodeMesh(t,e)}_getAttributesFromMesh(t){let e={...t,...t.attributes};return t.indices&&(e.indices=t.indices),e}_encodePointCloud(t,e){let o=new this.draco.PointCloud;e.metadata&&this._addGeometryMetadata(o,e.metadata);let a=this._getAttributesFromMesh(t);this._createDracoPointCloud(o,a,e);let i=new this.draco.DracoInt8Array;try{let s=this.dracoEncoder.EncodePointCloudToDracoBuffer(o,!1,i);if(!(s>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
(()=>{var Xt=Object.create;var U=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ct=r=>U(r,"__esModule",{value:!0});var l=(r,t)=>()=>(r&&(t=r(r=0)),t);var dt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ee=(r,t)=>{ct(r);for(var e in t)U(r,e,{get:t[e],enumerable:!0})},re=(r,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zt(t))!te.call(r,o)&&o!=="default"&&U(r,o,{get:()=>t[o],enumerable:!(e=Jt(t,o))||e.enumerable});return r},oe=r=>re(ct(U(r!=null?Xt(Kt(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ae,q,ut=l(()=>{ae="latest",q=typeof __VERSION__!="undefined"?__VERSION__:ae;typeof __VERSION__=="undefined"&&console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.")});function lt(r,t){if(!r)throw new Error(t||"loaders.gl assertion failed.")}var mt=l(()=>{});var f,Ke,tr,pt,er,b,w,rr,yt,or,V=l(()=>{f={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},Ke=f.self||f.window||f.global||{},tr=f.window||f.self||f.global||{},pt=f.global||f.self||f.window||{},er=f.document||{},b=typeof process!="object"||String(process)!=="[object process]"||process.browser,w=typeof importScripts=="function",rr=typeof window!="undefined"&&typeof window.orientation!="undefined",yt=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),or=yt&&parseFloat(yt[1])||0});var ht=dt(()=>{});async function _(r,t=null,e={}){return t&&(r=ft(r,t,e)),Q[r]=Q[r]||se(r),await Q[r]}function ft(r,t,e){if(r.startsWith("http"))return r;let o=e.modules||{};return o[r]?o[r]:b?e.CDN?(lt(e.CDN.startsWith("http")),`${e.CDN}/${t}@${ie}/dist/libs/${r}`):w?`../src/libs/${r}`:`modules/${t}/src/libs/${r}`:`modules/${t}/dist/libs/${r}`}async function se(r){if(r.endsWith("wasm"))return await(await fetch(r)).arrayBuffer();if(!b)try{return O&&O.requireFromFile&&await O.requireFromFile(r)}catch{return null}if(w)return importScripts(r);let e=await(await fetch(r)).text();return ce(e,r)}function ce(r,t){if(!b)return O.requireFromString&&O.requireFromString(r,t);if(w)return eval.call(pt,r),null;let e=document.createElement("script");e.id=t;try{e.appendChild(document.createTextNode(r))}catch{e.text=r}return document.body.appendChild(e),null}var O,ne,ie,Q,bt=l(()=>{V();O=oe(ht());mt();ut();ne="latest",ie=typeof q!="undefined"?q:ne,Q={}});var v=l(()=>{V();bt()});var I,z=l(()=>{I=typeof __VERSION__!="undefined"?__VERSION__:"latest"});var de,Y,gt=l(()=>{v();z();de={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Y={name:"Draco",id:b?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:I,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:de}});function H(r){let t=1/0,e=1/0,o=1/0,a=-1/0,i=-1/0,s=-1/0,c=r.POSITION?r.POSITION.value:[],u=c&&c.length;for(let m=0;m<u;m+=3){let h=c[m],D=c[m+1],M=c[m+2];t=h<t?h:t,e=D<e?D:e,o=M<o?M:o,a=h>a?h:a,i=D>i?D:i,s=M>s?M:s}return[[t,e,o],[a,i,s]]}var At=l(()=>{});function Dt(r,t){if(!r)throw new Error(t||"loader assertion failed.")}var Mt=l(()=>{});function ue(r){let t={};for(let e of r)t[e.name]&&console.warn("Schema: duplicated field name",e.name,e),t[e.name]=!0}function _t(r,t){return new Map([...r||new Map,...t||new Map])}var y,It=l(()=>{Mt();y=class{constructor(t,e){Dt(Array.isArray(t)),ue(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){let e=Object.create(null);for(let a of t)e[a]=!0;let o=this.fields.filter(a=>e[a.name]);return new y(o,this.metadata)}selectAt(...t){let e=t.map(o=>this.fields[o]).filter(Boolean);return new y(e,this.metadata)}assign(t){let e,o=this.metadata;if(t instanceof y){let s=t;e=s.fields,o=_t(_t(new Map,this.metadata),s.metadata)}else e=t;let a=Object.create(null);for(let s of this.fields)a[s.name]=s;for(let s of e)a[s.name]=s;let i=Object.values(a);return new y(i,o)}}});var g,wt=l(()=>{g=class{constructor(t,e,o=!1,a=new Map){this.name=t,this.type=e,this.nullable=o,this.metadata=a}get typeId(){return this.type&&this.type.typeId}clone(){return new g(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}});var d,Ot=l(()=>{(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"})(d||(d={}))});var p,X,J,A,T,x,S,E,F,N,Tt,L,B,P,Z,K,le,tt,xt,et,rt,me,ot,R,at,St=l(()=>{Ot();p=class{static isNull(t){return t&&t.typeId===d.Null}static isInt(t){return t&&t.typeId===d.Int}static isFloat(t){return t&&t.typeId===d.Float}static isBinary(t){return t&&t.typeId===d.Binary}static isUtf8(t){return t&&t.typeId===d.Utf8}static isBool(t){return t&&t.typeId===d.Bool}static isDecimal(t){return t&&t.typeId===d.Decimal}static isDate(t){return t&&t.typeId===d.Date}static isTime(t){return t&&t.typeId===d.Time}static isTimestamp(t){return t&&t.typeId===d.Timestamp}static isInterval(t){return t&&t.typeId===d.Interval}static isList(t){return t&&t.typeId===d.List}static isStruct(t){return t&&t.typeId===d.Struct}static isUnion(t){return t&&t.typeId===d.Union}static isFixedSizeBinary(t){return t&&t.typeId===d.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===d.FixedSizeList}static isMap(t){return t&&t.typeId===d.Map}static isDictionary(t){return t&&t.typeId===d.Dictionary}get typeId(){return d.NONE}compareTo(t){return this===t}},X=class extends p{get typeId(){return d.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},J=class extends p{get typeId(){return d.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},A=class extends p{constructor(t,e){super();this.isSigned=t,this.bitWidth=e}get typeId(){return d.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},T=class extends A{constructor(){super(!0,8)}},x=class extends A{constructor(){super(!0,16)}},S=class extends A{constructor(){super(!0,32)}},E=class extends A{constructor(){super(!1,8)}},F=class extends A{constructor(){super(!1,16)}},N=class extends A{constructor(){super(!1,32)}},Tt={HALF:16,SINGLE:32,DOUBLE:64},L=class extends p{constructor(t){super();this.precision=t}get typeId(){return d.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}},B=class extends L{constructor(){super(Tt.SINGLE)}},P=class extends L{constructor(){super(Tt.DOUBLE)}},Z=class extends p{constructor(){super()}get typeId(){return d.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},K=class extends p{get typeId(){return d.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},le={DAY:0,MILLISECOND:1},tt=class extends p{constructor(t){super();this.unit=t}get typeId(){return d.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${le[this.unit]}>`}},xt={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},et=class extends p{constructor(t,e){super();this.unit=t,this.bitWidth=e}get typeId(){return d.Time}toString(){return`Time${this.bitWidth}<${xt[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}},rt=class extends p{constructor(t,e=null){super();this.unit=t,this.timezone=e}get typeId(){return d.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${xt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}},me={DAY_TIME:0,YEAR_MONTH:1},ot=class extends p{constructor(t){super();this.unit=t}get typeId(){return d.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${me[this.unit]}>`}},R=class extends p{constructor(t,e){super();this.listSize=t,this.children=[e]}get typeId(){return d.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},at=class extends p{constructor(t){super();this.children=t}get typeId(){return d.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}}});var W=l(()=>{It();wt();St()});function Et(r){switch(r.constructor){case Int8Array:return new T;case Uint8Array:return new E;case Int16Array:return new x;case Uint16Array:return new F;case Int32Array:return new S;case Uint32Array:return new N;case Float32Array:return new B;case Float64Array:return new P;default:throw new Error("array type not supported")}}var Ft=l(()=>{W()});function nt(r,t,e){let o=Et(t.value),a=e||Nt(t);return new g(r,new R(t.size,new g("value",o)),!1,a)}function Nt(r){let t=new Map;return"byteOffset"in r&&t.set("byteOffset",r.byteOffset.toString(10)),"byteStride"in r&&t.set("byteStride",r.byteStride.toString(10)),"normalized"in r&&t.set("normalized",r.normalized.toString()),t}var Lt=l(()=>{W();Ft()});var $=l(()=>{At();Lt();W()});function Bt(r,t,e){let o=Rt(t.metadata),a=[],i=Te(t.attributes);for(let s in r){let c=r[s],u=Pt(s,c,i[s]);a.push(u)}if(e){let s=Pt("indices",e);a.push(s)}return new y(a,o)}function Te(r){let t={};for(let e in r){let o=r[e];t[o.name||"undefined"]=o}return t}function Pt(r,t,e){let o=e?Rt(e.metadata):void 0;return nt(r,t,o)}function Rt(r){let t=new Map;for(let e in r)t.set(`${e}.string`,JSON.stringify(r[e]));return t}var Ct=l(()=>{$();$()});function Ee(r,t){switch(t){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function Fe(r){let t=r.size(),e=new Int32Array(t);for(let o=0;o<t;o++)e[o]=r.GetValue(o);return e}function Ne(r){let t=r.size(),e=new Int32Array(t);for(let o=0;o<t;o++)e[o]=r.GetValue(o);return e}var kt,xe,Se,G,Ut=l(()=>{$();Ct();kt={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},xe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Se=4,G=class{constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){let o=new this.draco.DecoderBuffer;o.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);let a=this.decoder.GetEncodedGeometryType(o),i=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(a){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(o,i);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(o,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!i.ptr){let M=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(M)}let c=this._getDracoLoaderData(i,a,e),u=this._getMeshData(i,c,e),m=H(u.attributes),h=Bt(u.attributes,c,u.indices);return{loader:"draco",loaderData:c,header:{vertexCount:i.num_points(),boundingBox:m},...u,schema:h}}finally{this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(t,e,o){let a=this._getTopLevelMetadata(t),i=this._getDracoAttributes(t,o);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:a,attributes:i}}_getDracoAttributes(t,e){let o={};for(let a=0;a<t.num_attributes();a++){let i=this.decoder.GetAttribute(t,a),s=this._getAttributeMetadata(t,a);o[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:a,metadata:s};let c=this._getQuantizationTransform(i,e);c&&(o[i.unique_id()].quantization_transform=c);let u=this._getOctahedronTransform(i,e);u&&(o[i.unique_id()].octahedron_transform=u)}return o}_getMeshData(t,e,o){let a=this._getMeshAttributes(e,t,o);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(o.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(t,e,o){let a={};for(let i of Object.values(t.attributes)){let s=this._deduceAttributeName(i,o);i.name=s;let{value:c,size:u}=this._getAttributeValues(e,i);a[s]={value:c,size:u,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return a}_getTriangleListIndices(t){let o=t.num_faces()*3,a=o*Se,i=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(t,a,i),new Uint32Array(this.draco.HEAPF32.buffer,i,o).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(t){let e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),Ne(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){let o=xe[e.data_type],a=e.num_components,s=t.num_points()*a,c=s*o.BYTES_PER_ELEMENT,u=Ee(this.draco,o),m,h=this.draco._malloc(c);try{let D=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,D,u,c,h),m=new o(this.draco.HEAPF32.buffer,h,s).slice()}finally{this.draco._free(h)}return{value:m,size:a}}_deduceAttributeName(t,e){let o=t.unique_id;for(let[s,c]of Object.entries(e.extraAttributes||{}))if(c===o)return s;let a=t.attribute_type;for(let s in kt)if(this.draco[s]===a)return kt[s];let i=e.attributeNameEntry||"name";return t.metadata[i]?t.metadata[i].string:`CUSTOM_ATTRIBUTE_${o}`}_getTopLevelMetadata(t){let e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){let o=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(o)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let e={},o=this.metadataQuerier.NumEntries(t);for(let a=0;a<o;a++){let i=this.metadataQuerier.GetEntryName(t,a);e[i]=this._getDracoMetadataField(t,i)}return e}_getDracoMetadataField(t,e){let o=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,o);let a=Fe(o);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:a}}finally{this.draco.destroy(o)}}_disableAttributeTransforms(t){let{quantizedAttributes:e=[],octahedronAttributes:o=[]}=t,a=[...e,...o];for(let i of a)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(t,e){let{quantizedAttributes:o=[]}=e,a=t.attribute_type();if(o.map(s=>this.decoder[s]).includes(a)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(c=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,e){let{octahedronAttributes:o=[]}=e,a=t.attribute_type();if(o.map(s=>this.decoder[s]).includes(a)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function vt(r){let t=r.modules||{};return t.draco3d?C=C||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):C=C||Ue(r),await C}async function zt(r){let t=r.modules||{};return t.draco3d?k=k||t.draco3d.createEncoderModule({}).then(e=>({draco:e})):k=k||ze(r),await k}async function Ue(r){let t,e;switch(r.draco&&r.draco.decoderType){case"js":t=await _(Pe,"draco",r);break;case"wasm":default:[t,e]=await Promise.all([await _(Re,"draco",r),await _(Ce,"draco",r)])}return t=t||globalThis.DracoDecoderModule,await ve(t,e)}function ve(r,t){let e={};return t&&(e.wasmBinary=t),new Promise(o=>{r({...e,onModuleLoaded:a=>o({draco:a})})})}async function ze(r){let t=await _(ke,"draco",r);return t=t||globalThis.DracoEncoderModule,new Promise(e=>{t({onModuleLoaded:o=>e({draco:o})})})}var Le,Be,it,Pe,Re,Ce,ke,C,k,st=l(()=>{v();Le="1.5.5",Be="1.4.1",it=`https://www.gstatic.com/draco/versioned/decoders/${Le}`,Pe=`${it}/draco_decoder.js`,Re=`${it}/draco_wasm_wrapper.js`,Ce=`${it}/draco_decoder.wasm`,ke=`https://raw.githubusercontent.com/google/draco/${Be}/javascript/draco_encoder.js`});function $t(r){let t=r.size(),e=new ArrayBuffer(t),o=new Int8Array(e);for(let a=0;a<t;++a)o[a]=r.GetValue(a);return e}function $e(r){return r.entries&&!r.hasOwnProperty("entries")?r.entries():Object.entries(r)}var Wt,We,j,Gt=l(()=>{Wt={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},We=()=>{},j=class{constructor(t){this.draco=t,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(t){t&&this.draco.destroy(t)}encodeSync(t,e={}){return this.log=We,this._setOptions(e),e.pointcloud?this._encodePointCloud(t,e):this._encodeMesh(t,e)}_getAttributesFromMesh(t){let e={...t,...t.attributes};return t.indices&&(e.indices=t.indices),e}_encodePointCloud(t,e){let o=new this.draco.PointCloud;e.metadata&&this._addGeometryMetadata(o,e.metadata);let a=this._getAttributesFromMesh(t);this._createDracoPointCloud(o,a,e);let i=new this.draco.DracoInt8Array;try{let s=this.dracoEncoder.EncodePointCloudToDracoBuffer(o,!1,i);if(!(s>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
with ${o.num_attributes()} attributes into ${s} bytes`),$t(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(o)}}_encodeMesh(t,e){let o=new this.draco.Mesh;e.metadata&&this._addGeometryMetadata(o,e.metadata);let a=this._getAttributesFromMesh(t);this._createDracoMesh(o,a,e);let i=new this.draco.DracoInt8Array;try{let s=this.dracoEncoder.EncodeMeshToDracoBuffer(o,i);if(s<=0)throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
with ${o.num_attributes()} attributes into ${s} bytes`),$t(i)}finally{this.destroyEncodedObject(i),this.destroyEncodedObject(o)}}_setOptions(t){if("speed"in t&&this.dracoEncoder.SetSpeedOptions(...t.speed),"method"in t){let e=this.draco[t.method||"MESH_SEQUENTIAL_ENCODING"];this.dracoEncoder.SetEncodingMethod(e)}if("quantization"in t)for(let e in t.quantization){let o=t.quantization[e],a=this.draco[e];this.dracoEncoder.SetAttributeQuantization(a,o)}}_createDracoMesh(t,e,o){let a=o.attributesMetadata||{};try{let i=this._getPositionAttribute(e);if(!i)throw new Error("positions");let s=i.length/3;for(let c in e){let u=e[c];c=Wt[c]||c;let m=this._addAttributeToMesh(t,c,u,s);m!==-1&&this._addAttributeMetadata(t,m,{name:c,...a[c]||{}})}}catch(i){throw this.destroyEncodedObject(t),i}return t}_createDracoPointCloud(t,e,o){let a=o.attributesMetadata||{};try{let i=this._getPositionAttribute(e);if(!i)throw new Error("positions");let s=i.length/3;for(let c in e){let u=e[c];c=Wt[c]||c;let m=this._addAttributeToMesh(t,c,u,s);m!==-1&&this._addAttributeMetadata(t,m,{name:c,...a[c]||{}})}}catch(i){throw this.destroyEncodedObject(t),i}return t}_addAttributeToMesh(t,e,o,a){if(!ArrayBuffer.isView(o))return-1;let i=this._getDracoAttributeType(e),s=o.length/a;if(i==="indices"){let m=o.length/3;return this.log(`Adding attribute ${e}, size ${m}`),this.dracoMeshBuilder.AddFacesToMesh(t,m,o),-1}this.log(`Adding attribute ${e}, size ${s}`);let c=this.dracoMeshBuilder,{buffer:u}=o;switch(o.constructor){case Int8Array:return c.AddInt8Attribute(t,i,a,s,new Int8Array(u));case Int16Array:return c.AddInt16Attribute(t,i,a,s,new Int16Array(u));case Int32Array:return c.AddInt32Attribute(t,i,a,s,new Int32Array(u));case Uint8Array:case Uint8ClampedArray:return c.AddUInt8Attribute(t,i,a,s,new Uint8Array(u));case Uint16Array:return c.AddUInt16Attribute(t,i,a,s,new Uint16Array(u));case Uint32Array:return c.AddUInt32Attribute(t,i,a,s,new Uint32Array(u));case Float32Array:default:return c.AddFloatAttribute(t,i,a,s,new Float32Array(u))}}_getDracoAttributeType(t){switch(t.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(t){for(let e in t){let o=t[e];if(this._getDracoAttributeType(e)===this.draco.POSITION)return o}return null}_addGeometryMetadata(t,e){let o=new this.draco.Metadata;this._populateDracoMetadata(o,e),this.dracoMeshBuilder.AddMetadata(t,o)}_addAttributeMetadata(t,e,o){let a=new this.draco.Metadata;this._populateDracoMetadata(a,o),this.dracoMeshBuilder.SetMetadataForAttribute(t,e,a)}_populateDracoMetadata(t,e){for(let[o,a]of $e(e))switch(typeof a){case"number":Math.trunc(a)===a?this.dracoMetadataBuilder.AddIntEntry(t,o,a):this.dracoMetadataBuilder.AddDoubleEntry(t,o,a);break;case"object":a instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(t,o,a,a.length);break;case"string":default:this.dracoMetadataBuilder.AddStringEntry(t,o,a)}}}});async function je(r,t={}){let{draco:e}=await zt(t),o=new j(e);try{return o.encodeSync(r,t.draco)}finally{o.destroy()}}var Ge,jt,qt=l(()=>{Gt();st();z();Ge={pointcloud:!1,attributeNameEntry:"name"},jt={name:"DRACO",id:"draco",module:"draco",version:I,extensions:["drc"],encode:je,options:{draco:Ge}}});var Qt={};ee(Qt,{DracoLoader:()=>Vt,DracoWorkerLoader:()=>Y,DracoWriter:()=>jt,DracoWriterWorker:()=>qe,_TypecheckDracoLoader:()=>Qe});async function Ve(r,t){let{draco:e}=await vt(t),o=new G(e);try{return o.parseSync(r,t?.draco)}finally{o.destroy()}}var qe,Vt,Qe,Yt=l(()=>{gt();Ut();st();z();v();qt();qe={id:b?"draco-writer":"draco-writer-nodejs",name:"Draco compressed geometry writer",module:"draco",version:I,worker:!0,options:{draco:{},source:null}},Vt={...Y,parse:Ve};Qe=Vt});var He=dt((uo,Ht)=>{var Ye=(Yt(),Qt);globalThis.loaders=globalThis.loaders||{};Ht.exports=Object.assign(globalThis.loaders,Ye)});He();})();
//# sourceMappingURL=dist.min.js.map

@@ -1,2 +0,2 @@

(()=>{var we=Object.create;var C=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var Se=t=>C(t,"__esModule",{value:!0});var Oe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ee=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Me(e))!_e.call(t,o)&&o!=="default"&&C(t,o,{get:()=>e[o],enumerable:!(r=Ie(e,o))||r.enumerable});return t},Le=t=>Ee(Se(C(t!=null?we(Te(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var se=Oe(()=>{});var W="3.4.0";function re(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var g={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},At=g.self||g.window||g.global||{},Dt=g.window||g.self||g.global||{},oe=g.global||g.self||g.window||{},xt=g.document||{};var D=typeof process!="object"||String(process)!=="[object process]"||process.browser,I=typeof importScripts=="function",wt=typeof window!="undefined"&&typeof window.orientation!="undefined",ae=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),It=ae&&parseFloat(ae[1])||0;function U(t,e=!0,r){let o=r||new Set;if(t){if(ne(t))o.add(t);else if(ne(t.buffer))o.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let n in t)U(t[n],e,o)}}return r===void 0?Array.from(o):[]}function ne(t){return t?t instanceof ArrayBuffer||typeof MessagePort!="undefined"&&t instanceof MessagePort||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas:!1}function x(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var z=new Map,m=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(x())}static set onmessage(e){function r(n){let s=x(),{type:i,payload:l}=s?n:n.data;e(i,l)}let o=x();o?(o.on("message",r),o.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r}static addEventListener(e){let r=z.get(e);r||(r=n=>{if(!Fe(n))return;let s=x(),{type:i,payload:l}=s?n:n.data;e(i,l)}),x()?console.error("not implemented"):globalThis.addEventListener("message",r)}static removeEventListener(e){let r=z.get(e);z.delete(e),x()?console.error("not implemented"):globalThis.removeEventListener("message",r)}static postMessage(e,r){let o={source:"loaders.gl",type:e,payload:r},n=U(r),s=x();s?s.postMessage(o,n):globalThis.postMessage(o,n)}};function Fe(t){let{type:e,data:r}=t;return e==="message"&&r&&typeof r.source=="string"&&r.source.startsWith("loaders.gl")}var M=Le(se());var Ne="beta",Pe=typeof W!="undefined"?W:Ne,V={};async function T(t,e=null,r={}){return e&&(t=ie(t,e,r)),V[t]=V[t]||ke(t),await V[t]}function ie(t,e,r){if(t.startsWith("http"))return t;let o=r.modules||{};return o[t]?o[t]:D?r.CDN?(re(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Pe}/dist/libs/${t}`):I?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}async function ke(t){if(t.endsWith("wasm"))return await(await fetch(t)).arrayBuffer();if(!D)try{return M&&M.requireFromFile&&await M.requireFromFile(t)}catch{return null}if(I)return importScripts(t);let r=await(await fetch(t)).text();return Be(r,t)}function Be(t,e){if(!D)return M.requireFromString&&M.requireFromString(t,e);if(I)return eval.call(oe,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}var Re=0;function $(t){!m.inWorkerThread()||(m.onmessage=async(e,r)=>{switch(e){case"process":try{let{input:o,options:n={},context:s={}}=r,i=await Ce({loader:t,arrayBuffer:o,options:n,context:{...s,parse:ve}});m.postMessage("done",{result:i})}catch(o){let n=o instanceof Error?o.message:"";m.postMessage("error",{error:n})}break;default:}})}function ve(t,e){return new Promise((r,o)=>{let n=Re++,s=(l,d)=>{if(d.id===n)switch(l){case"done":m.removeEventListener(s),r(d.result);break;case"error":m.removeEventListener(s),o(d.error);break;default:}};m.addEventListener(s);let i={id:n,input:t,options:e};m.postMessage("process",i)})}async function Ce({loader:t,arrayBuffer:e,options:r,context:o}){let n,s;if(t.parseSync||t.parse)n=e,s=t.parseSync||t.parse;else if(t.parseTextSync)n=new TextDecoder().decode(e),s=t.parseTextSync;else throw new Error(`Could not load data with ${t.name} loader`);return r={...r,modules:t&&t.options&&t.options.modules||{},worker:!1},await s(n,{...r},o,t)}var ce="3.4.0";var We={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},le={name:"Draco",id:D?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:ce,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:We};function q(t){let e=1/0,r=1/0,o=1/0,n=-1/0,s=-1/0,i=-1/0,l=t.POSITION?t.POSITION.value:[],d=l&&l.length;for(let f=0;f<d;f+=3){let y=l[f],A=l[f+1],w=l[f+2];e=y<e?y:e,r=A<r?A:r,o=w<o?w:o,n=y>n?y:n,s=A>s?A:s,i=w>i?w:i}return[[e,r,o],[n,s,i]]}function de(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var p=class{constructor(e,r){de(Array.isArray(e)),Ue(e),this.fields=e,this.metadata=r||new Map}compareTo(e){if(this.metadata!==e.metadata||this.fields.length!==e.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(e.fields[r]))return!1;return!0}select(...e){let r=Object.create(null);for(let n of e)r[n]=!0;let o=this.fields.filter(n=>r[n.name]);return new p(o,this.metadata)}selectAt(...e){let r=e.map(o=>this.fields[o]).filter(Boolean);return new p(r,this.metadata)}assign(e){let r,o=this.metadata;if(e instanceof p){let i=e;r=i.fields,o=ue(ue(new Map,this.metadata),i.metadata)}else r=e;let n=Object.create(null);for(let i of this.fields)n[i.name]=i;for(let i of r)n[i.name]=i;let s=Object.values(n);return new p(s,o)}};function Ue(t){let e={};for(let r of t)e[r.name]&&console.warn("Schema: duplicated field name",r.name,r),e[r.name]=!0}function ue(t,e){return new Map([...t||new Map,...e||new Map])}var b=class{constructor(e,r,o=!1,n=new Map){this.name=e,this.type=r,this.nullable=o,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new b(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}};var c;(function(a){a[a.NONE=0]="NONE",a[a.Null=1]="Null",a[a.Int=2]="Int",a[a.Float=3]="Float",a[a.Binary=4]="Binary",a[a.Utf8=5]="Utf8",a[a.Bool=6]="Bool",a[a.Decimal=7]="Decimal",a[a.Date=8]="Date",a[a.Time=9]="Time",a[a.Timestamp=10]="Timestamp",a[a.Interval=11]="Interval",a[a.List=12]="List",a[a.Struct=13]="Struct",a[a.Union=14]="Union",a[a.FixedSizeBinary=15]="FixedSizeBinary",a[a.FixedSizeList=16]="FixedSizeList",a[a.Map=17]="Map",a[a.Dictionary=-1]="Dictionary",a[a.Int8=-2]="Int8",a[a.Int16=-3]="Int16",a[a.Int32=-4]="Int32",a[a.Int64=-5]="Int64",a[a.Uint8=-6]="Uint8",a[a.Uint16=-7]="Uint16",a[a.Uint32=-8]="Uint32",a[a.Uint64=-9]="Uint64",a[a.Float16=-10]="Float16",a[a.Float32=-11]="Float32",a[a.Float64=-12]="Float64",a[a.DateDay=-13]="DateDay",a[a.DateMillisecond=-14]="DateMillisecond",a[a.TimestampSecond=-15]="TimestampSecond",a[a.TimestampMillisecond=-16]="TimestampMillisecond",a[a.TimestampMicrosecond=-17]="TimestampMicrosecond",a[a.TimestampNanosecond=-18]="TimestampNanosecond",a[a.TimeSecond=-19]="TimeSecond",a[a.TimeMillisecond=-20]="TimeMillisecond",a[a.TimeMicrosecond=-21]="TimeMicrosecond",a[a.TimeNanosecond=-22]="TimeNanosecond",a[a.DenseUnion=-23]="DenseUnion",a[a.SparseUnion=-24]="SparseUnion",a[a.IntervalDayTime=-25]="IntervalDayTime",a[a.IntervalYearMonth=-26]="IntervalYearMonth"})(c||(c={}));var u=class{static isNull(e){return e&&e.typeId===c.Null}static isInt(e){return e&&e.typeId===c.Int}static isFloat(e){return e&&e.typeId===c.Float}static isBinary(e){return e&&e.typeId===c.Binary}static isUtf8(e){return e&&e.typeId===c.Utf8}static isBool(e){return e&&e.typeId===c.Bool}static isDecimal(e){return e&&e.typeId===c.Decimal}static isDate(e){return e&&e.typeId===c.Date}static isTime(e){return e&&e.typeId===c.Time}static isTimestamp(e){return e&&e.typeId===c.Timestamp}static isInterval(e){return e&&e.typeId===c.Interval}static isList(e){return e&&e.typeId===c.List}static isStruct(e){return e&&e.typeId===c.Struct}static isUnion(e){return e&&e.typeId===c.Union}static isFixedSizeBinary(e){return e&&e.typeId===c.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===c.FixedSizeList}static isMap(e){return e&&e.typeId===c.Map}static isDictionary(e){return e&&e.typeId===c.Dictionary}get typeId(){return c.NONE}compareTo(e){return this===e}},G=class extends u{get typeId(){return c.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},Q=class extends u{get typeId(){return c.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},h=class extends u{constructor(e,r){super();this.isSigned=e,this.bitWidth=r}get typeId(){return c.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},_=class extends h{constructor(){super(!0,8)}},S=class extends h{constructor(){super(!0,16)}},O=class extends h{constructor(){super(!0,32)}};var E=class extends h{constructor(){super(!1,8)}},L=class extends h{constructor(){super(!1,16)}},F=class extends h{constructor(){super(!1,32)}};var me={HALF:16,SINGLE:32,DOUBLE:64},N=class extends u{constructor(e){super();this.precision=e}get typeId(){return c.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}};var P=class extends N{constructor(){super(me.SINGLE)}},k=class extends N{constructor(){super(me.DOUBLE)}},j=class extends u{constructor(){super()}get typeId(){return c.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},Y=class extends u{get typeId(){return c.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},ze={DAY:0,MILLISECOND:1},H=class extends u{constructor(e){super();this.unit=e}get typeId(){return c.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${ze[this.unit]}>`}};var pe={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},J=class extends u{constructor(e,r){super();this.unit=e,this.bitWidth=r}get typeId(){return c.Time}toString(){return`Time${this.bitWidth}<${pe[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}};var X=class extends u{constructor(e,r=null){super();this.unit=e,this.timezone=r}get typeId(){return c.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${pe[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};var Ve={DAY_TIME:0,YEAR_MONTH:1},Z=class extends u{constructor(e){super();this.unit=e}get typeId(){return c.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${Ve[this.unit]}>`}};var B=class extends u{constructor(e,r){super();this.listSize=e,this.children=[r]}get typeId(){return c.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},K=class extends u{constructor(e){super();this.children=e}get typeId(){return c.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function fe(t){switch(t.constructor){case Int8Array:return new _;case Uint8Array:return new E;case Int16Array:return new S;case Uint16Array:return new L;case Int32Array:return new O;case Uint32Array:return new F;case Float32Array:return new P;case Float64Array:return new k;default:throw new Error("array type not supported")}}function ee(t,e,r){let o=fe(e.value),n=r||ye(e);return new b(t,new B(e.size,new b("value",o)),!1,n)}function ye(t){let e=new Map;return"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10)),"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10)),"normalized"in t&&e.set("normalized",t.normalized.toString()),e}function ge(t,e,r){let o=he(e.metadata),n=[],s=rt(e.attributes);for(let i in t){let l=t[i],d=be(i,l,s[i]);n.push(d)}if(r){let i=be("indices",r);n.push(i)}return new p(n,o)}function rt(t){let e={};for(let r in t){let o=t[r];e[o.name||"undefined"]=o}return e}function be(t,e,r){let o=r?he(r.metadata):void 0;return ee(t,e,o)}function he(t){let e=new Map;for(let r in t)e.set(`${r}.string`,JSON.stringify(t[r]));return e}var Ae={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ot={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},at=4,v=class{constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let o=new this.draco.DecoderBuffer;o.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let n=this.decoder.GetEncodedGeometryType(o),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(n){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(o,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(o,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let w=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(w)}let l=this._getDracoLoaderData(s,n,r),d=this._getMeshData(s,l,r),f=q(d.attributes),y=ge(d.attributes,l,d.indices);return{loader:"draco",loaderData:l,header:{vertexCount:s.num_points(),boundingBox:f},...d,schema:y}}finally{this.draco.destroy(o),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,o){let n=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,o);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(e,r){let o={};for(let n=0;n<e.num_attributes();n++){let s=this.decoder.GetAttribute(e,n),i=this._getAttributeMetadata(e,n);o[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:i};let l=this._getQuantizationTransform(s,r);l&&(o[s.unique_id()].quantization_transform=l);let d=this._getOctahedronTransform(s,r);d&&(o[s.unique_id()].octahedron_transform=d)}return o}_getMeshData(e,r,o){let n=this._getMeshAttributes(r,e,o);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(o.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,r,o){let n={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,o);s.name=i;let{value:l,size:d}=this._getAttributeValues(r,s);n[i]={value:l,size:d,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(e){let o=e.num_faces()*3,n=o*at,s=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(e,n,s),new Uint32Array(this.draco.HEAPF32.buffer,s,o).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),it(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let o=ot[r.data_type],n=r.num_components,i=e.num_points()*n,l=i*o.BYTES_PER_ELEMENT,d=nt(this.draco,o),f,y=this.draco._malloc(l);try{let A=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,A,d,l,y),f=new o(this.draco.HEAPF32.buffer,y,i).slice()}finally{this.draco._free(y)}return{value:f,size:n}}_deduceAttributeName(e,r){let o=e.unique_id;for(let[i,l]of Object.entries(r.extraAttributes||{}))if(l===o)return i;let n=e.attribute_type;for(let i in Ae)if(this.draco[i]===n)return Ae[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${o}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let o=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(o)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},o=this.metadataQuerier.NumEntries(e);for(let n=0;n<o;n++){let s=this.metadataQuerier.GetEntryName(e,n);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let o=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,o);let n=st(o);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:n}}finally{this.draco.destroy(o)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:o=[]}=e,n=[...r,...o];for(let s of n)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:o=[]}=r,n=e.attribute_type();if(o.map(i=>this.decoder[i]).includes(n)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(l=>i.min_value(l))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:o=[]}=r,n=e.attribute_type();if(o.map(i=>this.decoder[i]).includes(n)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function nt(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function st(t){let e=t.size(),r=new Int32Array(e);for(let o=0;o<e;o++)r[o]=t.GetValue(o);return r}function it(t){let e=t.size(),r=new Int32Array(e);for(let o=0;o<e;o++)r[o]=t.GetValue(o);return r}var ct="1.5.5",lt="1.4.1",te=`https://www.gstatic.com/draco/versioned/decoders/${ct}`,dt=`${te}/draco_decoder.js`,ut=`${te}/draco_wasm_wrapper.js`,mt=`${te}/draco_decoder.wasm`,Tr=`https://raw.githubusercontent.com/google/draco/${lt}/javascript/draco_encoder.js`,R;async function De(t){let e=t.modules||{};return e.draco3d?R=R||e.draco3d.createDecoderModule({}).then(r=>({draco:r})):R=R||pt(t),await R}async function pt(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await T(dt,"draco",t);break;case"wasm":default:[e,r]=await Promise.all([await T(ut,"draco",t),await T(mt,"draco",t)])}return e=e||globalThis.DracoDecoderModule,await ft(e,r)}function ft(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(o=>{t({...r,onModuleLoaded:n=>o({draco:n})})})}var xe={...le,parse:yt};async function yt(t,e){let{draco:r}=await De(e),o=new v(r);try{return o.parseSync(t,e?.draco)}finally{o.destroy()}}$(xe);})();
(()=>{var we=Object.create;var C=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var Se=t=>C(t,"__esModule",{value:!0});var Oe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ee=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Me(e))!_e.call(t,o)&&o!=="default"&&C(t,o,{get:()=>e[o],enumerable:!(r=Ie(e,o))||r.enumerable});return t},Le=t=>Ee(Se(C(t!=null?we(Te(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var se=Oe(()=>{});var W="3.4.1";function re(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var g={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},At=g.self||g.window||g.global||{},Dt=g.window||g.self||g.global||{},oe=g.global||g.self||g.window||{},xt=g.document||{};var D=typeof process!="object"||String(process)!=="[object process]"||process.browser,I=typeof importScripts=="function",wt=typeof window!="undefined"&&typeof window.orientation!="undefined",ae=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),It=ae&&parseFloat(ae[1])||0;function U(t,e=!0,r){let o=r||new Set;if(t){if(ne(t))o.add(t);else if(ne(t.buffer))o.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let n in t)U(t[n],e,o)}}return r===void 0?Array.from(o):[]}function ne(t){return t?t instanceof ArrayBuffer||typeof MessagePort!="undefined"&&t instanceof MessagePort||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas:!1}function x(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var z=new Map,m=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(x())}static set onmessage(e){function r(n){let s=x(),{type:i,payload:l}=s?n:n.data;e(i,l)}let o=x();o?(o.on("message",r),o.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r}static addEventListener(e){let r=z.get(e);r||(r=n=>{if(!Fe(n))return;let s=x(),{type:i,payload:l}=s?n:n.data;e(i,l)}),x()?console.error("not implemented"):globalThis.addEventListener("message",r)}static removeEventListener(e){let r=z.get(e);z.delete(e),x()?console.error("not implemented"):globalThis.removeEventListener("message",r)}static postMessage(e,r){let o={source:"loaders.gl",type:e,payload:r},n=U(r),s=x();s?s.postMessage(o,n):globalThis.postMessage(o,n)}};function Fe(t){let{type:e,data:r}=t;return e==="message"&&r&&typeof r.source=="string"&&r.source.startsWith("loaders.gl")}var M=Le(se());var Ne="latest",Pe=typeof W!="undefined"?W:Ne,V={};async function T(t,e=null,r={}){return e&&(t=ie(t,e,r)),V[t]=V[t]||ke(t),await V[t]}function ie(t,e,r){if(t.startsWith("http"))return t;let o=r.modules||{};return o[t]?o[t]:D?r.CDN?(re(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Pe}/dist/libs/${t}`):I?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}async function ke(t){if(t.endsWith("wasm"))return await(await fetch(t)).arrayBuffer();if(!D)try{return M&&M.requireFromFile&&await M.requireFromFile(t)}catch{return null}if(I)return importScripts(t);let r=await(await fetch(t)).text();return Be(r,t)}function Be(t,e){if(!D)return M.requireFromString&&M.requireFromString(t,e);if(I)return eval.call(oe,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}var Re=0;function $(t){!m.inWorkerThread()||(m.onmessage=async(e,r)=>{switch(e){case"process":try{let{input:o,options:n={},context:s={}}=r,i=await Ce({loader:t,arrayBuffer:o,options:n,context:{...s,parse:ve}});m.postMessage("done",{result:i})}catch(o){let n=o instanceof Error?o.message:"";m.postMessage("error",{error:n})}break;default:}})}function ve(t,e){return new Promise((r,o)=>{let n=Re++,s=(l,d)=>{if(d.id===n)switch(l){case"done":m.removeEventListener(s),r(d.result);break;case"error":m.removeEventListener(s),o(d.error);break;default:}};m.addEventListener(s);let i={id:n,input:t,options:e};m.postMessage("process",i)})}async function Ce({loader:t,arrayBuffer:e,options:r,context:o}){let n,s;if(t.parseSync||t.parse)n=e,s=t.parseSync||t.parse;else if(t.parseTextSync)n=new TextDecoder().decode(e),s=t.parseTextSync;else throw new Error(`Could not load data with ${t.name} loader`);return r={...r,modules:t&&t.options&&t.options.modules||{},worker:!1},await s(n,{...r},o,t)}var ce="3.4.1";var We={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},le={name:"Draco",id:D?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:ce,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:We};function q(t){let e=1/0,r=1/0,o=1/0,n=-1/0,s=-1/0,i=-1/0,l=t.POSITION?t.POSITION.value:[],d=l&&l.length;for(let f=0;f<d;f+=3){let y=l[f],A=l[f+1],w=l[f+2];e=y<e?y:e,r=A<r?A:r,o=w<o?w:o,n=y>n?y:n,s=A>s?A:s,i=w>i?w:i}return[[e,r,o],[n,s,i]]}function de(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var p=class{constructor(e,r){de(Array.isArray(e)),Ue(e),this.fields=e,this.metadata=r||new Map}compareTo(e){if(this.metadata!==e.metadata||this.fields.length!==e.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(e.fields[r]))return!1;return!0}select(...e){let r=Object.create(null);for(let n of e)r[n]=!0;let o=this.fields.filter(n=>r[n.name]);return new p(o,this.metadata)}selectAt(...e){let r=e.map(o=>this.fields[o]).filter(Boolean);return new p(r,this.metadata)}assign(e){let r,o=this.metadata;if(e instanceof p){let i=e;r=i.fields,o=ue(ue(new Map,this.metadata),i.metadata)}else r=e;let n=Object.create(null);for(let i of this.fields)n[i.name]=i;for(let i of r)n[i.name]=i;let s=Object.values(n);return new p(s,o)}};function Ue(t){let e={};for(let r of t)e[r.name]&&console.warn("Schema: duplicated field name",r.name,r),e[r.name]=!0}function ue(t,e){return new Map([...t||new Map,...e||new Map])}var b=class{constructor(e,r,o=!1,n=new Map){this.name=e,this.type=r,this.nullable=o,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new b(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}};var c;(function(a){a[a.NONE=0]="NONE",a[a.Null=1]="Null",a[a.Int=2]="Int",a[a.Float=3]="Float",a[a.Binary=4]="Binary",a[a.Utf8=5]="Utf8",a[a.Bool=6]="Bool",a[a.Decimal=7]="Decimal",a[a.Date=8]="Date",a[a.Time=9]="Time",a[a.Timestamp=10]="Timestamp",a[a.Interval=11]="Interval",a[a.List=12]="List",a[a.Struct=13]="Struct",a[a.Union=14]="Union",a[a.FixedSizeBinary=15]="FixedSizeBinary",a[a.FixedSizeList=16]="FixedSizeList",a[a.Map=17]="Map",a[a.Dictionary=-1]="Dictionary",a[a.Int8=-2]="Int8",a[a.Int16=-3]="Int16",a[a.Int32=-4]="Int32",a[a.Int64=-5]="Int64",a[a.Uint8=-6]="Uint8",a[a.Uint16=-7]="Uint16",a[a.Uint32=-8]="Uint32",a[a.Uint64=-9]="Uint64",a[a.Float16=-10]="Float16",a[a.Float32=-11]="Float32",a[a.Float64=-12]="Float64",a[a.DateDay=-13]="DateDay",a[a.DateMillisecond=-14]="DateMillisecond",a[a.TimestampSecond=-15]="TimestampSecond",a[a.TimestampMillisecond=-16]="TimestampMillisecond",a[a.TimestampMicrosecond=-17]="TimestampMicrosecond",a[a.TimestampNanosecond=-18]="TimestampNanosecond",a[a.TimeSecond=-19]="TimeSecond",a[a.TimeMillisecond=-20]="TimeMillisecond",a[a.TimeMicrosecond=-21]="TimeMicrosecond",a[a.TimeNanosecond=-22]="TimeNanosecond",a[a.DenseUnion=-23]="DenseUnion",a[a.SparseUnion=-24]="SparseUnion",a[a.IntervalDayTime=-25]="IntervalDayTime",a[a.IntervalYearMonth=-26]="IntervalYearMonth"})(c||(c={}));var u=class{static isNull(e){return e&&e.typeId===c.Null}static isInt(e){return e&&e.typeId===c.Int}static isFloat(e){return e&&e.typeId===c.Float}static isBinary(e){return e&&e.typeId===c.Binary}static isUtf8(e){return e&&e.typeId===c.Utf8}static isBool(e){return e&&e.typeId===c.Bool}static isDecimal(e){return e&&e.typeId===c.Decimal}static isDate(e){return e&&e.typeId===c.Date}static isTime(e){return e&&e.typeId===c.Time}static isTimestamp(e){return e&&e.typeId===c.Timestamp}static isInterval(e){return e&&e.typeId===c.Interval}static isList(e){return e&&e.typeId===c.List}static isStruct(e){return e&&e.typeId===c.Struct}static isUnion(e){return e&&e.typeId===c.Union}static isFixedSizeBinary(e){return e&&e.typeId===c.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===c.FixedSizeList}static isMap(e){return e&&e.typeId===c.Map}static isDictionary(e){return e&&e.typeId===c.Dictionary}get typeId(){return c.NONE}compareTo(e){return this===e}},G=class extends u{get typeId(){return c.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},Q=class extends u{get typeId(){return c.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},h=class extends u{constructor(e,r){super();this.isSigned=e,this.bitWidth=r}get typeId(){return c.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},_=class extends h{constructor(){super(!0,8)}},S=class extends h{constructor(){super(!0,16)}},O=class extends h{constructor(){super(!0,32)}};var E=class extends h{constructor(){super(!1,8)}},L=class extends h{constructor(){super(!1,16)}},F=class extends h{constructor(){super(!1,32)}};var me={HALF:16,SINGLE:32,DOUBLE:64},N=class extends u{constructor(e){super();this.precision=e}get typeId(){return c.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}};var P=class extends N{constructor(){super(me.SINGLE)}},k=class extends N{constructor(){super(me.DOUBLE)}},j=class extends u{constructor(){super()}get typeId(){return c.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},Y=class extends u{get typeId(){return c.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},ze={DAY:0,MILLISECOND:1},H=class extends u{constructor(e){super();this.unit=e}get typeId(){return c.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${ze[this.unit]}>`}};var pe={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},J=class extends u{constructor(e,r){super();this.unit=e,this.bitWidth=r}get typeId(){return c.Time}toString(){return`Time${this.bitWidth}<${pe[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}};var X=class extends u{constructor(e,r=null){super();this.unit=e,this.timezone=r}get typeId(){return c.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${pe[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};var Ve={DAY_TIME:0,YEAR_MONTH:1},Z=class extends u{constructor(e){super();this.unit=e}get typeId(){return c.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${Ve[this.unit]}>`}};var B=class extends u{constructor(e,r){super();this.listSize=e,this.children=[r]}get typeId(){return c.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},K=class extends u{constructor(e){super();this.children=e}get typeId(){return c.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function fe(t){switch(t.constructor){case Int8Array:return new _;case Uint8Array:return new E;case Int16Array:return new S;case Uint16Array:return new L;case Int32Array:return new O;case Uint32Array:return new F;case Float32Array:return new P;case Float64Array:return new k;default:throw new Error("array type not supported")}}function ee(t,e,r){let o=fe(e.value),n=r||ye(e);return new b(t,new B(e.size,new b("value",o)),!1,n)}function ye(t){let e=new Map;return"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10)),"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10)),"normalized"in t&&e.set("normalized",t.normalized.toString()),e}function ge(t,e,r){let o=he(e.metadata),n=[],s=rt(e.attributes);for(let i in t){let l=t[i],d=be(i,l,s[i]);n.push(d)}if(r){let i=be("indices",r);n.push(i)}return new p(n,o)}function rt(t){let e={};for(let r in t){let o=t[r];e[o.name||"undefined"]=o}return e}function be(t,e,r){let o=r?he(r.metadata):void 0;return ee(t,e,o)}function he(t){let e=new Map;for(let r in t)e.set(`${r}.string`,JSON.stringify(t[r]));return e}var Ae={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ot={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},at=4,v=class{constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let o=new this.draco.DecoderBuffer;o.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let n=this.decoder.GetEncodedGeometryType(o),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(n){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(o,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(o,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let w=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(w)}let l=this._getDracoLoaderData(s,n,r),d=this._getMeshData(s,l,r),f=q(d.attributes),y=ge(d.attributes,l,d.indices);return{loader:"draco",loaderData:l,header:{vertexCount:s.num_points(),boundingBox:f},...d,schema:y}}finally{this.draco.destroy(o),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,o){let n=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,o);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(e,r){let o={};for(let n=0;n<e.num_attributes();n++){let s=this.decoder.GetAttribute(e,n),i=this._getAttributeMetadata(e,n);o[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:i};let l=this._getQuantizationTransform(s,r);l&&(o[s.unique_id()].quantization_transform=l);let d=this._getOctahedronTransform(s,r);d&&(o[s.unique_id()].octahedron_transform=d)}return o}_getMeshData(e,r,o){let n=this._getMeshAttributes(r,e,o);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(o.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,r,o){let n={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,o);s.name=i;let{value:l,size:d}=this._getAttributeValues(r,s);n[i]={value:l,size:d,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(e){let o=e.num_faces()*3,n=o*at,s=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(e,n,s),new Uint32Array(this.draco.HEAPF32.buffer,s,o).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),it(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let o=ot[r.data_type],n=r.num_components,i=e.num_points()*n,l=i*o.BYTES_PER_ELEMENT,d=nt(this.draco,o),f,y=this.draco._malloc(l);try{let A=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,A,d,l,y),f=new o(this.draco.HEAPF32.buffer,y,i).slice()}finally{this.draco._free(y)}return{value:f,size:n}}_deduceAttributeName(e,r){let o=e.unique_id;for(let[i,l]of Object.entries(r.extraAttributes||{}))if(l===o)return i;let n=e.attribute_type;for(let i in Ae)if(this.draco[i]===n)return Ae[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${o}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let o=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(o)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},o=this.metadataQuerier.NumEntries(e);for(let n=0;n<o;n++){let s=this.metadataQuerier.GetEntryName(e,n);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let o=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,o);let n=st(o);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:n}}finally{this.draco.destroy(o)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:o=[]}=e,n=[...r,...o];for(let s of n)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:o=[]}=r,n=e.attribute_type();if(o.map(i=>this.decoder[i]).includes(n)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(l=>i.min_value(l))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:o=[]}=r,n=e.attribute_type();if(o.map(i=>this.decoder[i]).includes(n)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function nt(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function st(t){let e=t.size(),r=new Int32Array(e);for(let o=0;o<e;o++)r[o]=t.GetValue(o);return r}function it(t){let e=t.size(),r=new Int32Array(e);for(let o=0;o<e;o++)r[o]=t.GetValue(o);return r}var ct="1.5.5",lt="1.4.1",te=`https://www.gstatic.com/draco/versioned/decoders/${ct}`,dt=`${te}/draco_decoder.js`,ut=`${te}/draco_wasm_wrapper.js`,mt=`${te}/draco_decoder.wasm`,Tr=`https://raw.githubusercontent.com/google/draco/${lt}/javascript/draco_encoder.js`,R;async function De(t){let e=t.modules||{};return e.draco3d?R=R||e.draco3d.createDecoderModule({}).then(r=>({draco:r})):R=R||pt(t),await R}async function pt(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await T(dt,"draco",t);break;case"wasm":default:[e,r]=await Promise.all([await T(ut,"draco",t),await T(mt,"draco",t)])}return e=e||globalThis.DracoDecoderModule,await ft(e,r)}function ft(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(o=>{t({...r,onModuleLoaded:n=>o({draco:n})})})}var xe={...le,parse:yt};async function yt(t,e){let{draco:r}=await De(e),o=new v(r);try{return o.parseSync(t,e?.draco)}finally{o.destroy()}}$(xe);})();
//# sourceMappingURL=draco-worker.js.map

@@ -1,4 +0,4 @@

(()=>{var x=Object.create;var w=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=t=>w(t,"__esModule",{value:!0});var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var j=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!V.call(t,o)&&o!=="default"&&w(t,o,{get:()=>e[o],enumerable:!(r=N(e,o))||r.enumerable});return t},U=t=>j($(w(t!=null?x(F(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var W=q(()=>{});var b="3.4.0";function D(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var c={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},ie=c.self||c.window||c.global||{},de=c.window||c.self||c.global||{},k=c.global||c.self||c.window||{},ce=c.document||{};var h=typeof process!="object"||String(process)!=="[object process]"||process.browser,g=typeof importScripts=="function",le=typeof window!="undefined"&&typeof window.orientation!="undefined",T=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),ue=T&&parseFloat(T[1])||0;function M(t,e=!0,r){let o=r||new Set;if(t){if(P(t))o.add(t);else if(P(t.buffer))o.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let a in t)M(t[a],e,o)}}return r===void 0?Array.from(o):[]}function P(t){return t?t instanceof ArrayBuffer||typeof MessagePort!="undefined"&&t instanceof MessagePort||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas:!1}function f(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var _=new Map,u=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(f())}static set onmessage(e){function r(a){let s=f(),{type:i,payload:n}=s?a:a.data;e(i,n)}let o=f();o?(o.on("message",r),o.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r}static addEventListener(e){let r=_.get(e);r||(r=a=>{if(!z(a))return;let s=f(),{type:i,payload:n}=s?a:a.data;e(i,n)}),f()?console.error("not implemented"):globalThis.addEventListener("message",r)}static removeEventListener(e){let r=_.get(e);_.delete(e),f()?console.error("not implemented"):globalThis.removeEventListener("message",r)}static postMessage(e,r){let o={source:"loaders.gl",type:e,payload:r},a=M(r),s=f();s?s.postMessage(o,a):globalThis.postMessage(o,a)}};function z(t){let{type:e,data:r}=t;return e==="message"&&r&&typeof r.source=="string"&&r.source.startsWith("loaders.gl")}var p=U(W());var G="beta",Q=typeof b!="undefined"?b:G,A={};async function E(t,e=null,r={}){return e&&(t=B(t,e,r)),A[t]=A[t]||X(t),await A[t]}function B(t,e,r){if(t.startsWith("http"))return t;let o=r.modules||{};return o[t]?o[t]:h?r.CDN?(D(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Q}/dist/libs/${t}`):g?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}async function X(t){if(t.endsWith("wasm"))return await(await fetch(t)).arrayBuffer();if(!h)try{return p&&p.requireFromFile&&await p.requireFromFile(t)}catch{return null}if(g)return importScripts(t);let r=await(await fetch(t)).text();return J(r,t)}function J(t,e){if(!h)return p.requireFromString&&p.requireFromString(t,e);if(g)return eval.call(k,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}var I={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},H=()=>{},m=class{constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,r={}){return this.log=H,this._setOptions(r),r.pointcloud?this._encodePointCloud(e,r):this._encodeMesh(e,r)}_getAttributesFromMesh(e){let r={...e,...e.attributes};return e.indices&&(r.indices=e.indices),r}_encodePointCloud(e,r){let o=new this.draco.PointCloud;r.metadata&&this._addGeometryMetadata(o,r.metadata);let a=this._getAttributesFromMesh(e);this._createDracoPointCloud(o,a,r);let s=new this.draco.DracoInt8Array;try{let i=this.dracoEncoder.EncodePointCloudToDracoBuffer(o,!1,s);if(!(i>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
(()=>{var x=Object.create;var w=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=t=>w(t,"__esModule",{value:!0});var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var j=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!V.call(t,o)&&o!=="default"&&w(t,o,{get:()=>e[o],enumerable:!(r=N(e,o))||r.enumerable});return t},U=t=>j($(w(t!=null?x(F(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var W=q(()=>{});var b="3.4.1";function D(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var c={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},ie=c.self||c.window||c.global||{},de=c.window||c.self||c.global||{},k=c.global||c.self||c.window||{},ce=c.document||{};var h=typeof process!="object"||String(process)!=="[object process]"||process.browser,g=typeof importScripts=="function",le=typeof window!="undefined"&&typeof window.orientation!="undefined",T=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),ue=T&&parseFloat(T[1])||0;function M(t,e=!0,r){let o=r||new Set;if(t){if(P(t))o.add(t);else if(P(t.buffer))o.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let a in t)M(t[a],e,o)}}return r===void 0?Array.from(o):[]}function P(t){return t?t instanceof ArrayBuffer||typeof MessagePort!="undefined"&&t instanceof MessagePort||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas:!1}function f(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var _=new Map,u=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(f())}static set onmessage(e){function r(a){let s=f(),{type:i,payload:n}=s?a:a.data;e(i,n)}let o=f();o?(o.on("message",r),o.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r}static addEventListener(e){let r=_.get(e);r||(r=a=>{if(!z(a))return;let s=f(),{type:i,payload:n}=s?a:a.data;e(i,n)}),f()?console.error("not implemented"):globalThis.addEventListener("message",r)}static removeEventListener(e){let r=_.get(e);_.delete(e),f()?console.error("not implemented"):globalThis.removeEventListener("message",r)}static postMessage(e,r){let o={source:"loaders.gl",type:e,payload:r},a=M(r),s=f();s?s.postMessage(o,a):globalThis.postMessage(o,a)}};function z(t){let{type:e,data:r}=t;return e==="message"&&r&&typeof r.source=="string"&&r.source.startsWith("loaders.gl")}var p=U(W());var G="latest",Q=typeof b!="undefined"?b:G,A={};async function E(t,e=null,r={}){return e&&(t=B(t,e,r)),A[t]=A[t]||X(t),await A[t]}function B(t,e,r){if(t.startsWith("http"))return t;let o=r.modules||{};return o[t]?o[t]:h?r.CDN?(D(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Q}/dist/libs/${t}`):g?`../src/libs/${t}`:`modules/${e}/src/libs/${t}`:`modules/${e}/dist/libs/${t}`}async function X(t){if(t.endsWith("wasm"))return await(await fetch(t)).arrayBuffer();if(!h)try{return p&&p.requireFromFile&&await p.requireFromFile(t)}catch{return null}if(g)return importScripts(t);let r=await(await fetch(t)).text();return J(r,t)}function J(t,e){if(!h)return p.requireFromString&&p.requireFromString(t,e);if(g)return eval.call(k,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}var I={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},H=()=>{},m=class{constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder),this.dracoMeshBuilder=null,this.dracoEncoder=null,this.draco=null}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,r={}){return this.log=H,this._setOptions(r),r.pointcloud?this._encodePointCloud(e,r):this._encodeMesh(e,r)}_getAttributesFromMesh(e){let r={...e,...e.attributes};return e.indices&&(r.indices=e.indices),r}_encodePointCloud(e,r){let o=new this.draco.PointCloud;r.metadata&&this._addGeometryMetadata(o,r.metadata);let a=this._getAttributesFromMesh(e);this._createDracoPointCloud(o,a,r);let s=new this.draco.DracoInt8Array;try{let i=this.dracoEncoder.EncodePointCloudToDracoBuffer(o,!1,s);if(!(i>0))throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
with ${o.num_attributes()} attributes into ${i} bytes`),R(s)}finally{this.destroyEncodedObject(s),this.destroyEncodedObject(o)}}_encodeMesh(e,r){let o=new this.draco.Mesh;r.metadata&&this._addGeometryMetadata(o,r.metadata);let a=this._getAttributesFromMesh(e);this._createDracoMesh(o,a,r);let s=new this.draco.DracoInt8Array;try{let i=this.dracoEncoder.EncodeMeshToDracoBuffer(o,s);if(i<=0)throw new Error("Draco encoding failed.");return this.log(`DRACO encoded ${o.num_points()} points
with ${o.num_attributes()} attributes into ${i} bytes`),R(s)}finally{this.destroyEncodedObject(s),this.destroyEncodedObject(o)}}_setOptions(e){if("speed"in e&&this.dracoEncoder.SetSpeedOptions(...e.speed),"method"in e){let r=this.draco[e.method||"MESH_SEQUENTIAL_ENCODING"];this.dracoEncoder.SetEncodingMethod(r)}if("quantization"in e)for(let r in e.quantization){let o=e.quantization[r],a=this.draco[r];this.dracoEncoder.SetAttributeQuantization(a,o)}}_createDracoMesh(e,r,o){let a=o.attributesMetadata||{};try{let s=this._getPositionAttribute(r);if(!s)throw new Error("positions");let i=s.length/3;for(let n in r){let d=r[n];n=I[n]||n;let l=this._addAttributeToMesh(e,n,d,i);l!==-1&&this._addAttributeMetadata(e,l,{name:n,...a[n]||{}})}}catch(s){throw this.destroyEncodedObject(e),s}return e}_createDracoPointCloud(e,r,o){let a=o.attributesMetadata||{};try{let s=this._getPositionAttribute(r);if(!s)throw new Error("positions");let i=s.length/3;for(let n in r){let d=r[n];n=I[n]||n;let l=this._addAttributeToMesh(e,n,d,i);l!==-1&&this._addAttributeMetadata(e,l,{name:n,...a[n]||{}})}}catch(s){throw this.destroyEncodedObject(e),s}return e}_addAttributeToMesh(e,r,o,a){if(!ArrayBuffer.isView(o))return-1;let s=this._getDracoAttributeType(r),i=o.length/a;if(s==="indices"){let l=o.length/3;return this.log(`Adding attribute ${r}, size ${l}`),this.dracoMeshBuilder.AddFacesToMesh(e,l,o),-1}this.log(`Adding attribute ${r}, size ${i}`);let n=this.dracoMeshBuilder,{buffer:d}=o;switch(o.constructor){case Int8Array:return n.AddInt8Attribute(e,s,a,i,new Int8Array(d));case Int16Array:return n.AddInt16Attribute(e,s,a,i,new Int16Array(d));case Int32Array:return n.AddInt32Attribute(e,s,a,i,new Int32Array(d));case Uint8Array:case Uint8ClampedArray:return n.AddUInt8Attribute(e,s,a,i,new Uint8Array(d));case Uint16Array:return n.AddUInt16Attribute(e,s,a,i,new Uint16Array(d));case Uint32Array:return n.AddUInt32Attribute(e,s,a,i,new Uint32Array(d));case Float32Array:default:return n.AddFloatAttribute(e,s,a,i,new Float32Array(d))}}_getDracoAttributeType(e){switch(e.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(e){for(let r in e){let o=e[r];if(this._getDracoAttributeType(r)===this.draco.POSITION)return o}return null}_addGeometryMetadata(e,r){let o=new this.draco.Metadata;this._populateDracoMetadata(o,r),this.dracoMeshBuilder.AddMetadata(e,o)}_addAttributeMetadata(e,r,o){let a=new this.draco.Metadata;this._populateDracoMetadata(a,o),this.dracoMeshBuilder.SetMetadataForAttribute(e,r,a)}_populateDracoMetadata(e,r){for(let[o,a]of K(r))switch(typeof a){case"number":Math.trunc(a)===a?this.dracoMetadataBuilder.AddIntEntry(e,o,a):this.dracoMetadataBuilder.AddDoubleEntry(e,o,a);break;case"object":a instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,o,a,a.length);break;case"string":default:this.dracoMetadataBuilder.AddStringEntry(e,o,a)}}};function R(t){let e=t.size(),r=new ArrayBuffer(e),o=new Int8Array(r);for(let a=0;a<e;++a)o[a]=t.GetValue(a);return r}function K(t){return t.entries&&!t.hasOwnProperty("entries")?t.entries():Object.entries(t)}var Y="1.5.5",Z="1.4.1",O=`https://www.gstatic.com/draco/versioned/decoders/${Y}`,Te=`${O}/draco_decoder.js`,Pe=`${O}/draco_wasm_wrapper.js`,We=`${O}/draco_decoder.wasm`,ee=`https://raw.githubusercontent.com/google/draco/${Z}/javascript/draco_encoder.js`;var y;async function S(t){let e=t.modules||{};return e.draco3d?y=y||e.draco3d.createEncoderModule({}).then(r=>({draco:r})):y=y||re(t),await y}async function re(t){let e=await E(ee,"draco",t);return e=e||globalThis.DracoEncoderModule,new Promise(r=>{e({onModuleLoaded:o=>r({draco:o})})})}var C="3.4.0";var te={pointcloud:!1,attributeNameEntry:"name"},L={name:"DRACO",id:"draco",module:"draco",version:C,extensions:["drc"],encode:oe,options:{draco:te}};async function oe(t,e={}){let{draco:r}=await S(e),o=new m(r);try{return o.encodeSync(t,e.draco)}finally{o.destroy()}}(()=>{!u.inWorkerThread()||(u.onmessage=async(t,e)=>{switch(t){case"process":try{let{input:r,options:o}=e,a=await L.encode(r,o);u.postMessage("done",{result:a})}catch(r){let o=r instanceof Error?r.message:"";u.postMessage("error",{error:o})}break;default:}})})();})();
with ${o.num_attributes()} attributes into ${i} bytes`),R(s)}finally{this.destroyEncodedObject(s),this.destroyEncodedObject(o)}}_setOptions(e){if("speed"in e&&this.dracoEncoder.SetSpeedOptions(...e.speed),"method"in e){let r=this.draco[e.method||"MESH_SEQUENTIAL_ENCODING"];this.dracoEncoder.SetEncodingMethod(r)}if("quantization"in e)for(let r in e.quantization){let o=e.quantization[r],a=this.draco[r];this.dracoEncoder.SetAttributeQuantization(a,o)}}_createDracoMesh(e,r,o){let a=o.attributesMetadata||{};try{let s=this._getPositionAttribute(r);if(!s)throw new Error("positions");let i=s.length/3;for(let n in r){let d=r[n];n=I[n]||n;let l=this._addAttributeToMesh(e,n,d,i);l!==-1&&this._addAttributeMetadata(e,l,{name:n,...a[n]||{}})}}catch(s){throw this.destroyEncodedObject(e),s}return e}_createDracoPointCloud(e,r,o){let a=o.attributesMetadata||{};try{let s=this._getPositionAttribute(r);if(!s)throw new Error("positions");let i=s.length/3;for(let n in r){let d=r[n];n=I[n]||n;let l=this._addAttributeToMesh(e,n,d,i);l!==-1&&this._addAttributeMetadata(e,l,{name:n,...a[n]||{}})}}catch(s){throw this.destroyEncodedObject(e),s}return e}_addAttributeToMesh(e,r,o,a){if(!ArrayBuffer.isView(o))return-1;let s=this._getDracoAttributeType(r),i=o.length/a;if(s==="indices"){let l=o.length/3;return this.log(`Adding attribute ${r}, size ${l}`),this.dracoMeshBuilder.AddFacesToMesh(e,l,o),-1}this.log(`Adding attribute ${r}, size ${i}`);let n=this.dracoMeshBuilder,{buffer:d}=o;switch(o.constructor){case Int8Array:return n.AddInt8Attribute(e,s,a,i,new Int8Array(d));case Int16Array:return n.AddInt16Attribute(e,s,a,i,new Int16Array(d));case Int32Array:return n.AddInt32Attribute(e,s,a,i,new Int32Array(d));case Uint8Array:case Uint8ClampedArray:return n.AddUInt8Attribute(e,s,a,i,new Uint8Array(d));case Uint16Array:return n.AddUInt16Attribute(e,s,a,i,new Uint16Array(d));case Uint32Array:return n.AddUInt32Attribute(e,s,a,i,new Uint32Array(d));case Float32Array:default:return n.AddFloatAttribute(e,s,a,i,new Float32Array(d))}}_getDracoAttributeType(e){switch(e.toLowerCase()){case"indices":return"indices";case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return this.draco.GENERIC}}_getPositionAttribute(e){for(let r in e){let o=e[r];if(this._getDracoAttributeType(r)===this.draco.POSITION)return o}return null}_addGeometryMetadata(e,r){let o=new this.draco.Metadata;this._populateDracoMetadata(o,r),this.dracoMeshBuilder.AddMetadata(e,o)}_addAttributeMetadata(e,r,o){let a=new this.draco.Metadata;this._populateDracoMetadata(a,o),this.dracoMeshBuilder.SetMetadataForAttribute(e,r,a)}_populateDracoMetadata(e,r){for(let[o,a]of K(r))switch(typeof a){case"number":Math.trunc(a)===a?this.dracoMetadataBuilder.AddIntEntry(e,o,a):this.dracoMetadataBuilder.AddDoubleEntry(e,o,a);break;case"object":a instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,o,a,a.length);break;case"string":default:this.dracoMetadataBuilder.AddStringEntry(e,o,a)}}};function R(t){let e=t.size(),r=new ArrayBuffer(e),o=new Int8Array(r);for(let a=0;a<e;++a)o[a]=t.GetValue(a);return r}function K(t){return t.entries&&!t.hasOwnProperty("entries")?t.entries():Object.entries(t)}var Y="1.5.5",Z="1.4.1",O=`https://www.gstatic.com/draco/versioned/decoders/${Y}`,Te=`${O}/draco_decoder.js`,Pe=`${O}/draco_wasm_wrapper.js`,We=`${O}/draco_decoder.wasm`,ee=`https://raw.githubusercontent.com/google/draco/${Z}/javascript/draco_encoder.js`;var y;async function S(t){let e=t.modules||{};return e.draco3d?y=y||e.draco3d.createEncoderModule({}).then(r=>({draco:r})):y=y||re(t),await y}async function re(t){let e=await E(ee,"draco",t);return e=e||globalThis.DracoEncoderModule,new Promise(r=>{e({onModuleLoaded:o=>r({draco:o})})})}var C="3.4.1";var te={pointcloud:!1,attributeNameEntry:"name"},L={name:"DRACO",id:"draco",module:"draco",version:C,extensions:["drc"],encode:oe,options:{draco:te}};async function oe(t,e={}){let{draco:r}=await S(e),o=new m(r);try{return o.encodeSync(t,e.draco)}finally{o.destroy()}}(()=>{!u.inWorkerThread()||(u.onmessage=async(t,e)=>{switch(t){case"process":try{let{input:r,options:o}=e,a=await L.encode(r,o);u.postMessage("done",{result:a})}catch(r){let o=r instanceof Error?r.message:"";u.postMessage("error",{error:o})}break;default:}})})();})();
//# sourceMappingURL=draco-writer-worker.js.map

@@ -7,4 +7,4 @@ "use strict";

exports.VERSION = void 0;
var VERSION = typeof "3.4.0" !== 'undefined' ? "3.4.0" : 'latest';
var VERSION = typeof "3.4.1" !== 'undefined' ? "3.4.1" : 'latest';
exports.VERSION = VERSION;
//# sourceMappingURL=version.js.map

@@ -1,2 +0,2 @@

export const VERSION = typeof "3.4.0" !== 'undefined' ? "3.4.0" : 'latest';
export const VERSION = typeof "3.4.1" !== 'undefined' ? "3.4.1" : 'latest';
//# sourceMappingURL=version.js.map
{
"name": "@loaders.gl/draco",
"version": "3.4.0",
"version": "3.4.1",
"description": "Framework-independent loader and writer for Draco compressed meshes and point clouds",

@@ -45,11 +45,11 @@ "license": "MIT",

"@babel/runtime": "^7.3.1",
"@loaders.gl/loader-utils": "3.4.0",
"@loaders.gl/schema": "3.4.0",
"@loaders.gl/worker-utils": "3.4.0",
"@loaders.gl/loader-utils": "3.4.1",
"@loaders.gl/schema": "3.4.1",
"@loaders.gl/worker-utils": "3.4.1",
"draco3d": "1.5.5"
},
"devDependencies": {
"@loaders.gl/polyfills": "3.4.0"
"@loaders.gl/polyfills": "3.4.1"
},
"gitHead": "63854c9c521112108239e9c23fd6accbe6d6e380"
"gitHead": "2c39d1032c1a8b3678a6f09507b89ffe92ca9e1b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc