@file-viewer/renderer-3d 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GEO3D.md +12 -3
- package/README.en.md +37 -3
- package/README.md +37 -3
- package/dist/geo3d-workers/manifest.json +2 -2
- package/dist/geo3dPointFactories.js +6 -6
- package/dist/geo3dRasterFactories.js +1 -1
- package/dist/geo3dRuntime.js +2 -1
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var mc=Object.create;var Us=Object.defineProperty;var gc=Object.getOwnPropertyDescriptor;var _c=Object.getOwnPropertyNames;var yc=Object.getPrototypeOf,vc=Object.prototype.hasOwnProperty;var Ns=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var K=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var xc=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _c(e))!vc.call(s,i)&&i!==t&&Us(s,i,{get:()=>e[i],enumerable:!(n=gc(e,i))||n.enumerable});return s};var Fn=(s,e,t)=>(t=s!=null?mc(yc(s)):{},xc(e||!s||!s.__esModule?Us(t,"default",{value:s,enumerable:!0}):t,s));var Os=K(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0})});var Bs=K(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.Hierarchy=void 0;On.Hierarchy={parse:Sc};function Sc(s){return Object.entries(s).reduce((e,[t,n])=>(n===-1?e.pages[t]={}:n&&(e.nodes[t]={pointCount:n}),e),{nodes:{},pages:{}})}});var Vs=K(ht=>{"use strict";var bc=ht&&ht.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),zs=ht&&ht.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bc(e,s,t)};Object.defineProperty(ht,"__esModule",{value:!0});zs(Os(),ht);zs(Bs(),ht)});var Bn=K(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hierarchyItemLength=Ot.infoLength=void 0;Ot.infoLength=160;Ot.hierarchyItemLength=32});var zn=K(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.evlrHeaderLength=ft.vlrHeaderLength=ft.minHeaderLength=void 0;ft.minHeaderLength=375;ft.vlrHeaderLength=54;ft.evlrHeaderLength=60});var ks=K(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getBigUint64=Bt.parseBigInt=void 0;function Mc(s){if(s>BigInt(Number.MAX_SAFE_INTEGER)||s<BigInt(-Number.MAX_SAFE_INTEGER))throw new Error(`Cannot convert bigint to number: ${s}`);return Number(s)}Bt.parseBigInt=Mc;function wc(s,e,t){if(s.getBigUint64)return s.getBigUint64(e,t);let[n,i]=t?[4,0]:[0,4],r=BigInt(s.getUint32(e+n,t)),l=BigInt(s.getUint32(e+i,t));return(r<<BigInt(32))+l}Bt.getBigUint64=wc});var ji=K(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.toCString=dt.toDataView=dt.Binary=void 0;dt.Binary={toDataView:Ji,toCString:Gs};function Ji(s){return new DataView(s.buffer,s.byteOffset,s.length)}dt.toDataView=Ji;function Gs(s){let e=Ji(s),t="";for(let n=0;n<e.byteLength;++n){let i=e.getInt8(n);if(i===0)return t;t+=String.fromCharCode(i)}return t}dt.toCString=Gs});var Ys=K(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.Bounds=void 0;Vn.Bounds={min:Tc,max:Ec,mid:Ki,width:Hs,depth:Ws,height:Xs,cube:Ac,step:qs,stepTo:Cc,intersection:Rc};function Tc(s){return[s[0],s[1],s[2]]}function Ec(s){return[s[3],s[4],s[5]]}function Ki([s,e,t,n,i,r]){return[s+(n-s)/2,e+(i-e)/2,t+(r-t)/2]}function Hs(s){return s[3]-s[0]}function Ws(s){return s[4]-s[1]}function Xs(s){return s[5]-s[2]}function Ac(s){let e=Ki(s),t=Math.max(Hs(s),Ws(s),Xs(s))/2;return[e[0]-t,e[1]-t,e[2]-t,e[0]+t,e[1]+t,e[2]+t]}function qs(s,[e,t,n]){let[i,r,l,c,u,h]=s,[d,p,v]=Ki(s);return[e?d:i,t?p:r,n?v:l,e?c:d,t?u:p,n?h:v]}function Cc(s,[e,t,n,i]){for(let r=e-1;r>=0;--r)s=qs(s,[t>>r&1,n>>r&1,i>>r&1]);return s}function Rc(s,e){return[Math.max(s[0],e[0]),Math.max(s[1],e[1]),Math.max(s[2],e[2]),Math.min(s[3],e[3]),Math.min(s[4],e[4]),Math.min(s[5],e[5])]}});var $s=K(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.Dimension=void 0;var Pc={int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}};kn.Dimension={Type:Pc,ctype:Ic};function Ic({type:s,size:e}){switch(s){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${s}/${e}`)}});var Js=K((pt,Zs)=>{var Gn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Hn=(function(){function s(){this.fetch=!1,this.DOMException=Gn.DOMException}return s.prototype=Gn,new s})();(function(s){var e=(function(t){var n=typeof s<"u"&&s||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function r(y){return y&&DataView.prototype.isPrototypeOf(y)}if(i.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(y){return y&&l.indexOf(Object.prototype.toString.call(y))>-1};function u(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(y)||y==="")throw new TypeError('Invalid character in header field name: "'+y+'"');return y.toLowerCase()}function h(y){return typeof y!="string"&&(y=String(y)),y}function d(y){var M={next:function(){var B=y.shift();return{done:B===void 0,value:B}}};return i.iterable&&(M[Symbol.iterator]=function(){return M}),M}function p(y){this.map={},y instanceof p?y.forEach(function(M,B){this.append(B,M)},this):Array.isArray(y)?y.forEach(function(M){if(M.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+M.length);this.append(M[0],M[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(M){this.append(M,y[M])},this)}p.prototype.append=function(y,M){y=u(y),M=h(M);var B=this.map[y];this.map[y]=B?B+", "+M:M},p.prototype.delete=function(y){delete this.map[u(y)]},p.prototype.get=function(y){return y=u(y),this.has(y)?this.map[y]:null},p.prototype.has=function(y){return this.map.hasOwnProperty(u(y))},p.prototype.set=function(y,M){this.map[u(y)]=h(M)},p.prototype.forEach=function(y,M){for(var B in this.map)this.map.hasOwnProperty(B)&&y.call(M,this.map[B],B,this)},p.prototype.keys=function(){var y=[];return this.forEach(function(M,B){y.push(B)}),d(y)},p.prototype.values=function(){var y=[];return this.forEach(function(M){y.push(M)}),d(y)},p.prototype.entries=function(){var y=[];return this.forEach(function(M,B){y.push([B,M])}),d(y)},i.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function v(y){if(!y._noBody){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}}function _(y){return new Promise(function(M,B){y.onload=function(){M(y.result)},y.onerror=function(){B(y.error)}})}function g(y){var M=new FileReader,B=_(M);return M.readAsArrayBuffer(y),B}function x(y){var M=new FileReader,B=_(M),X=/charset=([A-Za-z0-9_-]+)/.exec(y.type),k=X?X[1]:"utf-8";return M.readAsText(y,k),B}function A(y){for(var M=new Uint8Array(y),B=new Array(M.length),X=0;X<M.length;X++)B[X]=String.fromCharCode(M[X]);return B.join("")}function E(y){if(y.slice)return y.slice(0);var M=new Uint8Array(y.byteLength);return M.set(new Uint8Array(y)),M.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(y){this.bodyUsed=this.bodyUsed,this._bodyInit=y,y?typeof y=="string"?this._bodyText=y:i.blob&&Blob.prototype.isPrototypeOf(y)?this._bodyBlob=y:i.formData&&FormData.prototype.isPrototypeOf(y)?this._bodyFormData=y:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(y)?this._bodyText=y.toString():i.arrayBuffer&&i.blob&&r(y)?(this._bodyArrayBuffer=E(y.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(y)||c(y))?this._bodyArrayBuffer=E(y):this._bodyText=y=Object.prototype.toString.call(y):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof y=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(y)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var y=v(this);if(y)return y;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var y=v(this);return y||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var y=v(this);if(y)return y;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(A(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function O(y){var M=y.toUpperCase();return N.indexOf(M)>-1?M:y}function C(y,M){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');M=M||{};var B=M.body;if(y instanceof C){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,M.headers||(this.headers=new p(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!B&&y._bodyInit!=null&&(B=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new p(M.headers)),this.method=O(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal||(function(){if("AbortController"in n){var q=new AbortController;return q.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(B),(this.method==="GET"||this.method==="HEAD")&&(M.cache==="no-store"||M.cache==="no-cache")){var X=/([?&])_=[^&]*/;if(X.test(this.url))this.url=this.url.replace(X,"$1_="+new Date().getTime());else{var k=/\?/;this.url+=(k.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function G(y){var M=new FormData;return y.trim().split("&").forEach(function(B){if(B){var X=B.split("="),k=X.shift().replace(/\+/g," "),q=X.join("=").replace(/\+/g," ");M.append(decodeURIComponent(k),decodeURIComponent(q))}}),M}function z(y){var M=new p,B=y.replace(/\r?\n[\t ]+/g," ");return B.split("\r").map(function(X){return X.indexOf(`
|
|
2
|
-
`)===0?X.substr(1,X.length):X}).forEach(function(X){var k=X.split(":"),q=k.shift().trim();if(q){var L=k.join(":").trim();try{M.append(q,L)}catch(de){console.warn("Response "+de.message)}}}),M}I.call(C.prototype);function $(y,M){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=M.statusText===void 0?"":""+M.statusText,this.headers=new p(M.headers),this.url=M.url||"",this._initBody(y)}I.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},$.error=function(){var y=new $(null,{status:200,statusText:""});return y.ok=!1,y.status=0,y.type="error",y};var Q=[301,302,303,307,308];$.redirect=function(y,M){if(Q.indexOf(M)===-1)throw new RangeError("Invalid status code");return new $(null,{status:M,headers:{location:y}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(M,B){this.message=M,this.name=B;var X=Error(M);this.stack=X.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function re(y,M){return new Promise(function(B,X){var k=new C(y,M);if(k.signal&&k.signal.aborted)return X(new t.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function L(){q.abort()}q.onload=function(){var ee={statusText:q.statusText,headers:z(q.getAllResponseHeaders()||"")};k.url.indexOf("file://")===0&&(q.status<200||q.status>599)?ee.status=200:ee.status=q.status,ee.url="responseURL"in q?q.responseURL:ee.headers.get("X-Request-URL");var pe="response"in q?q.response:q.responseText;setTimeout(function(){B(new $(pe,ee))},0)},q.onerror=function(){setTimeout(function(){X(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){X(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){X(new t.DOMException("Aborted","AbortError"))},0)};function de(ee){try{return ee===""&&n.location.href?n.location.href:ee}catch{return ee}}if(q.open(k.method,de(k.url),!0),k.credentials==="include"?q.withCredentials=!0:k.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(i.blob?q.responseType="blob":i.arrayBuffer&&(q.responseType="arraybuffer")),M&&typeof M.headers=="object"&&!(M.headers instanceof p||n.Headers&&M.headers instanceof n.Headers)){var _e=[];Object.getOwnPropertyNames(M.headers).forEach(function(ee){_e.push(u(ee)),q.setRequestHeader(ee,h(M.headers[ee]))}),k.headers.forEach(function(ee,pe){_e.indexOf(pe)===-1&&q.setRequestHeader(pe,ee)})}else k.headers.forEach(function(ee,pe){q.setRequestHeader(pe,ee)});k.signal&&(k.signal.addEventListener("abort",L),q.onreadystatechange=function(){q.readyState===4&&k.signal.removeEventListener("abort",L)}),q.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return re.polyfill=!0,n.fetch||(n.fetch=re,n.Headers=p,n.Request=C,n.Response=$),t.Headers=p,t.Request=C,t.Response=$,t.fetch=re,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(Hn);Hn.fetch.ponyfill=!0;delete Hn.fetch.polyfill;var zt=Gn.fetch?Gn:Hn;pt=zt.fetch;pt.default=zt.fetch;pt.fetch=zt.fetch;pt.Headers=zt.Headers;pt.Request=zt.Request;pt.Response=zt.Response;Zs.exports=pt});var js=K(()=>{});var ea=K(Be=>{"use strict";var Lc=Be&&Be.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Dc=Be&&Be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Uc=Be&&Be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Lc(e,s,t);return Dc(e,s),e},Nc=Be&&Be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Be,"__esModule",{value:!0});Be.Getter=void 0;var Fc=Nc(Js());Be.Getter={create:Oc,http:Ks,file:Qs};function Oc(s){return typeof s=="function"?s:s.startsWith("http://")||s.startsWith("https://")?Ks(s):Qs(s)}function Ks(s){return async function(t,n){if(t<0||n<0||t>n)throw new Error("Invalid range");let r=await(await(0,Fc.default)(s,{headers:{Range:`bytes=${t}-${n-1}`}})).arrayBuffer();return new Uint8Array(r)}}function Qs(s){return async function(t,n){let i=await Promise.resolve().then(()=>Uc(js()));async function r(l=0,c=1/0){if(l<0||c<0||l>c)throw new Error("Invalid range");await i.promises.access(s);let u=i.createReadStream(s,{start:l,end:c-1,autoClose:!0});return Bc(u)}return r(t,n)}}async function Bc(s){return await new Promise((e,t)=>{let n=[];s.on("data",i=>n.push(i)),s.on("error",t),s.on("end",()=>e(Buffer.concat(n)))})}});var na=K(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.Key=void 0;Vt.Key={create:zc,parse:ta,toString:Vc,step:kc,up:Gc,compare:Hc,depth:Wc};function zc(s,e=0,t=0,n=0){return typeof s!="number"?ta(s):[s,e,t,n]}function ta(s){if(typeof s!="string")return s;let[e,t,n,i,...r]=s.split("-").map(c=>parseInt(c,10)),l=[e,t,n,i];if(r.length!==0||l.some(c=>typeof c!="number"||Number.isNaN(c)))throw new Error(`Invalid key: ${s}`);return l}function Vc(s){return typeof s=="string"?s:s.join("-")}function kc(s,[e,t,n]){let[i,r,l,c]=Vt.Key.create(s);return[i+1,r*2+e,l*2+t,c*2+n]}function Gc(s,e=1){let[t,n,i,r]=Vt.Key.create(s);return[t-e,n>>e,i>>e,r>>e]}function Hc(s,e){for(let t=0;t<s.length;++t){if(s[t]<e[t])return-1;if(s[t]>e[t])return 1}return 0}function Wc(s){return s[0]}});var ia=K(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Scale=void 0;Wn.Scale={apply:(s,e=1,t=0)=>(s-t)/e,unapply:(s,e=1,t=0)=>s*e+t}});var ra=K(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Step=void 0;Xn.Step={fromIndex:Xc,list:qc};function Xc(s){if(s<0||s>=8)throw new Error(`Invalid step index: ${s}`);let e=s>>0&1?1:0,t=s>>1&1?1:0,n=s>>2&1?1:0;return[e,t,n]}function qc(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}});var ze=K(he=>{"use strict";var Yc=he&&he.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),$c=he&&he.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Yc(e,s,t)};Object.defineProperty(he,"__esModule",{value:!0});he.Step=he.Scale=he.Key=he.Getter=he.Dimension=he.Bounds=he.Binary=void 0;$c(ks(),he);var Zc=ji();Object.defineProperty(he,"Binary",{enumerable:!0,get:function(){return Zc.Binary}});var Jc=Ys();Object.defineProperty(he,"Bounds",{enumerable:!0,get:function(){return Jc.Bounds}});var jc=$s();Object.defineProperty(he,"Dimension",{enumerable:!0,get:function(){return jc.Dimension}});var Kc=ea();Object.defineProperty(he,"Getter",{enumerable:!0,get:function(){return Kc.Getter}});var Qc=na();Object.defineProperty(he,"Key",{enumerable:!0,get:function(){return Qc.Key}});var eu=ia();Object.defineProperty(he,"Scale",{enumerable:!0,get:function(){return eu.Scale}});var tu=ra();Object.defineProperty(he,"Step",{enumerable:!0,get:function(){return tu.Step}})});var Qi=K(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ExtraBytes=void 0;var Se=ze();Yn.ExtraBytes={getDimension:nu,parse:iu,parseOne:sa};var qn=192;function nu({type:s,length:e}){switch(s){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:s,size:e}}case"float":switch(e){case 4:case 8:return{type:s,size:e}}}}function iu(s){if(s.byteLength%qn!==0)throw new Error(`Invalid extra bytes VLR length: ${s.byteLength}`);let e=[];for(let t=0;t<s.byteLength;t+=qn)e.push(sa(s.slice(t,t+qn)));return e}function sa(s){if(s.byteLength!==qn)throw new Error(`Invalid extra bytes entry length: ${s.byteLength}`);let e=Se.Binary.toDataView(s),t=Se.Binary.toCString(s.slice(4,36)),n=Se.Binary.toCString(s.slice(60,192)),i=e.getUint8(2),r=e.getUint8(3);if(i>=11)throw new Error(`Invalid extra bytes "type" value: ${i}`);if(i===0)return{name:t,description:n,length:r};let l=su(r),c=ru(i);if(!c)throw new Error(`Failed to extract dimension type: ${i}`);let{type:u,size:h}=c;function d(v){switch(u){case"signed":return(0,Se.parseBigInt)(e.getBigInt64(v,!0));case"unsigned":return(0,Se.parseBigInt)((0,Se.getBigUint64)(e,v,!0));case"float":return e.getFloat64(v,!0)}}let p={name:t,description:n,type:u,length:h};return l.hasNodata&&(p.nodata=d(40)),l.hasMin&&(p.min=d(64)),l.hasMax&&(p.max=d(88)),l.hasScale&&(p.scale=e.getFloat64(112)),l.hasOffset&&(p.offset=e.getFloat64(136)),p}function ru(s){switch(s){case 1:return Se.Dimension.Type.uint8;case 2:return Se.Dimension.Type.int8;case 3:return Se.Dimension.Type.uint16;case 4:return Se.Dimension.Type.int16;case 5:return Se.Dimension.Type.uint32;case 6:return Se.Dimension.Type.int32;case 7:return Se.Dimension.Type.uint64;case 8:return Se.Dimension.Type.int64;case 9:return Se.Dimension.Type.float32;case 10:return Se.Dimension.Type.float64}}function su(s){return{hasNodata:!!(s&1),hasMin:!!(s>>1&1),hasMax:!!(s>>2&1),hasScale:!!(s>>3&1),hasOffset:!!(s>>4&1)}}});var er=K($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.Dimensions=void 0;var au=ze(),ou=Qi();$n.Dimensions={create:cu};var{Type:ue}=au.Dimension,lu={X:ue.float64,Y:ue.float64,Z:ue.float64,Intensity:ue.uint16,ReturnNumber:ue.uint8,NumberOfReturns:ue.uint8,ScanDirectionFlag:ue.boolean,EdgeOfFlightLine:ue.boolean,Classification:ue.uint8,Synthetic:ue.boolean,KeyPoint:ue.boolean,Withheld:ue.boolean,Overlap:ue.boolean,ScanAngle:ue.float32,UserData:ue.uint8,PointSourceId:ue.uint16,GpsTime:ue.float64,Red:ue.uint16,Green:ue.uint16,Blue:ue.uint16,ScannerChannel:ue.uint8,Infrared:ue.uint16};function cu(s,e=[]){return Object.keys(s).reduce((t,n)=>{let i=lu[n];if(i)return{...t,[n]:i};let r=e.find(c=>c.name===n),l=r&&ou.ExtraBytes.getDimension(r);if(l)return{...t,[n]:l};throw new Error(`Failed to look up LAS type: ${n}`)},{})}});var tr=K(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Extractor=void 0;var Je=ze();Jn.Extractor={create:du};function uu(s){switch(s){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${s}`)}}function hu(s,e,{type:t,length:n}){let i=mt(s);switch(t){case"signed":switch(n){case 1:return(r,l)=>r.getInt8(i(l)+e);case 2:return(r,l)=>r.getInt16(i(l)+e,!0);case 4:return(r,l)=>r.getInt32(i(l)+e,!0);case 8:return(r,l)=>(0,Je.parseBigInt)(r.getBigInt64(i(l)+e,!0))}case"unsigned":switch(n){case 1:return(r,l)=>r.getUint8(i(l)+e);case 2:return(r,l)=>r.getUint16(i(l)+e,!0);case 4:return(r,l)=>r.getUint32(i(l)+e,!0);case 8:return(r,l)=>(0,Je.parseBigInt)((0,Je.getBigUint64)(r,i(l)+e,!0))}case"float":switch(n){case 4:return(r,l)=>r.getFloat32(i(l)+e,!0);case 8:return(r,l)=>r.getFloat64(i(l)+e,!0)}}}function fu(s,e){let n=uu(s.pointDataRecordFormat);return e.reduce((i,r)=>{let l=n;n+=r.length;let c=hu(s,l,r);if(!c)return i;let u=(h,d)=>Je.Scale.unapply(c(h,d),r.scale,r.offset);return{...i,[r.name]:u}},{})}function du(s,e=[]){let t=fu(s,e);return{...(()=>{let{pointDataRecordFormat:i}=s;switch(i){case 0:return Zn(s);case 1:return pu(s);case 2:return mu(s);case 3:return gu(s);case 6:return aa(s);case 7:return oa(s);case 8:return _u(s);default:throw new Error(`Unsupported point data record format: ${i}`)}})(),...t}}function Zn(s){let{scale:e,offset:t}=s,n=mt(s);function i(c,u){return c.getUint8(n(u)+14)}function r(c,u){return c.getUint8(n(u)+15)}function l(c,u){return r(c,u)&31}return{X:(c,u)=>Je.Scale.unapply(c.getInt32(n(u),!0),e[0],t[0]),Y:(c,u)=>Je.Scale.unapply(c.getInt32(n(u)+4,!0),e[1],t[1]),Z:(c,u)=>Je.Scale.unapply(c.getInt32(n(u)+8,!0),e[2],t[2]),Intensity:(c,u)=>c.getUint16(n(u)+12,!0),ReturnNumber:(c,u)=>i(c,u)&7,NumberOfReturns:(c,u)=>(i(c,u)&56)>>3,ScanDirectionFlag:(c,u)=>(i(c,u)&64)>>6,EdgeOfFlightLine:(c,u)=>(i(c,u)&128)>>7,Classification:(c,u)=>{let h=l(c,u);return h===12?0:h},Synthetic:(c,u)=>(r(c,u)&32)>>5,KeyPoint:(c,u)=>(r(c,u)&64)>>6,Withheld:(c,u)=>(r(c,u)&128)>>7,Overlap:(c,u)=>l(c,u)===12?1:0,ScanAngle:(c,u)=>c.getInt8(n(u)+16),UserData:(c,u)=>c.getUint8(n(u)+17),PointSourceId:(c,u)=>c.getUint16(n(u)+18,!0)}}function pu(s){let e=mt(s);return{...Zn(s),GpsTime:(t,n)=>t.getFloat64(e(n)+20,!0)}}function mu(s){let e=mt(s);return{...Zn(s),Red:(t,n)=>t.getUint16(e(n)+20,!0),Green:(t,n)=>t.getUint16(e(n)+22,!0),Blue:(t,n)=>t.getUint16(e(n)+24,!0)}}function gu(s){let e=mt(s);return{...Zn(s),GpsTime:(t,n)=>t.getFloat64(e(n)+20,!0),Red:(t,n)=>t.getUint16(e(n)+28,!0),Green:(t,n)=>t.getUint16(e(n)+30,!0),Blue:(t,n)=>t.getUint16(e(n)+32,!0)}}function aa(s){let{scale:e,offset:t}=s,n=mt(s);function i(r,l){return r.getUint8(n(l)+15)}return{X:(r,l)=>Je.Scale.unapply(r.getInt32(n(l),!0),e[0],t[0]),Y:(r,l)=>Je.Scale.unapply(r.getInt32(n(l)+4,!0),e[1],t[1]),Z:(r,l)=>Je.Scale.unapply(r.getInt32(n(l)+8,!0),e[2],t[2]),Intensity:(r,l)=>r.getUint16(n(l)+12,!0),ReturnNumber:(r,l)=>r.getUint16(n(l)+14,!0)&15,NumberOfReturns:(r,l)=>(r.getUint16(n(l)+14,!0)&240)>>4,Synthetic:(r,l)=>i(r,l)&1,KeyPoint:(r,l)=>(i(r,l)&2)>>1,Withheld:(r,l)=>(i(r,l)&4)>>2,Overlap:(r,l)=>(i(r,l)&8)>>3,ScannerChannel:(r,l)=>(i(r,l)&48)>>4,ScanDirectionFlag:(r,l)=>(i(r,l)&64)>>6,EdgeOfFlightLine:(r,l)=>(i(r,l)&128)>>7,Classification:(r,l)=>r.getUint8(n(l)+16),UserData:(r,l)=>r.getUint8(n(l)+17),ScanAngle:(r,l)=>r.getInt16(n(l)+18,!0)*.006,PointSourceId:(r,l)=>r.getUint16(n(l)+20,!0),GpsTime:(r,l)=>r.getFloat64(n(l)+22,!0)}}function oa(s){let e=mt(s);return{...aa(s),Red:(t,n)=>t.getUint16(e(n)+30,!0),Green:(t,n)=>t.getUint16(e(n)+32,!0),Blue:(t,n)=>t.getUint16(e(n)+34,!0)}}function _u(s){let e=mt(s);return{...oa(s),Infrared:(t,n)=>t.getUint16(e(n)+36,!0)}}function mt(s){let{pointDataRecordLength:e}=s;return function(n){return n*e}}});var ca=K(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.formatGuid=kt.parsePoint=void 0;var la=ze();function yu(s){let e=la.Binary.toDataView(s);if(e.byteLength!==24)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]}kt.parsePoint=yu;function vu(s){let e=la.Binary.toDataView(s);if(e.byteLength!==16)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let t="";for(let n=0;n<e.byteLength;n+=4){let i=e.getUint32(n,!0);t+=i.toString(16).padStart(8,"0")}return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,32)].join("-")}kt.formatGuid=vu});var ir=K(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Header=void 0;var Ie=ze(),ua=zn(),nr=ca();jn.Header={parse:xu};function xu(s){if(s.byteLength<ua.minHeaderLength)throw new Error(`Invalid header: must be at least ${ua.minHeaderLength} bytes`);let e=Ie.Binary.toDataView(s),t=Ie.Binary.toCString(s.slice(0,4));if(t!=="LASF")throw new Error(`Invalid file signature: ${t}`);let n=e.getUint8(24),i=e.getUint8(25);if(n!==1||i!==2&&i!==4)throw new Error(`Invalid version (only 1.2 and 1.4 supported): ${n}.${i}`);let r={fileSignature:t,fileSourceId:e.getUint16(4,!0),globalEncoding:e.getUint16(6,!0),projectId:(0,nr.formatGuid)(s.slice(8,24)),majorVersion:n,minorVersion:i,systemIdentifier:Ie.Binary.toCString(s.slice(26,58)),generatingSoftware:Ie.Binary.toCString(s.slice(58,90)),fileCreationDayOfYear:e.getUint16(90,!0),fileCreationYear:e.getUint16(92,!0),headerLength:e.getUint16(94,!0),pointDataOffset:e.getUint32(96,!0),vlrCount:e.getUint32(100,!0),pointDataRecordFormat:e.getUint8(104)&15,pointDataRecordLength:e.getUint16(105,!0),pointCount:e.getUint32(107,!0),pointCountByReturn:bu(s.slice(111,131)),scale:(0,nr.parsePoint)(s.slice(131,155)),offset:(0,nr.parsePoint)(s.slice(155,179)),min:[e.getFloat64(187,!0),e.getFloat64(203,!0),e.getFloat64(219,!0)],max:[e.getFloat64(179,!0),e.getFloat64(195,!0),e.getFloat64(211,!0)],waveformDataOffset:0,evlrOffset:0,evlrCount:0};return i==2?r:{...r,pointCount:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,247,!0)),pointCountByReturn:Su(s.slice(255,375)),waveformDataOffset:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,227,!0)),evlrOffset:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,235,!0)),evlrCount:e.getUint32(243,!0)}}function Su(s){let e=Ie.Binary.toDataView(s),t=[];for(let n=0;n<120;n+=8)t.push((0,Ie.getBigUint64)(e,n,!0));return t.map(n=>(0,Ie.parseBigInt)(n))}function bu(s){let e=Ie.Binary.toDataView(s),t=[];for(let n=0;n<20;n+=4)t.push(e.getUint32(n,!0));return t}});var ha=K((Kn,sr)=>{var rr=(()=>{var s=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return(function(e){e=e||{};var t=typeof e<"u"?e:{},n,i;t.ready=new Promise(function(a,o){n=a,i=o}),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach(a=>{Object.getOwnPropertyDescriptor(t.ready,a)||Object.defineProperty(t.ready,a,{get:()=>Re("You are getting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>Re("You are setting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})});var r=Object.assign({},t),l=[],c="./this.program",u=(a,o)=>{throw o},h=!0,d=!1,p=!1,v=!1;if(t.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var _="";function g(a){return t.locateFile?t.locateFile(a,_):_+a}var x,A,E,I;function N(a){if(a instanceof Po)return;let o=a;a&&typeof a=="object"&&a.stack&&(o=[a,a.stack]),C("exiting due to exception: "+o)}if(v){if(typeof process=="object"&&typeof Ns=="function"||typeof window=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");typeof read<"u"&&(x=function(o){return read(o)}),E=function(o){let f;return typeof readbuffer=="function"?new Uint8Array(readbuffer(o)):(f=read(o,"binary"),L(typeof f=="object"),f)},A=function(o,f,m){setTimeout(()=>f(E(o)),0)},typeof scriptArgs<"u"?l=scriptArgs:typeof arguments<"u"&&(l=arguments),typeof quit=="function"&&(u=(a,o)=>{N(o),quit(a)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)}else if(h||d){if(d?_=self.location.href:typeof document<"u"&&document.currentScript&&(_=document.currentScript.src),s&&(_=s),_.indexOf("blob:")!==0?_=_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):_="",!(typeof window=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");x=a=>{var o=new XMLHttpRequest;return o.open("GET",a,!1),o.send(null),o.responseText},d&&(E=a=>{var o=new XMLHttpRequest;return o.open("GET",a,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}),A=(a,o,f)=>{var m=new XMLHttpRequest;m.open("GET",a,!0),m.responseType="arraybuffer",m.onload=()=>{if(m.status==200||m.status==0&&m.response){o(m.response);return}f()},m.onerror=f,m.send(null)},I=a=>document.title=a}else throw new Error("environment detection error");var O=t.print||console.log.bind(console),C=t.printErr||console.warn.bind(console);Object.assign(t,r),r=null,rc(),t.arguments&&(l=t.arguments),z("arguments","arguments_"),t.thisProgram&&(c=t.thisProgram),z("thisProgram","thisProgram"),t.quit&&(u=t.quit),z("quit","quit_"),L(typeof t.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),L(typeof t.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),L(typeof t.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),L(typeof t.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),L(typeof t.read>"u","Module.read option was removed (modify read_ in JS)"),L(typeof t.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),L(typeof t.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),L(typeof t.setWindowTitle>"u","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),L(typeof t.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),z("read","read_"),z("readAsync","readAsync"),z("readBinary","readBinary"),z("setWindowTitle","setWindowTitle"),L(!d,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),L(!p,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),L(!v,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var G=4;function z(a,o){Object.getOwnPropertyDescriptor(t,a)||Object.defineProperty(t,a,{configurable:!0,get:function(){Re("Module."+a+" has been replaced with plain "+o+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function $(a){Object.getOwnPropertyDescriptor(t,a)&&Re("`Module."+a+"` was supplied but `"+a+"` not included in INCOMING_MODULE_JS_API")}function Q(a){return a==="FS_createPath"||a==="FS_createDataFile"||a==="FS_createPreloadedFile"||a==="FS_unlink"||a==="addRunDependency"||a==="FS_createLazyFile"||a==="FS_createDevice"||a==="removeRunDependency"}function re(a){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,a)&&Object.defineProperty(globalThis,a,{configurable:!0,get:function(){var o="`"+a+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";Q(a)&&(o+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),lt(o)}})}function y(a){Object.getOwnPropertyDescriptor(t,a)||Object.defineProperty(t,a,{configurable:!0,get:function(){var o="'"+a+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";Q(a)&&(o+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Re(o)}})}var M;t.wasmBinary&&(M=t.wasmBinary),z("wasmBinary","wasmBinary");var B=t.noExitRuntime||!0;z("noExitRuntime","noExitRuntime"),typeof WebAssembly!="object"&&Re("no native wasm support detected");var X,k=!1,q;function L(a,o){a||Re("Assertion failed"+(o?": "+o:""))}var de=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function _e(a,o,f){for(var m=o+f,S=o;a[S]&&!(S>=m);)++S;if(S-o>16&&a.buffer&&de)return de.decode(a.subarray(o,S));for(var w="";o<S;){var T=a[o++];if(!(T&128)){w+=String.fromCharCode(T);continue}var b=a[o++]&63;if((T&224)==192){w+=String.fromCharCode((T&31)<<6|b);continue}var P=a[o++]&63;if((T&240)==224?T=(T&15)<<12|b<<6|P:((T&248)!=240&<("Invalid UTF-8 leading byte 0x"+T.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),T=(T&7)<<18|b<<12|P<<6|a[o++]&63),T<65536)w+=String.fromCharCode(T);else{var D=T-65536;w+=String.fromCharCode(55296|D>>10,56320|D&1023)}}return w}function ee(a,o){return a?_e(Ce,a,o):""}function pe(a,o,f,m){if(!(m>0))return 0;for(var S=f,w=f+m-1,T=0;T<a.length;++T){var b=a.charCodeAt(T);if(b>=55296&&b<=57343){var P=a.charCodeAt(++T);b=65536+((b&1023)<<10)|P&1023}if(b<=127){if(f>=w)break;o[f++]=b}else if(b<=2047){if(f+1>=w)break;o[f++]=192|b>>6,o[f++]=128|b&63}else if(b<=65535){if(f+2>=w)break;o[f++]=224|b>>12,o[f++]=128|b>>6&63,o[f++]=128|b&63}else{if(f+3>=w)break;b>1114111&<("Invalid Unicode code point 0x"+b.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),o[f++]=240|b>>18,o[f++]=128|b>>12&63,o[f++]=128|b>>6&63,o[f++]=128|b&63}}return o[f]=0,f-S}function Tn(a,o,f){return L(typeof f=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),pe(a,Ce,o,f)}function ts(a){for(var o=0,f=0;f<a.length;++f){var m=a.charCodeAt(f);m<=127?o++:m<=2047?o+=2:m>=55296&&m<=57343?(o+=4,++f):o+=3}return o}var En,Ye,Ce,It,An,oe,ie,ns,is;function rs(a){En=a,t.HEAP8=Ye=new Int8Array(a),t.HEAP16=It=new Int16Array(a),t.HEAP32=oe=new Int32Array(a),t.HEAPU8=Ce=new Uint8Array(a),t.HEAPU16=An=new Uint16Array(a),t.HEAPU32=ie=new Uint32Array(a),t.HEAPF32=ns=new Float32Array(a),t.HEAPF64=is=new Float64Array(a)}var Pi=65536;t.TOTAL_STACK&&L(Pi===t.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Ii=t.INITIAL_MEMORY||262144;z("INITIAL_MEMORY","INITIAL_MEMORY"),L(Ii>=Pi,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Ii+"! (TOTAL_STACK="+Pi+")"),L(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),L(!t.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),L(Ii==262144,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");var ot;function _o(){var a=Zi();L((a&3)==0),ie[a>>2]=34821223,ie[a+4>>2]=2310721022,ie[0]=1668509029}function Li(){if(!k){var a=Zi(),o=ie[a>>2],f=ie[a+4>>2];(o!=34821223||f!=2310721022)&&Re("Stack overflow! Stack cookie has been overwritten at 0x"+a.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+f.toString(16)+" 0x"+o.toString(16)),ie[0]!==1668509029&&Re("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(function(){var a=new Int16Array(1),o=new Int8Array(a.buffer);if(a[0]=25459,o[0]!==115||o[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var ss=[],as=[],os=[],Di=!1;function yo(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)So(t.preRun.shift());Ui(ss)}function vo(){L(!Di),Di=!0,Li(),Ui(as)}function xo(){if(Li(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Mo(t.postRun.shift());Ui(os)}function So(a){ss.unshift(a)}function bo(a){as.unshift(a)}function Mo(a){os.unshift(a)}L(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Tt=0,Et=null,rn=null,sn={};function wo(a){Tt++,t.monitorRunDependencies&&t.monitorRunDependencies(Tt),a?(L(!sn[a]),sn[a]=1,Et===null&&typeof setInterval<"u"&&(Et=setInterval(function(){if(k){clearInterval(Et),Et=null;return}var o=!1;for(var f in sn)o||(o=!0,C("still waiting on run dependencies:")),C("dependency: "+f);o&&C("(end of list)")},1e4))):C("warning: run dependency added without ID")}function To(a){if(Tt--,t.monitorRunDependencies&&t.monitorRunDependencies(Tt),a?(L(sn[a]),delete sn[a]):C("warning: run dependency removed without ID"),Tt==0&&(Et!==null&&(clearInterval(Et),Et=null),rn)){var o=rn;rn=null,o()}}function Re(a){t.onAbort&&t.onAbort(a),a="Aborted("+a+")",C(a),k=!0,q=1;var o=new WebAssembly.RuntimeError(a);throw i(o),o}var Fe={error:function(){Re("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){Fe.error()},createDataFile:function(){Fe.error()},createPreloadedFile:function(){Fe.error()},createLazyFile:function(){Fe.error()},open:function(){Fe.error()},mkdev:function(){Fe.error()},registerDevice:function(){Fe.error()},analyzePath:function(){Fe.error()},loadFilesFromDB:function(){Fe.error()},ErrnoError:function(){Fe.error()}};t.FS_createDataFile=Fe.createDataFile,t.FS_createPreloadedFile=Fe.createPreloadedFile;var Eo="data:application/octet-stream;base64,";function ls(a){return a.startsWith(Eo)}function Ao(a){return a.startsWith("file://")}function ye(a,o){return function(){var f=a,m=o;return o||(m=t.asm),L(Di,"native function `"+f+"` called before runtime initialization"),m[a]||L(m[a],"exported native function `"+f+"` not found"),m[a].apply(null,arguments)}}var De;De="laz-perf.wasm",ls(De)||(De=g(De));function cs(a){try{if(a==De&&M)return new Uint8Array(M);if(E)return E(a);throw"both async and sync fetching of the wasm failed"}catch(o){Re(o)}}function Co(){return!M&&(h||d)&&typeof fetch=="function"?fetch(De,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+De+"'";return a.arrayBuffer()}).catch(function(){return cs(De)}):Promise.resolve().then(function(){return cs(De)})}function Ro(){var a={env:Ps,wasi_snapshot_preview1:Ps};function o(b,P){var D=b.exports;t.asm=D,X=t.asm.memory,L(X,"memory not found in wasm exports"),rs(X.buffer),ot=t.asm.__indirect_function_table,L(ot,"table not found in wasm exports"),bo(t.asm.__wasm_call_ctors),To("wasm-instantiate")}wo("wasm-instantiate");var f=t;function m(b){L(t===f,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),f=null,o(b.instance)}function S(b){return Co().then(function(P){return WebAssembly.instantiate(P,a)}).then(function(P){return P}).then(b,function(P){C("failed to asynchronously prepare wasm: "+P),Ao(De)&&C("warning: Loading from a file URI ("+De+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),Re(P)})}function w(){return!M&&typeof WebAssembly.instantiateStreaming=="function"&&!ls(De)&&typeof fetch=="function"?fetch(De,{credentials:"same-origin"}).then(function(b){var P=WebAssembly.instantiateStreaming(b,a);return P.then(m,function(D){return C("wasm streaming compile failed: "+D),C("falling back to ArrayBuffer instantiation"),S(m)})}):S(m)}if(t.instantiateWasm)try{var T=t.instantiateWasm(a,o);return T}catch(b){return C("Module.instantiateWasm callback failed with error: "+b),!1}return w().catch(i),{}}var kp,Gp;function Po(a){this.name="ExitStatus",this.message="Program terminated with exit("+a+")",this.status=a}function Ui(a){for(;a.length>0;)a.shift()(t)}function Io(a){return lt("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),a}function Hp(a){var o=/\b_Z[\w\d_]+/g;return a.replace(o,function(f){var m=Io(f);return f===m?f:m+" ["+f+"]"})}function Wp(){var a=new Error;if(!a.stack){try{throw new Error}catch(o){a=o}if(!a.stack)return"(no stack trace available)"}return a.stack.toString()}function lt(a){lt.shown||(lt.shown={}),lt.shown[a]||(lt.shown[a]=1,C(a))}function us(a,o){L(a.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Ye.set(a,o)}function Lo(a){return $i(a+24)+24}function Do(a){this.excPtr=a,this.ptr=a-24,this.set_type=function(o){ie[this.ptr+4>>2]=o},this.get_type=function(){return ie[this.ptr+4>>2]},this.set_destructor=function(o){ie[this.ptr+8>>2]=o},this.get_destructor=function(){return ie[this.ptr+8>>2]},this.set_refcount=function(o){oe[this.ptr>>2]=o},this.set_caught=function(o){o=o?1:0,Ye[this.ptr+12>>0]=o},this.get_caught=function(){return Ye[this.ptr+12>>0]!=0},this.set_rethrown=function(o){o=o?1:0,Ye[this.ptr+13>>0]=o},this.get_rethrown=function(){return Ye[this.ptr+13>>0]!=0},this.init=function(o,f){this.set_adjusted_ptr(0),this.set_type(o),this.set_destructor(f),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var o=oe[this.ptr>>2];oe[this.ptr>>2]=o+1},this.release_ref=function(){var o=oe[this.ptr>>2];return oe[this.ptr>>2]=o-1,L(o>0),o===1},this.set_adjusted_ptr=function(o){ie[this.ptr+16>>2]=o},this.get_adjusted_ptr=function(){return ie[this.ptr+16>>2]},this.get_exception_ptr=function(){var o=hc(this.get_type());if(o)return ie[this.excPtr>>2];var f=this.get_adjusted_ptr();return f!==0?f:this.excPtr}}var Uo=0,No=0;function Fo(a,o,f){var m=new Do(a);throw m.init(o,f),Uo=a,No++,a+" - Exception catching is disabled, this exception cannot be caught. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch."}function Oo(a,o,f,m,S){}function Ni(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a)}}function Bo(){for(var a=new Array(256),o=0;o<256;++o)a[o]=String.fromCharCode(o);hs=a}var hs=void 0;function Oe(a){for(var o="",f=a;Ce[f];)o+=hs[Ce[f++]];return o}var Lt={},Dt={},Cn={},zo=48,Vo=57;function fs(a){if(a===void 0)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var o=a.charCodeAt(0);return o>=zo&&o<=Vo?"_"+a:a}function ds(a,o){return a=fs(a),function(){"use strict";return o.apply(this,arguments)}}function Fi(a,o){var f=ds(o,function(m){this.name=o,this.message=m;var S=new Error(m).stack;S!==void 0&&(this.stack=this.toString()+`
|
|
3
|
-
`+
|
|
1
|
+
var mc=Object.create;var Us=Object.defineProperty;var gc=Object.getOwnPropertyDescriptor;var _c=Object.getOwnPropertyNames;var yc=Object.getPrototypeOf,vc=Object.prototype.hasOwnProperty;var Ns=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var te=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var xc=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _c(e))!vc.call(s,i)&&i!==t&&Us(s,i,{get:()=>e[i],enumerable:!(n=gc(e,i))||n.enumerable});return s};var On=(s,e,t)=>(t=s!=null?mc(yc(s)):{},xc(e||!s||!s.__esModule?Us(t,"default",{value:s,enumerable:!0}):t,s));var Os=te(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0})});var Bs=te(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Hierarchy=void 0;Bn.Hierarchy={parse:Sc};function Sc(s){return Object.entries(s).reduce((e,[t,n])=>(n===-1?e.pages[t]={}:n&&(e.nodes[t]={pointCount:n}),e),{nodes:{},pages:{}})}});var Vs=te(ht=>{"use strict";var bc=ht&&ht.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),zs=ht&&ht.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bc(e,s,t)};Object.defineProperty(ht,"__esModule",{value:!0});zs(Os(),ht);zs(Bs(),ht)});var zn=te(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.hierarchyItemLength=zt.infoLength=void 0;zt.infoLength=160;zt.hierarchyItemLength=32});var Vn=te(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.evlrHeaderLength=ft.vlrHeaderLength=ft.minHeaderLength=void 0;ft.minHeaderLength=375;ft.vlrHeaderLength=54;ft.evlrHeaderLength=60});var ks=te(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getBigUint64=Vt.parseBigInt=void 0;function Mc(s){if(s>BigInt(Number.MAX_SAFE_INTEGER)||s<BigInt(-Number.MAX_SAFE_INTEGER))throw new Error(`Cannot convert bigint to number: ${s}`);return Number(s)}Vt.parseBigInt=Mc;function wc(s,e,t){if(s.getBigUint64)return s.getBigUint64(e,t);let[n,i]=t?[4,0]:[0,4],r=BigInt(s.getUint32(e+n,t)),l=BigInt(s.getUint32(e+i,t));return(r<<BigInt(32))+l}Vt.getBigUint64=wc});var Ki=te(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.toCString=dt.toDataView=dt.Binary=void 0;dt.Binary={toDataView:ji,toCString:Gs};function ji(s){return new DataView(s.buffer,s.byteOffset,s.length)}dt.toDataView=ji;function Gs(s){let e=ji(s),t="";for(let n=0;n<e.byteLength;++n){let i=e.getInt8(n);if(i===0)return t;t+=String.fromCharCode(i)}return t}dt.toCString=Gs});var Ys=te(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.Bounds=void 0;kn.Bounds={min:Tc,max:Ec,mid:Qi,width:Hs,depth:Ws,height:Xs,cube:Ac,step:qs,stepTo:Cc,intersection:Rc};function Tc(s){return[s[0],s[1],s[2]]}function Ec(s){return[s[3],s[4],s[5]]}function Qi([s,e,t,n,i,r]){return[s+(n-s)/2,e+(i-e)/2,t+(r-t)/2]}function Hs(s){return s[3]-s[0]}function Ws(s){return s[4]-s[1]}function Xs(s){return s[5]-s[2]}function Ac(s){let e=Qi(s),t=Math.max(Hs(s),Ws(s),Xs(s))/2;return[e[0]-t,e[1]-t,e[2]-t,e[0]+t,e[1]+t,e[2]+t]}function qs(s,[e,t,n]){let[i,r,l,c,u,h]=s,[d,p,_]=Qi(s);return[e?d:i,t?p:r,n?_:l,e?c:d,t?u:p,n?h:_]}function Cc(s,[e,t,n,i]){for(let r=e-1;r>=0;--r)s=qs(s,[t>>r&1,n>>r&1,i>>r&1]);return s}function Rc(s,e){return[Math.max(s[0],e[0]),Math.max(s[1],e[1]),Math.max(s[2],e[2]),Math.min(s[3],e[3]),Math.min(s[4],e[4]),Math.min(s[5],e[5])]}});var $s=te(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Dimension=void 0;var Pc={int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}};Gn.Dimension={Type:Pc,ctype:Ic};function Ic({type:s,size:e}){switch(s){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${s}/${e}`)}});var Js=te((pt,Zs)=>{var Hn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Wn=(function(){function s(){this.fetch=!1,this.DOMException=Hn.DOMException}return s.prototype=Hn,new s})();(function(s){var e=(function(t){var n=typeof s<"u"&&s||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function r(g){return g&&DataView.prototype.isPrototypeOf(g)}if(i.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(g){return g&&l.indexOf(Object.prototype.toString.call(g))>-1};function u(g){if(typeof g!="string"&&(g=String(g)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(g)||g==="")throw new TypeError('Invalid character in header field name: "'+g+'"');return g.toLowerCase()}function h(g){return typeof g!="string"&&(g=String(g)),g}function d(g){var T={next:function(){var D=g.shift();return{done:D===void 0,value:D}}};return i.iterable&&(T[Symbol.iterator]=function(){return T}),T}function p(g){this.map={},g instanceof p?g.forEach(function(T,D){this.append(D,T)},this):Array.isArray(g)?g.forEach(function(T){if(T.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+T.length);this.append(T[0],T[1])},this):g&&Object.getOwnPropertyNames(g).forEach(function(T){this.append(T,g[T])},this)}p.prototype.append=function(g,T){g=u(g),T=h(T);var D=this.map[g];this.map[g]=D?D+", "+T:T},p.prototype.delete=function(g){delete this.map[u(g)]},p.prototype.get=function(g){return g=u(g),this.has(g)?this.map[g]:null},p.prototype.has=function(g){return this.map.hasOwnProperty(u(g))},p.prototype.set=function(g,T){this.map[u(g)]=h(T)},p.prototype.forEach=function(g,T){for(var D in this.map)this.map.hasOwnProperty(D)&&g.call(T,this.map[D],D,this)},p.prototype.keys=function(){var g=[];return this.forEach(function(T,D){g.push(D)}),d(g)},p.prototype.values=function(){var g=[];return this.forEach(function(T){g.push(T)}),d(g)},p.prototype.entries=function(){var g=[];return this.forEach(function(T,D){g.push([D,T])}),d(g)},i.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function _(g){if(!g._noBody){if(g.bodyUsed)return Promise.reject(new TypeError("Already read"));g.bodyUsed=!0}}function y(g){return new Promise(function(T,D){g.onload=function(){T(g.result)},g.onerror=function(){D(g.error)}})}function v(g){var T=new FileReader,D=y(T);return T.readAsArrayBuffer(g),D}function M(g){var T=new FileReader,D=y(T),V=/charset=([A-Za-z0-9_-]+)/.exec(g.type),k=V?V[1]:"utf-8";return T.readAsText(g,k),D}function b(g){for(var T=new Uint8Array(g),D=new Array(T.length),V=0;V<T.length;V++)D[V]=String.fromCharCode(T[V]);return D.join("")}function S(g){if(g.slice)return g.slice(0);var T=new Uint8Array(g.byteLength);return T.set(new Uint8Array(g)),T.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(g){this.bodyUsed=this.bodyUsed,this._bodyInit=g,g?typeof g=="string"?this._bodyText=g:i.blob&&Blob.prototype.isPrototypeOf(g)?this._bodyBlob=g:i.formData&&FormData.prototype.isPrototypeOf(g)?this._bodyFormData=g:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(g)?this._bodyText=g.toString():i.arrayBuffer&&i.blob&&r(g)?(this._bodyArrayBuffer=S(g.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(g)||c(g))?this._bodyArrayBuffer=S(g):this._bodyText=g=Object.prototype.toString.call(g):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof g=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(g)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var g=_(this);if(g)return g;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var g=_(this);return g||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var g=_(this);if(g)return g;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(b(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function B(g){var T=g.toUpperCase();return L.indexOf(T)>-1?T:g}function C(g,T){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T=T||{};var D=T.body;if(g instanceof C){if(g.bodyUsed)throw new TypeError("Already read");this.url=g.url,this.credentials=g.credentials,T.headers||(this.headers=new p(g.headers)),this.method=g.method,this.mode=g.mode,this.signal=g.signal,!D&&g._bodyInit!=null&&(D=g._bodyInit,g.bodyUsed=!0)}else this.url=String(g);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new p(T.headers)),this.method=B(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal||(function(){if("AbortController"in n){var Y=new AbortController;return Y.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(D),(this.method==="GET"||this.method==="HEAD")&&(T.cache==="no-store"||T.cache==="no-cache")){var V=/([?&])_=[^&]*/;if(V.test(this.url))this.url=this.url.replace(V,"$1_="+new Date().getTime());else{var k=/\?/;this.url+=(k.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function G(g){var T=new FormData;return g.trim().split("&").forEach(function(D){if(D){var V=D.split("="),k=V.shift().replace(/\+/g," "),Y=V.join("=").replace(/\+/g," ");T.append(decodeURIComponent(k),decodeURIComponent(Y))}}),T}function O(g){var T=new p,D=g.replace(/\r?\n[\t ]+/g," ");return D.split("\r").map(function(V){return V.indexOf(`
|
|
2
|
+
`)===0?V.substr(1,V.length):V}).forEach(function(V){var k=V.split(":"),Y=k.shift().trim();if(Y){var U=k.join(":").trim();try{T.append(Y,U)}catch(ge){console.warn("Response "+ge.message)}}}),T}R.call(C.prototype);function W(g,T){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(T||(T={}),this.type="default",this.status=T.status===void 0?200:T.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=T.statusText===void 0?"":""+T.statusText,this.headers=new p(T.headers),this.url=T.url||"",this._initBody(g)}R.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},W.error=function(){var g=new W(null,{status:200,statusText:""});return g.ok=!1,g.status=0,g.type="error",g};var $=[301,302,303,307,308];W.redirect=function(g,T){if($.indexOf(T)===-1)throw new RangeError("Invalid status code");return new W(null,{status:T,headers:{location:g}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(T,D){this.message=T,this.name=D;var V=Error(T);this.stack=V.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function j(g,T){return new Promise(function(D,V){var k=new C(g,T);if(k.signal&&k.signal.aborted)return V(new t.DOMException("Aborted","AbortError"));var Y=new XMLHttpRequest;function U(){Y.abort()}Y.onload=function(){var K={statusText:Y.statusText,headers:O(Y.getAllResponseHeaders()||"")};k.url.indexOf("file://")===0&&(Y.status<200||Y.status>599)?K.status=200:K.status=Y.status,K.url="responseURL"in Y?Y.responseURL:K.headers.get("X-Request-URL");var ue="response"in Y?Y.response:Y.responseText;setTimeout(function(){D(new W(ue,K))},0)},Y.onerror=function(){setTimeout(function(){V(new TypeError("Network request failed"))},0)},Y.ontimeout=function(){setTimeout(function(){V(new TypeError("Network request timed out"))},0)},Y.onabort=function(){setTimeout(function(){V(new t.DOMException("Aborted","AbortError"))},0)};function ge(K){try{return K===""&&n.location.href?n.location.href:K}catch{return K}}if(Y.open(k.method,ge(k.url),!0),k.credentials==="include"?Y.withCredentials=!0:k.credentials==="omit"&&(Y.withCredentials=!1),"responseType"in Y&&(i.blob?Y.responseType="blob":i.arrayBuffer&&(Y.responseType="arraybuffer")),T&&typeof T.headers=="object"&&!(T.headers instanceof p||n.Headers&&T.headers instanceof n.Headers)){var ve=[];Object.getOwnPropertyNames(T.headers).forEach(function(K){ve.push(u(K)),Y.setRequestHeader(K,h(T.headers[K]))}),k.headers.forEach(function(K,ue){ve.indexOf(ue)===-1&&Y.setRequestHeader(ue,K)})}else k.headers.forEach(function(K,ue){Y.setRequestHeader(ue,K)});k.signal&&(k.signal.addEventListener("abort",U),Y.onreadystatechange=function(){Y.readyState===4&&k.signal.removeEventListener("abort",U)}),Y.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return j.polyfill=!0,n.fetch||(n.fetch=j,n.Headers=p,n.Request=C,n.Response=W),t.Headers=p,t.Request=C,t.Response=W,t.fetch=j,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(Wn);Wn.fetch.ponyfill=!0;delete Wn.fetch.polyfill;var kt=Hn.fetch?Hn:Wn;pt=kt.fetch;pt.default=kt.fetch;pt.fetch=kt.fetch;pt.Headers=kt.Headers;pt.Request=kt.Request;pt.Response=kt.Response;Zs.exports=pt});var js=te(()=>{});var ea=te(Be=>{"use strict";var Lc=Be&&Be.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Dc=Be&&Be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Uc=Be&&Be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Lc(e,s,t);return Dc(e,s),e},Nc=Be&&Be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Be,"__esModule",{value:!0});Be.Getter=void 0;var Fc=Nc(Js());Be.Getter={create:Oc,http:Ks,file:Qs};function Oc(s){return typeof s=="function"?s:s.startsWith("http://")||s.startsWith("https://")?Ks(s):Qs(s)}function Ks(s){return async function(t,n){if(t<0||n<0||t>n)throw new Error("Invalid range");let r=await(await(0,Fc.default)(s,{headers:{Range:`bytes=${t}-${n-1}`}})).arrayBuffer();return new Uint8Array(r)}}function Qs(s){return async function(t,n){let i=await Promise.resolve().then(()=>Uc(js()));async function r(l=0,c=1/0){if(l<0||c<0||l>c)throw new Error("Invalid range");await i.promises.access(s);let u=i.createReadStream(s,{start:l,end:c-1,autoClose:!0});return Bc(u)}return r(t,n)}}async function Bc(s){return await new Promise((e,t)=>{let n=[];s.on("data",i=>n.push(i)),s.on("error",t),s.on("end",()=>e(Buffer.concat(n)))})}});var na=te(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.Key=void 0;Gt.Key={create:zc,parse:ta,toString:Vc,step:kc,up:Gc,compare:Hc,depth:Wc};function zc(s,e=0,t=0,n=0){return typeof s!="number"?ta(s):[s,e,t,n]}function ta(s){if(typeof s!="string")return s;let[e,t,n,i,...r]=s.split("-").map(c=>parseInt(c,10)),l=[e,t,n,i];if(r.length!==0||l.some(c=>typeof c!="number"||Number.isNaN(c)))throw new Error(`Invalid key: ${s}`);return l}function Vc(s){return typeof s=="string"?s:s.join("-")}function kc(s,[e,t,n]){let[i,r,l,c]=Gt.Key.create(s);return[i+1,r*2+e,l*2+t,c*2+n]}function Gc(s,e=1){let[t,n,i,r]=Gt.Key.create(s);return[t-e,n>>e,i>>e,r>>e]}function Hc(s,e){for(let t=0;t<s.length;++t){if(s[t]<e[t])return-1;if(s[t]>e[t])return 1}return 0}function Wc(s){return s[0]}});var ia=te(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Scale=void 0;Xn.Scale={apply:(s,e=1,t=0)=>(s-t)/e,unapply:(s,e=1,t=0)=>s*e+t}});var ra=te(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.Step=void 0;qn.Step={fromIndex:Xc,list:qc};function Xc(s){if(s<0||s>=8)throw new Error(`Invalid step index: ${s}`);let e=s>>0&1?1:0,t=s>>1&1?1:0,n=s>>2&1?1:0;return[e,t,n]}function qc(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}});var ze=te(fe=>{"use strict";var Yc=fe&&fe.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),$c=fe&&fe.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Yc(e,s,t)};Object.defineProperty(fe,"__esModule",{value:!0});fe.Step=fe.Scale=fe.Key=fe.Getter=fe.Dimension=fe.Bounds=fe.Binary=void 0;$c(ks(),fe);var Zc=Ki();Object.defineProperty(fe,"Binary",{enumerable:!0,get:function(){return Zc.Binary}});var Jc=Ys();Object.defineProperty(fe,"Bounds",{enumerable:!0,get:function(){return Jc.Bounds}});var jc=$s();Object.defineProperty(fe,"Dimension",{enumerable:!0,get:function(){return jc.Dimension}});var Kc=ea();Object.defineProperty(fe,"Getter",{enumerable:!0,get:function(){return Kc.Getter}});var Qc=na();Object.defineProperty(fe,"Key",{enumerable:!0,get:function(){return Qc.Key}});var eu=ia();Object.defineProperty(fe,"Scale",{enumerable:!0,get:function(){return eu.Scale}});var tu=ra();Object.defineProperty(fe,"Step",{enumerable:!0,get:function(){return tu.Step}})});var er=te($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.ExtraBytes=void 0;var Se=ze();$n.ExtraBytes={getDimension:nu,parse:iu,parseOne:sa};var Yn=192;function nu({type:s,length:e}){switch(s){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:s,size:e}}case"float":switch(e){case 4:case 8:return{type:s,size:e}}}}function iu(s){if(s.byteLength%Yn!==0)throw new Error(`Invalid extra bytes VLR length: ${s.byteLength}`);let e=[];for(let t=0;t<s.byteLength;t+=Yn)e.push(sa(s.slice(t,t+Yn)));return e}function sa(s){if(s.byteLength!==Yn)throw new Error(`Invalid extra bytes entry length: ${s.byteLength}`);let e=Se.Binary.toDataView(s),t=Se.Binary.toCString(s.slice(4,36)),n=Se.Binary.toCString(s.slice(60,192)),i=e.getUint8(2),r=e.getUint8(3);if(i>=11)throw new Error(`Invalid extra bytes "type" value: ${i}`);if(i===0)return{name:t,description:n,length:r};let l=su(r),c=ru(i);if(!c)throw new Error(`Failed to extract dimension type: ${i}`);let{type:u,size:h}=c;function d(_){switch(u){case"signed":return(0,Se.parseBigInt)(e.getBigInt64(_,!0));case"unsigned":return(0,Se.parseBigInt)((0,Se.getBigUint64)(e,_,!0));case"float":return e.getFloat64(_,!0)}}let p={name:t,description:n,type:u,length:h};return l.hasNodata&&(p.nodata=d(40)),l.hasMin&&(p.min=d(64)),l.hasMax&&(p.max=d(88)),l.hasScale&&(p.scale=e.getFloat64(112)),l.hasOffset&&(p.offset=e.getFloat64(136)),p}function ru(s){switch(s){case 1:return Se.Dimension.Type.uint8;case 2:return Se.Dimension.Type.int8;case 3:return Se.Dimension.Type.uint16;case 4:return Se.Dimension.Type.int16;case 5:return Se.Dimension.Type.uint32;case 6:return Se.Dimension.Type.int32;case 7:return Se.Dimension.Type.uint64;case 8:return Se.Dimension.Type.int64;case 9:return Se.Dimension.Type.float32;case 10:return Se.Dimension.Type.float64}}function su(s){return{hasNodata:!!(s&1),hasMin:!!(s>>1&1),hasMax:!!(s>>2&1),hasScale:!!(s>>3&1),hasOffset:!!(s>>4&1)}}});var tr=te(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.Dimensions=void 0;var au=ze(),ou=er();Zn.Dimensions={create:cu};var{Type:he}=au.Dimension,lu={X:he.float64,Y:he.float64,Z:he.float64,Intensity:he.uint16,ReturnNumber:he.uint8,NumberOfReturns:he.uint8,ScanDirectionFlag:he.boolean,EdgeOfFlightLine:he.boolean,Classification:he.uint8,Synthetic:he.boolean,KeyPoint:he.boolean,Withheld:he.boolean,Overlap:he.boolean,ScanAngle:he.float32,UserData:he.uint8,PointSourceId:he.uint16,GpsTime:he.float64,Red:he.uint16,Green:he.uint16,Blue:he.uint16,ScannerChannel:he.uint8,Infrared:he.uint16};function cu(s,e=[]){return Object.keys(s).reduce((t,n)=>{let i=lu[n];if(i)return{...t,[n]:i};let r=e.find(c=>c.name===n),l=r&&ou.ExtraBytes.getDimension(r);if(l)return{...t,[n]:l};throw new Error(`Failed to look up LAS type: ${n}`)},{})}});var nr=te(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Extractor=void 0;var Je=ze();jn.Extractor={create:du};function uu(s){switch(s){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${s}`)}}function hu(s,e,{type:t,length:n}){let i=mt(s);switch(t){case"signed":switch(n){case 1:return(r,l)=>r.getInt8(i(l)+e);case 2:return(r,l)=>r.getInt16(i(l)+e,!0);case 4:return(r,l)=>r.getInt32(i(l)+e,!0);case 8:return(r,l)=>(0,Je.parseBigInt)(r.getBigInt64(i(l)+e,!0))}case"unsigned":switch(n){case 1:return(r,l)=>r.getUint8(i(l)+e);case 2:return(r,l)=>r.getUint16(i(l)+e,!0);case 4:return(r,l)=>r.getUint32(i(l)+e,!0);case 8:return(r,l)=>(0,Je.parseBigInt)((0,Je.getBigUint64)(r,i(l)+e,!0))}case"float":switch(n){case 4:return(r,l)=>r.getFloat32(i(l)+e,!0);case 8:return(r,l)=>r.getFloat64(i(l)+e,!0)}}}function fu(s,e){let n=uu(s.pointDataRecordFormat);return e.reduce((i,r)=>{let l=n;n+=r.length;let c=hu(s,l,r);if(!c)return i;let u=(h,d)=>Je.Scale.unapply(c(h,d),r.scale,r.offset);return{...i,[r.name]:u}},{})}function du(s,e=[]){let t=fu(s,e);return{...(()=>{let{pointDataRecordFormat:i}=s;switch(i){case 0:return Jn(s);case 1:return pu(s);case 2:return mu(s);case 3:return gu(s);case 6:return aa(s);case 7:return oa(s);case 8:return _u(s);default:throw new Error(`Unsupported point data record format: ${i}`)}})(),...t}}function Jn(s){let{scale:e,offset:t}=s,n=mt(s);function i(c,u){return c.getUint8(n(u)+14)}function r(c,u){return c.getUint8(n(u)+15)}function l(c,u){return r(c,u)&31}return{X:(c,u)=>Je.Scale.unapply(c.getInt32(n(u),!0),e[0],t[0]),Y:(c,u)=>Je.Scale.unapply(c.getInt32(n(u)+4,!0),e[1],t[1]),Z:(c,u)=>Je.Scale.unapply(c.getInt32(n(u)+8,!0),e[2],t[2]),Intensity:(c,u)=>c.getUint16(n(u)+12,!0),ReturnNumber:(c,u)=>i(c,u)&7,NumberOfReturns:(c,u)=>(i(c,u)&56)>>3,ScanDirectionFlag:(c,u)=>(i(c,u)&64)>>6,EdgeOfFlightLine:(c,u)=>(i(c,u)&128)>>7,Classification:(c,u)=>{let h=l(c,u);return h===12?0:h},Synthetic:(c,u)=>(r(c,u)&32)>>5,KeyPoint:(c,u)=>(r(c,u)&64)>>6,Withheld:(c,u)=>(r(c,u)&128)>>7,Overlap:(c,u)=>l(c,u)===12?1:0,ScanAngle:(c,u)=>c.getInt8(n(u)+16),UserData:(c,u)=>c.getUint8(n(u)+17),PointSourceId:(c,u)=>c.getUint16(n(u)+18,!0)}}function pu(s){let e=mt(s);return{...Jn(s),GpsTime:(t,n)=>t.getFloat64(e(n)+20,!0)}}function mu(s){let e=mt(s);return{...Jn(s),Red:(t,n)=>t.getUint16(e(n)+20,!0),Green:(t,n)=>t.getUint16(e(n)+22,!0),Blue:(t,n)=>t.getUint16(e(n)+24,!0)}}function gu(s){let e=mt(s);return{...Jn(s),GpsTime:(t,n)=>t.getFloat64(e(n)+20,!0),Red:(t,n)=>t.getUint16(e(n)+28,!0),Green:(t,n)=>t.getUint16(e(n)+30,!0),Blue:(t,n)=>t.getUint16(e(n)+32,!0)}}function aa(s){let{scale:e,offset:t}=s,n=mt(s);function i(r,l){return r.getUint8(n(l)+15)}return{X:(r,l)=>Je.Scale.unapply(r.getInt32(n(l),!0),e[0],t[0]),Y:(r,l)=>Je.Scale.unapply(r.getInt32(n(l)+4,!0),e[1],t[1]),Z:(r,l)=>Je.Scale.unapply(r.getInt32(n(l)+8,!0),e[2],t[2]),Intensity:(r,l)=>r.getUint16(n(l)+12,!0),ReturnNumber:(r,l)=>r.getUint16(n(l)+14,!0)&15,NumberOfReturns:(r,l)=>(r.getUint16(n(l)+14,!0)&240)>>4,Synthetic:(r,l)=>i(r,l)&1,KeyPoint:(r,l)=>(i(r,l)&2)>>1,Withheld:(r,l)=>(i(r,l)&4)>>2,Overlap:(r,l)=>(i(r,l)&8)>>3,ScannerChannel:(r,l)=>(i(r,l)&48)>>4,ScanDirectionFlag:(r,l)=>(i(r,l)&64)>>6,EdgeOfFlightLine:(r,l)=>(i(r,l)&128)>>7,Classification:(r,l)=>r.getUint8(n(l)+16),UserData:(r,l)=>r.getUint8(n(l)+17),ScanAngle:(r,l)=>r.getInt16(n(l)+18,!0)*.006,PointSourceId:(r,l)=>r.getUint16(n(l)+20,!0),GpsTime:(r,l)=>r.getFloat64(n(l)+22,!0)}}function oa(s){let e=mt(s);return{...aa(s),Red:(t,n)=>t.getUint16(e(n)+30,!0),Green:(t,n)=>t.getUint16(e(n)+32,!0),Blue:(t,n)=>t.getUint16(e(n)+34,!0)}}function _u(s){let e=mt(s);return{...oa(s),Infrared:(t,n)=>t.getUint16(e(n)+36,!0)}}function mt(s){let{pointDataRecordLength:e}=s;return function(n){return n*e}}});var ca=te(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.formatGuid=Ht.parsePoint=void 0;var la=ze();function yu(s){let e=la.Binary.toDataView(s);if(e.byteLength!==24)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]}Ht.parsePoint=yu;function vu(s){let e=la.Binary.toDataView(s);if(e.byteLength!==16)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let t="";for(let n=0;n<e.byteLength;n+=4){let i=e.getUint32(n,!0);t+=i.toString(16).padStart(8,"0")}return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,32)].join("-")}Ht.formatGuid=vu});var rr=te(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Header=void 0;var Ie=ze(),ua=Vn(),ir=ca();Kn.Header={parse:xu};function xu(s){if(s.byteLength<ua.minHeaderLength)throw new Error(`Invalid header: must be at least ${ua.minHeaderLength} bytes`);let e=Ie.Binary.toDataView(s),t=Ie.Binary.toCString(s.slice(0,4));if(t!=="LASF")throw new Error(`Invalid file signature: ${t}`);let n=e.getUint8(24),i=e.getUint8(25);if(n!==1||i!==2&&i!==4)throw new Error(`Invalid version (only 1.2 and 1.4 supported): ${n}.${i}`);let r={fileSignature:t,fileSourceId:e.getUint16(4,!0),globalEncoding:e.getUint16(6,!0),projectId:(0,ir.formatGuid)(s.slice(8,24)),majorVersion:n,minorVersion:i,systemIdentifier:Ie.Binary.toCString(s.slice(26,58)),generatingSoftware:Ie.Binary.toCString(s.slice(58,90)),fileCreationDayOfYear:e.getUint16(90,!0),fileCreationYear:e.getUint16(92,!0),headerLength:e.getUint16(94,!0),pointDataOffset:e.getUint32(96,!0),vlrCount:e.getUint32(100,!0),pointDataRecordFormat:e.getUint8(104)&15,pointDataRecordLength:e.getUint16(105,!0),pointCount:e.getUint32(107,!0),pointCountByReturn:bu(s.slice(111,131)),scale:(0,ir.parsePoint)(s.slice(131,155)),offset:(0,ir.parsePoint)(s.slice(155,179)),min:[e.getFloat64(187,!0),e.getFloat64(203,!0),e.getFloat64(219,!0)],max:[e.getFloat64(179,!0),e.getFloat64(195,!0),e.getFloat64(211,!0)],waveformDataOffset:0,evlrOffset:0,evlrCount:0};return i==2?r:{...r,pointCount:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,247,!0)),pointCountByReturn:Su(s.slice(255,375)),waveformDataOffset:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,227,!0)),evlrOffset:(0,Ie.parseBigInt)((0,Ie.getBigUint64)(e,235,!0)),evlrCount:e.getUint32(243,!0)}}function Su(s){let e=Ie.Binary.toDataView(s),t=[];for(let n=0;n<120;n+=8)t.push((0,Ie.getBigUint64)(e,n,!0));return t.map(n=>(0,Ie.parseBigInt)(n))}function bu(s){let e=Ie.Binary.toDataView(s),t=[];for(let n=0;n<20;n+=4)t.push(e.getUint32(n,!0));return t}});var ha=te((Qn,ar)=>{var sr=(()=>{var s=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return(function(e){e=e||{};var t=typeof e<"u"?e:{},n,i;t.ready=new Promise(function(a,o){n=a,i=o}),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach(a=>{Object.getOwnPropertyDescriptor(t.ready,a)||Object.defineProperty(t.ready,a,{get:()=>Re("You are getting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>Re("You are setting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})});var r=Object.assign({},t),l=[],c="./this.program",u=(a,o)=>{throw o},h=!0,d=!1,p=!1,_=!1;if(t.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var y="";function v(a){return t.locateFile?t.locateFile(a,y):y+a}var M,b,S,R;function L(a){if(a instanceof Po)return;let o=a;a&&typeof a=="object"&&a.stack&&(o=[a,a.stack]),C("exiting due to exception: "+o)}if(_){if(typeof process=="object"&&typeof Ns=="function"||typeof window=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");typeof read<"u"&&(M=function(o){return read(o)}),S=function(o){let f;return typeof readbuffer=="function"?new Uint8Array(readbuffer(o)):(f=read(o,"binary"),U(typeof f=="object"),f)},b=function(o,f,m){setTimeout(()=>f(S(o)),0)},typeof scriptArgs<"u"?l=scriptArgs:typeof arguments<"u"&&(l=arguments),typeof quit=="function"&&(u=(a,o)=>{L(o),quit(a)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)}else if(h||d){if(d?y=self.location.href:typeof document<"u"&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y.indexOf("blob:")!==0?y=y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):y="",!(typeof window=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");M=a=>{var o=new XMLHttpRequest;return o.open("GET",a,!1),o.send(null),o.responseText},d&&(S=a=>{var o=new XMLHttpRequest;return o.open("GET",a,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}),b=(a,o,f)=>{var m=new XMLHttpRequest;m.open("GET",a,!0),m.responseType="arraybuffer",m.onload=()=>{if(m.status==200||m.status==0&&m.response){o(m.response);return}f()},m.onerror=f,m.send(null)},R=a=>document.title=a}else throw new Error("environment detection error");var B=t.print||console.log.bind(console),C=t.printErr||console.warn.bind(console);Object.assign(t,r),r=null,rc(),t.arguments&&(l=t.arguments),O("arguments","arguments_"),t.thisProgram&&(c=t.thisProgram),O("thisProgram","thisProgram"),t.quit&&(u=t.quit),O("quit","quit_"),U(typeof t.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),U(typeof t.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),U(typeof t.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),U(typeof t.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),U(typeof t.read>"u","Module.read option was removed (modify read_ in JS)"),U(typeof t.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),U(typeof t.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),U(typeof t.setWindowTitle>"u","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),U(typeof t.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),O("read","read_"),O("readAsync","readAsync"),O("readBinary","readBinary"),O("setWindowTitle","setWindowTitle"),U(!d,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),U(!p,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),U(!_,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var G=4;function O(a,o){Object.getOwnPropertyDescriptor(t,a)||Object.defineProperty(t,a,{configurable:!0,get:function(){Re("Module."+a+" has been replaced with plain "+o+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function W(a){Object.getOwnPropertyDescriptor(t,a)&&Re("`Module."+a+"` was supplied but `"+a+"` not included in INCOMING_MODULE_JS_API")}function $(a){return a==="FS_createPath"||a==="FS_createDataFile"||a==="FS_createPreloadedFile"||a==="FS_unlink"||a==="addRunDependency"||a==="FS_createLazyFile"||a==="FS_createDevice"||a==="removeRunDependency"}function j(a){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,a)&&Object.defineProperty(globalThis,a,{configurable:!0,get:function(){var o="`"+a+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";$(a)&&(o+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),lt(o)}})}function g(a){Object.getOwnPropertyDescriptor(t,a)||Object.defineProperty(t,a,{configurable:!0,get:function(){var o="'"+a+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";$(a)&&(o+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Re(o)}})}var T;t.wasmBinary&&(T=t.wasmBinary),O("wasmBinary","wasmBinary");var D=t.noExitRuntime||!0;O("noExitRuntime","noExitRuntime"),typeof WebAssembly!="object"&&Re("no native wasm support detected");var V,k=!1,Y;function U(a,o){a||Re("Assertion failed"+(o?": "+o:""))}var ge=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ve(a,o,f){for(var m=o+f,x=o;a[x]&&!(x>=m);)++x;if(x-o>16&&a.buffer&&ge)return ge.decode(a.subarray(o,x));for(var E="";o<x;){var A=a[o++];if(!(A&128)){E+=String.fromCharCode(A);continue}var w=a[o++]&63;if((A&224)==192){E+=String.fromCharCode((A&31)<<6|w);continue}var I=a[o++]&63;if((A&240)==224?A=(A&15)<<12|w<<6|I:((A&248)!=240&<("Invalid UTF-8 leading byte 0x"+A.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),A=(A&7)<<18|w<<12|I<<6|a[o++]&63),A<65536)E+=String.fromCharCode(A);else{var N=A-65536;E+=String.fromCharCode(55296|N>>10,56320|N&1023)}}return E}function K(a,o){return a?ve(Ce,a,o):""}function ue(a,o,f,m){if(!(m>0))return 0;for(var x=f,E=f+m-1,A=0;A<a.length;++A){var w=a.charCodeAt(A);if(w>=55296&&w<=57343){var I=a.charCodeAt(++A);w=65536+((w&1023)<<10)|I&1023}if(w<=127){if(f>=E)break;o[f++]=w}else if(w<=2047){if(f+1>=E)break;o[f++]=192|w>>6,o[f++]=128|w&63}else if(w<=65535){if(f+2>=E)break;o[f++]=224|w>>12,o[f++]=128|w>>6&63,o[f++]=128|w&63}else{if(f+3>=E)break;w>1114111&<("Invalid Unicode code point 0x"+w.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),o[f++]=240|w>>18,o[f++]=128|w>>12&63,o[f++]=128|w>>6&63,o[f++]=128|w&63}}return o[f]=0,f-x}function an(a,o,f){return U(typeof f=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),ue(a,Ce,o,f)}function It(a){for(var o=0,f=0;f<a.length;++f){var m=a.charCodeAt(f);m<=127?o++:m<=2047?o+=2:m>=55296&&m<=57343?(o+=4,++f):o+=3}return o}var Lt,Ye,Ce,Dt,Cn,oe,re,ns,is;function rs(a){Lt=a,t.HEAP8=Ye=new Int8Array(a),t.HEAP16=Dt=new Int16Array(a),t.HEAP32=oe=new Int32Array(a),t.HEAPU8=Ce=new Uint8Array(a),t.HEAPU16=Cn=new Uint16Array(a),t.HEAPU32=re=new Uint32Array(a),t.HEAPF32=ns=new Float32Array(a),t.HEAPF64=is=new Float64Array(a)}var Ii=65536;t.TOTAL_STACK&&U(Ii===t.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Li=t.INITIAL_MEMORY||262144;O("INITIAL_MEMORY","INITIAL_MEMORY"),U(Li>=Ii,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Li+"! (TOTAL_STACK="+Ii+")"),U(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),U(!t.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),U(Li==262144,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");var ot;function _o(){var a=Ji();U((a&3)==0),re[a>>2]=34821223,re[a+4>>2]=2310721022,re[0]=1668509029}function Di(){if(!k){var a=Ji(),o=re[a>>2],f=re[a+4>>2];(o!=34821223||f!=2310721022)&&Re("Stack overflow! Stack cookie has been overwritten at 0x"+a.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+f.toString(16)+" 0x"+o.toString(16)),re[0]!==1668509029&&Re("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(function(){var a=new Int16Array(1),o=new Int8Array(a.buffer);if(a[0]=25459,o[0]!==115||o[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var ss=[],as=[],os=[],Ui=!1;function yo(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)So(t.preRun.shift());Ni(ss)}function vo(){U(!Ui),Ui=!0,Di(),Ni(as)}function xo(){if(Di(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Mo(t.postRun.shift());Ni(os)}function So(a){ss.unshift(a)}function bo(a){as.unshift(a)}function Mo(a){os.unshift(a)}U(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),U(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),U(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),U(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Tt=0,Et=null,on=null,ln={};function wo(a){Tt++,t.monitorRunDependencies&&t.monitorRunDependencies(Tt),a?(U(!ln[a]),ln[a]=1,Et===null&&typeof setInterval<"u"&&(Et=setInterval(function(){if(k){clearInterval(Et),Et=null;return}var o=!1;for(var f in ln)o||(o=!0,C("still waiting on run dependencies:")),C("dependency: "+f);o&&C("(end of list)")},1e4))):C("warning: run dependency added without ID")}function To(a){if(Tt--,t.monitorRunDependencies&&t.monitorRunDependencies(Tt),a?(U(ln[a]),delete ln[a]):C("warning: run dependency removed without ID"),Tt==0&&(Et!==null&&(clearInterval(Et),Et=null),on)){var o=on;on=null,o()}}function Re(a){t.onAbort&&t.onAbort(a),a="Aborted("+a+")",C(a),k=!0,Y=1;var o=new WebAssembly.RuntimeError(a);throw i(o),o}var Fe={error:function(){Re("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){Fe.error()},createDataFile:function(){Fe.error()},createPreloadedFile:function(){Fe.error()},createLazyFile:function(){Fe.error()},open:function(){Fe.error()},mkdev:function(){Fe.error()},registerDevice:function(){Fe.error()},analyzePath:function(){Fe.error()},loadFilesFromDB:function(){Fe.error()},ErrnoError:function(){Fe.error()}};t.FS_createDataFile=Fe.createDataFile,t.FS_createPreloadedFile=Fe.createPreloadedFile;var Eo="data:application/octet-stream;base64,";function ls(a){return a.startsWith(Eo)}function Ao(a){return a.startsWith("file://")}function _e(a,o){return function(){var f=a,m=o;return o||(m=t.asm),U(Ui,"native function `"+f+"` called before runtime initialization"),m[a]||U(m[a],"exported native function `"+f+"` not found"),m[a].apply(null,arguments)}}var De;De="laz-perf.wasm",ls(De)||(De=v(De));function cs(a){try{if(a==De&&T)return new Uint8Array(T);if(S)return S(a);throw"both async and sync fetching of the wasm failed"}catch(o){Re(o)}}function Co(){return!T&&(h||d)&&typeof fetch=="function"?fetch(De,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+De+"'";return a.arrayBuffer()}).catch(function(){return cs(De)}):Promise.resolve().then(function(){return cs(De)})}function Ro(){var a={env:Ps,wasi_snapshot_preview1:Ps};function o(w,I){var N=w.exports;t.asm=N,V=t.asm.memory,U(V,"memory not found in wasm exports"),rs(V.buffer),ot=t.asm.__indirect_function_table,U(ot,"table not found in wasm exports"),bo(t.asm.__wasm_call_ctors),To("wasm-instantiate")}wo("wasm-instantiate");var f=t;function m(w){U(t===f,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),f=null,o(w.instance)}function x(w){return Co().then(function(I){return WebAssembly.instantiate(I,a)}).then(function(I){return I}).then(w,function(I){C("failed to asynchronously prepare wasm: "+I),Ao(De)&&C("warning: Loading from a file URI ("+De+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),Re(I)})}function E(){return!T&&typeof WebAssembly.instantiateStreaming=="function"&&!ls(De)&&typeof fetch=="function"?fetch(De,{credentials:"same-origin"}).then(function(w){var I=WebAssembly.instantiateStreaming(w,a);return I.then(m,function(N){return C("wasm streaming compile failed: "+N),C("falling back to ArrayBuffer instantiation"),x(m)})}):x(m)}if(t.instantiateWasm)try{var A=t.instantiateWasm(a,o);return A}catch(w){return C("Module.instantiateWasm callback failed with error: "+w),!1}return E().catch(i),{}}var kp,Gp;function Po(a){this.name="ExitStatus",this.message="Program terminated with exit("+a+")",this.status=a}function Ni(a){for(;a.length>0;)a.shift()(t)}function Io(a){return lt("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),a}function Hp(a){var o=/\b_Z[\w\d_]+/g;return a.replace(o,function(f){var m=Io(f);return f===m?f:m+" ["+f+"]"})}function Wp(){var a=new Error;if(!a.stack){try{throw new Error}catch(o){a=o}if(!a.stack)return"(no stack trace available)"}return a.stack.toString()}function lt(a){lt.shown||(lt.shown={}),lt.shown[a]||(lt.shown[a]=1,C(a))}function us(a,o){U(a.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Ye.set(a,o)}function Lo(a){return Zi(a+24)+24}function Do(a){this.excPtr=a,this.ptr=a-24,this.set_type=function(o){re[this.ptr+4>>2]=o},this.get_type=function(){return re[this.ptr+4>>2]},this.set_destructor=function(o){re[this.ptr+8>>2]=o},this.get_destructor=function(){return re[this.ptr+8>>2]},this.set_refcount=function(o){oe[this.ptr>>2]=o},this.set_caught=function(o){o=o?1:0,Ye[this.ptr+12>>0]=o},this.get_caught=function(){return Ye[this.ptr+12>>0]!=0},this.set_rethrown=function(o){o=o?1:0,Ye[this.ptr+13>>0]=o},this.get_rethrown=function(){return Ye[this.ptr+13>>0]!=0},this.init=function(o,f){this.set_adjusted_ptr(0),this.set_type(o),this.set_destructor(f),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var o=oe[this.ptr>>2];oe[this.ptr>>2]=o+1},this.release_ref=function(){var o=oe[this.ptr>>2];return oe[this.ptr>>2]=o-1,U(o>0),o===1},this.set_adjusted_ptr=function(o){re[this.ptr+16>>2]=o},this.get_adjusted_ptr=function(){return re[this.ptr+16>>2]},this.get_exception_ptr=function(){var o=hc(this.get_type());if(o)return re[this.excPtr>>2];var f=this.get_adjusted_ptr();return f!==0?f:this.excPtr}}var Uo=0,No=0;function Fo(a,o,f){var m=new Do(a);throw m.init(o,f),Uo=a,No++,a+" - Exception catching is disabled, this exception cannot be caught. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch."}function Oo(a,o,f,m,x){}function Fi(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a)}}function Bo(){for(var a=new Array(256),o=0;o<256;++o)a[o]=String.fromCharCode(o);hs=a}var hs=void 0;function Oe(a){for(var o="",f=a;Ce[f];)o+=hs[Ce[f++]];return o}var Ut={},Nt={},Rn={},zo=48,Vo=57;function fs(a){if(a===void 0)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var o=a.charCodeAt(0);return o>=zo&&o<=Vo?"_"+a:a}function ds(a,o){return a=fs(a),function(){"use strict";return o.apply(this,arguments)}}function Oi(a,o){var f=ds(o,function(m){this.name=o,this.message=m;var x=new Error(m).stack;x!==void 0&&(this.stack=this.toString()+`
|
|
3
|
+
`+x.replace(/^Error(:[^\n]*)?\n/,""))});return f.prototype=Object.create(a.prototype),f.prototype.constructor=f,f.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},f}var Ft=void 0;function ne(a){throw new Ft(a)}var ps=void 0;function Pn(a){throw new ps(a)}function cn(a,o,f){a.forEach(function(w){Rn[w]=o});function m(w){var I=f(w);I.length!==a.length&&Pn("Mismatched type converter count");for(var N=0;N<a.length;++N)et(a[N],I[N])}var x=new Array(o.length),E=[],A=0;o.forEach((w,I)=>{Nt.hasOwnProperty(w)?x[I]=Nt[w]:(E.push(w),Ut.hasOwnProperty(w)||(Ut[w]=[]),Ut[w].push(()=>{x[I]=Nt[w],++A,A===E.length&&m(x)}))}),E.length===0&&m(x)}function et(a,o,f={}){if(!("argPackAdvance"in o))throw new TypeError("registerType registeredInstance requires argPackAdvance");var m=o.name;if(a||ne('type "'+m+'" must have a positive integer typeid pointer'),Nt.hasOwnProperty(a)){if(f.ignoreDuplicateRegistrations)return;ne("Cannot register type '"+m+"' twice")}if(Nt[a]=o,delete Rn[a],Ut.hasOwnProperty(a)){var x=Ut[a];delete Ut[a],x.forEach(E=>E())}}function ko(a,o,f,m,x){var E=Fi(f);o=Oe(o),et(a,{name:o,fromWireType:function(A){return!!A},toWireType:function(A,w){return w?m:x},argPackAdvance:8,readValueFromPointer:function(A){var w;if(f===1)w=Ye;else if(f===2)w=Dt;else if(f===4)w=oe;else throw new TypeError("Unknown boolean type size: "+o);return this.fromWireType(w[A>>E])},destructorFunction:null})}function Go(a){if(!(this instanceof ct)||!(a instanceof ct))return!1;for(var o=this.$$.ptrType.registeredClass,f=this.$$.ptr,m=a.$$.ptrType.registeredClass,x=a.$$.ptr;o.baseClass;)f=o.upcast(f),o=o.baseClass;for(;m.baseClass;)x=m.upcast(x),m=m.baseClass;return o===m&&f===x}function Ho(a){return{count:a.count,deleteScheduled:a.deleteScheduled,preservePointerOnDelete:a.preservePointerOnDelete,ptr:a.ptr,ptrType:a.ptrType,smartPtr:a.smartPtr,smartPtrType:a.smartPtrType}}function Bi(a){function o(f){return f.$$.ptrType.registeredClass.name}ne(o(a)+" instance already deleted")}var zi=!1;function ms(a){}function Wo(a){a.smartPtr?a.smartPtrType.rawDestructor(a.smartPtr):a.ptrType.registeredClass.rawDestructor(a.ptr)}function gs(a){a.count.value-=1;var o=a.count.value===0;o&&Wo(a)}function _s(a,o,f){if(o===f)return a;if(f.baseClass===void 0)return null;var m=_s(a,o,f.baseClass);return m===null?null:f.downcast(m)}var ys={};function Xo(){return Object.keys(fn).length}function qo(){var a=[];for(var o in fn)fn.hasOwnProperty(o)&&a.push(fn[o]);return a}var un=[];function Vi(){for(;un.length;){var a=un.pop();a.$$.deleteScheduled=!1,a.delete()}}var hn=void 0;function Yo(a){hn=a,un.length&&hn&&hn(Vi)}function $o(){t.getInheritedInstanceCount=Xo,t.getLiveInheritedInstances=qo,t.flushPendingDeletes=Vi,t.setDelayFunction=Yo}var fn={};function Zo(a,o){for(o===void 0&&ne("ptr should not be undefined");a.baseClass;)o=a.upcast(o),a=a.baseClass;return o}function Jo(a,o){return o=Zo(a,o),fn[o]}function In(a,o){(!o.ptrType||!o.ptr)&&Pn("makeClassHandle requires ptr and ptrType");var f=!!o.smartPtrType,m=!!o.smartPtr;return f!==m&&Pn("Both smartPtrType and smartPtr must be specified"),o.count={value:1},dn(Object.create(a,{$$:{value:o}}))}function vs(a){var o=this.getPointee(a);if(!o)return this.destructor(a),null;var f=Jo(this.registeredClass,o);if(f!==void 0){if(f.$$.count.value===0)return f.$$.ptr=o,f.$$.smartPtr=a,f.clone();var m=f.clone();return this.destructor(a),m}function x(){return this.isSmartPointer?In(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:o,smartPtrType:this,smartPtr:a}):In(this.registeredClass.instancePrototype,{ptrType:this,ptr:a})}var E=this.registeredClass.getActualType(o),A=ys[E];if(!A)return x.call(this);var w;this.isConst?w=A.constPointerType:w=A.pointerType;var I=_s(o,this.registeredClass,w.registeredClass);return I===null?x.call(this):this.isSmartPointer?In(w.registeredClass.instancePrototype,{ptrType:w,ptr:I,smartPtrType:this,smartPtr:a}):In(w.registeredClass.instancePrototype,{ptrType:w,ptr:I})}function dn(a){return typeof FinalizationRegistry>"u"?(dn=o=>o,a):(zi=new FinalizationRegistry(o=>{console.warn(o.leakWarning.stack.replace(/^Error: /,"")),gs(o.$$)}),dn=o=>{var f=o.$$,m=!!f.smartPtr;if(m){var x={$$:f},E=f.ptrType.registeredClass;x.leakWarning=new Error("Embind found a leaked C++ instance "+E.name+" <0x"+f.ptr.toString(16)+`>.
|
|
4
4
|
We'll free it automatically in this case, but this functionality is not reliable across various environments.
|
|
5
5
|
Make sure to invoke .delete() manually once you're done with the instance instead.
|
|
6
|
-
Originally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(S.leakWarning,vs),Bi.register(o,S,o)}return o},ms=o=>Bi.unregister(o),un(a))}function jo(){if(this.$$.ptr||Oi(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var a=un(Object.create(Object.getPrototypeOf(this),{$$:{value:Ho(this.$$)}}));return a.$$.count.value+=1,a.$$.deleteScheduled=!1,a}function Ko(){this.$$.ptr||Oi(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&te("Object already scheduled for deletion"),ms(this),gs(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Qo(){return!this.$$.ptr}function el(){return this.$$.ptr||Oi(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&te("Object already scheduled for deletion"),on.push(this),on.length===1&&ln&&ln(zi),this.$$.deleteScheduled=!0,this}function tl(){ct.prototype.isAliasOf=Go,ct.prototype.clone=jo,ct.prototype.delete=Ko,ct.prototype.isDeleted=Qo,ct.prototype.deleteLater=el}function ct(){}function xs(a,o,f){if(a[o].overloadTable===void 0){var m=a[o];a[o]=function(){return a[o].overloadTable.hasOwnProperty(arguments.length)||te("Function '"+f+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[o].overloadTable+")!"),a[o].overloadTable[arguments.length].apply(this,arguments)},a[o].overloadTable=[],a[o].overloadTable[m.argCount]=m}}function nl(a,o,f){t.hasOwnProperty(a)?((f===void 0||t[a].overloadTable!==void 0&&t[a].overloadTable[f]!==void 0)&&te("Cannot register public name '"+a+"' twice"),xs(t,a,a),t.hasOwnProperty(f)&&te("Cannot register multiple overloads of a function with the same number of arguments ("+f+")!"),t[a].overloadTable[f]=o):(t[a]=o,f!==void 0&&(t[a].numArguments=f))}function il(a,o,f,m,S,w,T,b){this.name=a,this.constructor=o,this.instancePrototype=f,this.rawDestructor=m,this.baseClass=S,this.getActualType=w,this.upcast=T,this.downcast=b,this.pureVirtualFunctions=[]}function Vi(a,o,f){for(;o!==f;)o.upcast||te("Expected null or instance of "+f.name+", got an instance of "+o.name),a=o.upcast(a),o=o.baseClass;return a}function rl(a,o){if(o===null)return this.isReference&&te("null is not a valid "+this.name),0;o.$$||te('Cannot pass "'+Ft(o)+'" as a '+this.name),o.$$.ptr||te("Cannot pass deleted object as a pointer of type "+this.name);var f=o.$$.ptrType.registeredClass,m=Vi(o.$$.ptr,f,this.registeredClass);return m}function sl(a,o){var f;if(o===null)return this.isReference&&te("null is not a valid "+this.name),this.isSmartPointer?(f=this.rawConstructor(),a!==null&&a.push(this.rawDestructor,f),f):0;o.$$||te('Cannot pass "'+Ft(o)+'" as a '+this.name),o.$$.ptr||te("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&o.$$.ptrType.isConst&&te("Cannot convert argument of type "+(o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name)+" to parameter type "+this.name);var m=o.$$.ptrType.registeredClass;if(f=Vi(o.$$.ptr,m,this.registeredClass),this.isSmartPointer)switch(o.$$.smartPtr===void 0&&te("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:o.$$.smartPtrType===this?f=o.$$.smartPtr:te("Cannot convert argument of type "+(o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:f=o.$$.smartPtr;break;case 2:if(o.$$.smartPtrType===this)f=o.$$.smartPtr;else{var S=o.clone();f=this.rawShare(f,Hi.toHandle(function(){S.delete()})),a!==null&&a.push(this.rawDestructor,f)}break;default:te("Unsupporting sharing policy")}return f}function al(a,o){if(o===null)return this.isReference&&te("null is not a valid "+this.name),0;o.$$||te('Cannot pass "'+Ft(o)+'" as a '+this.name),o.$$.ptr||te("Cannot pass deleted object as a pointer of type "+this.name),o.$$.ptrType.isConst&&te("Cannot convert argument of type "+o.$$.ptrType.name+" to parameter type "+this.name);var f=o.$$.ptrType.registeredClass,m=Vi(o.$$.ptr,f,this.registeredClass);return m}function In(a){return this.fromWireType(oe[a>>2])}function ol(a){return this.rawGetPointee&&(a=this.rawGetPointee(a)),a}function ll(a){this.rawDestructor&&this.rawDestructor(a)}function cl(a){a!==null&&a.delete()}function ul(){tt.prototype.getPointee=ol,tt.prototype.destructor=ll,tt.prototype.argPackAdvance=8,tt.prototype.readValueFromPointer=In,tt.prototype.deleteObject=cl,tt.prototype.fromWireType=vs}function tt(a,o,f,m,S,w,T,b,P,D,H){this.name=a,this.registeredClass=o,this.isReference=f,this.isConst=m,this.isSmartPointer=S,this.pointeeType=w,this.sharingPolicy=T,this.rawGetPointee=b,this.rawConstructor=P,this.rawShare=D,this.rawDestructor=H,!S&&o.baseClass===void 0?m?(this.toWireType=rl,this.destructorFunction=null):(this.toWireType=al,this.destructorFunction=null):this.toWireType=sl}function hl(a,o,f){t.hasOwnProperty(a)||Rn("Replacing nonexistant public symbol"),t[a].overloadTable!==void 0&&f!==void 0?t[a].overloadTable[f]=o:(t[a]=o,t[a].argCount=f)}function fl(a,o,f){L("dynCall_"+a in t,"bad function pointer type - no table for sig '"+a+"'"),f&&f.length?L(f.length===a.substring(1).replace(/j/g,"--").length):L(a.length==1);var m=t["dynCall_"+a];return f&&f.length?m.apply(null,[o].concat(f)):m.call(null,o)}var hn=[];function Ln(a){var o=hn[a];return o||(a>=hn.length&&(hn.length=a+1),hn[a]=o=ot.get(a)),L(ot.get(a)==o,"JavaScript-side Wasm function table mirror is out of date!"),o}function dl(a,o,f){if(a.includes("j"))return fl(a,o,f);L(Ln(o),"missing table entry in dynCall: "+o);var m=Ln(o).apply(null,f);return m}function pl(a,o){L(a.includes("j")||a.includes("p"),"getDynCaller should only be called with i64 sigs");var f=[];return function(){return f.length=0,Object.assign(f,arguments),dl(a,o,f)}}function Nt(a,o){a=Oe(a);function f(){return a.includes("j")?pl(a,o):Ln(o)}var m=f();return typeof m!="function"&&te("unknown function pointer with signature "+a+": "+o),m}var Ss=void 0;function ml(a){var o=sc(a),f=Oe(o);return ut(o),f}function ki(a,o){var f=[],m={};function S(w){if(!m[w]&&!Dt[w]){if(Cn[w]){Cn[w].forEach(S);return}f.push(w),m[w]=!0}}throw o.forEach(S),new Ss(a+": "+f.map(ml).join([", "]))}function gl(a,o,f,m,S,w,T,b,P,D,H,Y,W){H=Oe(H),w=Nt(S,w),b&&(b=Nt(T,b)),D&&(D=Nt(P,D)),W=Nt(Y,W);var ce=fs(H);nl(ce,function(){ki("Cannot construct "+H+" due to unbound types",[m])}),an([a,o,f],m?[m]:[],function(ne){ne=ne[0];var se,Pe;m?(se=ne.registeredClass,Pe=se.instancePrototype):Pe=ct.prototype;var Ze=ds(ce,function(){if(Object.getPrototypeOf(this)!==R)throw new Ut("Use 'new' to construct "+H);if(V.constructor_body===void 0)throw new Ut(H+" has no accessible constructor");var Nn=V.constructor_body[arguments.length];if(Nn===void 0)throw new Ut("Tried to invoke ctor of "+H+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(V.constructor_body).toString()+") parameters instead!");return Nn.apply(this,arguments)}),R=Object.create(Pe,{constructor:{value:Ze}});Ze.prototype=R;var V=new il(H,Ze,R,W,se,w,b,D),xe=new tt(H,V,!0,!1,!1),ve=new tt(H+"*",V,!1,!1,!1),At=new tt(H+" const*",V,!1,!0,!1);return ys[a]={pointerType:ve,constPointerType:At},hl(ce,Ze),[xe,ve,At]})}function bs(a,o){for(var f=[],m=0;m<a;m++)f.push(ie[o+m*4>>2]);return f}function _l(a){for(;a.length;){var o=a.pop(),f=a.pop();f(o)}}function Ms(a,o,f,m,S){var w=o.length;w<2&&te("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var T=o[1]!==null&&f!==null,b=!1,P=1;P<o.length;++P)if(o[P]!==null&&o[P].destructorFunction===void 0){b=!0;break}var D=o[0].name!=="void",H=w-2,Y=new Array(H),W=[],ce=[];return function(){arguments.length!==H&&te("function "+a+" called with "+arguments.length+" arguments, expected "+H+" args!"),ce.length=0;var ne;W.length=T?2:1,W[0]=S,T&&(ne=o[1].toWireType(ce,this),W[1]=ne);for(var se=0;se<H;++se)Y[se]=o[se+2].toWireType(ce,arguments[se]),W.push(Y[se]);var Pe=m.apply(null,W);function Ze(R){if(b)_l(ce);else for(var V=T?1:2;V<o.length;V++){var xe=V===1?ne:Y[V-2];o[V].destructorFunction!==null&&o[V].destructorFunction(xe)}if(D)return o[0].fromWireType(R)}return Ze(Pe)}}function yl(a,o,f,m,S,w){L(o>0);var T=bs(o,f);S=Nt(m,S),an([],[a],function(b){b=b[0];var P="constructor "+b.name;if(b.registeredClass.constructor_body===void 0&&(b.registeredClass.constructor_body=[]),b.registeredClass.constructor_body[o-1]!==void 0)throw new Ut("Cannot register multiple constructors with identical number of parameters ("+(o-1)+") for class '"+b.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return b.registeredClass.constructor_body[o-1]=()=>{ki("Cannot construct "+b.name+" due to unbound types",T)},an([],T,function(D){return D.splice(1,0,null),b.registeredClass.constructor_body[o-1]=Ms(P,D,null,S,w),[]}),[]})}function vl(a,o,f,m,S,w,T,b){var P=bs(f,m);o=Oe(o),w=Nt(S,w),an([],[a],function(D){D=D[0];var H=D.name+"."+o;o.startsWith("@@")&&(o=Symbol[o.substring(2)]),b&&D.registeredClass.pureVirtualFunctions.push(o);function Y(){ki("Cannot call "+H+" due to unbound types",P)}var W=D.registeredClass.instancePrototype,ce=W[o];return ce===void 0||ce.overloadTable===void 0&&ce.className!==D.name&&ce.argCount===f-2?(Y.argCount=f-2,Y.className=D.name,W[o]=Y):(xs(W,o,H),W[o].overloadTable[f-2]=Y),an([],P,function(ne){var se=Ms(H,ne,D,w,T);return W[o].overloadTable===void 0?(se.argCount=f-2,W[o]=se):W[o].overloadTable[f-2]=se,[]}),[]})}var Gi=[],$e=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function xl(a){a>4&&--$e[a].refcount===0&&($e[a]=void 0,Gi.push(a))}function Sl(){for(var a=0,o=5;o<$e.length;++o)$e[o]!==void 0&&++a;return a}function bl(){for(var a=5;a<$e.length;++a)if($e[a]!==void 0)return $e[a];return null}function Ml(){t.count_emval_handles=Sl,t.get_first_emval=bl}var Hi={toValue:a=>(a||te("Cannot use deleted val. handle = "+a),$e[a].value),toHandle:a=>{switch(a){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:{var o=Gi.length?Gi.pop():$e.length;return $e[o]={refcount:1,value:a},o}}}};function wl(a,o){o=Oe(o),et(a,{name:o,fromWireType:function(f){var m=Hi.toValue(f);return xl(f),m},toWireType:function(f,m){return Hi.toHandle(m)},argPackAdvance:8,readValueFromPointer:In,destructorFunction:null})}function Ft(a){if(a===null)return"null";var o=typeof a;return o==="object"||o==="array"||o==="function"?a.toString():""+a}function Tl(a,o){switch(o){case 2:return function(f){return this.fromWireType(ns[f>>2])};case 3:return function(f){return this.fromWireType(is[f>>3])};default:throw new TypeError("Unknown float type: "+a)}}function El(a,o,f){var m=Ni(f);o=Oe(o),et(a,{name:o,fromWireType:function(S){return S},toWireType:function(S,w){if(typeof w!="number"&&typeof w!="boolean")throw new TypeError('Cannot convert "'+Ft(w)+'" to '+this.name);return w},argPackAdvance:8,readValueFromPointer:Tl(o,m),destructorFunction:null})}function Al(a,o,f){switch(o){case 0:return f?function(S){return Ye[S]}:function(S){return Ce[S]};case 1:return f?function(S){return It[S>>1]}:function(S){return An[S>>1]};case 2:return f?function(S){return oe[S>>2]}:function(S){return ie[S>>2]};default:throw new TypeError("Unknown integer type: "+a)}}function Cl(a,o,f,m,S){o=Oe(o),S===-1&&(S=4294967295);var w=Ni(f),T=Y=>Y;if(m===0){var b=32-8*f;T=Y=>Y<<b>>>b}var P=o.includes("unsigned"),D=(Y,W)=>{if(typeof Y!="number"&&typeof Y!="boolean")throw new TypeError('Cannot convert "'+Ft(Y)+'" to '+W);if(Y<m||Y>S)throw new TypeError('Passing a number "'+Ft(Y)+'" from JS side to C/C++ side to an argument of type "'+o+'", which is outside the valid range ['+m+", "+S+"]!")},H;P?H=function(Y,W){return D(W,this.name),W>>>0}:H=function(Y,W){return D(W,this.name),W},et(a,{name:o,fromWireType:T,toWireType:H,argPackAdvance:8,readValueFromPointer:Al(o,w,m!==0),destructorFunction:null})}function Rl(a,o,f){var m=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],S=m[o];function w(T){T=T>>2;var b=ie,P=b[T],D=b[T+1];return new S(En,D,P)}f=Oe(f),et(a,{name:f,fromWireType:w,argPackAdvance:8,readValueFromPointer:w},{ignoreDuplicateRegistrations:!0})}function Pl(a,o){o=Oe(o);var f=o==="std::string";et(a,{name:o,fromWireType:function(m){var S=ie[m>>2],w=m+4,T;if(f)for(var b=w,P=0;P<=S;++P){var D=w+P;if(P==S||Ce[D]==0){var H=D-b,Y=ee(b,H);T===void 0?T=Y:(T+="\0",T+=Y),b=D+1}}else{for(var W=new Array(S),P=0;P<S;++P)W[P]=String.fromCharCode(Ce[w+P]);T=W.join("")}return ut(m),T},toWireType:function(m,S){S instanceof ArrayBuffer&&(S=new Uint8Array(S));var w,T=typeof S=="string";T||S instanceof Uint8Array||S instanceof Uint8ClampedArray||S instanceof Int8Array||te("Cannot pass non-string to std::string"),f&&T?w=ts(S):w=S.length;var b=$i(4+w+1),P=b+4;if(ie[b>>2]=w,f&&T)Tn(S,P,w+1);else if(T)for(var D=0;D<w;++D){var H=S.charCodeAt(D);H>255&&(ut(P),te("String has UTF-16 code units that do not fit in 8 bits")),Ce[P+D]=H}else for(var D=0;D<w;++D)Ce[P+D]=S[D];return m!==null&&m.push(ut,b),b},argPackAdvance:8,readValueFromPointer:In,destructorFunction:function(m){ut(m)}})}var ws=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Il(a,o){L(a%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var f=a,m=f>>1,S=m+o/2;!(m>=S)&&An[m];)++m;if(f=m<<1,f-a>32&&ws)return ws.decode(Ce.subarray(a,f));for(var w="",T=0;!(T>=o/2);++T){var b=It[a+T*2>>1];if(b==0)break;w+=String.fromCharCode(b)}return w}function Ll(a,o,f){if(L(o%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),L(typeof f=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),f===void 0&&(f=2147483647),f<2)return 0;f-=2;for(var m=o,S=f<a.length*2?f/2:a.length,w=0;w<S;++w){var T=a.charCodeAt(w);It[o>>1]=T,o+=2}return It[o>>1]=0,o-m}function Dl(a){return a.length*2}function Ul(a,o){L(a%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var f=0,m="";!(f>=o/4);){var S=oe[a+f*4>>2];if(S==0)break;if(++f,S>=65536){var w=S-65536;m+=String.fromCharCode(55296|w>>10,56320|w&1023)}else m+=String.fromCharCode(S)}return m}function Nl(a,o,f){if(L(o%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),L(typeof f=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),f===void 0&&(f=2147483647),f<4)return 0;for(var m=o,S=m+f-4,w=0;w<a.length;++w){var T=a.charCodeAt(w);if(T>=55296&&T<=57343){var b=a.charCodeAt(++w);T=65536+((T&1023)<<10)|b&1023}if(oe[o>>2]=T,o+=4,o+4>S)break}return oe[o>>2]=0,o-m}function Fl(a){for(var o=0,f=0;f<a.length;++f){var m=a.charCodeAt(f);m>=55296&&m<=57343&&++f,o+=4}return o}function Ol(a,o,f){f=Oe(f);var m,S,w,T,b;o===2?(m=Il,S=Ll,T=Dl,w=()=>An,b=1):o===4&&(m=Ul,S=Nl,T=Fl,w=()=>ie,b=2),et(a,{name:f,fromWireType:function(P){for(var D=ie[P>>2],H=w(),Y,W=P+4,ce=0;ce<=D;++ce){var ne=P+4+ce*o;if(ce==D||H[ne>>b]==0){var se=ne-W,Pe=m(W,se);Y===void 0?Y=Pe:(Y+="\0",Y+=Pe),W=ne+o}}return ut(P),Y},toWireType:function(P,D){typeof D!="string"&&te("Cannot pass non-string to C++ string type "+f);var H=T(D),Y=$i(4+H+o);return ie[Y>>2]=H>>b,S(D,Y+4,H+o),P!==null&&P.push(ut,Y),Y},argPackAdvance:8,readValueFromPointer:In,destructorFunction:function(P){ut(P)}})}function Bl(a,o){o=Oe(o),et(a,{isVoid:!0,name:o,argPackAdvance:0,fromWireType:function(){},toWireType:function(f,m){}})}function zl(){Re("native code called abort()")}function Vl(a,o,f){Ce.copyWithin(a,o,o+f)}function kl(){return 2147483648}function Gl(a){try{return X.grow(a-En.byteLength+65535>>>16),rs(X.buffer),1}catch(o){C("emscripten_realloc_buffer: Attempted to grow heap from "+En.byteLength+" bytes to "+a+" bytes, but got error: "+o)}}function Hl(a){var o=Ce.length;a=a>>>0,L(a>o);var f=kl();if(a>f)return C("Cannot enlarge memory, asked to go up to "+a+" bytes, but the limit is "+f+" bytes!"),!1;let m=(P,D)=>P+(D-P%D)%D;for(var S=1;S<=4;S*=2){var w=o*(1+.2/S);w=Math.min(w,a+100663296);var T=Math.min(f,m(Math.max(a,w),65536)),b=Gl(T);if(b)return!0}return C("Failed to grow the heap from "+o+" bytes to "+T+" bytes, not enough memory!"),!1}var Wi={};function Wl(){return c||"./this.program"}function fn(){if(!fn.strings){var a=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:a,_:Wl()};for(var f in Wi)Wi[f]===void 0?delete o[f]:o[f]=Wi[f];var m=[];for(var f in o)m.push(f+"="+o[f]);fn.strings=m}return fn.strings}function Xl(a,o,f){for(var m=0;m<a.length;++m)L(a.charCodeAt(m)===(a.charCodeAt(m)&255)),Ye[o++>>0]=a.charCodeAt(m);f||(Ye[o>>0]=0)}var Xi={varargs:void 0,get:function(){L(Xi.varargs!=null),Xi.varargs+=4;var a=oe[Xi.varargs-4>>2];return a},getStr:function(a){var o=ee(a);return o}};function ql(a,o){var f=0;return fn().forEach(function(m,S){var w=o+f;ie[a+S*4>>2]=w,Xl(m,w),f+=m.length+1}),0}function Yl(a,o){var f=fn();ie[a>>2]=f.length;var m=0;return f.forEach(function(S){m+=S.length+1}),ie[o>>2]=m,0}function $l(a){Re("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")}function Zl(a,o,f,m,S){return 70}var qi=[null,[],[]];function Yi(a,o){var f=qi[a];L(f),o===0||o===10?((a===1?O:C)(_e(f,0)),f.length=0):f.push(o)}function Xp(){ac(0),qi[1].length&&Yi(1,10),qi[2].length&&Yi(2,10)}function Jl(a,o,f,m){for(var S=0,w=0;w<f;w++){var T=ie[o>>2],b=ie[o+4>>2];o+=8;for(var P=0;P<b;P++)Yi(a,Ce[T+P]);S+=b}return ie[m>>2]=S,0}function Dn(a){return a%4===0&&(a%100!==0||a%400===0)}function jl(a,o){for(var f=0,m=0;m<=o;f+=a[m++]);return f}var Ts=[31,29,31,30,31,30,31,31,30,31,30,31],Es=[31,28,31,30,31,30,31,31,30,31,30,31];function Kl(a,o){for(var f=new Date(a.getTime());o>0;){var m=Dn(f.getFullYear()),S=f.getMonth(),w=(m?Ts:Es)[S];if(o>w-f.getDate())o-=w-f.getDate()+1,f.setDate(1),S<11?f.setMonth(S+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else return f.setDate(f.getDate()+o),f}return f}function Ql(a,o,f){var m=f>0?f:ts(a)+1,S=new Array(m),w=pe(a,S,0,S.length);return o&&(S.length=w),S}function ec(a,o,f,m){var S=oe[m+40>>2],w={tm_sec:oe[m>>2],tm_min:oe[m+4>>2],tm_hour:oe[m+8>>2],tm_mday:oe[m+12>>2],tm_mon:oe[m+16>>2],tm_year:oe[m+20>>2],tm_wday:oe[m+24>>2],tm_yday:oe[m+28>>2],tm_isdst:oe[m+32>>2],tm_gmtoff:oe[m+36>>2],tm_zone:S?ee(S):""},T=ee(f),b={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var P in b)T=T.replace(new RegExp(P,"g"),b[P]);var D=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],H=["January","February","March","April","May","June","July","August","September","October","November","December"];function Y(R,V,xe){for(var ve=typeof R=="number"?R.toString():R||"";ve.length<V;)ve=xe[0]+ve;return ve}function W(R,V){return Y(R,V,"0")}function ce(R,V){function xe(At){return At<0?-1:At>0?1:0}var ve;return(ve=xe(R.getFullYear()-V.getFullYear()))===0&&(ve=xe(R.getMonth()-V.getMonth()))===0&&(ve=xe(R.getDate()-V.getDate())),ve}function ne(R){switch(R.getDay()){case 0:return new Date(R.getFullYear()-1,11,29);case 1:return R;case 2:return new Date(R.getFullYear(),0,3);case 3:return new Date(R.getFullYear(),0,2);case 4:return new Date(R.getFullYear(),0,1);case 5:return new Date(R.getFullYear()-1,11,31);case 6:return new Date(R.getFullYear()-1,11,30)}}function se(R){var V=Kl(new Date(R.tm_year+1900,0,1),R.tm_yday),xe=new Date(V.getFullYear(),0,4),ve=new Date(V.getFullYear()+1,0,4),At=ne(xe),Nn=ne(ve);return ce(At,V)<=0?ce(Nn,V)<=0?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var Pe={"%a":function(R){return D[R.tm_wday].substring(0,3)},"%A":function(R){return D[R.tm_wday]},"%b":function(R){return H[R.tm_mon].substring(0,3)},"%B":function(R){return H[R.tm_mon]},"%C":function(R){var V=R.tm_year+1900;return W(V/100|0,2)},"%d":function(R){return W(R.tm_mday,2)},"%e":function(R){return Y(R.tm_mday,2," ")},"%g":function(R){return se(R).toString().substring(2)},"%G":function(R){return se(R)},"%H":function(R){return W(R.tm_hour,2)},"%I":function(R){var V=R.tm_hour;return V==0?V=12:V>12&&(V-=12),W(V,2)},"%j":function(R){return W(R.tm_mday+jl(Dn(R.tm_year+1900)?Ts:Es,R.tm_mon-1),3)},"%m":function(R){return W(R.tm_mon+1,2)},"%M":function(R){return W(R.tm_min,2)},"%n":function(){return`
|
|
7
|
-
`},"%p":function(R){return R.tm_hour>=0&&R.tm_hour<12?"AM":"PM"},"%S":function(R){return W(R.tm_sec,2)},"%t":function(){return" "},"%u":function(R){return R.tm_wday||7},"%U":function(R){var V=R.tm_yday+7-R.tm_wday;return W(Math.floor(V/7),2)},"%V":function(R){var V=Math.floor((R.tm_yday+7-(R.tm_wday+6)%7)/7);if((R.tm_wday+371-R.tm_yday-2)%7<=2&&V++,V){if(V==53){var ve=(R.tm_wday+371-R.tm_yday)%7;ve!=4&&(ve!=3||!Dn(R.tm_year))&&(V=1)}}else{V=52;var xe=(R.tm_wday+7-R.tm_yday-1)%7;(xe==4||xe==5&&Dn(R.tm_year%400-1))&&V++}return W(V,2)},"%w":function(R){return R.tm_wday},"%W":function(R){var V=R.tm_yday+7-(R.tm_wday+6)%7;return W(Math.floor(V/7),2)},"%y":function(R){return(R.tm_year+1900).toString().substring(2)},"%Y":function(R){return R.tm_year+1900},"%z":function(R){var V=R.tm_gmtoff,xe=V>=0;return V=Math.abs(V)/60,V=V/60*100+V%60,(xe?"+":"-")+("0000"+V).slice(-4)},"%Z":function(R){return R.tm_zone},"%%":function(){return"%"}};T=T.replace(/%%/g,"\0\0");for(var P in Pe)T.includes(P)&&(T=T.replace(new RegExp(P,"g"),Pe[P](w)));T=T.replace(/\0\0/g,"%");var Ze=Ql(T,!1);return Ze.length>o?0:(us(Ze,a),Ze.length-1)}function tc(a,o,f,m){return ec(a,o,f,m)}function As(a,o){L(a<16384),a<128?o.push(a):o.push(a%128|128,a>>7)}function nc(a){for(var o={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},f={parameters:[],results:a[0]=="v"?[]:[o[a[0]]]},m=1;m<a.length;++m)L(a[m]in o,"invalid signature char: "+a[m]),f.parameters.push(o[a[m]]);return f}function qp(a,o){if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(nc(o),a);var f=[1,96],m=o.slice(0,1),S=o.slice(1),w={i:127,p:127,j:126,f:125,d:124};As(S.length,f);for(var T=0;T<S.length;++T)L(S[T]in w,"invalid signature char: "+S[T]),f.push(w[S[T]]);m=="v"?f.push(0):f.push(1,w[m]);var b=[0,97,115,109,1,0,0,0,1];As(f.length,b),b.push.apply(b,f),b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var P=new WebAssembly.Module(new Uint8Array(b)),D=new WebAssembly.Instance(P,{e:{f:a}}),H=D.exports.f;return H}function Yp(a,o){if(Cs)for(var f=a;f<a+o;f++){var m=Ln(f);m&&Cs.set(m,f)}}var Cs=void 0,Rs=[];function $p(){if(Rs.length)return Rs.pop();try{ot.grow(1)}catch(a){throw a instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":a}return ot.length-1}function Zp(a,o){ot.set(a,o),hn[a]=ot.get(a)}var Jp=1;function ic(a){var o=t["_"+a];return L(o,"Cannot call unknown function "+a+", make sure it is exported"),o}function jp(a,o,f,m,S){var w={string:ne=>{var se=0;if(ne!=null&&ne!==0){var Pe=(ne.length<<2)+1;se=Ls(Pe),Tn(ne,se,Pe)}return se},array:ne=>{var se=Ls(ne.length);return us(ne,se),se}};function T(ne){return o==="string"?ee(ne):o==="boolean"?!!ne:ne}var b=ic(a),P=[],D=0;if(L(o!=="array",'Return type should not be "array".'),m)for(var H=0;H<m.length;H++){var Y=w[f[H]];Y?(D===0&&(D=cc()),P[H]=Y(m[H])):P[H]=m[H]}var W=b.apply(null,P);function ce(ne){return D!==0&&uc(D),T(ne)}return W=ce(W),W}Bo(),Ut=t.BindingError=Fi(Error,"BindingError"),ps=t.InternalError=Fi(Error,"InternalError"),tl(),$o(),ul(),Ss=t.UnboundTypeError=Fi(Error,"UnboundTypeError"),Ml();var Kp=!0;function rc(){$("fetchSettings")}var Ps={__cxa_allocate_exception:Lo,__cxa_throw:Fo,_embind_register_bigint:Oo,_embind_register_bool:ko,_embind_register_class:gl,_embind_register_class_constructor:yl,_embind_register_class_function:vl,_embind_register_emval:wl,_embind_register_float:El,_embind_register_integer:Cl,_embind_register_memory_view:Rl,_embind_register_std_string:Pl,_embind_register_std_wstring:Ol,_embind_register_void:Bl,abort:zl,emscripten_memcpy_big:Vl,emscripten_resize_heap:Hl,environ_get:ql,environ_sizes_get:Yl,fd_close:$l,fd_seek:Zl,fd_write:Jl,strftime_l:tc},Qp=Ro(),em=t.___wasm_call_ctors=ye("__wasm_call_ctors"),$i=t._malloc=ye("malloc"),ut=t._free=ye("free"),sc=t.___getTypeName=ye("__getTypeName"),tm=t.__embind_initialize_bindings=ye("_embind_initialize_bindings"),nm=t.___errno_location=ye("__errno_location"),ac=t._fflush=ye("fflush"),Is=t._emscripten_stack_init=function(){return(Is=t._emscripten_stack_init=t.asm.emscripten_stack_init).apply(null,arguments)},oc=t._emscripten_stack_get_free=function(){return(oc=t._emscripten_stack_get_free=t.asm.emscripten_stack_get_free).apply(null,arguments)},lc=t._emscripten_stack_get_base=function(){return(lc=t._emscripten_stack_get_base=t.asm.emscripten_stack_get_base).apply(null,arguments)},Zi=t._emscripten_stack_get_end=function(){return(Zi=t._emscripten_stack_get_end=t.asm.emscripten_stack_get_end).apply(null,arguments)},cc=t.stackSave=ye("stackSave"),uc=t.stackRestore=ye("stackRestore"),Ls=t.stackAlloc=ye("stackAlloc"),hc=t.___cxa_is_pointer_type=ye("__cxa_is_pointer_type"),im=t.dynCall_viijii=ye("dynCall_viijii"),rm=t.dynCall_ji=ye("dynCall_ji"),sm=t.dynCall_jiji=ye("dynCall_jiji"),am=t.dynCall_iiiiij=ye("dynCall_iiiiij"),om=t.dynCall_iiiiijj=ye("dynCall_iiiiijj"),lm=t.dynCall_iiiiiijj=ye("dynCall_iiiiiijj"),fc=["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"];fc.forEach(y);var dc=["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"];dc.forEach(re);var Un;rn=function a(){Un||Ds(),Un||(rn=a)};function pc(){Is(),_o()}function Ds(a){if(a=a||l,Tt>0||(pc(),yo(),Tt>0))return;function o(){Un||(Un=!0,t.calledRun=!0,!k&&(vo(),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),L(!t._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),xo()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),o()},1)):o(),Li()}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return Ds(),e.ready})})();typeof Kn=="object"&&typeof sr=="object"?sr.exports=rr:typeof define=="function"&&define.amd?define([],function(){return rr}):typeof Kn=="object"&&(Kn.createLazPerf=rr)});var fa=K(je=>{"use strict";var Mu=je&&je.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(je,"__esModule",{value:!0});je.LazPerf=je.create=je.createLazPerf=void 0;var ar=Mu(ha());je.createLazPerf=ar.default;je.create=ar.default;je.LazPerf={create:ar.default}});var _a=K(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.decompressFile=gt.decompressChunk=gt.PointData=void 0;var da=fa(),wu=ir();gt.PointData={createLazPerf:da.createLazPerf,decompressChunk:ma,decompressFile:ga};var or;async function pa(s){return s||(or||(or=(0,da.createLazPerf)()),or)}async function ma(s,{pointCount:e,pointDataRecordFormat:t,pointDataRecordLength:n},i){let r=await pa(i),l=new Uint8Array(e*n),c=r._malloc(s.byteLength),u=r._malloc(n),h=new r.ChunkDecoder;try{r.HEAPU8.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength),c),h.open(t,n,c);for(let d=0;d<e;++d)h.getPoint(u),l.set(new Uint8Array(r.HEAPU8.buffer,u,n),d*n)}finally{r._free(c),r._free(u),h.delete()}return l}gt.decompressChunk=ma;async function ga(s,e){let t=await pa(e),n=wu.Header.parse(s),{pointCount:i,pointDataRecordLength:r}=n,l=new Uint8Array(i*r),c=t._malloc(s.byteLength),u=t._malloc(r),h=new t.LASZip;try{t.HEAPU8.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength),c),h.open(c,s.byteLength);for(let d=0;d<i;++d)h.getPoint(u),l.set(new Uint8Array(t.HEAPU8.buffer,u,r),d*r)}finally{h.delete()}return l}gt.decompressFile=ga});var ya=K(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.View=void 0;var Tu=ze(),Eu=er(),Au=tr();Qn.View={create:Cu};function Cu(s,e,t=[],n){let i=Au.Extractor.create(e,t);if(n){let d=new Set([...n]);i=Object.entries(i).reduce((p,[v,_])=>(d.has(v)&&(p[v]=_),p),{})}let r=Eu.Dimensions.create(i,t),l=Tu.Binary.toDataView(s),c=e.pointDataRecordLength;if(l.byteLength%c!==0)throw new Error(`Invalid buffer length (${l.byteLength}) for point length ${c}`);let u=l.byteLength/e.pointDataRecordLength;function h(d){let p=i[d];if(!p)throw new Error(`No extractor for dimension: ${d}`);return function(v){if(v>=u)throw new RangeError(`View index (${v}) out of range: ${u}`);return p(l,v)}}return{pointCount:u,dimensions:r,getter:h}}});var ba=K(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.Vlr=void 0;var Ke=ze(),Gt=zn();ei.Vlr={walk:Iu,parse:Sa,find:xa,at:Ru,fetch:Pu};function xa(s,e,t){return s.find(n=>n.userId===e&&n.recordId===t)}function Ru(s,e,t){let n=xa(s,e,t);if(!n)throw new Error(`VLR not found: ${e}/${t}`);return n}function Pu(s,{contentOffset:e,contentLength:t}){return t===0?new Uint8Array:Ke.Getter.create(s)(e,e+t)}async function Iu(s,e){let t=Ke.Getter.create(s),n=await va({get:t,startOffset:e.headerLength,count:e.vlrCount,isExtended:!1}),i=await va({get:t,startOffset:e.evlrOffset,count:e.evlrCount,isExtended:!0});return[...n,...i]}function Sa(s,e){return(e?Du:Lu)(s)}function Lu(s){let e=Ke.Binary.toDataView(s);if(e.byteLength!==Gt.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${Gt.vlrHeaderLength}): ${e.byteLength}`);return{userId:Ke.Binary.toCString(s.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:Ke.Binary.toCString(s.slice(22,54)),isExtended:!1}}function Du(s){let e=Ke.Binary.toDataView(s);if(e.byteLength!==Gt.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${Gt.evlrHeaderLength}): ${e.byteLength}`);return{userId:Ke.Binary.toCString(s.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,Ke.parseBigInt)((0,Ke.getBigUint64)(e,20,!0)),description:Ke.Binary.toCString(s.slice(28,60)),isExtended:!0}}async function va({get:s,startOffset:e,count:t,isExtended:n}){let i=[],r=e,l=n?Gt.evlrHeaderLength:Gt.vlrHeaderLength;for(let c=0;c<t;++c){let u=l?await s(r,r+l):new Uint8Array,{userId:h,recordId:d,contentLength:p,description:v}=Sa(u,n);i.push({userId:h,recordId:d,contentOffset:r+l,contentLength:p,description:v,isExtended:n}),r+=l+p}return i}});var ti=K(le=>{"use strict";var Uu=le&&le.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Nu=le&&le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Fu=le&&le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Uu(e,s,t);return Nu(e,s),e};Object.defineProperty(le,"__esModule",{value:!0});le.Vlr=le.View=le.PointData=le.Header=le.Extractor=le.ExtraBytes=le.Dimensions=le.Constants=void 0;le.Constants=Fu(zn());var Ou=er();Object.defineProperty(le,"Dimensions",{enumerable:!0,get:function(){return Ou.Dimensions}});var Bu=Qi();Object.defineProperty(le,"ExtraBytes",{enumerable:!0,get:function(){return Bu.ExtraBytes}});var zu=tr();Object.defineProperty(le,"Extractor",{enumerable:!0,get:function(){return zu.Extractor}});var Vu=ir();Object.defineProperty(le,"Header",{enumerable:!0,get:function(){return Vu.Header}});var ku=_a();Object.defineProperty(le,"PointData",{enumerable:!0,get:function(){return ku.PointData}});var Gu=ya();Object.defineProperty(le,"View",{enumerable:!0,get:function(){return Gu.View}});var Hu=ba();Object.defineProperty(le,"Vlr",{enumerable:!0,get:function(){return Hu.Vlr}})});var lr=K(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Hierarchy=void 0;var dn=ze(),Ma=Bn();ni.Hierarchy={parse:wa,load:Wu};function wa(s){let e=dn.Binary.toDataView(s);if(e.byteLength%Ma.hierarchyItemLength!==0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);let t={},n={};for(let i=0;i<e.byteLength;i+=Ma.hierarchyItemLength){let r=e.getInt32(i+0,!0),l=e.getInt32(i+4,!0),c=e.getInt32(i+8,!0),u=e.getInt32(i+12,!0),h=(0,dn.parseBigInt)((0,dn.getBigUint64)(e,i+16,!0)),d=e.getInt32(i+24,!0),p=e.getInt32(i+28,!0),v=dn.Key.toString([r,l,c,u]);if(p<-1)throw new Error(`Invalid hierarchy point count at key: ${v}`);p===-1?n[v]={pageOffset:h,pageLength:d}:t[v]={pointCount:p,pointDataOffset:h,pointDataLength:d}}return{nodes:t,pages:n}}async function Wu(s,e){let t=dn.Getter.create(s);return wa(await t(e.pageOffset,e.pageOffset+e.pageLength))}});var cr=K(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Info=void 0;var pn=ze(),Ta=Bn();ii.Info={parse:Xu};function Xu(s){let e=pn.Binary.toDataView(s);if(e.byteLength!==Ta.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${Ta.infoLength}): ${e.byteLength}`);let t=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],n=e.getFloat64(24,!0);return{cube:[t[0]-n,t[1]-n,t[2]-n,t[0]+n,t[1]+n,t[2]+n],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,pn.parseBigInt)((0,pn.getBigUint64)(e,40,!0)),pageLength:(0,pn.parseBigInt)((0,pn.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}});var Ca=K(Qe=>{"use strict";var qu=Qe&&Qe.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Yu=Qe&&Qe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),$u=Qe&&Qe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&qu(e,s,t);return Yu(e,s),e};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Copc=void 0;var Ve=$u(ti()),ri=ze(),Zu=lr(),Ju=cr();Qe.Copc={create:ju,loadHierarchyPage:Ku,loadCompressedPointDataBuffer:Ea,loadPointDataBuffer:Aa,loadPointDataView:Qu};async function ju(s){let e=ri.Getter.create(s),t=65536,n=e(0,t);async function i(_,g){return g>=t?e(_,g):(await n).slice(_,g)}let r=Ve.Header.parse(await i(0,Ve.Constants.minHeaderLength)),l=await Ve.Vlr.walk(i,r),c=Ve.Vlr.find(l,"copc",1);if(!c)throw new Error("COPC info VLR is required");let u=Ju.Info.parse(await Ve.Vlr.fetch(i,c)),h,d=Ve.Vlr.find(l,"LASF_Projection",2112);d&&d.contentLength&&(h=ri.Binary.toCString(await Ve.Vlr.fetch(i,d)),h===""&&(h=void 0));let p=[],v=Ve.Vlr.find(l,"LASF_Spec",4);return v&&(p=Ve.ExtraBytes.parse(await Ve.Vlr.fetch(i,v))),{header:r,vlrs:l,info:u,wkt:h,eb:p}}async function Ku(s,e){let t=ri.Getter.create(s);return Zu.Hierarchy.load(t,e)}async function Ea(s,{pointDataOffset:e,pointDataLength:t}){return ri.Getter.create(s)(e,e+t)}async function Aa(s,{pointDataRecordFormat:e,pointDataRecordLength:t},n,i){let r=await Ea(s,n),{pointCount:l}=n;return Ve.PointData.decompressChunk(r,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:t},i)}async function Qu(s,e,t,{lazPerf:n,include:i}={}){let r=await Aa(s,e.header,t,n);return Ve.View.create(r,e.header,e.eb,i)}});var Ra=K(be=>{"use strict";var eh=be&&be.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),th=be&&be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),nh=be&&be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&eh(e,s,t);return th(e,s),e};Object.defineProperty(be,"__esModule",{value:!0});be.Info=be.Hierarchy=be.Copc=be.Constants=void 0;be.Constants=nh(Bn());var ih=Ca();Object.defineProperty(be,"Copc",{enumerable:!0,get:function(){return ih.Copc}});var rh=lr();Object.defineProperty(be,"Hierarchy",{enumerable:!0,get:function(){return rh.Hierarchy}});var sh=cr();Object.defineProperty(be,"Info",{enumerable:!0,get:function(){return sh.Info}})});var ur=K(Me=>{"use strict";var Pa=Me&&Me.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),ah=Me&&Me.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ia=Me&&Me.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Pa(e,s,t);return ah(e,s),e},La=Me&&Me.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pa(e,s,t)};Object.defineProperty(Me,"__esModule",{value:!0});Me.Las=Me.Ept=void 0;Me.Ept=Ia(Vs());La(Ra(),Me);Me.Las=Ia(ti());La(ze(),Me)});import zp from"@giro3d/giro3d/entities/PointCloud.js";var Ri=Fn(ur()),fo=Fn(ti()),po=Fn(ji());var qa=1;var Ya=3;var xr=0,Sr=1,br=2,Mr=3,wr=4,Tr=5,Er=6,Ar=7,$a=0,Za=1,Ja=2;var kr=1,Gr=2,Hr=3,Wr=4,Xr=5,qr=6,Yr=7;var $r=300,ja=301,Zr=302;var Ka=306,Cr=1e3,yn=1001,Rr=1002;var Qa=1006;var eo=1008;var to=1009;var no=1015;var io=1023;var xn=2300,pi=2301,fi=2302,Pr=2303,Ir=2400,Lr=2401,Dr=2402;var Jr="",Ge="srgb",Ur="srgb-linear",Nr="linear",di="srgb";var ro=35044;var vn=2e3,Fr=2001;function oh(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function Or(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}var Da={},mi=null;function so(s){let e=s[0];if(typeof e=="string"&&e.startsWith("TSL:")){let t=s[1];t&&t.isStackTrace?s[0]+=" "+t.getLocation():s[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return s}function Ee(...s){s=so(s);let e="THREE."+s.shift();if(mi)mi("warn",e,...s);else{let t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function me(...s){s=so(s);let e="THREE."+s.shift();if(mi)mi("error",e,...s);else{let t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function jt(...s){let e=s.join(" ");e in Da||(Da[e]=!0,Ee(...s))}var lh={[xr]:Sr,[br]:Er,[wr]:Ar,[Mr]:Tr,[Sr]:xr,[Er]:br,[Ar]:wr,[Tr]:Mr},Qt=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let i=n[e];if(i!==void 0){let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let i=n.slice(0);for(let r=0,l=i.length;r<l;r++)i[r].call(this,e);e.target=null}}},we=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var Gm=Math.PI/180,ch=180/Math.PI;function jr(){let s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(we[s&255]+we[s>>8&255]+we[s>>16&255]+we[s>>24&255]+"-"+we[e&255]+we[e>>8&255]+"-"+we[e>>16&15|64]+we[e>>24&255]+"-"+we[t&63|128]+we[t>>8&255]+"-"+we[t>>16&255]+we[t>>24&255]+we[n&255]+we[n>>8&255]+we[n>>16&255]+we[n>>24&255]).toLowerCase()}function j(s,e,t){return Math.max(e,Math.min(t,s))}function uh(s,e){return(s%e+e)%e}function hr(s,e,t){return(1-t)*s+t*e}function mn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:case Uint8ClampedArray:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Le(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:case Uint8ClampedArray:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}var He=class s{static{s.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=j(this.x,e.x,t.x),this.y=j(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=j(this.x,e,t),this.y=j(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(j(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(j(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,l=this.y-e.y;return this.x=r*n-l*i+e.x,this.y=r*i+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},at=class{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,l,c){let u=n[i+0],h=n[i+1],d=n[i+2],p=n[i+3],v=r[l+0],_=r[l+1],g=r[l+2],x=r[l+3];if(p!==x||u!==v||h!==_||d!==g){let A=u*v+h*_+d*g+p*x;A<0&&(v=-v,_=-_,g=-g,x=-x,A=-A);let E=1-c;if(A<.9995){let I=Math.acos(A),N=Math.sin(I);E=Math.sin(E*I)/N,c=Math.sin(c*I)/N,u=u*E+v*c,h=h*E+_*c,d=d*E+g*c,p=p*E+x*c}else{u=u*E+v*c,h=h*E+_*c,d=d*E+g*c,p=p*E+x*c;let I=1/Math.sqrt(u*u+h*h+d*d+p*p);u*=I,h*=I,d*=I,p*=I}}e[t]=u,e[t+1]=h,e[t+2]=d,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,i,r,l){let c=n[i],u=n[i+1],h=n[i+2],d=n[i+3],p=r[l],v=r[l+1],_=r[l+2],g=r[l+3];return e[t]=c*g+d*p+u*_-h*v,e[t+1]=u*g+d*v+h*p-c*_,e[t+2]=h*g+d*_+c*v-u*p,e[t+3]=d*g-c*p-u*v-h*_,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,l=e._order,c=Math.cos,u=Math.sin,h=c(n/2),d=c(i/2),p=c(r/2),v=u(n/2),_=u(i/2),g=u(r/2);switch(l){case"XYZ":this._x=v*d*p+h*_*g,this._y=h*_*p-v*d*g,this._z=h*d*g+v*_*p,this._w=h*d*p-v*_*g;break;case"YXZ":this._x=v*d*p+h*_*g,this._y=h*_*p-v*d*g,this._z=h*d*g-v*_*p,this._w=h*d*p+v*_*g;break;case"ZXY":this._x=v*d*p-h*_*g,this._y=h*_*p+v*d*g,this._z=h*d*g+v*_*p,this._w=h*d*p-v*_*g;break;case"ZYX":this._x=v*d*p-h*_*g,this._y=h*_*p+v*d*g,this._z=h*d*g-v*_*p,this._w=h*d*p+v*_*g;break;case"YZX":this._x=v*d*p+h*_*g,this._y=h*_*p+v*d*g,this._z=h*d*g-v*_*p,this._w=h*d*p-v*_*g;break;case"XZY":this._x=v*d*p-h*_*g,this._y=h*_*p-v*d*g,this._z=h*d*g+v*_*p,this._w=h*d*p+v*_*g;break;default:Ee("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],l=t[1],c=t[5],u=t[9],h=t[2],d=t[6],p=t[10],v=n+c+p;if(v>0){let _=.5/Math.sqrt(v+1);this._w=.25/_,this._x=(d-u)*_,this._y=(r-h)*_,this._z=(l-i)*_}else if(n>c&&n>p){let _=2*Math.sqrt(1+n-c-p);this._w=(d-u)/_,this._x=.25*_,this._y=(i+l)/_,this._z=(r+h)/_}else if(c>p){let _=2*Math.sqrt(1+c-n-p);this._w=(r-h)/_,this._x=(i+l)/_,this._y=.25*_,this._z=(u+d)/_}else{let _=2*Math.sqrt(1+p-n-c);this._w=(l-i)/_,this._x=(r+h)/_,this._y=(u+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(j(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,l=e._w,c=t._x,u=t._y,h=t._z,d=t._w;return this._x=n*d+l*c+i*h-r*u,this._y=i*d+l*u+r*c-n*h,this._z=r*d+l*h+n*u-i*c,this._w=l*d-n*c-i*u-r*h,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,r=e._z,l=e._w,c=this.dot(e);c<0&&(n=-n,i=-i,r=-r,l=-l,c=-c);let u=1-t;if(c<.9995){let h=Math.acos(c),d=Math.sin(h);u=Math.sin(u*h)/d,t=Math.sin(t*h)/d,this._x=this._x*u+n*t,this._y=this._y*u+i*t,this._z=this._z*u+r*t,this._w=this._w*u+l*t,this._onChangeCallback()}else this._x=this._x*u+n*t,this._y=this._y*u+i*t,this._z=this._z*u+r*t,this._w=this._w*u+l*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},F=class s{static{s.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ua.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ua.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,l=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*l,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*l,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*l,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,l=e.y,c=e.z,u=e.w,h=2*(l*i-c*n),d=2*(c*t-r*i),p=2*(r*n-l*t);return this.x=t+u*h+l*p-c*d,this.y=n+u*d+c*h-r*p,this.z=i+u*p+r*d-l*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=j(this.x,e.x,t.x),this.y=j(this.y,e.y,t.y),this.z=j(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=j(this.x,e,t),this.y=j(this.y,e,t),this.z=j(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(j(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,l=t.x,c=t.y,u=t.z;return this.x=i*u-r*c,this.y=r*l-n*u,this.z=n*c-i*l,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return fr.copy(this).projectOnVector(e),this.sub(fr)}reflect(e){return this.sub(fr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(j(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},fr=new F,Ua=new at,Z=class s{static{s.prototype.isMatrix3=!0}constructor(e,t,n,i,r,l,c,u,h){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,l,c,u,h)}set(e,t,n,i,r,l,c,u,h){let d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=r,d[5]=u,d[6]=n,d[7]=l,d[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,l=n[0],c=n[3],u=n[6],h=n[1],d=n[4],p=n[7],v=n[2],_=n[5],g=n[8],x=i[0],A=i[3],E=i[6],I=i[1],N=i[4],O=i[7],C=i[2],G=i[5],z=i[8];return r[0]=l*x+c*I+u*C,r[3]=l*A+c*N+u*G,r[6]=l*E+c*O+u*z,r[1]=h*x+d*I+p*C,r[4]=h*A+d*N+p*G,r[7]=h*E+d*O+p*z,r[2]=v*x+_*I+g*C,r[5]=v*A+_*N+g*G,r[8]=v*E+_*O+g*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8];return t*l*d-t*c*h-n*r*d+n*c*u+i*r*h-i*l*u}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=d*l-c*h,v=c*u-d*r,_=h*r-l*u,g=t*p+n*v+i*_;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let x=1/g;return e[0]=p*x,e[1]=(i*h-d*n)*x,e[2]=(c*n-i*l)*x,e[3]=v*x,e[4]=(d*t-i*u)*x,e[5]=(i*r-c*t)*x,e[6]=_*x,e[7]=(n*u-h*t)*x,e[8]=(l*t-n*r)*x,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,l,c){let u=Math.cos(r),h=Math.sin(r);return this.set(n*u,n*h,-n*(u*l+h*c)+l+e,-i*h,i*u,-i*(-h*l+u*c)+c+t,0,0,1),this}scale(e,t){return jt("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(dr.makeScale(e,t)),this}rotate(e){return jt("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(dr.makeRotation(-e)),this}translate(e,t){return jt("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(dr.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},dr=new Z,Na=new Z().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fa=new Z().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function hh(){let s={enabled:!0,workingColorSpace:Ur,spaces:{},convert:function(i,r,l){return this.enabled===!1||r===l||!r||!l||(this.spaces[r].transfer===di&&(i.r=rt(i.r),i.g=rt(i.g),i.b=rt(i.b)),this.spaces[r].primaries!==this.spaces[l].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===di&&(i.r=Kt(i.r),i.g=Kt(i.g),i.b=Kt(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Jr?Nr:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,l){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return jt("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return jt("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ur]:{primaries:e,whitePoint:n,transfer:Nr,toXYZ:Na,fromXYZ:Fa,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ge},outputColorSpaceConfig:{drawingBufferColorSpace:Ge}},[Ge]:{primaries:e,whitePoint:n,transfer:di,toXYZ:Na,fromXYZ:Fa,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ge}}}),s}var ke=hh();function rt(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Kt(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}var Ht,gi=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ht===void 0&&(Ht=Or("canvas")),Ht.width=e.width,Ht.height=e.height;let i=Ht.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Ht}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Or("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let l=0;l<r.length;l++)r[l]=rt(r[l]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(rt(t[n]/255)*255):t[n]=rt(t[n]);return{data:t,width:e.width,height:e.height}}else return Ee("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},fh=0,_i=class{constructor(e=null){this.isTextureSource=!0,Object.defineProperty(this,"id",{value:fh++}),this.uuid=jr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let l=0,c=i.length;l<c;l++)i[l].isDataTexture?r.push(pr(i[l].image)):r.push(pr(i[l]))}else r=pr(i);n.url=r}return t||(e.images[this.uuid]=n),n}};function pr(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?gi.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ee("Texture: Unable to serialize Texture."),{})}var dh=0,mr=new F,en=class s extends Qt{constructor(e=s.DEFAULT_IMAGE,t=s.DEFAULT_MAPPING,n=yn,i=yn,r=Qa,l=eo,c=io,u=to,h=s.DEFAULT_ANISOTROPY,d=Jr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dh++}),this.uuid=jr(),this.name="",this.source=new _i(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=l,this.anisotropy=h,this.format=c,this.internalFormat=null,this.type=u,this.offset=new He(0,0),this.repeat=new He(1,1),this.center=new He(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Z,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(mr).x}get height(){return this.source.getSize(mr).y}get depth(){return this.source.getSize(mr).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){Ee(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(i===void 0){Ee(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$r)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Cr:e.x=e.x-Math.floor(e.x);break;case yn:e.x=e.x<0?0:1;break;case Rr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Cr:e.y=e.y-Math.floor(e.y);break;case yn:e.y=e.y<0?0:1;break;case Rr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};en.DEFAULT_IMAGE=null;en.DEFAULT_MAPPING=$r;en.DEFAULT_ANISOTROPY=1;var Br=class s{static{s.prototype.isVector4=!0}constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i+l[12]*r,this.y=l[1]*t+l[5]*n+l[9]*i+l[13]*r,this.z=l[2]*t+l[6]*n+l[10]*i+l[14]*r,this.w=l[3]*t+l[7]*n+l[11]*i+l[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,u=e.elements,h=u[0],d=u[4],p=u[8],v=u[1],_=u[5],g=u[9],x=u[2],A=u[6],E=u[10];if(Math.abs(d-v)<.01&&Math.abs(p-x)<.01&&Math.abs(g-A)<.01){if(Math.abs(d+v)<.1&&Math.abs(p+x)<.1&&Math.abs(g+A)<.1&&Math.abs(h+_+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let N=(h+1)/2,O=(_+1)/2,C=(E+1)/2,G=(d+v)/4,z=(p+x)/4,$=(g+A)/4;return N>O&&N>C?N<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(N),i=G/n,r=z/n):O>C?O<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(O),n=G/i,r=$/i):C<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(C),n=z/r,i=$/r),this.set(n,i,r,t),this}let I=Math.sqrt((A-g)*(A-g)+(p-x)*(p-x)+(v-d)*(v-d));return Math.abs(I)<.001&&(I=1),this.x=(A-g)/I,this.y=(p-x)/I,this.z=(v-d)/I,this.w=Math.acos((h+_+E-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=j(this.x,e.x,t.x),this.y=j(this.y,e.y,t.y),this.z=j(this.z,e.z,t.z),this.w=j(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=j(this.x,e,t),this.y=j(this.y,e,t),this.z=j(this.z,e,t),this.w=j(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(j(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};var st=class s{static{s.prototype.isMatrix4=!0}constructor(e,t,n,i,r,l,c,u,h,d,p,v,_,g,x,A){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,l,c,u,h,d,p,v,_,g,x,A)}set(e,t,n,i,r,l,c,u,h,d,p,v,_,g,x,A){let E=this.elements;return E[0]=e,E[4]=t,E[8]=n,E[12]=i,E[1]=r,E[5]=l,E[9]=c,E[13]=u,E[2]=h,E[6]=d,E[10]=p,E[14]=v,E[3]=_,E[7]=g,E[11]=x,E[15]=A,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new s().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,i=1/Wt.setFromMatrixColumn(e,0).length(),r=1/Wt.setFromMatrixColumn(e,1).length(),l=1/Wt.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,l=Math.cos(n),c=Math.sin(n),u=Math.cos(i),h=Math.sin(i),d=Math.cos(r),p=Math.sin(r);if(e.order==="XYZ"){let v=l*d,_=l*p,g=c*d,x=c*p;t[0]=u*d,t[4]=-u*p,t[8]=h,t[1]=_+g*h,t[5]=v-x*h,t[9]=-c*u,t[2]=x-v*h,t[6]=g+_*h,t[10]=l*u}else if(e.order==="YXZ"){let v=u*d,_=u*p,g=h*d,x=h*p;t[0]=v+x*c,t[4]=g*c-_,t[8]=l*h,t[1]=l*p,t[5]=l*d,t[9]=-c,t[2]=_*c-g,t[6]=x+v*c,t[10]=l*u}else if(e.order==="ZXY"){let v=u*d,_=u*p,g=h*d,x=h*p;t[0]=v-x*c,t[4]=-l*p,t[8]=g+_*c,t[1]=_+g*c,t[5]=l*d,t[9]=x-v*c,t[2]=-l*h,t[6]=c,t[10]=l*u}else if(e.order==="ZYX"){let v=l*d,_=l*p,g=c*d,x=c*p;t[0]=u*d,t[4]=g*h-_,t[8]=v*h+x,t[1]=u*p,t[5]=x*h+v,t[9]=_*h-g,t[2]=-h,t[6]=c*u,t[10]=l*u}else if(e.order==="YZX"){let v=l*u,_=l*h,g=c*u,x=c*h;t[0]=u*d,t[4]=x-v*p,t[8]=g*p+_,t[1]=p,t[5]=l*d,t[9]=-c*d,t[2]=-h*d,t[6]=_*p+g,t[10]=v-x*p}else if(e.order==="XZY"){let v=l*u,_=l*h,g=c*u,x=c*h;t[0]=u*d,t[4]=-p,t[8]=h*d,t[1]=v*p+x,t[5]=l*d,t[9]=_*p-g,t[2]=g*p-_,t[6]=c*d,t[10]=x*p+v}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ph,e,mh)}lookAt(e,t,n){let i=this.elements;return Ue.subVectors(e,t),Ue.lengthSq()===0&&(Ue.z=1),Ue.normalize(),_t.crossVectors(n,Ue),_t.lengthSq()===0&&(Math.abs(n.z)===1?Ue.x+=1e-4:Ue.z+=1e-4,Ue.normalize(),_t.crossVectors(n,Ue)),_t.normalize(),si.crossVectors(Ue,_t),i[0]=_t.x,i[4]=si.x,i[8]=Ue.x,i[1]=_t.y,i[5]=si.y,i[9]=Ue.y,i[2]=_t.z,i[6]=si.z,i[10]=Ue.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,l=n[0],c=n[4],u=n[8],h=n[12],d=n[1],p=n[5],v=n[9],_=n[13],g=n[2],x=n[6],A=n[10],E=n[14],I=n[3],N=n[7],O=n[11],C=n[15],G=i[0],z=i[4],$=i[8],Q=i[12],re=i[1],y=i[5],M=i[9],B=i[13],X=i[2],k=i[6],q=i[10],L=i[14],de=i[3],_e=i[7],ee=i[11],pe=i[15];return r[0]=l*G+c*re+u*X+h*de,r[4]=l*z+c*y+u*k+h*_e,r[8]=l*$+c*M+u*q+h*ee,r[12]=l*Q+c*B+u*L+h*pe,r[1]=d*G+p*re+v*X+_*de,r[5]=d*z+p*y+v*k+_*_e,r[9]=d*$+p*M+v*q+_*ee,r[13]=d*Q+p*B+v*L+_*pe,r[2]=g*G+x*re+A*X+E*de,r[6]=g*z+x*y+A*k+E*_e,r[10]=g*$+x*M+A*q+E*ee,r[14]=g*Q+x*B+A*L+E*pe,r[3]=I*G+N*re+O*X+C*de,r[7]=I*z+N*y+O*k+C*_e,r[11]=I*$+N*M+O*q+C*ee,r[15]=I*Q+N*B+O*L+C*pe,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],l=e[1],c=e[5],u=e[9],h=e[13],d=e[2],p=e[6],v=e[10],_=e[14],g=e[3],x=e[7],A=e[11],E=e[15],I=u*_-h*v,N=c*_-h*p,O=c*v-u*p,C=l*_-h*d,G=l*v-u*d,z=l*p-c*d;return t*(x*I-A*N+E*O)-n*(g*I-A*C+E*G)+i*(g*N-x*C+E*z)-r*(g*O-x*G+A*z)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[1],l=e[5],c=e[9],u=e[2],h=e[6],d=e[10];return t*(l*d-c*h)-n*(r*d-c*u)+i*(r*h-l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=e[9],v=e[10],_=e[11],g=e[12],x=e[13],A=e[14],E=e[15],I=t*c-n*l,N=t*u-i*l,O=t*h-r*l,C=n*u-i*c,G=n*h-r*c,z=i*h-r*u,$=d*x-p*g,Q=d*A-v*g,re=d*E-_*g,y=p*A-v*x,M=p*E-_*x,B=v*E-_*A,X=I*B-N*M+O*y+C*re-G*Q+z*$;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let k=1/X;return e[0]=(c*B-u*M+h*y)*k,e[1]=(i*M-n*B-r*y)*k,e[2]=(x*z-A*G+E*C)*k,e[3]=(v*G-p*z-_*C)*k,e[4]=(u*re-l*B-h*Q)*k,e[5]=(t*B-i*re+r*Q)*k,e[6]=(A*O-g*z-E*N)*k,e[7]=(d*z-v*O+_*N)*k,e[8]=(l*M-c*re+h*$)*k,e[9]=(n*re-t*M-r*$)*k,e[10]=(g*G-x*O+E*I)*k,e[11]=(p*O-d*G-_*I)*k,e[12]=(c*Q-l*y-u*$)*k,e[13]=(t*y-n*Q+i*$)*k,e[14]=(x*N-g*C-A*I)*k,e[15]=(d*C-p*N+v*I)*k,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,l=e.x,c=e.y,u=e.z,h=r*l,d=r*c;return this.set(h*l+n,h*c-i*u,h*u+i*c,0,h*c+i*u,d*c+n,d*u-i*l,0,h*u-i*c,d*u+i*l,r*u*u+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,l){return this.set(1,n,r,0,e,1,l,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,l=t._y,c=t._z,u=t._w,h=r+r,d=l+l,p=c+c,v=r*h,_=r*d,g=r*p,x=l*d,A=l*p,E=c*p,I=u*h,N=u*d,O=u*p,C=n.x,G=n.y,z=n.z;return i[0]=(1-(x+E))*C,i[1]=(_+O)*C,i[2]=(g-N)*C,i[3]=0,i[4]=(_-O)*G,i[5]=(1-(v+E))*G,i[6]=(A+I)*G,i[7]=0,i[8]=(g+N)*z,i[9]=(A-I)*z,i[10]=(1-(v+x))*z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];let r=this.determinantAffine();if(r===0)return n.set(1,1,1),t.identity(),this;let l=Wt.set(i[0],i[1],i[2]).length(),c=Wt.set(i[4],i[5],i[6]).length(),u=Wt.set(i[8],i[9],i[10]).length();r<0&&(l=-l),Xe.copy(this);let h=1/l,d=1/c,p=1/u;return Xe.elements[0]*=h,Xe.elements[1]*=h,Xe.elements[2]*=h,Xe.elements[4]*=d,Xe.elements[5]*=d,Xe.elements[6]*=d,Xe.elements[8]*=p,Xe.elements[9]*=p,Xe.elements[10]*=p,t.setFromRotationMatrix(Xe),n.x=l,n.y=c,n.z=u,this}makePerspective(e,t,n,i,r,l,c=vn,u=!1){let h=this.elements,d=2*r/(t-e),p=2*r/(n-i),v=(t+e)/(t-e),_=(n+i)/(n-i),g,x;if(u)g=r/(l-r),x=l*r/(l-r);else if(c===vn)g=-(l+r)/(l-r),x=-2*l*r/(l-r);else if(c===Fr)g=-l/(l-r),x=-l*r/(l-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=d,h[4]=0,h[8]=v,h[12]=0,h[1]=0,h[5]=p,h[9]=_,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=x,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,r,l,c=vn,u=!1){let h=this.elements,d=2/(t-e),p=2/(n-i),v=-(t+e)/(t-e),_=-(n+i)/(n-i),g,x;if(u)g=1/(l-r),x=l/(l-r);else if(c===vn)g=-2/(l-r),x=-(l+r)/(l-r);else if(c===Fr)g=-1/(l-r),x=-r/(l-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=d,h[4]=0,h[8]=0,h[12]=v,h[1]=0,h[5]=p,h[9]=0,h[13]=_,h[2]=0,h[6]=0,h[10]=g,h[14]=x,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Wt=new F,Xe=new st,ph=new F(0,0,0),mh=new F(1,1,1),_t=new F,si=new F,Ue=new F,Oa=new st,Ba=new at,Sn=class s{constructor(e=0,t=0,n=0,i=s.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],l=i[4],c=i[8],u=i[1],h=i[5],d=i[9],p=i[2],v=i[6],_=i[10];switch(t){case"XYZ":this._y=Math.asin(j(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,_),this._z=Math.atan2(-l,r)):(this._x=Math.atan2(v,h),this._z=0);break;case"YXZ":this._x=Math.asin(-j(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,_),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-p,r),this._z=0);break;case"ZXY":this._x=Math.asin(j(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-p,_),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,r));break;case"ZYX":this._y=Math.asin(-j(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(v,_),this._z=Math.atan2(u,r)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(j(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-d,h),this._y=Math.atan2(-p,r)):(this._x=0,this._y=Math.atan2(c,_));break;case"XZY":this._z=Math.asin(-j(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(v,h),this._y=Math.atan2(c,r)):(this._x=Math.atan2(-d,_),this._y=0);break;default:Ee("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Oa.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Oa,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ba.setFromEuler(this),this.setFromQuaternion(Ba,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Sn.DEFAULT_ORDER="XYZ";var yi=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},gh=0,za=new F,Xt=new at,nt=new st,ai=new F,gn=new F,_h=new F,yh=new at,Va=new F(1,0,0),ka=new F(0,1,0),Ga=new F(0,0,1),Ha={type:"added"},vh={type:"removed"},qt={type:"childadded",child:null},gr={type:"childremoved",child:null},tn=class s extends Qt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:gh++}),this.uuid=jr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=s.DEFAULT_UP.clone();let e=new F,t=new Sn,n=new at,i=new F(1,1,1);function r(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new st},normalMatrix:{value:new Z}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=s.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=s.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new yi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Xt.setFromAxisAngle(e,t),this.quaternion.multiply(Xt),this}rotateOnWorldAxis(e,t){return Xt.setFromAxisAngle(e,t),this.quaternion.premultiply(Xt),this}rotateX(e){return this.rotateOnAxis(Va,e)}rotateY(e){return this.rotateOnAxis(ka,e)}rotateZ(e){return this.rotateOnAxis(Ga,e)}translateOnAxis(e,t){return za.copy(e).applyQuaternion(this.quaternion),this.position.add(za.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Va,e)}translateY(e){return this.translateOnAxis(ka,e)}translateZ(e){return this.translateOnAxis(Ga,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(nt.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ai.copy(e):ai.set(e,t,n);let i=this.parent;this.updateWorldMatrix(!0,!1),gn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?nt.lookAt(gn,ai,this.up):nt.lookAt(ai,gn,this.up),this.quaternion.setFromRotationMatrix(nt),i&&(nt.extractRotation(i.matrixWorld),Xt.setFromRotationMatrix(nt),this.quaternion.premultiply(Xt.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(me("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Ha),qt.child=e,this.dispatchEvent(qt),qt.child=null):me("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(vh),gr.child=e,this.dispatchEvent(gr),gr.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),nt.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),nt.multiply(e.parent.matrixWorld)),e.applyMatrix4(nt),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ha),qt.child=e,this.dispatchEvent(qt),qt.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){let l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let i=this.children;for(let r=0,l=i.length;r<l;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gn,e,_h),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gn,yh,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}intersectsFrustum(){}traverse(e){e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,i=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*n-r[8]*i,r[13]+=n-r[1]*t-r[5]*n-r[9]*i,r[14]+=i-r[2]*t-r[6]*n-r[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let r=this.children;for(let l=0,c=r.length;l<c;l++)r[l].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,i.name=this.name,i.castShadow=this.castShadow,i.receiveShadow=this.receiveShadow,i.visible=this.visible,i.frustumCulled=this.frustumCulled,i.renderOrder=this.renderOrder,i.static=this.static,i.matrixAutoUpdate=this.matrixAutoUpdate,Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(c=>({...c})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let u=c.shapes;if(Array.isArray(u))for(let h=0,d=u.length;h<d;h++){let p=u[h];r(e.shapes,p)}else r(e.shapes,u)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let u=0,h=this.material.length;u<h;u++)c.push(r(e.materials,this.material[u]));i.material=c}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let u=this.animations[c];i.animations.push(r(e.animations,u))}}if(t){let c=l(e.geometries),u=l(e.materials),h=l(e.textures),d=l(e.images),p=l(e.shapes),v=l(e.skeletons),_=l(e.animations),g=l(e.nodes);c.length>0&&(n.geometries=c),u.length>0&&(n.materials=u),h.length>0&&(n.textures=h),d.length>0&&(n.images=d),p.length>0&&(n.shapes=p),v.length>0&&(n.skeletons=v),_.length>0&&(n.animations=_),g.length>0&&(n.nodes=g)}return n.object=i,n;function l(c){let u=[];for(let h in c){let d=c[h];delete d.metadata,u.push(d)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let i=e.children[n];this.add(i.clone())}return this}dispose(){this.dispatchEvent({type:"dispose"})}};tn.DEFAULT_UP=new F(0,1,0);tn.DEFAULT_MATRIX_AUTO_UPDATE=!0;tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ao={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},yt={h:0,s:0,l:0},oi={h:0,s:0,l:0};function _r(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}var ge=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ge){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ke.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=ke.workingColorSpace){return this.r=e,this.g=t,this.b=n,ke.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=ke.workingColorSpace){if(e=uh(e,1),t=j(t,0,1),n=j(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,l=2*n-r;this.r=_r(l,r,e+1/3),this.g=_r(l,r,e),this.b=_r(l,r,e-1/3)}return ke.colorSpaceToWorking(this,i),this}setStyle(e,t=Ge){function n(r){r!==void 0&&parseFloat(r)<1&&Ee("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,l=i[1],c=i[2];switch(l){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:Ee("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=i[1],l=r.length;if(l===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(r,16),t);Ee("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ge){let n=ao[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Ee("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=rt(e.r),this.g=rt(e.g),this.b=rt(e.b),this}copyLinearToSRGB(e){return this.r=Kt(e.r),this.g=Kt(e.g),this.b=Kt(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ge){return ke.workingToColorSpace(Te.copy(this),e),Math.round(j(Te.r*255,0,255))*65536+Math.round(j(Te.g*255,0,255))*256+Math.round(j(Te.b*255,0,255))}getHexString(e=Ge){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ke.workingColorSpace){ke.workingToColorSpace(Te.copy(this),t);let n=Te.r,i=Te.g,r=Te.b,l=Math.max(n,i,r),c=Math.min(n,i,r),u,h,d=(c+l)/2;if(c===l)u=0,h=0;else{let p=l-c;switch(h=d<=.5?p/(l+c):p/(2-l-c),l){case n:u=(i-r)/p+(i<r?6:0);break;case i:u=(r-n)/p+2;break;case r:u=(n-i)/p+4;break}u/=6}return e.h=u,e.s=h,e.l=d,e}getRGB(e,t=ke.workingColorSpace){return ke.workingToColorSpace(Te.copy(this),t),e.r=Te.r,e.g=Te.g,e.b=Te.b,e}getStyle(e=Ge){ke.workingToColorSpace(Te.copy(this),e);let t=Te.r,n=Te.g,i=Te.b;return e!==Ge?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(yt),this.setHSL(yt.h+e,yt.s+t,yt.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(yt),e.getHSL(oi);let n=hr(yt.h,oi.h,t),i=hr(yt.s,oi.s,t),r=hr(yt.l,oi.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},Te=new ge;ge.NAMES=ao;var We=class{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qe.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qe.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=qe.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=r.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,qe):qe.fromBufferAttribute(r,l),qe.applyMatrix4(e.matrixWorld),this.expandByPoint(qe);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),li.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),li.copy(n.boundingBox)),li.applyMatrix4(e.matrixWorld),this.union(li)}let i=e.children;for(let r=0,l=i.length;r<l;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qe),qe.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(_n),ci.subVectors(this.max,_n),Yt.subVectors(e.a,_n),$t.subVectors(e.b,_n),Zt.subVectors(e.c,_n),vt.subVectors($t,Yt),xt.subVectors(Zt,$t),Ct.subVectors(Yt,Zt);let t=[0,-vt.z,vt.y,0,-xt.z,xt.y,0,-Ct.z,Ct.y,vt.z,0,-vt.x,xt.z,0,-xt.x,Ct.z,0,-Ct.x,-vt.y,vt.x,0,-xt.y,xt.x,0,-Ct.y,Ct.x,0];return!yr(t,Yt,$t,Zt,ci)||(t=[1,0,0,0,1,0,0,0,1],!yr(t,Yt,$t,Zt,ci))?!1:(ui.crossVectors(vt,xt),t=[ui.x,ui.y,ui.z],yr(t,Yt,$t,Zt,ci))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qe).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qe).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(it[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),it[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),it[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),it[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),it[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),it[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),it[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),it[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(it),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},it=[new F,new F,new F,new F,new F,new F,new F,new F],qe=new F,li=new We,Yt=new F,$t=new F,Zt=new F,vt=new F,xt=new F,Ct=new F,_n=new F,ci=new F,ui=new F,Rt=new F;function yr(s,e,t,n,i){for(let r=0,l=s.length-3;r<=l;r+=3){Rt.fromArray(s,r);let c=i.x*Math.abs(Rt.x)+i.y*Math.abs(Rt.y)+i.z*Math.abs(Rt.z),u=e.dot(Rt),h=t.dot(Rt),d=n.dot(Rt);if(Math.max(-Math.max(u,h,d),Math.min(u,h,d))>c)return!1}return!0}var fe=new F,hi=new He,xh=0,nn=class extends Qt{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:xh++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ro,this.updateRanges=[],this.gpuType=no,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)hi.fromBufferAttribute(this,t),hi.applyMatrix3(e),this.setXY(t,hi.x,hi.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)fe.fromBufferAttribute(this,t),fe.applyMatrix3(e),this.setXYZ(t,fe.x,fe.y,fe.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)fe.fromBufferAttribute(this,t),fe.applyMatrix4(e),this.setXYZ(t,fe.x,fe.y,fe.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)fe.fromBufferAttribute(this,t),fe.applyNormalMatrix(e),this.setXYZ(t,fe.x,fe.y,fe.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)fe.fromBufferAttribute(this,t),fe.transformDirection(e),this.setXYZ(t,fe.x,fe.y,fe.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=mn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Le(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=mn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=mn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=mn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=mn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array),i=Le(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array),i=Le(i,this.array),r=Le(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return e.name=this.name,e.usage=this.usage,e.gpuType=this.gpuType,e}dispose(){this.dispatchEvent({type:"dispose"})}};var bn=class extends nn{constructor(e,t,n){super(new Float32Array(e),t,n)}};function oo(s){let e={};for(let t in s){e[t]={};for(let n in s[t]){let i=s[t][n];if(Wa(i))i.isRenderTargetTexture?(Ee("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone();else if(Array.isArray(i))if(Wa(i[0])){let r=[];for(let l=0,c=i.length;l<c;l++)r[l]=i[l].clone();e[t][n]=r}else e[t][n]=i.slice();else e[t][n]=i}}return e}function Ae(s){let e={};for(let t=0;t<s.length;t++){let n=oo(s[t]);for(let i in n)e[i]=n[i]}return e}function Wa(s){return s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)}function Jt(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function vr(s){return s!==void 0&&s.inTangents!==void 0&&s.outTangents!==void 0}var St=class{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let l;t:{i:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(r=i,i=t[++n],e<i)break e}l=t.length;break t}if(!(e>=r)){let c=t[1];e<c&&(n=2,r=c);for(let u=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===u)break;if(i=r,r=t[--n-1],e>=r)break e}l=n,n=0;break t}break n}for(;n<l;){let c=n+l>>>1;e<t[c]?l=c:n=c+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let l=0;l!==i;++l)t[l]=n[r+l];return t}interpolate_(){throw new Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}},vi=class extends St{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ir,endingEnd:Ir}}intervalChanged_(e,t,n){let i=this.parameterPositions,r=e-2,l=e+1,c=i[r],u=i[l];if(c===void 0)switch(this.getSettings_().endingStart){case Lr:r=e,c=2*t-n;break;case Dr:r=i.length-2,c=t+i[r]-i[r+1];break;default:r=e,c=n}if(u===void 0)switch(this.getSettings_().endingEnd){case Lr:l=e,u=2*n-t;break;case Dr:l=1,u=n+i[1]-i[0];break;default:l=e-1,u=t}let h=(n-t)*.5,d=this.valueSize;this._weightPrev=h/(t-c),this._weightNext=h/(u-n),this._offsetPrev=r*d,this._offsetNext=l*d}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=this._offsetPrev,p=this._offsetNext,v=this._weightPrev,_=this._weightNext,g=(n-t)/(i-t),x=g*g,A=x*g,E=-v*A+2*v*x-v*g,I=(1+v)*A+(-1.5-2*v)*x+(-.5+v)*g+1,N=(-1-_)*A+(1.5+_)*x+.5*g,O=_*A-_*x;for(let C=0;C!==c;++C)r[C]=E*l[d+C]+I*l[h+C]+N*l[u+C]+O*l[p+C];return r}},xi=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=(n-t)/(i-t),p=1-d;for(let v=0;v!==c;++v)r[v]=l[h+v]*p+l[u+v]*d;return r}},Si=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}},bi=class extends St{interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=this.inTangents,p=this.outTangents;if(!d||!p){let g=(n-t)/(i-t),x=1-g;for(let A=0;A!==c;++A)r[A]=l[h+A]*x+l[u+A]*g;return r}let v=c*2,_=e-1;for(let g=0;g!==c;++g){let x=l[h+g],A=l[u+g],E=_*v+g*2,I=p[E],N=p[E+1],O=e*v+g*2,C=d[O],G=d[O+1],z=bh(n,t,I,C,i);r[g]=lo(z,x,N,G,A)}return r}};function lo(s,e,t,n,i){let r=1-s;return r*r*r*e+3*r*r*s*t+3*r*s*s*n+s*s*s*i}function Sh(s,e,t,n,i){let r=1-s;return 3*r*r*(t-e)+6*r*s*(n-t)+3*s*s*(i-n)}function bh(s,e,t,n,i){let r=(s-e)/(i-e);for(let l=0;l<8;l++){let c=lo(r,e,t,n,i)-s;if(Math.abs(c)<1e-10)break;let u=Sh(r,e,t,n,i);if(Math.abs(u)<1e-10)break;r=Math.max(0,Math.min(1,r-c/u))}return r}var Ne=class{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Jt(t,this.TimeBufferType),this.values=Jt(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Jt(e.times,Array),values:Jt(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i),vr(e.settings)&&(n.settings={inTangents:Jt(e.settings.inTangents,Array),outTangents:Jt(e.settings.outTangents,Array)})}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Si(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new xi(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new vi(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new bi(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case xn:t=this.InterpolantFactoryMethodDiscrete;break;case pi:t=this.InterpolantFactoryMethodLinear;break;case fi:t=this.InterpolantFactoryMethodSmooth;break;case Pr:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ee("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return xn;case this.InterpolantFactoryMethodLinear:return pi;case this.InterpolantFactoryMethodSmooth:return fi;case this.InterpolantFactoryMethodBezier:return Pr}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e;vr(this.settings)&&(Xa(this.settings.inTangents,e),Xa(this.settings.outTangents,e))}return this}trim(e,t){let n=this.times,i=n.length,r=0,l=i-1;for(;r!==i&&n[r]<e;)++r;for(;l!==-1&&n[l]>t;)--l;if(++l,r!==0||l!==i){r>=l&&(l=Math.max(l,1),r=l-1);let c=this.getValueSize();this.times=n.slice(r,l),this.values=this.values.slice(r*c,l*c)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(me("KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,r=n.length;r===0&&(me("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==r;c++){let u=n[c];if(typeof u=="number"&&isNaN(u)){me("KeyframeTrack: Time is not a valid number.",this,c,u),e=!1;break}if(l!==null&&l>u){me("KeyframeTrack: Out of order keys.",this,c,u,l),e=!1;break}l=u}if(i!==void 0&&oh(i))for(let c=0,u=i.length;c!==u;++c){let h=i[c];if(isNaN(h)){me("KeyframeTrack: Value is not a valid number.",this,c,h),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===fi,r=e.length-1,l=1;for(let c=1;c<r;++c){let u=!1,h=e[c],d=e[c+1];if(h!==d&&(c!==1||h!==e[0]))if(i)u=!0;else{let p=c*n,v=p-n,_=p+n;for(let g=0;g!==n;++g){let x=t[p+g];if(x!==t[v+g]||x!==t[_+g]){u=!0;break}}}if(u){if(c!==l){e[l]=e[c];let p=c*n,v=l*n;for(let _=0;_!==n;++_)t[v+_]=t[p+_]}++l}}if(r>0){e[l]=e[r];for(let c=r*n,u=l*n,h=0;h!==n;++h)t[u+h]=t[c+h];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,vr(this.settings)&&(i.settings={inTangents:this.settings.inTangents.slice(),outTangents:this.settings.outTangents.slice()}),i}};function Xa(s,e){for(let t=0,n=s.length;t!==n;t+=2)s[t]*=e}Ne.prototype.ValueTypeName="";Ne.prototype.TimeBufferType=Float32Array;Ne.prototype.ValueBufferType=Float32Array;Ne.prototype.DefaultInterpolation=pi;var bt=class extends Ne{constructor(e,t,n){super(e,t,n)}};bt.prototype.ValueTypeName="bool";bt.prototype.ValueBufferType=Array;bt.prototype.DefaultInterpolation=xn;bt.prototype.InterpolantFactoryMethodLinear=void 0;bt.prototype.InterpolantFactoryMethodSmooth=void 0;var Mi=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};Mi.prototype.ValueTypeName="color";var wi=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};wi.prototype.ValueTypeName="number";var Ti=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=(n-t)/(i-t),h=e*c;for(let d=h+c;h!==d;h+=4)at.slerpFlat(r,0,l,h-c,l,h,u);return r}},Mn=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new Ti(this.times,this.values,this.getValueSize(),e)}};Mn.prototype.ValueTypeName="quaternion";Mn.prototype.InterpolantFactoryMethodSmooth=void 0;var Mt=class extends Ne{constructor(e,t,n){super(e,t,n)}};Mt.prototype.ValueTypeName="string";Mt.prototype.ValueBufferType=Array;Mt.prototype.DefaultInterpolation=xn;Mt.prototype.InterpolantFactoryMethodLinear=void 0;Mt.prototype.InterpolantFactoryMethodSmooth=void 0;var Ei=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};Ei.prototype.ValueTypeName="vector";var Ai=class{constructor(e,t,n){let i=this,r=!1,l=0,c=0,u,h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(d){c++,r===!1&&i.onStart!==void 0&&i.onStart(d,l,c),r=!0},this.itemEnd=function(d){l++,i.onProgress!==void 0&&i.onProgress(d,l,c),l===c&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return d=d.normalize("NFC"),u?u(d):d},this.setURLModifier=function(d){return u=d,this},this.addHandler=function(d,p){return h.push(d,p),this},this.removeHandler=function(d){let p=h.indexOf(d);return p!==-1&&h.splice(p,2),this},this.getHandler=function(d){for(let p=0,v=h.length;p<v;p+=2){let _=h[p],g=h[p+1];if(_.global&&(_.lastIndex=0),_.test(d))return g}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}},co=new Ai,Ci=class{constructor(e){this.manager=e!==void 0?e:co,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};Ci.DEFAULT_MATERIAL_NAME="__DEFAULT";var Kr="\\[\\]\\.:\\/",Mh=new RegExp("["+Kr+"]","g"),Qr="[^"+Kr+"]",wh="[^"+Kr.replace("\\.","")+"]",Th=/((?:WC+[\/:])*)/.source.replace("WC",Qr),Eh=/(WCOD+)?/.source.replace("WCOD",wh),Ah=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qr),Ch=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qr),Rh=new RegExp("^"+Th+Eh+Ah+Ch+"$"),Ph=["material","materials","bones","map"],zr=class{constructor(e,t,n){let i=n||ae.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},ae=class s{constructor(e,t,n){this.path=t,this.parsedPath=n||s.parseTrackName(t),this.node=s.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new s.Composite(e,t,n):new s(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Mh,"")}static parseTrackName(e){let t=Rh.exec(e);if(t===null)throw new Error("THREE.PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let r=n.nodeName.substring(i+1);Ph.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(r){for(let l=0;l<r.length;l++){let c=r[l];if(c.name===t||c.uuid===t)return c;let u=n(c.children);if(u)return u}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=s.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ee("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let h=t.objectIndex;switch(n){case"materials":if(!e.material){me("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){me("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){me("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===h){h=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){me("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){me("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){me("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(h!==void 0){if(e[h]===void 0){me("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}let l=e[i];if(l===void 0){let h=t.nodeName;me("PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?c=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(r!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){me("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){me("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=r}else l.fromArray!==void 0&&l.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};ae.Composite=zr;ae.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};ae.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};ae.prototype.GetterByBindingType=[ae.prototype._getValue_direct,ae.prototype._getValue_array,ae.prototype._getValue_arrayElement,ae.prototype._getValue_toArray];ae.prototype.SetterByBindingTypeAndVersioning=[[ae.prototype._setValue_direct,ae.prototype._setValue_direct_setNeedsUpdate,ae.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_array,ae.prototype._setValue_array_setNeedsUpdate,ae.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_arrayElement,ae.prototype._setValue_arrayElement_setNeedsUpdate,ae.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_fromArray,ae.prototype._setValue_fromArray_setNeedsUpdate,ae.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Hm=new Float32Array(1);var Vr=class s{static{s.prototype.isMatrix2=!0}constructor(e,t,n,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){let r=this.elements;return r[0]=e,r[2]=t,r[1]=n,r[3]=i,this}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"186"}}));typeof window<"u"&&(window.__THREE__?Ee("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="186");var Ih=`#ifdef USE_ALPHAHASH
|
|
6
|
+
Originally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(x.leakWarning,vs),zi.register(o,x,o)}return o},ms=o=>zi.unregister(o),dn(a))}function jo(){if(this.$$.ptr||Bi(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var a=dn(Object.create(Object.getPrototypeOf(this),{$$:{value:Ho(this.$$)}}));return a.$$.count.value+=1,a.$$.deleteScheduled=!1,a}function Ko(){this.$$.ptr||Bi(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ne("Object already scheduled for deletion"),ms(this),gs(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Qo(){return!this.$$.ptr}function el(){return this.$$.ptr||Bi(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ne("Object already scheduled for deletion"),un.push(this),un.length===1&&hn&&hn(Vi),this.$$.deleteScheduled=!0,this}function tl(){ct.prototype.isAliasOf=Go,ct.prototype.clone=jo,ct.prototype.delete=Ko,ct.prototype.isDeleted=Qo,ct.prototype.deleteLater=el}function ct(){}function xs(a,o,f){if(a[o].overloadTable===void 0){var m=a[o];a[o]=function(){return a[o].overloadTable.hasOwnProperty(arguments.length)||ne("Function '"+f+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[o].overloadTable+")!"),a[o].overloadTable[arguments.length].apply(this,arguments)},a[o].overloadTable=[],a[o].overloadTable[m.argCount]=m}}function nl(a,o,f){t.hasOwnProperty(a)?((f===void 0||t[a].overloadTable!==void 0&&t[a].overloadTable[f]!==void 0)&&ne("Cannot register public name '"+a+"' twice"),xs(t,a,a),t.hasOwnProperty(f)&&ne("Cannot register multiple overloads of a function with the same number of arguments ("+f+")!"),t[a].overloadTable[f]=o):(t[a]=o,f!==void 0&&(t[a].numArguments=f))}function il(a,o,f,m,x,E,A,w){this.name=a,this.constructor=o,this.instancePrototype=f,this.rawDestructor=m,this.baseClass=x,this.getActualType=E,this.upcast=A,this.downcast=w,this.pureVirtualFunctions=[]}function ki(a,o,f){for(;o!==f;)o.upcast||ne("Expected null or instance of "+f.name+", got an instance of "+o.name),a=o.upcast(a),o=o.baseClass;return a}function rl(a,o){if(o===null)return this.isReference&&ne("null is not a valid "+this.name),0;o.$$||ne('Cannot pass "'+Bt(o)+'" as a '+this.name),o.$$.ptr||ne("Cannot pass deleted object as a pointer of type "+this.name);var f=o.$$.ptrType.registeredClass,m=ki(o.$$.ptr,f,this.registeredClass);return m}function sl(a,o){var f;if(o===null)return this.isReference&&ne("null is not a valid "+this.name),this.isSmartPointer?(f=this.rawConstructor(),a!==null&&a.push(this.rawDestructor,f),f):0;o.$$||ne('Cannot pass "'+Bt(o)+'" as a '+this.name),o.$$.ptr||ne("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&o.$$.ptrType.isConst&&ne("Cannot convert argument of type "+(o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name)+" to parameter type "+this.name);var m=o.$$.ptrType.registeredClass;if(f=ki(o.$$.ptr,m,this.registeredClass),this.isSmartPointer)switch(o.$$.smartPtr===void 0&&ne("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:o.$$.smartPtrType===this?f=o.$$.smartPtr:ne("Cannot convert argument of type "+(o.$$.smartPtrType?o.$$.smartPtrType.name:o.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:f=o.$$.smartPtr;break;case 2:if(o.$$.smartPtrType===this)f=o.$$.smartPtr;else{var x=o.clone();f=this.rawShare(f,Wi.toHandle(function(){x.delete()})),a!==null&&a.push(this.rawDestructor,f)}break;default:ne("Unsupporting sharing policy")}return f}function al(a,o){if(o===null)return this.isReference&&ne("null is not a valid "+this.name),0;o.$$||ne('Cannot pass "'+Bt(o)+'" as a '+this.name),o.$$.ptr||ne("Cannot pass deleted object as a pointer of type "+this.name),o.$$.ptrType.isConst&&ne("Cannot convert argument of type "+o.$$.ptrType.name+" to parameter type "+this.name);var f=o.$$.ptrType.registeredClass,m=ki(o.$$.ptr,f,this.registeredClass);return m}function Ln(a){return this.fromWireType(oe[a>>2])}function ol(a){return this.rawGetPointee&&(a=this.rawGetPointee(a)),a}function ll(a){this.rawDestructor&&this.rawDestructor(a)}function cl(a){a!==null&&a.delete()}function ul(){tt.prototype.getPointee=ol,tt.prototype.destructor=ll,tt.prototype.argPackAdvance=8,tt.prototype.readValueFromPointer=Ln,tt.prototype.deleteObject=cl,tt.prototype.fromWireType=vs}function tt(a,o,f,m,x,E,A,w,I,N,X){this.name=a,this.registeredClass=o,this.isReference=f,this.isConst=m,this.isSmartPointer=x,this.pointeeType=E,this.sharingPolicy=A,this.rawGetPointee=w,this.rawConstructor=I,this.rawShare=N,this.rawDestructor=X,!x&&o.baseClass===void 0?m?(this.toWireType=rl,this.destructorFunction=null):(this.toWireType=al,this.destructorFunction=null):this.toWireType=sl}function hl(a,o,f){t.hasOwnProperty(a)||Pn("Replacing nonexistant public symbol"),t[a].overloadTable!==void 0&&f!==void 0?t[a].overloadTable[f]=o:(t[a]=o,t[a].argCount=f)}function fl(a,o,f){U("dynCall_"+a in t,"bad function pointer type - no table for sig '"+a+"'"),f&&f.length?U(f.length===a.substring(1).replace(/j/g,"--").length):U(a.length==1);var m=t["dynCall_"+a];return f&&f.length?m.apply(null,[o].concat(f)):m.call(null,o)}var pn=[];function Dn(a){var o=pn[a];return o||(a>=pn.length&&(pn.length=a+1),pn[a]=o=ot.get(a)),U(ot.get(a)==o,"JavaScript-side Wasm function table mirror is out of date!"),o}function dl(a,o,f){if(a.includes("j"))return fl(a,o,f);U(Dn(o),"missing table entry in dynCall: "+o);var m=Dn(o).apply(null,f);return m}function pl(a,o){U(a.includes("j")||a.includes("p"),"getDynCaller should only be called with i64 sigs");var f=[];return function(){return f.length=0,Object.assign(f,arguments),dl(a,o,f)}}function Ot(a,o){a=Oe(a);function f(){return a.includes("j")?pl(a,o):Dn(o)}var m=f();return typeof m!="function"&&ne("unknown function pointer with signature "+a+": "+o),m}var Ss=void 0;function ml(a){var o=sc(a),f=Oe(o);return ut(o),f}function Gi(a,o){var f=[],m={};function x(E){if(!m[E]&&!Nt[E]){if(Rn[E]){Rn[E].forEach(x);return}f.push(E),m[E]=!0}}throw o.forEach(x),new Ss(a+": "+f.map(ml).join([", "]))}function gl(a,o,f,m,x,E,A,w,I,N,X,Z,q){X=Oe(X),E=Ot(x,E),w&&(w=Ot(A,w)),N&&(N=Ot(I,N)),q=Ot(Z,q);var ce=fs(X);nl(ce,function(){Gi("Cannot construct "+X+" due to unbound types",[m])}),cn([a,o,f],m?[m]:[],function(ie){ie=ie[0];var se,Pe;m?(se=ie.registeredClass,Pe=se.instancePrototype):Pe=ct.prototype;var Ze=ds(ce,function(){if(Object.getPrototypeOf(this)!==P)throw new Ft("Use 'new' to construct "+X);if(H.constructor_body===void 0)throw new Ft(X+" has no accessible constructor");var Fn=H.constructor_body[arguments.length];if(Fn===void 0)throw new Ft("Tried to invoke ctor of "+X+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(H.constructor_body).toString()+") parameters instead!");return Fn.apply(this,arguments)}),P=Object.create(Pe,{constructor:{value:Ze}});Ze.prototype=P;var H=new il(X,Ze,P,q,se,E,w,N),xe=new tt(X,H,!0,!1,!1),ye=new tt(X+"*",H,!1,!1,!1),At=new tt(X+" const*",H,!1,!0,!1);return ys[a]={pointerType:ye,constPointerType:At},hl(ce,Ze),[xe,ye,At]})}function bs(a,o){for(var f=[],m=0;m<a;m++)f.push(re[o+m*4>>2]);return f}function _l(a){for(;a.length;){var o=a.pop(),f=a.pop();f(o)}}function Ms(a,o,f,m,x){var E=o.length;E<2&&ne("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var A=o[1]!==null&&f!==null,w=!1,I=1;I<o.length;++I)if(o[I]!==null&&o[I].destructorFunction===void 0){w=!0;break}var N=o[0].name!=="void",X=E-2,Z=new Array(X),q=[],ce=[];return function(){arguments.length!==X&&ne("function "+a+" called with "+arguments.length+" arguments, expected "+X+" args!"),ce.length=0;var ie;q.length=A?2:1,q[0]=x,A&&(ie=o[1].toWireType(ce,this),q[1]=ie);for(var se=0;se<X;++se)Z[se]=o[se+2].toWireType(ce,arguments[se]),q.push(Z[se]);var Pe=m.apply(null,q);function Ze(P){if(w)_l(ce);else for(var H=A?1:2;H<o.length;H++){var xe=H===1?ie:Z[H-2];o[H].destructorFunction!==null&&o[H].destructorFunction(xe)}if(N)return o[0].fromWireType(P)}return Ze(Pe)}}function yl(a,o,f,m,x,E){U(o>0);var A=bs(o,f);x=Ot(m,x),cn([],[a],function(w){w=w[0];var I="constructor "+w.name;if(w.registeredClass.constructor_body===void 0&&(w.registeredClass.constructor_body=[]),w.registeredClass.constructor_body[o-1]!==void 0)throw new Ft("Cannot register multiple constructors with identical number of parameters ("+(o-1)+") for class '"+w.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return w.registeredClass.constructor_body[o-1]=()=>{Gi("Cannot construct "+w.name+" due to unbound types",A)},cn([],A,function(N){return N.splice(1,0,null),w.registeredClass.constructor_body[o-1]=Ms(I,N,null,x,E),[]}),[]})}function vl(a,o,f,m,x,E,A,w){var I=bs(f,m);o=Oe(o),E=Ot(x,E),cn([],[a],function(N){N=N[0];var X=N.name+"."+o;o.startsWith("@@")&&(o=Symbol[o.substring(2)]),w&&N.registeredClass.pureVirtualFunctions.push(o);function Z(){Gi("Cannot call "+X+" due to unbound types",I)}var q=N.registeredClass.instancePrototype,ce=q[o];return ce===void 0||ce.overloadTable===void 0&&ce.className!==N.name&&ce.argCount===f-2?(Z.argCount=f-2,Z.className=N.name,q[o]=Z):(xs(q,o,X),q[o].overloadTable[f-2]=Z),cn([],I,function(ie){var se=Ms(X,ie,N,E,A);return q[o].overloadTable===void 0?(se.argCount=f-2,q[o]=se):q[o].overloadTable[f-2]=se,[]}),[]})}var Hi=[],$e=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function xl(a){a>4&&--$e[a].refcount===0&&($e[a]=void 0,Hi.push(a))}function Sl(){for(var a=0,o=5;o<$e.length;++o)$e[o]!==void 0&&++a;return a}function bl(){for(var a=5;a<$e.length;++a)if($e[a]!==void 0)return $e[a];return null}function Ml(){t.count_emval_handles=Sl,t.get_first_emval=bl}var Wi={toValue:a=>(a||ne("Cannot use deleted val. handle = "+a),$e[a].value),toHandle:a=>{switch(a){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:{var o=Hi.length?Hi.pop():$e.length;return $e[o]={refcount:1,value:a},o}}}};function wl(a,o){o=Oe(o),et(a,{name:o,fromWireType:function(f){var m=Wi.toValue(f);return xl(f),m},toWireType:function(f,m){return Wi.toHandle(m)},argPackAdvance:8,readValueFromPointer:Ln,destructorFunction:null})}function Bt(a){if(a===null)return"null";var o=typeof a;return o==="object"||o==="array"||o==="function"?a.toString():""+a}function Tl(a,o){switch(o){case 2:return function(f){return this.fromWireType(ns[f>>2])};case 3:return function(f){return this.fromWireType(is[f>>3])};default:throw new TypeError("Unknown float type: "+a)}}function El(a,o,f){var m=Fi(f);o=Oe(o),et(a,{name:o,fromWireType:function(x){return x},toWireType:function(x,E){if(typeof E!="number"&&typeof E!="boolean")throw new TypeError('Cannot convert "'+Bt(E)+'" to '+this.name);return E},argPackAdvance:8,readValueFromPointer:Tl(o,m),destructorFunction:null})}function Al(a,o,f){switch(o){case 0:return f?function(x){return Ye[x]}:function(x){return Ce[x]};case 1:return f?function(x){return Dt[x>>1]}:function(x){return Cn[x>>1]};case 2:return f?function(x){return oe[x>>2]}:function(x){return re[x>>2]};default:throw new TypeError("Unknown integer type: "+a)}}function Cl(a,o,f,m,x){o=Oe(o),x===-1&&(x=4294967295);var E=Fi(f),A=Z=>Z;if(m===0){var w=32-8*f;A=Z=>Z<<w>>>w}var I=o.includes("unsigned"),N=(Z,q)=>{if(typeof Z!="number"&&typeof Z!="boolean")throw new TypeError('Cannot convert "'+Bt(Z)+'" to '+q);if(Z<m||Z>x)throw new TypeError('Passing a number "'+Bt(Z)+'" from JS side to C/C++ side to an argument of type "'+o+'", which is outside the valid range ['+m+", "+x+"]!")},X;I?X=function(Z,q){return N(q,this.name),q>>>0}:X=function(Z,q){return N(q,this.name),q},et(a,{name:o,fromWireType:A,toWireType:X,argPackAdvance:8,readValueFromPointer:Al(o,E,m!==0),destructorFunction:null})}function Rl(a,o,f){var m=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],x=m[o];function E(A){A=A>>2;var w=re,I=w[A],N=w[A+1];return new x(Lt,N,I)}f=Oe(f),et(a,{name:f,fromWireType:E,argPackAdvance:8,readValueFromPointer:E},{ignoreDuplicateRegistrations:!0})}function Pl(a,o){o=Oe(o);var f=o==="std::string";et(a,{name:o,fromWireType:function(m){var x=re[m>>2],E=m+4,A;if(f)for(var w=E,I=0;I<=x;++I){var N=E+I;if(I==x||Ce[N]==0){var X=N-w,Z=K(w,X);A===void 0?A=Z:(A+="\0",A+=Z),w=N+1}}else{for(var q=new Array(x),I=0;I<x;++I)q[I]=String.fromCharCode(Ce[E+I]);A=q.join("")}return ut(m),A},toWireType:function(m,x){x instanceof ArrayBuffer&&(x=new Uint8Array(x));var E,A=typeof x=="string";A||x instanceof Uint8Array||x instanceof Uint8ClampedArray||x instanceof Int8Array||ne("Cannot pass non-string to std::string"),f&&A?E=It(x):E=x.length;var w=Zi(4+E+1),I=w+4;if(re[w>>2]=E,f&&A)an(x,I,E+1);else if(A)for(var N=0;N<E;++N){var X=x.charCodeAt(N);X>255&&(ut(I),ne("String has UTF-16 code units that do not fit in 8 bits")),Ce[I+N]=X}else for(var N=0;N<E;++N)Ce[I+N]=x[N];return m!==null&&m.push(ut,w),w},argPackAdvance:8,readValueFromPointer:Ln,destructorFunction:function(m){ut(m)}})}var ws=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Il(a,o){U(a%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var f=a,m=f>>1,x=m+o/2;!(m>=x)&&Cn[m];)++m;if(f=m<<1,f-a>32&&ws)return ws.decode(Ce.subarray(a,f));for(var E="",A=0;!(A>=o/2);++A){var w=Dt[a+A*2>>1];if(w==0)break;E+=String.fromCharCode(w)}return E}function Ll(a,o,f){if(U(o%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),U(typeof f=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),f===void 0&&(f=2147483647),f<2)return 0;f-=2;for(var m=o,x=f<a.length*2?f/2:a.length,E=0;E<x;++E){var A=a.charCodeAt(E);Dt[o>>1]=A,o+=2}return Dt[o>>1]=0,o-m}function Dl(a){return a.length*2}function Ul(a,o){U(a%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var f=0,m="";!(f>=o/4);){var x=oe[a+f*4>>2];if(x==0)break;if(++f,x>=65536){var E=x-65536;m+=String.fromCharCode(55296|E>>10,56320|E&1023)}else m+=String.fromCharCode(x)}return m}function Nl(a,o,f){if(U(o%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),U(typeof f=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),f===void 0&&(f=2147483647),f<4)return 0;for(var m=o,x=m+f-4,E=0;E<a.length;++E){var A=a.charCodeAt(E);if(A>=55296&&A<=57343){var w=a.charCodeAt(++E);A=65536+((A&1023)<<10)|w&1023}if(oe[o>>2]=A,o+=4,o+4>x)break}return oe[o>>2]=0,o-m}function Fl(a){for(var o=0,f=0;f<a.length;++f){var m=a.charCodeAt(f);m>=55296&&m<=57343&&++f,o+=4}return o}function Ol(a,o,f){f=Oe(f);var m,x,E,A,w;o===2?(m=Il,x=Ll,A=Dl,E=()=>Cn,w=1):o===4&&(m=Ul,x=Nl,A=Fl,E=()=>re,w=2),et(a,{name:f,fromWireType:function(I){for(var N=re[I>>2],X=E(),Z,q=I+4,ce=0;ce<=N;++ce){var ie=I+4+ce*o;if(ce==N||X[ie>>w]==0){var se=ie-q,Pe=m(q,se);Z===void 0?Z=Pe:(Z+="\0",Z+=Pe),q=ie+o}}return ut(I),Z},toWireType:function(I,N){typeof N!="string"&&ne("Cannot pass non-string to C++ string type "+f);var X=A(N),Z=Zi(4+X+o);return re[Z>>2]=X>>w,x(N,Z+4,X+o),I!==null&&I.push(ut,Z),Z},argPackAdvance:8,readValueFromPointer:Ln,destructorFunction:function(I){ut(I)}})}function Bl(a,o){o=Oe(o),et(a,{isVoid:!0,name:o,argPackAdvance:0,fromWireType:function(){},toWireType:function(f,m){}})}function zl(){Re("native code called abort()")}function Vl(a,o,f){Ce.copyWithin(a,o,o+f)}function kl(){return 2147483648}function Gl(a){try{return V.grow(a-Lt.byteLength+65535>>>16),rs(V.buffer),1}catch(o){C("emscripten_realloc_buffer: Attempted to grow heap from "+Lt.byteLength+" bytes to "+a+" bytes, but got error: "+o)}}function Hl(a){var o=Ce.length;a=a>>>0,U(a>o);var f=kl();if(a>f)return C("Cannot enlarge memory, asked to go up to "+a+" bytes, but the limit is "+f+" bytes!"),!1;let m=(I,N)=>I+(N-I%N)%N;for(var x=1;x<=4;x*=2){var E=o*(1+.2/x);E=Math.min(E,a+100663296);var A=Math.min(f,m(Math.max(a,E),65536)),w=Gl(A);if(w)return!0}return C("Failed to grow the heap from "+o+" bytes to "+A+" bytes, not enough memory!"),!1}var Xi={};function Wl(){return c||"./this.program"}function mn(){if(!mn.strings){var a=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:a,_:Wl()};for(var f in Xi)Xi[f]===void 0?delete o[f]:o[f]=Xi[f];var m=[];for(var f in o)m.push(f+"="+o[f]);mn.strings=m}return mn.strings}function Xl(a,o,f){for(var m=0;m<a.length;++m)U(a.charCodeAt(m)===(a.charCodeAt(m)&255)),Ye[o++>>0]=a.charCodeAt(m);f||(Ye[o>>0]=0)}var qi={varargs:void 0,get:function(){U(qi.varargs!=null),qi.varargs+=4;var a=oe[qi.varargs-4>>2];return a},getStr:function(a){var o=K(a);return o}};function ql(a,o){var f=0;return mn().forEach(function(m,x){var E=o+f;re[a+x*4>>2]=E,Xl(m,E),f+=m.length+1}),0}function Yl(a,o){var f=mn();re[a>>2]=f.length;var m=0;return f.forEach(function(x){m+=x.length+1}),re[o>>2]=m,0}function $l(a){Re("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")}function Zl(a,o,f,m,x){return 70}var Yi=[null,[],[]];function $i(a,o){var f=Yi[a];U(f),o===0||o===10?((a===1?B:C)(ve(f,0)),f.length=0):f.push(o)}function Xp(){ac(0),Yi[1].length&&$i(1,10),Yi[2].length&&$i(2,10)}function Jl(a,o,f,m){for(var x=0,E=0;E<f;E++){var A=re[o>>2],w=re[o+4>>2];o+=8;for(var I=0;I<w;I++)$i(a,Ce[A+I]);x+=w}return re[m>>2]=x,0}function Un(a){return a%4===0&&(a%100!==0||a%400===0)}function jl(a,o){for(var f=0,m=0;m<=o;f+=a[m++]);return f}var Ts=[31,29,31,30,31,30,31,31,30,31,30,31],Es=[31,28,31,30,31,30,31,31,30,31,30,31];function Kl(a,o){for(var f=new Date(a.getTime());o>0;){var m=Un(f.getFullYear()),x=f.getMonth(),E=(m?Ts:Es)[x];if(o>E-f.getDate())o-=E-f.getDate()+1,f.setDate(1),x<11?f.setMonth(x+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else return f.setDate(f.getDate()+o),f}return f}function Ql(a,o,f){var m=f>0?f:It(a)+1,x=new Array(m),E=ue(a,x,0,x.length);return o&&(x.length=E),x}function ec(a,o,f,m){var x=oe[m+40>>2],E={tm_sec:oe[m>>2],tm_min:oe[m+4>>2],tm_hour:oe[m+8>>2],tm_mday:oe[m+12>>2],tm_mon:oe[m+16>>2],tm_year:oe[m+20>>2],tm_wday:oe[m+24>>2],tm_yday:oe[m+28>>2],tm_isdst:oe[m+32>>2],tm_gmtoff:oe[m+36>>2],tm_zone:x?K(x):""},A=K(f),w={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var I in w)A=A.replace(new RegExp(I,"g"),w[I]);var N=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],X=["January","February","March","April","May","June","July","August","September","October","November","December"];function Z(P,H,xe){for(var ye=typeof P=="number"?P.toString():P||"";ye.length<H;)ye=xe[0]+ye;return ye}function q(P,H){return Z(P,H,"0")}function ce(P,H){function xe(At){return At<0?-1:At>0?1:0}var ye;return(ye=xe(P.getFullYear()-H.getFullYear()))===0&&(ye=xe(P.getMonth()-H.getMonth()))===0&&(ye=xe(P.getDate()-H.getDate())),ye}function ie(P){switch(P.getDay()){case 0:return new Date(P.getFullYear()-1,11,29);case 1:return P;case 2:return new Date(P.getFullYear(),0,3);case 3:return new Date(P.getFullYear(),0,2);case 4:return new Date(P.getFullYear(),0,1);case 5:return new Date(P.getFullYear()-1,11,31);case 6:return new Date(P.getFullYear()-1,11,30)}}function se(P){var H=Kl(new Date(P.tm_year+1900,0,1),P.tm_yday),xe=new Date(H.getFullYear(),0,4),ye=new Date(H.getFullYear()+1,0,4),At=ie(xe),Fn=ie(ye);return ce(At,H)<=0?ce(Fn,H)<=0?H.getFullYear()+1:H.getFullYear():H.getFullYear()-1}var Pe={"%a":function(P){return N[P.tm_wday].substring(0,3)},"%A":function(P){return N[P.tm_wday]},"%b":function(P){return X[P.tm_mon].substring(0,3)},"%B":function(P){return X[P.tm_mon]},"%C":function(P){var H=P.tm_year+1900;return q(H/100|0,2)},"%d":function(P){return q(P.tm_mday,2)},"%e":function(P){return Z(P.tm_mday,2," ")},"%g":function(P){return se(P).toString().substring(2)},"%G":function(P){return se(P)},"%H":function(P){return q(P.tm_hour,2)},"%I":function(P){var H=P.tm_hour;return H==0?H=12:H>12&&(H-=12),q(H,2)},"%j":function(P){return q(P.tm_mday+jl(Un(P.tm_year+1900)?Ts:Es,P.tm_mon-1),3)},"%m":function(P){return q(P.tm_mon+1,2)},"%M":function(P){return q(P.tm_min,2)},"%n":function(){return`
|
|
7
|
+
`},"%p":function(P){return P.tm_hour>=0&&P.tm_hour<12?"AM":"PM"},"%S":function(P){return q(P.tm_sec,2)},"%t":function(){return" "},"%u":function(P){return P.tm_wday||7},"%U":function(P){var H=P.tm_yday+7-P.tm_wday;return q(Math.floor(H/7),2)},"%V":function(P){var H=Math.floor((P.tm_yday+7-(P.tm_wday+6)%7)/7);if((P.tm_wday+371-P.tm_yday-2)%7<=2&&H++,H){if(H==53){var ye=(P.tm_wday+371-P.tm_yday)%7;ye!=4&&(ye!=3||!Un(P.tm_year))&&(H=1)}}else{H=52;var xe=(P.tm_wday+7-P.tm_yday-1)%7;(xe==4||xe==5&&Un(P.tm_year%400-1))&&H++}return q(H,2)},"%w":function(P){return P.tm_wday},"%W":function(P){var H=P.tm_yday+7-(P.tm_wday+6)%7;return q(Math.floor(H/7),2)},"%y":function(P){return(P.tm_year+1900).toString().substring(2)},"%Y":function(P){return P.tm_year+1900},"%z":function(P){var H=P.tm_gmtoff,xe=H>=0;return H=Math.abs(H)/60,H=H/60*100+H%60,(xe?"+":"-")+("0000"+H).slice(-4)},"%Z":function(P){return P.tm_zone},"%%":function(){return"%"}};A=A.replace(/%%/g,"\0\0");for(var I in Pe)A.includes(I)&&(A=A.replace(new RegExp(I,"g"),Pe[I](E)));A=A.replace(/\0\0/g,"%");var Ze=Ql(A,!1);return Ze.length>o?0:(us(Ze,a),Ze.length-1)}function tc(a,o,f,m){return ec(a,o,f,m)}function As(a,o){U(a<16384),a<128?o.push(a):o.push(a%128|128,a>>7)}function nc(a){for(var o={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},f={parameters:[],results:a[0]=="v"?[]:[o[a[0]]]},m=1;m<a.length;++m)U(a[m]in o,"invalid signature char: "+a[m]),f.parameters.push(o[a[m]]);return f}function qp(a,o){if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(nc(o),a);var f=[1,96],m=o.slice(0,1),x=o.slice(1),E={i:127,p:127,j:126,f:125,d:124};As(x.length,f);for(var A=0;A<x.length;++A)U(x[A]in E,"invalid signature char: "+x[A]),f.push(E[x[A]]);m=="v"?f.push(0):f.push(1,E[m]);var w=[0,97,115,109,1,0,0,0,1];As(f.length,w),w.push.apply(w,f),w.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var I=new WebAssembly.Module(new Uint8Array(w)),N=new WebAssembly.Instance(I,{e:{f:a}}),X=N.exports.f;return X}function Yp(a,o){if(Cs)for(var f=a;f<a+o;f++){var m=Dn(f);m&&Cs.set(m,f)}}var Cs=void 0,Rs=[];function $p(){if(Rs.length)return Rs.pop();try{ot.grow(1)}catch(a){throw a instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":a}return ot.length-1}function Zp(a,o){ot.set(a,o),pn[a]=ot.get(a)}var Jp=1;function ic(a){var o=t["_"+a];return U(o,"Cannot call unknown function "+a+", make sure it is exported"),o}function jp(a,o,f,m,x){var E={string:ie=>{var se=0;if(ie!=null&&ie!==0){var Pe=(ie.length<<2)+1;se=Ls(Pe),an(ie,se,Pe)}return se},array:ie=>{var se=Ls(ie.length);return us(ie,se),se}};function A(ie){return o==="string"?K(ie):o==="boolean"?!!ie:ie}var w=ic(a),I=[],N=0;if(U(o!=="array",'Return type should not be "array".'),m)for(var X=0;X<m.length;X++){var Z=E[f[X]];Z?(N===0&&(N=cc()),I[X]=Z(m[X])):I[X]=m[X]}var q=w.apply(null,I);function ce(ie){return N!==0&&uc(N),A(ie)}return q=ce(q),q}Bo(),Ft=t.BindingError=Oi(Error,"BindingError"),ps=t.InternalError=Oi(Error,"InternalError"),tl(),$o(),ul(),Ss=t.UnboundTypeError=Oi(Error,"UnboundTypeError"),Ml();var Kp=!0;function rc(){W("fetchSettings")}var Ps={__cxa_allocate_exception:Lo,__cxa_throw:Fo,_embind_register_bigint:Oo,_embind_register_bool:ko,_embind_register_class:gl,_embind_register_class_constructor:yl,_embind_register_class_function:vl,_embind_register_emval:wl,_embind_register_float:El,_embind_register_integer:Cl,_embind_register_memory_view:Rl,_embind_register_std_string:Pl,_embind_register_std_wstring:Ol,_embind_register_void:Bl,abort:zl,emscripten_memcpy_big:Vl,emscripten_resize_heap:Hl,environ_get:ql,environ_sizes_get:Yl,fd_close:$l,fd_seek:Zl,fd_write:Jl,strftime_l:tc},Qp=Ro(),em=t.___wasm_call_ctors=_e("__wasm_call_ctors"),Zi=t._malloc=_e("malloc"),ut=t._free=_e("free"),sc=t.___getTypeName=_e("__getTypeName"),tm=t.__embind_initialize_bindings=_e("_embind_initialize_bindings"),nm=t.___errno_location=_e("__errno_location"),ac=t._fflush=_e("fflush"),Is=t._emscripten_stack_init=function(){return(Is=t._emscripten_stack_init=t.asm.emscripten_stack_init).apply(null,arguments)},oc=t._emscripten_stack_get_free=function(){return(oc=t._emscripten_stack_get_free=t.asm.emscripten_stack_get_free).apply(null,arguments)},lc=t._emscripten_stack_get_base=function(){return(lc=t._emscripten_stack_get_base=t.asm.emscripten_stack_get_base).apply(null,arguments)},Ji=t._emscripten_stack_get_end=function(){return(Ji=t._emscripten_stack_get_end=t.asm.emscripten_stack_get_end).apply(null,arguments)},cc=t.stackSave=_e("stackSave"),uc=t.stackRestore=_e("stackRestore"),Ls=t.stackAlloc=_e("stackAlloc"),hc=t.___cxa_is_pointer_type=_e("__cxa_is_pointer_type"),im=t.dynCall_viijii=_e("dynCall_viijii"),rm=t.dynCall_ji=_e("dynCall_ji"),sm=t.dynCall_jiji=_e("dynCall_jiji"),am=t.dynCall_iiiiij=_e("dynCall_iiiiij"),om=t.dynCall_iiiiijj=_e("dynCall_iiiiijj"),lm=t.dynCall_iiiiiijj=_e("dynCall_iiiiiijj"),fc=["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"];fc.forEach(g);var dc=["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"];dc.forEach(j);var Nn;on=function a(){Nn||Ds(),Nn||(on=a)};function pc(){Is(),_o()}function Ds(a){if(a=a||l,Tt>0||(pc(),yo(),Tt>0))return;function o(){Nn||(Nn=!0,t.calledRun=!0,!k&&(vo(),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),U(!t._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),xo()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),o()},1)):o(),Di()}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return Ds(),e.ready})})();typeof Qn=="object"&&typeof ar=="object"?ar.exports=sr:typeof define=="function"&&define.amd?define([],function(){return sr}):typeof Qn=="object"&&(Qn.createLazPerf=sr)});var fa=te(je=>{"use strict";var Mu=je&&je.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(je,"__esModule",{value:!0});je.LazPerf=je.create=je.createLazPerf=void 0;var or=Mu(ha());je.createLazPerf=or.default;je.create=or.default;je.LazPerf={create:or.default}});var _a=te(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.decompressFile=gt.decompressChunk=gt.PointData=void 0;var da=fa(),wu=rr();gt.PointData={createLazPerf:da.createLazPerf,decompressChunk:ma,decompressFile:ga};var lr;async function pa(s){return s||(lr||(lr=(0,da.createLazPerf)()),lr)}async function ma(s,{pointCount:e,pointDataRecordFormat:t,pointDataRecordLength:n},i){let r=await pa(i),l=new Uint8Array(e*n),c=r._malloc(s.byteLength),u=r._malloc(n),h=new r.ChunkDecoder;try{r.HEAPU8.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength),c),h.open(t,n,c);for(let d=0;d<e;++d)h.getPoint(u),l.set(new Uint8Array(r.HEAPU8.buffer,u,n),d*n)}finally{r._free(c),r._free(u),h.delete()}return l}gt.decompressChunk=ma;async function ga(s,e){let t=await pa(e),n=wu.Header.parse(s),{pointCount:i,pointDataRecordLength:r}=n,l=new Uint8Array(i*r),c=t._malloc(s.byteLength),u=t._malloc(r),h=new t.LASZip;try{t.HEAPU8.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength),c),h.open(c,s.byteLength);for(let d=0;d<i;++d)h.getPoint(u),l.set(new Uint8Array(t.HEAPU8.buffer,u,r),d*r)}finally{h.delete()}return l}gt.decompressFile=ga});var ya=te(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.View=void 0;var Tu=ze(),Eu=tr(),Au=nr();ei.View={create:Cu};function Cu(s,e,t=[],n){let i=Au.Extractor.create(e,t);if(n){let d=new Set([...n]);i=Object.entries(i).reduce((p,[_,y])=>(d.has(_)&&(p[_]=y),p),{})}let r=Eu.Dimensions.create(i,t),l=Tu.Binary.toDataView(s),c=e.pointDataRecordLength;if(l.byteLength%c!==0)throw new Error(`Invalid buffer length (${l.byteLength}) for point length ${c}`);let u=l.byteLength/e.pointDataRecordLength;function h(d){let p=i[d];if(!p)throw new Error(`No extractor for dimension: ${d}`);return function(_){if(_>=u)throw new RangeError(`View index (${_}) out of range: ${u}`);return p(l,_)}}return{pointCount:u,dimensions:r,getter:h}}});var ba=te(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.Vlr=void 0;var Ke=ze(),Wt=Vn();ti.Vlr={walk:Iu,parse:Sa,find:xa,at:Ru,fetch:Pu};function xa(s,e,t){return s.find(n=>n.userId===e&&n.recordId===t)}function Ru(s,e,t){let n=xa(s,e,t);if(!n)throw new Error(`VLR not found: ${e}/${t}`);return n}function Pu(s,{contentOffset:e,contentLength:t}){return t===0?new Uint8Array:Ke.Getter.create(s)(e,e+t)}async function Iu(s,e){let t=Ke.Getter.create(s),n=await va({get:t,startOffset:e.headerLength,count:e.vlrCount,isExtended:!1}),i=await va({get:t,startOffset:e.evlrOffset,count:e.evlrCount,isExtended:!0});return[...n,...i]}function Sa(s,e){return(e?Du:Lu)(s)}function Lu(s){let e=Ke.Binary.toDataView(s);if(e.byteLength!==Wt.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${Wt.vlrHeaderLength}): ${e.byteLength}`);return{userId:Ke.Binary.toCString(s.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:Ke.Binary.toCString(s.slice(22,54)),isExtended:!1}}function Du(s){let e=Ke.Binary.toDataView(s);if(e.byteLength!==Wt.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${Wt.evlrHeaderLength}): ${e.byteLength}`);return{userId:Ke.Binary.toCString(s.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,Ke.parseBigInt)((0,Ke.getBigUint64)(e,20,!0)),description:Ke.Binary.toCString(s.slice(28,60)),isExtended:!0}}async function va({get:s,startOffset:e,count:t,isExtended:n}){let i=[],r=e,l=n?Wt.evlrHeaderLength:Wt.vlrHeaderLength;for(let c=0;c<t;++c){let u=l?await s(r,r+l):new Uint8Array,{userId:h,recordId:d,contentLength:p,description:_}=Sa(u,n);i.push({userId:h,recordId:d,contentOffset:r+l,contentLength:p,description:_,isExtended:n}),r+=l+p}return i}});var ni=te(le=>{"use strict";var Uu=le&&le.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Nu=le&&le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Fu=le&&le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Uu(e,s,t);return Nu(e,s),e};Object.defineProperty(le,"__esModule",{value:!0});le.Vlr=le.View=le.PointData=le.Header=le.Extractor=le.ExtraBytes=le.Dimensions=le.Constants=void 0;le.Constants=Fu(Vn());var Ou=tr();Object.defineProperty(le,"Dimensions",{enumerable:!0,get:function(){return Ou.Dimensions}});var Bu=er();Object.defineProperty(le,"ExtraBytes",{enumerable:!0,get:function(){return Bu.ExtraBytes}});var zu=nr();Object.defineProperty(le,"Extractor",{enumerable:!0,get:function(){return zu.Extractor}});var Vu=rr();Object.defineProperty(le,"Header",{enumerable:!0,get:function(){return Vu.Header}});var ku=_a();Object.defineProperty(le,"PointData",{enumerable:!0,get:function(){return ku.PointData}});var Gu=ya();Object.defineProperty(le,"View",{enumerable:!0,get:function(){return Gu.View}});var Hu=ba();Object.defineProperty(le,"Vlr",{enumerable:!0,get:function(){return Hu.Vlr}})});var cr=te(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Hierarchy=void 0;var gn=ze(),Ma=zn();ii.Hierarchy={parse:wa,load:Wu};function wa(s){let e=gn.Binary.toDataView(s);if(e.byteLength%Ma.hierarchyItemLength!==0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);let t={},n={};for(let i=0;i<e.byteLength;i+=Ma.hierarchyItemLength){let r=e.getInt32(i+0,!0),l=e.getInt32(i+4,!0),c=e.getInt32(i+8,!0),u=e.getInt32(i+12,!0),h=(0,gn.parseBigInt)((0,gn.getBigUint64)(e,i+16,!0)),d=e.getInt32(i+24,!0),p=e.getInt32(i+28,!0),_=gn.Key.toString([r,l,c,u]);if(p<-1)throw new Error(`Invalid hierarchy point count at key: ${_}`);p===-1?n[_]={pageOffset:h,pageLength:d}:t[_]={pointCount:p,pointDataOffset:h,pointDataLength:d}}return{nodes:t,pages:n}}async function Wu(s,e){let t=gn.Getter.create(s);return wa(await t(e.pageOffset,e.pageOffset+e.pageLength))}});var ur=te(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.Info=void 0;var _n=ze(),Ta=zn();ri.Info={parse:Xu};function Xu(s){let e=_n.Binary.toDataView(s);if(e.byteLength!==Ta.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${Ta.infoLength}): ${e.byteLength}`);let t=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],n=e.getFloat64(24,!0);return{cube:[t[0]-n,t[1]-n,t[2]-n,t[0]+n,t[1]+n,t[2]+n],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,_n.parseBigInt)((0,_n.getBigUint64)(e,40,!0)),pageLength:(0,_n.parseBigInt)((0,_n.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}});var Ca=te(Qe=>{"use strict";var qu=Qe&&Qe.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),Yu=Qe&&Qe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),$u=Qe&&Qe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&qu(e,s,t);return Yu(e,s),e};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Copc=void 0;var Ve=$u(ni()),si=ze(),Zu=cr(),Ju=ur();Qe.Copc={create:ju,loadHierarchyPage:Ku,loadCompressedPointDataBuffer:Ea,loadPointDataBuffer:Aa,loadPointDataView:Qu};async function ju(s){let e=si.Getter.create(s),t=65536,n=e(0,t);async function i(y,v){return v>=t?e(y,v):(await n).slice(y,v)}let r=Ve.Header.parse(await i(0,Ve.Constants.minHeaderLength)),l=await Ve.Vlr.walk(i,r),c=Ve.Vlr.find(l,"copc",1);if(!c)throw new Error("COPC info VLR is required");let u=Ju.Info.parse(await Ve.Vlr.fetch(i,c)),h,d=Ve.Vlr.find(l,"LASF_Projection",2112);d&&d.contentLength&&(h=si.Binary.toCString(await Ve.Vlr.fetch(i,d)),h===""&&(h=void 0));let p=[],_=Ve.Vlr.find(l,"LASF_Spec",4);return _&&(p=Ve.ExtraBytes.parse(await Ve.Vlr.fetch(i,_))),{header:r,vlrs:l,info:u,wkt:h,eb:p}}async function Ku(s,e){let t=si.Getter.create(s);return Zu.Hierarchy.load(t,e)}async function Ea(s,{pointDataOffset:e,pointDataLength:t}){return si.Getter.create(s)(e,e+t)}async function Aa(s,{pointDataRecordFormat:e,pointDataRecordLength:t},n,i){let r=await Ea(s,n),{pointCount:l}=n;return Ve.PointData.decompressChunk(r,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:t},i)}async function Qu(s,e,t,{lazPerf:n,include:i}={}){let r=await Aa(s,e.header,t,n);return Ve.View.create(r,e.header,e.eb,i)}});var Ra=te(be=>{"use strict";var eh=be&&be.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),th=be&&be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),nh=be&&be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&eh(e,s,t);return th(e,s),e};Object.defineProperty(be,"__esModule",{value:!0});be.Info=be.Hierarchy=be.Copc=be.Constants=void 0;be.Constants=nh(zn());var ih=Ca();Object.defineProperty(be,"Copc",{enumerable:!0,get:function(){return ih.Copc}});var rh=cr();Object.defineProperty(be,"Hierarchy",{enumerable:!0,get:function(){return rh.Hierarchy}});var sh=ur();Object.defineProperty(be,"Info",{enumerable:!0,get:function(){return sh.Info}})});var hr=te(Me=>{"use strict";var Pa=Me&&Me.__createBinding||(Object.create?(function(s,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,i)}):(function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]})),ah=Me&&Me.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ia=Me&&Me.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Pa(e,s,t);return ah(e,s),e},La=Me&&Me.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pa(e,s,t)};Object.defineProperty(Me,"__esModule",{value:!0});Me.Las=Me.Ept=void 0;Me.Ept=Ia(Vs());La(Ra(),Me);Me.Las=Ia(ni());La(ze(),Me)});import zp from"@giro3d/giro3d/entities/PointCloud.js";var Pi=On(hr()),fo=On(ni()),po=On(Ki());var qa=1;var Ya=3;var Sr=0,br=1,Mr=2,wr=3,Tr=4,Er=5,Ar=6,Cr=7,$a=0,Za=1,Ja=2;var Gr=1,Hr=2,Wr=3,Xr=4,qr=5,Yr=6,$r=7;var Zr=300,ja=301,Jr=302;var Ka=306,Rr=1e3,Sn=1001,Pr=1002;var Qa=1006;var eo=1008;var to=1009;var no=1015;var io=1023;var Mn=2300,mi=2301,di=2302,Ir=2303,Lr=2400,Dr=2401,Ur=2402;var jr="",Ge="srgb",Nr="srgb-linear",Fr="linear",pi="srgb";var ro=35044;var bn=2e3,Or=2001;function oh(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function Br(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}var Da={},gi=null;function so(s){let e=s[0];if(typeof e=="string"&&e.startsWith("TSL:")){let t=s[1];t&&t.isStackTrace?s[0]+=" "+t.getLocation():s[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return s}function Ee(...s){s=so(s);let e="THREE."+s.shift();if(gi)gi("warn",e,...s);else{let t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function pe(...s){s=so(s);let e="THREE."+s.shift();if(gi)gi("error",e,...s);else{let t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function Qt(...s){let e=s.join(" ");e in Da||(Da[e]=!0,Ee(...s))}var lh={[Sr]:br,[Mr]:Ar,[Tr]:Cr,[wr]:Er,[br]:Sr,[Ar]:Mr,[Cr]:Tr,[Er]:wr},tn=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let i=n[e];if(i!==void 0){let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let i=n.slice(0);for(let r=0,l=i.length;r<l;r++)i[r].call(this,e);e.target=null}}},we=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var Gm=Math.PI/180,ch=180/Math.PI;function Kr(){let s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(we[s&255]+we[s>>8&255]+we[s>>16&255]+we[s>>24&255]+"-"+we[e&255]+we[e>>8&255]+"-"+we[e>>16&15|64]+we[e>>24&255]+"-"+we[t&63|128]+we[t>>8&255]+"-"+we[t>>16&255]+we[t>>24&255]+we[n&255]+we[n>>8&255]+we[n>>16&255]+we[n>>24&255]).toLowerCase()}function ee(s,e,t){return Math.max(e,Math.min(t,s))}function uh(s,e){return(s%e+e)%e}function fr(s,e,t){return(1-t)*s+t*e}function yn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:case Uint8ClampedArray:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Le(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:case Uint8ClampedArray:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}var He=class s{static{s.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=ee(this.x,e.x,t.x),this.y=ee(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ee(this.x,e,t),this.y=ee(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ee(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ee(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,l=this.y-e.y;return this.x=r*n-l*i+e.x,this.y=r*i+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},at=class{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,l,c){let u=n[i+0],h=n[i+1],d=n[i+2],p=n[i+3],_=r[l+0],y=r[l+1],v=r[l+2],M=r[l+3];if(p!==M||u!==_||h!==y||d!==v){let b=u*_+h*y+d*v+p*M;b<0&&(_=-_,y=-y,v=-v,M=-M,b=-b);let S=1-c;if(b<.9995){let R=Math.acos(b),L=Math.sin(R);S=Math.sin(S*R)/L,c=Math.sin(c*R)/L,u=u*S+_*c,h=h*S+y*c,d=d*S+v*c,p=p*S+M*c}else{u=u*S+_*c,h=h*S+y*c,d=d*S+v*c,p=p*S+M*c;let R=1/Math.sqrt(u*u+h*h+d*d+p*p);u*=R,h*=R,d*=R,p*=R}}e[t]=u,e[t+1]=h,e[t+2]=d,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,i,r,l){let c=n[i],u=n[i+1],h=n[i+2],d=n[i+3],p=r[l],_=r[l+1],y=r[l+2],v=r[l+3];return e[t]=c*v+d*p+u*y-h*_,e[t+1]=u*v+d*_+h*p-c*y,e[t+2]=h*v+d*y+c*_-u*p,e[t+3]=d*v-c*p-u*_-h*y,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,l=e._order,c=Math.cos,u=Math.sin,h=c(n/2),d=c(i/2),p=c(r/2),_=u(n/2),y=u(i/2),v=u(r/2);switch(l){case"XYZ":this._x=_*d*p+h*y*v,this._y=h*y*p-_*d*v,this._z=h*d*v+_*y*p,this._w=h*d*p-_*y*v;break;case"YXZ":this._x=_*d*p+h*y*v,this._y=h*y*p-_*d*v,this._z=h*d*v-_*y*p,this._w=h*d*p+_*y*v;break;case"ZXY":this._x=_*d*p-h*y*v,this._y=h*y*p+_*d*v,this._z=h*d*v+_*y*p,this._w=h*d*p-_*y*v;break;case"ZYX":this._x=_*d*p-h*y*v,this._y=h*y*p+_*d*v,this._z=h*d*v-_*y*p,this._w=h*d*p+_*y*v;break;case"YZX":this._x=_*d*p+h*y*v,this._y=h*y*p+_*d*v,this._z=h*d*v-_*y*p,this._w=h*d*p-_*y*v;break;case"XZY":this._x=_*d*p-h*y*v,this._y=h*y*p-_*d*v,this._z=h*d*v+_*y*p,this._w=h*d*p+_*y*v;break;default:Ee("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],l=t[1],c=t[5],u=t[9],h=t[2],d=t[6],p=t[10],_=n+c+p;if(_>0){let y=.5/Math.sqrt(_+1);this._w=.25/y,this._x=(d-u)*y,this._y=(r-h)*y,this._z=(l-i)*y}else if(n>c&&n>p){let y=2*Math.sqrt(1+n-c-p);this._w=(d-u)/y,this._x=.25*y,this._y=(i+l)/y,this._z=(r+h)/y}else if(c>p){let y=2*Math.sqrt(1+c-n-p);this._w=(r-h)/y,this._x=(i+l)/y,this._y=.25*y,this._z=(u+d)/y}else{let y=2*Math.sqrt(1+p-n-c);this._w=(l-i)/y,this._x=(r+h)/y,this._y=(u+d)/y,this._z=.25*y}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ee(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,l=e._w,c=t._x,u=t._y,h=t._z,d=t._w;return this._x=n*d+l*c+i*h-r*u,this._y=i*d+l*u+r*c-n*h,this._z=r*d+l*h+n*u-i*c,this._w=l*d-n*c-i*u-r*h,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,r=e._z,l=e._w,c=this.dot(e);c<0&&(n=-n,i=-i,r=-r,l=-l,c=-c);let u=1-t;if(c<.9995){let h=Math.acos(c),d=Math.sin(h);u=Math.sin(u*h)/d,t=Math.sin(t*h)/d,this._x=this._x*u+n*t,this._y=this._y*u+i*t,this._z=this._z*u+r*t,this._w=this._w*u+l*t,this._onChangeCallback()}else this._x=this._x*u+n*t,this._y=this._y*u+i*t,this._z=this._z*u+r*t,this._w=this._w*u+l*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},z=class s{static{s.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ua.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ua.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,l=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*l,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*l,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*l,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,l=e.y,c=e.z,u=e.w,h=2*(l*i-c*n),d=2*(c*t-r*i),p=2*(r*n-l*t);return this.x=t+u*h+l*p-c*d,this.y=n+u*d+c*h-r*p,this.z=i+u*p+r*d-l*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=ee(this.x,e.x,t.x),this.y=ee(this.y,e.y,t.y),this.z=ee(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ee(this.x,e,t),this.y=ee(this.y,e,t),this.z=ee(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ee(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,l=t.x,c=t.y,u=t.z;return this.x=i*u-r*c,this.y=r*l-n*u,this.z=n*c-i*l,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return dr.copy(this).projectOnVector(e),this.sub(dr)}reflect(e){return this.sub(dr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ee(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},dr=new z,Ua=new at,J=class s{static{s.prototype.isMatrix3=!0}constructor(e,t,n,i,r,l,c,u,h){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,l,c,u,h)}set(e,t,n,i,r,l,c,u,h){let d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=r,d[5]=u,d[6]=n,d[7]=l,d[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,l=n[0],c=n[3],u=n[6],h=n[1],d=n[4],p=n[7],_=n[2],y=n[5],v=n[8],M=i[0],b=i[3],S=i[6],R=i[1],L=i[4],B=i[7],C=i[2],G=i[5],O=i[8];return r[0]=l*M+c*R+u*C,r[3]=l*b+c*L+u*G,r[6]=l*S+c*B+u*O,r[1]=h*M+d*R+p*C,r[4]=h*b+d*L+p*G,r[7]=h*S+d*B+p*O,r[2]=_*M+y*R+v*C,r[5]=_*b+y*L+v*G,r[8]=_*S+y*B+v*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8];return t*l*d-t*c*h-n*r*d+n*c*u+i*r*h-i*l*u}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=d*l-c*h,_=c*u-d*r,y=h*r-l*u,v=t*p+n*_+i*y;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);let M=1/v;return e[0]=p*M,e[1]=(i*h-d*n)*M,e[2]=(c*n-i*l)*M,e[3]=_*M,e[4]=(d*t-i*u)*M,e[5]=(i*r-c*t)*M,e[6]=y*M,e[7]=(n*u-h*t)*M,e[8]=(l*t-n*r)*M,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,l,c){let u=Math.cos(r),h=Math.sin(r);return this.set(n*u,n*h,-n*(u*l+h*c)+l+e,-i*h,i*u,-i*(-h*l+u*c)+c+t,0,0,1),this}scale(e,t){return Qt("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(pr.makeScale(e,t)),this}rotate(e){return Qt("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(pr.makeRotation(-e)),this}translate(e,t){return Qt("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(pr.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},pr=new J,Na=new J().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fa=new J().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function hh(){let s={enabled:!0,workingColorSpace:Nr,spaces:{},convert:function(i,r,l){return this.enabled===!1||r===l||!r||!l||(this.spaces[r].transfer===pi&&(i.r=rt(i.r),i.g=rt(i.g),i.b=rt(i.b)),this.spaces[r].primaries!==this.spaces[l].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===pi&&(i.r=en(i.r),i.g=en(i.g),i.b=en(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===jr?Fr:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,l){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return Qt("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return Qt("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Nr]:{primaries:e,whitePoint:n,transfer:Fr,toXYZ:Na,fromXYZ:Fa,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ge},outputColorSpaceConfig:{drawingBufferColorSpace:Ge}},[Ge]:{primaries:e,whitePoint:n,transfer:pi,toXYZ:Na,fromXYZ:Fa,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ge}}}),s}var ke=hh();function rt(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function en(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}var Xt,_i=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Xt===void 0&&(Xt=Br("canvas")),Xt.width=e.width,Xt.height=e.height;let i=Xt.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Xt}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Br("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let l=0;l<r.length;l++)r[l]=rt(r[l]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(rt(t[n]/255)*255):t[n]=rt(t[n]);return{data:t,width:e.width,height:e.height}}else return Ee("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},fh=0,yi=class{constructor(e=null){this.isTextureSource=!0,Object.defineProperty(this,"id",{value:fh++}),this.uuid=Kr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let l=0,c=i.length;l<c;l++)i[l].isDataTexture?r.push(mr(i[l].image)):r.push(mr(i[l]))}else r=mr(i);n.url=r}return t||(e.images[this.uuid]=n),n}};function mr(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?_i.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ee("Texture: Unable to serialize Texture."),{})}var dh=0,gr=new z,nn=class s extends tn{constructor(e=s.DEFAULT_IMAGE,t=s.DEFAULT_MAPPING,n=Sn,i=Sn,r=Qa,l=eo,c=io,u=to,h=s.DEFAULT_ANISOTROPY,d=jr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dh++}),this.uuid=Kr(),this.name="",this.source=new yi(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=l,this.anisotropy=h,this.format=c,this.internalFormat=null,this.type=u,this.offset=new He(0,0),this.repeat=new He(1,1),this.center=new He(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new J,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(gr).x}get height(){return this.source.getSize(gr).y}get depth(){return this.source.getSize(gr).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){Ee(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(i===void 0){Ee(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Zr)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Rr:e.x=e.x-Math.floor(e.x);break;case Sn:e.x=e.x<0?0:1;break;case Pr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Rr:e.y=e.y-Math.floor(e.y);break;case Sn:e.y=e.y<0?0:1;break;case Pr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};nn.DEFAULT_IMAGE=null;nn.DEFAULT_MAPPING=Zr;nn.DEFAULT_ANISOTROPY=1;var zr=class s{static{s.prototype.isVector4=!0}constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i+l[12]*r,this.y=l[1]*t+l[5]*n+l[9]*i+l[13]*r,this.z=l[2]*t+l[6]*n+l[10]*i+l[14]*r,this.w=l[3]*t+l[7]*n+l[11]*i+l[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,u=e.elements,h=u[0],d=u[4],p=u[8],_=u[1],y=u[5],v=u[9],M=u[2],b=u[6],S=u[10];if(Math.abs(d-_)<.01&&Math.abs(p-M)<.01&&Math.abs(v-b)<.01){if(Math.abs(d+_)<.1&&Math.abs(p+M)<.1&&Math.abs(v+b)<.1&&Math.abs(h+y+S-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let L=(h+1)/2,B=(y+1)/2,C=(S+1)/2,G=(d+_)/4,O=(p+M)/4,W=(v+b)/4;return L>B&&L>C?L<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(L),i=G/n,r=O/n):B>C?B<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(B),n=G/i,r=W/i):C<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(C),n=O/r,i=W/r),this.set(n,i,r,t),this}let R=Math.sqrt((b-v)*(b-v)+(p-M)*(p-M)+(_-d)*(_-d));return Math.abs(R)<.001&&(R=1),this.x=(b-v)/R,this.y=(p-M)/R,this.z=(_-d)/R,this.w=Math.acos((h+y+S-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=ee(this.x,e.x,t.x),this.y=ee(this.y,e.y,t.y),this.z=ee(this.z,e.z,t.z),this.w=ee(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ee(this.x,e,t),this.y=ee(this.y,e,t),this.z=ee(this.z,e,t),this.w=ee(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ee(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};var st=class s{static{s.prototype.isMatrix4=!0}constructor(e,t,n,i,r,l,c,u,h,d,p,_,y,v,M,b){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,l,c,u,h,d,p,_,y,v,M,b)}set(e,t,n,i,r,l,c,u,h,d,p,_,y,v,M,b){let S=this.elements;return S[0]=e,S[4]=t,S[8]=n,S[12]=i,S[1]=r,S[5]=l,S[9]=c,S[13]=u,S[2]=h,S[6]=d,S[10]=p,S[14]=_,S[3]=y,S[7]=v,S[11]=M,S[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new s().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,i=1/qt.setFromMatrixColumn(e,0).length(),r=1/qt.setFromMatrixColumn(e,1).length(),l=1/qt.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,l=Math.cos(n),c=Math.sin(n),u=Math.cos(i),h=Math.sin(i),d=Math.cos(r),p=Math.sin(r);if(e.order==="XYZ"){let _=l*d,y=l*p,v=c*d,M=c*p;t[0]=u*d,t[4]=-u*p,t[8]=h,t[1]=y+v*h,t[5]=_-M*h,t[9]=-c*u,t[2]=M-_*h,t[6]=v+y*h,t[10]=l*u}else if(e.order==="YXZ"){let _=u*d,y=u*p,v=h*d,M=h*p;t[0]=_+M*c,t[4]=v*c-y,t[8]=l*h,t[1]=l*p,t[5]=l*d,t[9]=-c,t[2]=y*c-v,t[6]=M+_*c,t[10]=l*u}else if(e.order==="ZXY"){let _=u*d,y=u*p,v=h*d,M=h*p;t[0]=_-M*c,t[4]=-l*p,t[8]=v+y*c,t[1]=y+v*c,t[5]=l*d,t[9]=M-_*c,t[2]=-l*h,t[6]=c,t[10]=l*u}else if(e.order==="ZYX"){let _=l*d,y=l*p,v=c*d,M=c*p;t[0]=u*d,t[4]=v*h-y,t[8]=_*h+M,t[1]=u*p,t[5]=M*h+_,t[9]=y*h-v,t[2]=-h,t[6]=c*u,t[10]=l*u}else if(e.order==="YZX"){let _=l*u,y=l*h,v=c*u,M=c*h;t[0]=u*d,t[4]=M-_*p,t[8]=v*p+y,t[1]=p,t[5]=l*d,t[9]=-c*d,t[2]=-h*d,t[6]=y*p+v,t[10]=_-M*p}else if(e.order==="XZY"){let _=l*u,y=l*h,v=c*u,M=c*h;t[0]=u*d,t[4]=-p,t[8]=h*d,t[1]=_*p+M,t[5]=l*d,t[9]=y*p-v,t[2]=v*p-y,t[6]=c*d,t[10]=M*p+_}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ph,e,mh)}lookAt(e,t,n){let i=this.elements;return Ue.subVectors(e,t),Ue.lengthSq()===0&&(Ue.z=1),Ue.normalize(),_t.crossVectors(n,Ue),_t.lengthSq()===0&&(Math.abs(n.z)===1?Ue.x+=1e-4:Ue.z+=1e-4,Ue.normalize(),_t.crossVectors(n,Ue)),_t.normalize(),ai.crossVectors(Ue,_t),i[0]=_t.x,i[4]=ai.x,i[8]=Ue.x,i[1]=_t.y,i[5]=ai.y,i[9]=Ue.y,i[2]=_t.z,i[6]=ai.z,i[10]=Ue.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,l=n[0],c=n[4],u=n[8],h=n[12],d=n[1],p=n[5],_=n[9],y=n[13],v=n[2],M=n[6],b=n[10],S=n[14],R=n[3],L=n[7],B=n[11],C=n[15],G=i[0],O=i[4],W=i[8],$=i[12],j=i[1],g=i[5],T=i[9],D=i[13],V=i[2],k=i[6],Y=i[10],U=i[14],ge=i[3],ve=i[7],K=i[11],ue=i[15];return r[0]=l*G+c*j+u*V+h*ge,r[4]=l*O+c*g+u*k+h*ve,r[8]=l*W+c*T+u*Y+h*K,r[12]=l*$+c*D+u*U+h*ue,r[1]=d*G+p*j+_*V+y*ge,r[5]=d*O+p*g+_*k+y*ve,r[9]=d*W+p*T+_*Y+y*K,r[13]=d*$+p*D+_*U+y*ue,r[2]=v*G+M*j+b*V+S*ge,r[6]=v*O+M*g+b*k+S*ve,r[10]=v*W+M*T+b*Y+S*K,r[14]=v*$+M*D+b*U+S*ue,r[3]=R*G+L*j+B*V+C*ge,r[7]=R*O+L*g+B*k+C*ve,r[11]=R*W+L*T+B*Y+C*K,r[15]=R*$+L*D+B*U+C*ue,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],l=e[1],c=e[5],u=e[9],h=e[13],d=e[2],p=e[6],_=e[10],y=e[14],v=e[3],M=e[7],b=e[11],S=e[15],R=u*y-h*_,L=c*y-h*p,B=c*_-u*p,C=l*y-h*d,G=l*_-u*d,O=l*p-c*d;return t*(M*R-b*L+S*B)-n*(v*R-b*C+S*G)+i*(v*L-M*C+S*O)-r*(v*B-M*G+b*O)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[1],l=e[5],c=e[9],u=e[2],h=e[6],d=e[10];return t*(l*d-c*h)-n*(r*d-c*u)+i*(r*h-l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],p=e[9],_=e[10],y=e[11],v=e[12],M=e[13],b=e[14],S=e[15],R=t*c-n*l,L=t*u-i*l,B=t*h-r*l,C=n*u-i*c,G=n*h-r*c,O=i*h-r*u,W=d*M-p*v,$=d*b-_*v,j=d*S-y*v,g=p*b-_*M,T=p*S-y*M,D=_*S-y*b,V=R*D-L*T+B*g+C*j-G*$+O*W;if(V===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let k=1/V;return e[0]=(c*D-u*T+h*g)*k,e[1]=(i*T-n*D-r*g)*k,e[2]=(M*O-b*G+S*C)*k,e[3]=(_*G-p*O-y*C)*k,e[4]=(u*j-l*D-h*$)*k,e[5]=(t*D-i*j+r*$)*k,e[6]=(b*B-v*O-S*L)*k,e[7]=(d*O-_*B+y*L)*k,e[8]=(l*T-c*j+h*W)*k,e[9]=(n*j-t*T-r*W)*k,e[10]=(v*G-M*B+S*R)*k,e[11]=(p*B-d*G-y*R)*k,e[12]=(c*$-l*g-u*W)*k,e[13]=(t*g-n*$+i*W)*k,e[14]=(M*L-v*C-b*R)*k,e[15]=(d*C-p*L+_*R)*k,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,l=e.x,c=e.y,u=e.z,h=r*l,d=r*c;return this.set(h*l+n,h*c-i*u,h*u+i*c,0,h*c+i*u,d*c+n,d*u-i*l,0,h*u-i*c,d*u+i*l,r*u*u+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,l){return this.set(1,n,r,0,e,1,l,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,l=t._y,c=t._z,u=t._w,h=r+r,d=l+l,p=c+c,_=r*h,y=r*d,v=r*p,M=l*d,b=l*p,S=c*p,R=u*h,L=u*d,B=u*p,C=n.x,G=n.y,O=n.z;return i[0]=(1-(M+S))*C,i[1]=(y+B)*C,i[2]=(v-L)*C,i[3]=0,i[4]=(y-B)*G,i[5]=(1-(_+S))*G,i[6]=(b+R)*G,i[7]=0,i[8]=(v+L)*O,i[9]=(b-R)*O,i[10]=(1-(_+M))*O,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];let r=this.determinantAffine();if(r===0)return n.set(1,1,1),t.identity(),this;let l=qt.set(i[0],i[1],i[2]).length(),c=qt.set(i[4],i[5],i[6]).length(),u=qt.set(i[8],i[9],i[10]).length();r<0&&(l=-l),Xe.copy(this);let h=1/l,d=1/c,p=1/u;return Xe.elements[0]*=h,Xe.elements[1]*=h,Xe.elements[2]*=h,Xe.elements[4]*=d,Xe.elements[5]*=d,Xe.elements[6]*=d,Xe.elements[8]*=p,Xe.elements[9]*=p,Xe.elements[10]*=p,t.setFromRotationMatrix(Xe),n.x=l,n.y=c,n.z=u,this}makePerspective(e,t,n,i,r,l,c=bn,u=!1){let h=this.elements,d=2*r/(t-e),p=2*r/(n-i),_=(t+e)/(t-e),y=(n+i)/(n-i),v,M;if(u)v=r/(l-r),M=l*r/(l-r);else if(c===bn)v=-(l+r)/(l-r),M=-2*l*r/(l-r);else if(c===Or)v=-l/(l-r),M=-l*r/(l-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=d,h[4]=0,h[8]=_,h[12]=0,h[1]=0,h[5]=p,h[9]=y,h[13]=0,h[2]=0,h[6]=0,h[10]=v,h[14]=M,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,r,l,c=bn,u=!1){let h=this.elements,d=2/(t-e),p=2/(n-i),_=-(t+e)/(t-e),y=-(n+i)/(n-i),v,M;if(u)v=1/(l-r),M=l/(l-r);else if(c===bn)v=-2/(l-r),M=-(l+r)/(l-r);else if(c===Or)v=-1/(l-r),M=-r/(l-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=d,h[4]=0,h[8]=0,h[12]=_,h[1]=0,h[5]=p,h[9]=0,h[13]=y,h[2]=0,h[6]=0,h[10]=v,h[14]=M,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},qt=new z,Xe=new st,ph=new z(0,0,0),mh=new z(1,1,1),_t=new z,ai=new z,Ue=new z,Oa=new st,Ba=new at,wn=class s{constructor(e=0,t=0,n=0,i=s.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],l=i[4],c=i[8],u=i[1],h=i[5],d=i[9],p=i[2],_=i[6],y=i[10];switch(t){case"XYZ":this._y=Math.asin(ee(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,y),this._z=Math.atan2(-l,r)):(this._x=Math.atan2(_,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ee(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,y),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-p,r),this._z=0);break;case"ZXY":this._x=Math.asin(ee(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-p,y),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,r));break;case"ZYX":this._y=Math.asin(-ee(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(_,y),this._z=Math.atan2(u,r)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(ee(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-d,h),this._y=Math.atan2(-p,r)):(this._x=0,this._y=Math.atan2(c,y));break;case"XZY":this._z=Math.asin(-ee(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(_,h),this._y=Math.atan2(c,r)):(this._x=Math.atan2(-d,y),this._y=0);break;default:Ee("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Oa.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Oa,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ba.setFromEuler(this),this.setFromQuaternion(Ba,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};wn.DEFAULT_ORDER="XYZ";var vi=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},gh=0,za=new z,Yt=new at,nt=new st,oi=new z,vn=new z,_h=new z,yh=new at,Va=new z(1,0,0),ka=new z(0,1,0),Ga=new z(0,0,1),Ha={type:"added"},vh={type:"removed"},$t={type:"childadded",child:null},_r={type:"childremoved",child:null},rn=class s extends tn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:gh++}),this.uuid=Kr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=s.DEFAULT_UP.clone();let e=new z,t=new wn,n=new at,i=new z(1,1,1);function r(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new st},normalMatrix:{value:new J}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=s.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=s.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Yt.setFromAxisAngle(e,t),this.quaternion.multiply(Yt),this}rotateOnWorldAxis(e,t){return Yt.setFromAxisAngle(e,t),this.quaternion.premultiply(Yt),this}rotateX(e){return this.rotateOnAxis(Va,e)}rotateY(e){return this.rotateOnAxis(ka,e)}rotateZ(e){return this.rotateOnAxis(Ga,e)}translateOnAxis(e,t){return za.copy(e).applyQuaternion(this.quaternion),this.position.add(za.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Va,e)}translateY(e){return this.translateOnAxis(ka,e)}translateZ(e){return this.translateOnAxis(Ga,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(nt.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?oi.copy(e):oi.set(e,t,n);let i=this.parent;this.updateWorldMatrix(!0,!1),vn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?nt.lookAt(vn,oi,this.up):nt.lookAt(oi,vn,this.up),this.quaternion.setFromRotationMatrix(nt),i&&(nt.extractRotation(i.matrixWorld),Yt.setFromRotationMatrix(nt),this.quaternion.premultiply(Yt.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(pe("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Ha),$t.child=e,this.dispatchEvent($t),$t.child=null):pe("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(vh),_r.child=e,this.dispatchEvent(_r),_r.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),nt.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),nt.multiply(e.parent.matrixWorld)),e.applyMatrix4(nt),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ha),$t.child=e,this.dispatchEvent($t),$t.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){let l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let i=this.children;for(let r=0,l=i.length;r<l;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vn,e,_h),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vn,yh,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}intersectsFrustum(){}traverse(e){e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,i=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*n-r[8]*i,r[13]+=n-r[1]*t-r[5]*n-r[9]*i,r[14]+=i-r[2]*t-r[6]*n-r[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let r=this.children;for(let l=0,c=r.length;l<c;l++)r[l].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,i.name=this.name,i.castShadow=this.castShadow,i.receiveShadow=this.receiveShadow,i.visible=this.visible,i.frustumCulled=this.frustumCulled,i.renderOrder=this.renderOrder,i.static=this.static,i.matrixAutoUpdate=this.matrixAutoUpdate,Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(c=>({...c})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let u=c.shapes;if(Array.isArray(u))for(let h=0,d=u.length;h<d;h++){let p=u[h];r(e.shapes,p)}else r(e.shapes,u)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let u=0,h=this.material.length;u<h;u++)c.push(r(e.materials,this.material[u]));i.material=c}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let u=this.animations[c];i.animations.push(r(e.animations,u))}}if(t){let c=l(e.geometries),u=l(e.materials),h=l(e.textures),d=l(e.images),p=l(e.shapes),_=l(e.skeletons),y=l(e.animations),v=l(e.nodes);c.length>0&&(n.geometries=c),u.length>0&&(n.materials=u),h.length>0&&(n.textures=h),d.length>0&&(n.images=d),p.length>0&&(n.shapes=p),_.length>0&&(n.skeletons=_),y.length>0&&(n.animations=y),v.length>0&&(n.nodes=v)}return n.object=i,n;function l(c){let u=[];for(let h in c){let d=c[h];delete d.metadata,u.push(d)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let i=e.children[n];this.add(i.clone())}return this}dispose(){this.dispatchEvent({type:"dispose"})}};rn.DEFAULT_UP=new z(0,1,0);rn.DEFAULT_MATRIX_AUTO_UPDATE=!0;rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ao={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},yt={h:0,s:0,l:0},li={h:0,s:0,l:0};function yr(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}var me=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ge){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ke.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=ke.workingColorSpace){return this.r=e,this.g=t,this.b=n,ke.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=ke.workingColorSpace){if(e=uh(e,1),t=ee(t,0,1),n=ee(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,l=2*n-r;this.r=yr(l,r,e+1/3),this.g=yr(l,r,e),this.b=yr(l,r,e-1/3)}return ke.colorSpaceToWorking(this,i),this}setStyle(e,t=Ge){function n(r){r!==void 0&&parseFloat(r)<1&&Ee("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,l=i[1],c=i[2];switch(l){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:Ee("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=i[1],l=r.length;if(l===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(r,16),t);Ee("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ge){let n=ao[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Ee("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=rt(e.r),this.g=rt(e.g),this.b=rt(e.b),this}copyLinearToSRGB(e){return this.r=en(e.r),this.g=en(e.g),this.b=en(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ge){return ke.workingToColorSpace(Te.copy(this),e),Math.round(ee(Te.r*255,0,255))*65536+Math.round(ee(Te.g*255,0,255))*256+Math.round(ee(Te.b*255,0,255))}getHexString(e=Ge){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ke.workingColorSpace){ke.workingToColorSpace(Te.copy(this),t);let n=Te.r,i=Te.g,r=Te.b,l=Math.max(n,i,r),c=Math.min(n,i,r),u,h,d=(c+l)/2;if(c===l)u=0,h=0;else{let p=l-c;switch(h=d<=.5?p/(l+c):p/(2-l-c),l){case n:u=(i-r)/p+(i<r?6:0);break;case i:u=(r-n)/p+2;break;case r:u=(n-i)/p+4;break}u/=6}return e.h=u,e.s=h,e.l=d,e}getRGB(e,t=ke.workingColorSpace){return ke.workingToColorSpace(Te.copy(this),t),e.r=Te.r,e.g=Te.g,e.b=Te.b,e}getStyle(e=Ge){ke.workingToColorSpace(Te.copy(this),e);let t=Te.r,n=Te.g,i=Te.b;return e!==Ge?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(yt),this.setHSL(yt.h+e,yt.s+t,yt.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(yt),e.getHSL(li);let n=fr(yt.h,li.h,t),i=fr(yt.s,li.s,t),r=fr(yt.l,li.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},Te=new me;me.NAMES=ao;var We=class{constructor(e=new z(1/0,1/0,1/0),t=new z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qe.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qe.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=qe.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=r.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,qe):qe.fromBufferAttribute(r,l),qe.applyMatrix4(e.matrixWorld),this.expandByPoint(qe);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ci.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),ci.copy(n.boundingBox)),ci.applyMatrix4(e.matrixWorld),this.union(ci)}let i=e.children;for(let r=0,l=i.length;r<l;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qe),qe.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xn),ui.subVectors(this.max,xn),Zt.subVectors(e.a,xn),Jt.subVectors(e.b,xn),jt.subVectors(e.c,xn),vt.subVectors(Jt,Zt),xt.subVectors(jt,Jt),Ct.subVectors(Zt,jt);let t=[0,-vt.z,vt.y,0,-xt.z,xt.y,0,-Ct.z,Ct.y,vt.z,0,-vt.x,xt.z,0,-xt.x,Ct.z,0,-Ct.x,-vt.y,vt.x,0,-xt.y,xt.x,0,-Ct.y,Ct.x,0];return!vr(t,Zt,Jt,jt,ui)||(t=[1,0,0,0,1,0,0,0,1],!vr(t,Zt,Jt,jt,ui))?!1:(hi.crossVectors(vt,xt),t=[hi.x,hi.y,hi.z],vr(t,Zt,Jt,jt,ui))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qe).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qe).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(it[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),it[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),it[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),it[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),it[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),it[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),it[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),it[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(it),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},it=[new z,new z,new z,new z,new z,new z,new z,new z],qe=new z,ci=new We,Zt=new z,Jt=new z,jt=new z,vt=new z,xt=new z,Ct=new z,xn=new z,ui=new z,hi=new z,Rt=new z;function vr(s,e,t,n,i){for(let r=0,l=s.length-3;r<=l;r+=3){Rt.fromArray(s,r);let c=i.x*Math.abs(Rt.x)+i.y*Math.abs(Rt.y)+i.z*Math.abs(Rt.z),u=e.dot(Rt),h=t.dot(Rt),d=n.dot(Rt);if(Math.max(-Math.max(u,h,d),Math.min(u,h,d))>c)return!1}return!0}var de=new z,fi=new He,xh=0,sn=class extends tn{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:xh++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ro,this.updateRanges=[],this.gpuType=no,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix3(e),this.setXY(t,fi.x,fi.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)de.fromBufferAttribute(this,t),de.applyMatrix3(e),this.setXYZ(t,de.x,de.y,de.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)de.fromBufferAttribute(this,t),de.applyMatrix4(e),this.setXYZ(t,de.x,de.y,de.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)de.fromBufferAttribute(this,t),de.applyNormalMatrix(e),this.setXYZ(t,de.x,de.y,de.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)de.fromBufferAttribute(this,t),de.transformDirection(e),this.setXYZ(t,de.x,de.y,de.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=yn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Le(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Le(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array),i=Le(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Le(t,this.array),n=Le(n,this.array),i=Le(i,this.array),r=Le(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return e.name=this.name,e.usage=this.usage,e.gpuType=this.gpuType,e}dispose(){this.dispatchEvent({type:"dispose"})}};var Tn=class extends sn{constructor(e,t,n){super(new Float32Array(e),t,n)}};function oo(s){let e={};for(let t in s){e[t]={};for(let n in s[t]){let i=s[t][n];if(Wa(i))i.isRenderTargetTexture?(Ee("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone();else if(Array.isArray(i))if(Wa(i[0])){let r=[];for(let l=0,c=i.length;l<c;l++)r[l]=i[l].clone();e[t][n]=r}else e[t][n]=i.slice();else e[t][n]=i}}return e}function Ae(s){let e={};for(let t=0;t<s.length;t++){let n=oo(s[t]);for(let i in n)e[i]=n[i]}return e}function Wa(s){return s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)}function Kt(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function xr(s){return s!==void 0&&s.inTangents!==void 0&&s.outTangents!==void 0}var St=class{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let l;t:{i:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(r=i,i=t[++n],e<i)break e}l=t.length;break t}if(!(e>=r)){let c=t[1];e<c&&(n=2,r=c);for(let u=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===u)break;if(i=r,r=t[--n-1],e>=r)break e}l=n,n=0;break t}break n}for(;n<l;){let c=n+l>>>1;e<t[c]?l=c:n=c+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let l=0;l!==i;++l)t[l]=n[r+l];return t}interpolate_(){throw new Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}},xi=class extends St{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Lr,endingEnd:Lr}}intervalChanged_(e,t,n){let i=this.parameterPositions,r=e-2,l=e+1,c=i[r],u=i[l];if(c===void 0)switch(this.getSettings_().endingStart){case Dr:r=e,c=2*t-n;break;case Ur:r=i.length-2,c=t+i[r]-i[r+1];break;default:r=e,c=n}if(u===void 0)switch(this.getSettings_().endingEnd){case Dr:l=e,u=2*n-t;break;case Ur:l=1,u=n+i[1]-i[0];break;default:l=e-1,u=t}let h=(n-t)*.5,d=this.valueSize;this._weightPrev=h/(t-c),this._weightNext=h/(u-n),this._offsetPrev=r*d,this._offsetNext=l*d}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=this._offsetPrev,p=this._offsetNext,_=this._weightPrev,y=this._weightNext,v=(n-t)/(i-t),M=v*v,b=M*v,S=-_*b+2*_*M-_*v,R=(1+_)*b+(-1.5-2*_)*M+(-.5+_)*v+1,L=(-1-y)*b+(1.5+y)*M+.5*v,B=y*b-y*M;for(let C=0;C!==c;++C)r[C]=S*l[d+C]+R*l[h+C]+L*l[u+C]+B*l[p+C];return r}},Si=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=(n-t)/(i-t),p=1-d;for(let _=0;_!==c;++_)r[_]=l[h+_]*p+l[u+_]*d;return r}},bi=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}},Mi=class extends St{interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,d=this.inTangents,p=this.outTangents;if(!d||!p){let v=(n-t)/(i-t),M=1-v;for(let b=0;b!==c;++b)r[b]=l[h+b]*M+l[u+b]*v;return r}let _=c*2,y=e-1;for(let v=0;v!==c;++v){let M=l[h+v],b=l[u+v],S=y*_+v*2,R=p[S],L=p[S+1],B=e*_+v*2,C=d[B],G=d[B+1],O=bh(n,t,R,C,i);r[v]=lo(O,M,L,G,b)}return r}};function lo(s,e,t,n,i){let r=1-s;return r*r*r*e+3*r*r*s*t+3*r*s*s*n+s*s*s*i}function Sh(s,e,t,n,i){let r=1-s;return 3*r*r*(t-e)+6*r*s*(n-t)+3*s*s*(i-n)}function bh(s,e,t,n,i){let r=(s-e)/(i-e);for(let l=0;l<8;l++){let c=lo(r,e,t,n,i)-s;if(Math.abs(c)<1e-10)break;let u=Sh(r,e,t,n,i);if(Math.abs(u)<1e-10)break;r=Math.max(0,Math.min(1,r-c/u))}return r}var Ne=class{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Kt(t,this.TimeBufferType),this.values=Kt(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Kt(e.times,Array),values:Kt(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i),xr(e.settings)&&(n.settings={inTangents:Kt(e.settings.inTangents,Array),outTangents:Kt(e.settings.outTangents,Array)})}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new bi(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Si(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new xi(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new Mi(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case Mn:t=this.InterpolantFactoryMethodDiscrete;break;case mi:t=this.InterpolantFactoryMethodLinear;break;case di:t=this.InterpolantFactoryMethodSmooth;break;case Ir:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ee("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Mn;case this.InterpolantFactoryMethodLinear:return mi;case this.InterpolantFactoryMethodSmooth:return di;case this.InterpolantFactoryMethodBezier:return Ir}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e;xr(this.settings)&&(Xa(this.settings.inTangents,e),Xa(this.settings.outTangents,e))}return this}trim(e,t){let n=this.times,i=n.length,r=0,l=i-1;for(;r!==i&&n[r]<e;)++r;for(;l!==-1&&n[l]>t;)--l;if(++l,r!==0||l!==i){r>=l&&(l=Math.max(l,1),r=l-1);let c=this.getValueSize();this.times=n.slice(r,l),this.values=this.values.slice(r*c,l*c)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(pe("KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,r=n.length;r===0&&(pe("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==r;c++){let u=n[c];if(typeof u=="number"&&isNaN(u)){pe("KeyframeTrack: Time is not a valid number.",this,c,u),e=!1;break}if(l!==null&&l>u){pe("KeyframeTrack: Out of order keys.",this,c,u,l),e=!1;break}l=u}if(i!==void 0&&oh(i))for(let c=0,u=i.length;c!==u;++c){let h=i[c];if(isNaN(h)){pe("KeyframeTrack: Value is not a valid number.",this,c,h),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===di,r=e.length-1,l=1;for(let c=1;c<r;++c){let u=!1,h=e[c],d=e[c+1];if(h!==d&&(c!==1||h!==e[0]))if(i)u=!0;else{let p=c*n,_=p-n,y=p+n;for(let v=0;v!==n;++v){let M=t[p+v];if(M!==t[_+v]||M!==t[y+v]){u=!0;break}}}if(u){if(c!==l){e[l]=e[c];let p=c*n,_=l*n;for(let y=0;y!==n;++y)t[_+y]=t[p+y]}++l}}if(r>0){e[l]=e[r];for(let c=r*n,u=l*n,h=0;h!==n;++h)t[u+h]=t[c+h];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,xr(this.settings)&&(i.settings={inTangents:this.settings.inTangents.slice(),outTangents:this.settings.outTangents.slice()}),i}};function Xa(s,e){for(let t=0,n=s.length;t!==n;t+=2)s[t]*=e}Ne.prototype.ValueTypeName="";Ne.prototype.TimeBufferType=Float32Array;Ne.prototype.ValueBufferType=Float32Array;Ne.prototype.DefaultInterpolation=mi;var bt=class extends Ne{constructor(e,t,n){super(e,t,n)}};bt.prototype.ValueTypeName="bool";bt.prototype.ValueBufferType=Array;bt.prototype.DefaultInterpolation=Mn;bt.prototype.InterpolantFactoryMethodLinear=void 0;bt.prototype.InterpolantFactoryMethodSmooth=void 0;var wi=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};wi.prototype.ValueTypeName="color";var Ti=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};Ti.prototype.ValueTypeName="number";var Ei=class extends St{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=(n-t)/(i-t),h=e*c;for(let d=h+c;h!==d;h+=4)at.slerpFlat(r,0,l,h-c,l,h,u);return r}},En=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new Ei(this.times,this.values,this.getValueSize(),e)}};En.prototype.ValueTypeName="quaternion";En.prototype.InterpolantFactoryMethodSmooth=void 0;var Mt=class extends Ne{constructor(e,t,n){super(e,t,n)}};Mt.prototype.ValueTypeName="string";Mt.prototype.ValueBufferType=Array;Mt.prototype.DefaultInterpolation=Mn;Mt.prototype.InterpolantFactoryMethodLinear=void 0;Mt.prototype.InterpolantFactoryMethodSmooth=void 0;var Ai=class extends Ne{constructor(e,t,n,i){super(e,t,n,i)}};Ai.prototype.ValueTypeName="vector";var Ci=class{constructor(e,t,n){let i=this,r=!1,l=0,c=0,u,h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(d){c++,r===!1&&i.onStart!==void 0&&i.onStart(d,l,c),r=!0},this.itemEnd=function(d){l++,i.onProgress!==void 0&&i.onProgress(d,l,c),l===c&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return d=d.normalize("NFC"),u?u(d):d},this.setURLModifier=function(d){return u=d,this},this.addHandler=function(d,p){return h.push(d,p),this},this.removeHandler=function(d){let p=h.indexOf(d);return p!==-1&&h.splice(p,2),this},this.getHandler=function(d){for(let p=0,_=h.length;p<_;p+=2){let y=h[p],v=h[p+1];if(y.global&&(y.lastIndex=0),y.test(d))return v}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}},co=new Ci,Ri=class{constructor(e){this.manager=e!==void 0?e:co,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};Ri.DEFAULT_MATERIAL_NAME="__DEFAULT";var Qr="\\[\\]\\.:\\/",Mh=new RegExp("["+Qr+"]","g"),es="[^"+Qr+"]",wh="[^"+Qr.replace("\\.","")+"]",Th=/((?:WC+[\/:])*)/.source.replace("WC",es),Eh=/(WCOD+)?/.source.replace("WCOD",wh),Ah=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",es),Ch=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",es),Rh=new RegExp("^"+Th+Eh+Ah+Ch+"$"),Ph=["material","materials","bones","map"],Vr=class{constructor(e,t,n){let i=n||ae.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},ae=class s{constructor(e,t,n){this.path=t,this.parsedPath=n||s.parseTrackName(t),this.node=s.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new s.Composite(e,t,n):new s(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Mh,"")}static parseTrackName(e){let t=Rh.exec(e);if(t===null)throw new Error("THREE.PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let r=n.nodeName.substring(i+1);Ph.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(r){for(let l=0;l<r.length;l++){let c=r[l];if(c.name===t||c.uuid===t)return c;let u=n(c.children);if(u)return u}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=s.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ee("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let h=t.objectIndex;switch(n){case"materials":if(!e.material){pe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){pe("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){pe("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===h){h=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){pe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){pe("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){pe("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(h!==void 0){if(e[h]===void 0){pe("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}let l=e[i];if(l===void 0){let h=t.nodeName;pe("PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?c=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(r!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){pe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){pe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=r}else l.fromArray!==void 0&&l.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};ae.Composite=Vr;ae.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};ae.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};ae.prototype.GetterByBindingType=[ae.prototype._getValue_direct,ae.prototype._getValue_array,ae.prototype._getValue_arrayElement,ae.prototype._getValue_toArray];ae.prototype.SetterByBindingTypeAndVersioning=[[ae.prototype._setValue_direct,ae.prototype._setValue_direct_setNeedsUpdate,ae.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_array,ae.prototype._setValue_array_setNeedsUpdate,ae.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_arrayElement,ae.prototype._setValue_arrayElement_setNeedsUpdate,ae.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ae.prototype._setValue_fromArray,ae.prototype._setValue_fromArray_setNeedsUpdate,ae.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Hm=new Float32Array(1);var kr=class s{static{s.prototype.isMatrix2=!0}constructor(e,t,n,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){let r=this.elements;return r[0]=e,r[2]=t,r[1]=n,r[3]=i,this}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"186"}}));typeof window<"u"&&(window.__THREE__?Ee("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="186");var Ih=`#ifdef USE_ALPHAHASH
|
|
8
8
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
9
9
|
#endif`,Lh=`#ifdef USE_ALPHAHASH
|
|
10
10
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3822,7 +3822,7 @@ void main() {
|
|
|
3822
3822
|
#include <tonemapping_fragment>
|
|
3823
3823
|
#include <colorspace_fragment>
|
|
3824
3824
|
#include <fog_fragment>
|
|
3825
|
-
}`,J={alphahash_fragment:Ih,alphahash_pars_fragment:Lh,alphamap_fragment:Dh,alphamap_pars_fragment:Uh,alphatest_fragment:Nh,alphatest_pars_fragment:Fh,aomap_fragment:Oh,aomap_pars_fragment:Bh,batching_pars_vertex:zh,batching_vertex:Vh,begin_vertex:kh,beginnormal_vertex:Gh,bsdfs:Hh,iridescence_fragment:Wh,bumpmap_pars_fragment:Xh,clipping_planes_fragment:qh,clipping_planes_pars_fragment:Yh,clipping_planes_pars_vertex:$h,clipping_planes_vertex:Zh,color_fragment:Jh,color_pars_fragment:jh,color_pars_vertex:Kh,color_vertex:Qh,common:ef,cube_uv_reflection_fragment:tf,defaultnormal_vertex:nf,displacementmap_pars_vertex:rf,displacementmap_vertex:sf,emissivemap_fragment:af,emissivemap_pars_fragment:of,colorspace_fragment:lf,colorspace_pars_fragment:cf,envmap_fragment:uf,envmap_common_pars_fragment:hf,envmap_pars_fragment:ff,envmap_pars_vertex:df,envmap_physical_pars_fragment:wf,envmap_vertex:pf,fog_vertex:mf,fog_pars_vertex:gf,fog_fragment:_f,fog_pars_fragment:yf,gradientmap_pars_fragment:vf,lightmap_pars_fragment:xf,lights_lambert_fragment:Sf,lights_lambert_pars_fragment:bf,lights_pars_begin:Mf,lights_toon_fragment:Tf,lights_toon_pars_fragment:Ef,lights_phong_fragment:Af,lights_phong_pars_fragment:Cf,lights_physical_fragment:Rf,lights_physical_pars_fragment:Pf,lights_fragment_begin:If,lights_fragment_maps:Lf,lights_fragment_end:Df,lightprobes_pars_fragment:Uf,logdepthbuf_fragment:Nf,logdepthbuf_pars_fragment:Ff,logdepthbuf_pars_vertex:Of,logdepthbuf_vertex:Bf,map_fragment:zf,map_pars_fragment:Vf,map_particle_fragment:kf,map_particle_pars_fragment:Gf,metalnessmap_fragment:Hf,metalnessmap_pars_fragment:Wf,morphinstance_vertex:Xf,morphcolor_vertex:qf,morphnormal_vertex:Yf,morphtarget_pars_vertex:$f,morphtarget_vertex:Zf,normal_fragment_begin:Jf,normal_fragment_maps:jf,normal_pars_fragment:Kf,normal_pars_vertex:Qf,normal_vertex:ed,normalmap_pars_fragment:td,clearcoat_normal_fragment_begin:nd,clearcoat_normal_fragment_maps:id,clearcoat_pars_fragment:rd,iridescence_pars_fragment:sd,opaque_fragment:ad,packing:od,premultiplied_alpha_fragment:ld,project_vertex:cd,dithering_fragment:ud,dithering_pars_fragment:hd,roughnessmap_fragment:fd,roughnessmap_pars_fragment:dd,shadowmap_pars_fragment:pd,shadowmap_pars_vertex:md,shadowmap_vertex:gd,shadowmask_pars_fragment:_d,skinbase_vertex:yd,skinning_pars_vertex:vd,skinning_vertex:xd,skinnormal_vertex:Sd,specularmap_fragment:bd,specularmap_pars_fragment:Md,tonemapping_fragment:wd,tonemapping_pars_fragment:Td,transmission_fragment:Ed,transmission_pars_fragment:Ad,uv_pars_fragment:Cd,uv_pars_vertex:Rd,uv_vertex:Pd,worldpos_vertex:Id,background_vert:Ld,background_frag:Dd,backgroundCube_vert:Ud,backgroundCube_frag:Nd,cube_vert:Fd,cube_frag:Od,depth_vert:Bd,depth_frag:zd,distance_vert:Vd,distance_frag:kd,equirect_vert:Gd,equirect_frag:Hd,linedashed_vert:Wd,linedashed_frag:Xd,meshbasic_vert:qd,meshbasic_frag:Yd,meshlambert_vert:$d,meshlambert_frag:Zd,meshmatcap_vert:Jd,meshmatcap_frag:jd,meshnormal_vert:Kd,meshnormal_frag:Qd,meshphong_vert:ep,meshphong_frag:tp,meshphysical_vert:np,meshphysical_frag:ip,meshtoon_vert:rp,meshtoon_frag:sp,points_vert:ap,points_frag:op,shadow_vert:lp,shadow_frag:cp,sprite_vert:up,sprite_frag:hp},U={common:{diffuse:{value:new ge(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Z},alphaMap:{value:null},alphaMapTransform:{value:new Z},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Z}},envmap:{envMap:{value:null},envMapRotation:{value:new Z},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Z}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Z}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Z},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Z},normalScale:{value:new He(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Z},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Z}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Z}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Z}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ge(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},sunLights:{value:[],properties:{direction:{},color:{}}},sunLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},sunShadowMatrix:{value:[]},sunShadowCascade:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new F},probesMax:{value:new F},probesResolution:{value:new F}},points:{diffuse:{value:new ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Z},alphaTest:{value:0},uvTransform:{value:new Z}},sprite:{diffuse:{value:new ge(16777215)},opacity:{value:1},center:{value:new He(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Z},alphaMap:{value:null},alphaMapTransform:{value:new Z},alphaTest:{value:0}}},uo={basic:{uniforms:Ae([U.common,U.specularmap,U.envmap,U.aomap,U.lightmap,U.fog]),vertexShader:J.meshbasic_vert,fragmentShader:J.meshbasic_frag},lambert:{uniforms:Ae([U.common,U.specularmap,U.envmap,U.aomap,U.lightmap,U.emissivemap,U.bumpmap,U.normalmap,U.displacementmap,U.fog,U.lights,{emissive:{value:new ge(0)},envMapIntensity:{value:1}}]),vertexShader:J.meshlambert_vert,fragmentShader:J.meshlambert_frag},phong:{uniforms:Ae([U.common,U.specularmap,U.envmap,U.aomap,U.lightmap,U.emissivemap,U.bumpmap,U.normalmap,U.displacementmap,U.fog,U.lights,{emissive:{value:new ge(0)},specular:{value:new ge(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:J.meshphong_vert,fragmentShader:J.meshphong_frag},standard:{uniforms:Ae([U.common,U.envmap,U.aomap,U.lightmap,U.emissivemap,U.bumpmap,U.normalmap,U.displacementmap,U.roughnessmap,U.metalnessmap,U.fog,U.lights,{emissive:{value:new ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:J.meshphysical_vert,fragmentShader:J.meshphysical_frag},toon:{uniforms:Ae([U.common,U.aomap,U.lightmap,U.emissivemap,U.bumpmap,U.normalmap,U.displacementmap,U.gradientmap,U.fog,U.lights,{emissive:{value:new ge(0)}}]),vertexShader:J.meshtoon_vert,fragmentShader:J.meshtoon_frag},matcap:{uniforms:Ae([U.common,U.bumpmap,U.normalmap,U.displacementmap,U.fog,{matcap:{value:null}}]),vertexShader:J.meshmatcap_vert,fragmentShader:J.meshmatcap_frag},points:{uniforms:Ae([U.points,U.fog]),vertexShader:J.points_vert,fragmentShader:J.points_frag},dashed:{uniforms:Ae([U.common,U.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:J.linedashed_vert,fragmentShader:J.linedashed_frag},depth:{uniforms:Ae([U.common,U.displacementmap]),vertexShader:J.depth_vert,fragmentShader:J.depth_frag},normal:{uniforms:Ae([U.common,U.bumpmap,U.normalmap,U.displacementmap,{opacity:{value:1}}]),vertexShader:J.meshnormal_vert,fragmentShader:J.meshnormal_frag},sprite:{uniforms:Ae([U.sprite,U.fog]),vertexShader:J.sprite_vert,fragmentShader:J.sprite_frag},background:{uniforms:{uvTransform:{value:new Z},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:J.background_vert,fragmentShader:J.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Z}},vertexShader:J.backgroundCube_vert,fragmentShader:J.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:J.cube_vert,fragmentShader:J.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:J.equirect_vert,fragmentShader:J.equirect_frag},distance:{uniforms:Ae([U.common,U.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:J.distance_vert,fragmentShader:J.distance_frag},shadow:{uniforms:Ae([U.lights,U.fog,{color:{value:new ge(0)},opacity:{value:1}}]),vertexShader:J.shadow_vert,fragmentShader:J.shadow_frag}};uo.physical={uniforms:Ae([uo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Z},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Z},clearcoatNormalScale:{value:new He(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Z},dispersion:{value:0},retroreflectivity:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Z},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Z},sheen:{value:0},sheenColor:{value:new ge(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Z},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Z},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Z},transmissionSamplerSize:{value:new He},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Z},attenuationDistance:{value:0},attenuationColor:{value:new ge(0)},specularColor:{value:new ge(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Z},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Z},anisotropyVector:{value:new He},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Z}}]),vertexShader:J.meshphysical_vert,fragmentShader:J.meshphysical_frag};var fp=new Z;fp.set(-1,0,0,0,1,0,0,0,1);var bS={[kr]:"LINEAR_TONE_MAPPING",[Gr]:"REINHARD_TONE_MAPPING",[Hr]:"CINEON_TONE_MAPPING",[Wr]:"ACES_FILMIC_TONE_MAPPING",[qr]:"AGX_TONE_MAPPING",[Yr]:"NEUTRAL_TONE_MAPPING",[Xr]:"CUSTOM_TONE_MAPPING"};var MS=new Float32Array(16),wS=new Float32Array(9),TS=new Float32Array(4);var ES={[kr]:"Linear",[Gr]:"Reinhard",[Hr]:"Cineon",[Wr]:"ACESFilmic",[qr]:"AgX",[Yr]:"Neutral",[Xr]:"Custom"};var AS={[qa]:"SHADOWMAP_TYPE_PCF",[Ya]:"SHADOWMAP_TYPE_VSM"};var CS={[ja]:"ENVMAP_TYPE_CUBE",[Zr]:"ENVMAP_TYPE_CUBE",[Ka]:"ENVMAP_TYPE_CUBE_UV"};var RS={[Zr]:"ENVMAP_MODE_REFRACTION"};var PS={[$a]:"ENVMAP_BLENDING_MULTIPLY",[Za]:"ENVMAP_BLENDING_MIX",[Ja]:"ENVMAP_BLENDING_ADD"};var dp=new Z;dp.set(-1,0,0,0,1,0,0,0,1);var IS=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);import pp from"@giro3d/giro3d/core/geographic/CoordinateSystem.js";import mp from"@giro3d/giro3d/core/OperationCounter.js";import{defer as ho}from"@giro3d/giro3d/core/RequestQueue.js";import gp from"@giro3d/giro3d/utils/Fetcher.js";import{nonNull as wt}from"@giro3d/giro3d/utils/tsutils.js";import{getLazPerf as _p}from"@giro3d/giro3d/sources/las/config.js";import{extractAttributes as yp,getDimensionsToRead as vp}from"@giro3d/giro3d/sources/las/dimension.js";import{getPerPointFilters as xp}from"@giro3d/giro3d/sources/las/filter.js";import{createBufferAttribute as Sp,readColor as bp,readPosition as Mp,readScalarAttribute as wp}from"@giro3d/giro3d/sources/las/readers.js";import{createLasView as Tp}from"@giro3d/giro3d/sources/las/worker.js";import{PointCloudSourceBase as Ep}from"@giro3d/giro3d/sources/PointCloudSource.js";function Ap(s,e){let t=c=>async()=>{let h=await(await gp.blob(c)).arrayBuffer();return new Uint8Array(h)};async function n(c){let u=await _p();return Ri.Las.PointData.decompressFile(c,u)}async function i(c){return(await s.get()).queue("DecodeLazFile",{buffer:c.buffer},[c.buffer]).then(h=>new Uint8Array(h))}class r extends Ep{isLASSource=!0;type="LASSource";_opCounter=new mp;_filters=[];_options={decimate:1,enableWorkers:!0,compressColorsToUint8:!0};_header=null;_volume=null;_buffer=null;get loading(){return this._opCounter.loading}get progress(){return this._opCounter.progress}get filters(){return this._filters}set filters(u){this._filters.length=0,this._filters.push(...u),this.dispatchEvent({type:"updated"})}constructor(u){if(super(),this._opCounter.addEventListener("changed",()=>this.dispatchEvent({type:"progress"})),this._options.compressColorsToUint8=u.compressColorsTo8Bit??this._options.compressColorsToUint8,this._options.decimate=u.decimate??1,this._options.decimate<1)throw new Error("decimate should be at least 1");this._options.enableWorkers=u.enableWorkers??!0,u.filters!=null&&u.filters.length>0&&this._filters.push(...u.filters),this._getter=typeof u.url=="string"?t(u.url):u.url}async initializeOnce(){this._opCounter.increment(),this._buffer=await this._getter().finally(()=>this._opCounter.decrement()),this._header=fo.Header.parse(new Uint8Array(this._buffer));let{min:u,max:h}=this._header;return this._volume=new We().set(new F(u[0],u[1],u[2]),new F(h[0],h[1],h[2])),this}async getView(u){this._opCounter.increment();let h=new Uint8Array(wt(this._buffer)),d=wt(this._header),p;return this._options.enableWorkers===!1?p=await n(h).finally(()=>this._opCounter.decrement()):p=await i(h).finally(()=>this._opCounter.decrement()),Tp(p,d,void 0,u)}async getMetadata(){let u=wt(this._header,"not initialized"),h=await this.getView(),d={pointCount:u.pointCount,volume:wt(this._volume),attributes:yp(h.dimensions,wt(this._volume),this._options.compressColorsToUint8,null)},p=wt(this._buffer,"not initialized"),v=(x,A)=>{if(A>=p.byteLength)throw new Error;return new Uint8Array(p.slice(x,A))},_=await Ri.Las.Vlr.walk((x,A)=>Promise.resolve(v(x,A)),u),g=Ri.Las.Vlr.find(_,"LASF_Projection",2112);if(g&&g.contentLength){let x=g.contentOffset,A=x+g.contentLength,E=po.Binary.toCString(v(x,A));if(E!==null&&E)try{d.crs=pp.fromWkt(E)}catch(I){console.error(`Failed to parse WKT for LAS "${this.id}": `,I)}}return Promise.resolve(d)}async getHierarchy(){let{min:u,max:h,pointCount:d}=wt(this._header,"not initialized"),p=new We().set(new F(u[0],u[1],u[2]),new F(h[0],h[1],h[2]));return{depth:0,volume:p,id:"root",hasData:!0,geometricError:0,center:p.getCenter(new F),sourceId:this.id,pointCount:d}}async getNodeData(u){let h=u.attributes??[],d=vp(h,u.position,this._filters),p=await this.getView(d),{min:v}=wt(this._volume),_=v.clone(),g=this._options.decimate??1,x=u.signal,A=xp(this._filters,p),E=this._options.compressColorsToUint8;this._opCounter.increment(h.length);let I,N;if(u.position){this._opCounter.increment();let C=await ho(()=>Mp(p,_,g,A)).finally(()=>this._opCounter.decrement());I=new bn(new Float32Array(C.buffer),3),N=C.localBoundingBox}let O=await Promise.all(h.map(async C=>{let G;C.interpretation==="color"?G=()=>bp(p,g,E,A):G=()=>wp(p,C,g,A);let z=await ho(G,x).finally(()=>this._opCounter.decrement());return Sp(z,C,E)}));return Promise.resolve({origin:_,pointCount:I?.count??O[0]?.count,localBoundingBox:N,position:I,attributes:O})}getMemoryUsage(u){this._buffer!=null&&u.objects.set(this.id,{cpuMemory:this._buffer.byteLength,gpuMemory:0})}dispose(){s.dispose(),this._buffer=null,this._header=null,this._volume=null,this._filters.length=0}}function l(c,u){return new class extends c{initialize(){return this._initializePromise||(this._initializePromise=Promise.resolve().then(()=>this.initializeOnce()).then(h=>(this._ready=!0,this.dispatchEvent({type:"initialized"}),h))),this._initializePromise}async getNodeData(h){h.signal?.throwIfAborted();try{let d=await super.getNodeData(h);return h.signal?.throwIfAborted(),d}catch(d){throw h.signal?.throwIfAborted(),d}}}(u)}return l(r,e)}var wn=Fn(ur());import{GlobalCache as mo}from"@giro3d/giro3d/core/Cache.js";import go from"@giro3d/giro3d/core/geographic/CoordinateSystem.js";import*as Pt from"@giro3d/giro3d/core/Octree.js";import Cp from"@giro3d/giro3d/core/OperationCounter.js";import Rp from"@giro3d/giro3d/core/RequestQueue.js";import Pp from"@giro3d/giro3d/utils/Fetcher.js";import{nonNull as es}from"@giro3d/giro3d/utils/tsutils.js";import{getLazPerf as Ip}from"@giro3d/giro3d/sources/las/config.js";import{extractAttributes as Lp,getDimensionsToRead as Dp}from"@giro3d/giro3d/sources/las/dimension.js";import{createBufferAttribute as Up}from"@giro3d/giro3d/sources/las/readers.js";import{createLasView as Np,readView as Fp}from"@giro3d/giro3d/sources/las/worker.js";import{PointCloudSourceBase as Op}from"@giro3d/giro3d/sources/PointCloudSource.js";function Bp(s,e){let t=new Rp,n=_=>async(g,x)=>{let E=await(await Pp.blob(_,{headers:{Range:`bytes=${g}-${x-1}`}})).arrayBuffer();return new Uint8Array(E)};async function i(_,g){let x=await Ip();return wn.Las.PointData.decompressChunk(_,g,x)}async function r(_,g){return(await s.get()).queue("DecodeLazChunk",{buffer:_.buffer,metadata:g},[_.buffer]).then(A=>new Uint8Array(A))}let l=new F,c=new F;function u(_,g,x,A,E,I,N){let O=x.depth+1,C=x.x*2+E,G=x.y*2+I,z=x.z*2+N,$=`${O}-${C}-${G}-${z}`,Q=g.get($);if(!Q)return;let re=x.volume.getCenter(l),y=x.volume.getSize(c).divideScalar(2),M=pe=>pe===0?-1:0,B=re.x+y.x*M(E),X=re.y+y.y*M(I),k=re.z+y.z*M(N),q=new F(B,X,k),L=q.clone().add(y),de=new We(q,L),_e=de.getCenter(new F);return Pt.create({depth:O,x:C,y:G,z,id:$,center:_e,pointCount:Q.pointCount,geometricError:A,hasData:Q.pointCount>0,sourceId:_,volume:de},de,x)}async function h(_,g,x){let{nodes:A,pages:E}=await wn.Copc.loadHierarchyPage(_,g);for(let[I,N]of Object.entries(A))x.set(I,N);for(let I of Object.values(E))I&&await h(_,I,x)}class d extends Op{isCOPCSource=!0;type="COPCSource";_opCounter=new Cp;_nodeMap=new Map;_filters=[];_options={decimate:1,enableWorkers:!0,compressColorsToUint8:!0};get loading(){return this._opCounter.loading}get progress(){return this._opCounter.progress}get filters(){return this._filters}set filters(g){this._filters.length=0,g!=null&&this._filters.push(...g),this.dispatchEvent({type:"updated"})}constructor(g){if(super(),this._opCounter.addEventListener("changed",()=>this.dispatchEvent({type:"progress"})),this._options.compressColorsToUint8=g.compressColorsTo8Bit??this._options.compressColorsToUint8,this._options.decimate=g.decimate??1,this._options.decimate<1)throw new Error("decimate should be at least 1");this._options.enableWorkers=g.enableWorkers??!0,g.filters!=null&&g.filters.length>0&&this._filters.push(...g.filters),this._getter=typeof g.url=="string"?n(g.url):g.url}async initializeOnce(){let g=this._opCounter;g.increment(3);let x=await wn.Copc.create(this._getter).finally(()=>g.decrement()),[A,E,I]=x.header.min,[N,O,C]=x.header.max,G=new We(new F(A,E,I),new F(N,O,C)),z=new Map;await h(this._getter,x.info.rootHierarchyPage,z).finally(()=>g.decrement());let $=es(z.get("0-0-0-0"),"FATAL: no root node in the LAS file."),Q=await this.loadPointDataView(this._getter,x,$).finally(()=>g.decrement());return this._data={copc:x,nodes:z,volume:G,dimensions:Q.dimensions},this}getMetadata(){let g=this.ensureInitialized(),x=go.unknown;if(typeof g.copc.wkt<"u")try{x=go.fromWkt(g.copc.wkt)}catch(E){console.error(`Failed to parse WKT for COPC "${this.id}": `,E)}let A={pointCount:g.copc.header.pointCount,attributes:Lp(g.dimensions,g.volume,this._options.compressColorsToUint8,g.copc.info.gpsTimeRange),volume:g.volume,crs:x};return Promise.resolve(A)}getHierarchy(){let{copc:g,nodes:x}=this.ensureInitialized(),[A,E,I,N,O,C]=g.info.cube,G=new We(new F(A,E,I),new F(N,O,C)),z=es(x.get("0-0-0-0")),$=g.info.spacing,Q=Pt.create({depth:0,x:0,y:0,z:0,id:"0-0-0-0",volume:G,center:G.getCenter(new F),pointCount:z.pointCount,geometricError:$,hasData:z.pointCount>0,sourceId:this.id},G);return Pt.populate(Q,y=>{let M=$/2**(y.depth+1);return[u(this.id,x,y,M,0,0,0),u(this.id,x,y,M,1,0,0),u(this.id,x,y,M,1,1,0),u(this.id,x,y,M,0,1,0),u(this.id,x,y,M,0,0,1),u(this.id,x,y,M,1,0,1),u(this.id,x,y,M,1,1,1),u(this.id,x,y,M,0,1,1)]}),Pt.traverse(Q,y=>(this._nodeMap.set(y.id,y),!0)),Promise.resolve(Q)}async getNodeData(g){let{nodes:x,copc:A}=this.ensureInitialized(),E=g.node.id,I=-g.node.depth,N=x.get(E);if(!N)throw new Error("no such node: "+E);let O=g.signal;O?.throwIfAborted();let C=g.attributes??[],G=Dp(C,g.position,this._filters),z=es(this._nodeMap.get(E)),$=this._options.decimate,{x:Q,y:re,z:y}=g.node.center,M={pointCount:N.pointCount,pointDataRecordFormat:A.header.pointDataRecordFormat,pointDataRecordLength:A.header.pointDataRecordLength},B;this._options.enableWorkers?B=await this.loadNodeDataWithWorker(N,I,O,A,M,g,Q,re,y,G,$):B=await this.loadNodeData(A,N,G,I,O,Q,re,y,$,g),O?.throwIfAborted();let X,k;if(B.position){X=new nn(new Float32Array(B.position.buffer),3);let[L,de,_e,ee,pe,Tn]=B.position.localBoundingBox;k=new We(new F(L,de,_e),new F(ee,pe,Tn))}let q=C.map((L,de)=>{let _e=B.attributes[de];if(_e!=null)return Up(_e,L,this._options.compressColorsToUint8)});return{pointCount:X?.count??q[0]?.count,origin:z.center,localBoundingBox:k,position:X,attributes:q}}async loadNodeData(g,x,A,E,I,N,O,C,G,z){let $=await this._opCounter.wrap(this.loadPointDataView(this._getter,g,x,A,E,I));return I?.throwIfAborted(),Fp({view:$,origin:{x:N,y:O,z:C},stride:G,position:z.position,attributes:z.attributes??[],compressColors:this._options.compressColorsToUint8,filters:this._filters})}async loadNodeDataWithWorker(g,x,A,E,I,N,O,C,G,z,$){let Q=await this._opCounter.wrap(this.loadPointDataViewBuffer(this._getter,g,x));A?.throwIfAborted();let re=Q.slice(0);try{return this._opCounter.increment(),await(await s.get()).queue("ReadView",{buffer:re,header:E.header,metadata:I,position:N.position,origin:{x:O,y:C,z:G},include:z,filters:this._filters,eb:E.eb,stride:$,attributes:N.attributes??[],compressColors:this._options.compressColorsToUint8},[re])}finally{this._opCounter.decrement()}}ensureInitialized(){if(!this._data)throw new Error("not initialized");return this._data}async loadPointDataViewBuffer(g,x,A){let{pointDataOffset:E,pointDataLength:I}=x,N=`${this.id}-${E}-${I}`,O=mo.get(N);return O!=null?O.buffer:t.enqueue({id:N,priority:A,request:async()=>{let C=await g(E,E+I);return mo.set(N,C,{size:C.byteLength}),C.buffer}})}async loadPointDataView(g,x,A,E,I,N){let O=await this.loadPointDataViewBuffer(g,A,I);N?.throwIfAborted();let C;if(this._options.enableWorkers){let G=new Uint8Array(O.slice(0));C=await r(G,{pointCount:A.pointCount,pointDataRecordFormat:x.header.pointDataRecordFormat,pointDataRecordLength:x.header.pointDataRecordLength})}else{let G=new Uint8Array(O);C=await i(G,{pointCount:A.pointCount,pointDataRecordFormat:x.header.pointDataRecordFormat,pointDataRecordLength:x.header.pointDataRecordLength})}return N?.throwIfAborted(),Np(C,x.header,x.eb,E)}getMemoryUsage(){}dispose(){s.dispose(),this._data=void 0,this._nodeMap.clear(),this._filters.length=0}}function p(_){return _.isCOPCSource===!0}function v(_,g){return new class extends _{initialize(){return this._initializePromise||(this._initializePromise=Promise.resolve().then(()=>this.initializeOnce()).then(x=>(this._ready=!0,this.dispatchEvent({type:"initialized"}),x))),this._initializePromise}async getNodeData(x){x.signal?.throwIfAborted();try{let A=await super.getNodeData(x);return x.signal?.throwIfAborted(),A}catch(A){throw x.signal?.throwIfAborted(),A}}}(g)}return v(d,e)}function Vp(s,e){if(typeof s.prototype.loadNodeData!="function")throw new Error("Missing reviewed PointCloud loading method.");let t=new AbortController,n,i=()=>{t.signal.aborted||(t.abort(new Error("aborted")),n&&(n.frozen=!0))};return n=new class extends s{async loadNodeData(r,l,c){if(t.signal.aborted||l?.aborted)return;let u=new AbortController,h=()=>u.abort(new Error("aborted"));t.signal.addEventListener("abort",h,{once:!0}),l?.addEventListener("abort",h,{once:!0});try{return(t.signal.aborted||l?.aborted)&&h(),await super.loadNodeData(r,u.signal,c)}finally{t.signal.removeEventListener("abort",h),l?.removeEventListener("abort",h)}}clear(){t.signal.aborted||super.clear()}dispose(){try{i()}finally{super.dispose()}}}(e),{entity:n,stop:i}}function cb(s){return Vp(zp,s)}export{Bp as createCOPCSource,Ap as createLASSource,cb as createOwnedPointCloud};
|
|
3825
|
+
}`,Q={alphahash_fragment:Ih,alphahash_pars_fragment:Lh,alphamap_fragment:Dh,alphamap_pars_fragment:Uh,alphatest_fragment:Nh,alphatest_pars_fragment:Fh,aomap_fragment:Oh,aomap_pars_fragment:Bh,batching_pars_vertex:zh,batching_vertex:Vh,begin_vertex:kh,beginnormal_vertex:Gh,bsdfs:Hh,iridescence_fragment:Wh,bumpmap_pars_fragment:Xh,clipping_planes_fragment:qh,clipping_planes_pars_fragment:Yh,clipping_planes_pars_vertex:$h,clipping_planes_vertex:Zh,color_fragment:Jh,color_pars_fragment:jh,color_pars_vertex:Kh,color_vertex:Qh,common:ef,cube_uv_reflection_fragment:tf,defaultnormal_vertex:nf,displacementmap_pars_vertex:rf,displacementmap_vertex:sf,emissivemap_fragment:af,emissivemap_pars_fragment:of,colorspace_fragment:lf,colorspace_pars_fragment:cf,envmap_fragment:uf,envmap_common_pars_fragment:hf,envmap_pars_fragment:ff,envmap_pars_vertex:df,envmap_physical_pars_fragment:wf,envmap_vertex:pf,fog_vertex:mf,fog_pars_vertex:gf,fog_fragment:_f,fog_pars_fragment:yf,gradientmap_pars_fragment:vf,lightmap_pars_fragment:xf,lights_lambert_fragment:Sf,lights_lambert_pars_fragment:bf,lights_pars_begin:Mf,lights_toon_fragment:Tf,lights_toon_pars_fragment:Ef,lights_phong_fragment:Af,lights_phong_pars_fragment:Cf,lights_physical_fragment:Rf,lights_physical_pars_fragment:Pf,lights_fragment_begin:If,lights_fragment_maps:Lf,lights_fragment_end:Df,lightprobes_pars_fragment:Uf,logdepthbuf_fragment:Nf,logdepthbuf_pars_fragment:Ff,logdepthbuf_pars_vertex:Of,logdepthbuf_vertex:Bf,map_fragment:zf,map_pars_fragment:Vf,map_particle_fragment:kf,map_particle_pars_fragment:Gf,metalnessmap_fragment:Hf,metalnessmap_pars_fragment:Wf,morphinstance_vertex:Xf,morphcolor_vertex:qf,morphnormal_vertex:Yf,morphtarget_pars_vertex:$f,morphtarget_vertex:Zf,normal_fragment_begin:Jf,normal_fragment_maps:jf,normal_pars_fragment:Kf,normal_pars_vertex:Qf,normal_vertex:ed,normalmap_pars_fragment:td,clearcoat_normal_fragment_begin:nd,clearcoat_normal_fragment_maps:id,clearcoat_pars_fragment:rd,iridescence_pars_fragment:sd,opaque_fragment:ad,packing:od,premultiplied_alpha_fragment:ld,project_vertex:cd,dithering_fragment:ud,dithering_pars_fragment:hd,roughnessmap_fragment:fd,roughnessmap_pars_fragment:dd,shadowmap_pars_fragment:pd,shadowmap_pars_vertex:md,shadowmap_vertex:gd,shadowmask_pars_fragment:_d,skinbase_vertex:yd,skinning_pars_vertex:vd,skinning_vertex:xd,skinnormal_vertex:Sd,specularmap_fragment:bd,specularmap_pars_fragment:Md,tonemapping_fragment:wd,tonemapping_pars_fragment:Td,transmission_fragment:Ed,transmission_pars_fragment:Ad,uv_pars_fragment:Cd,uv_pars_vertex:Rd,uv_vertex:Pd,worldpos_vertex:Id,background_vert:Ld,background_frag:Dd,backgroundCube_vert:Ud,backgroundCube_frag:Nd,cube_vert:Fd,cube_frag:Od,depth_vert:Bd,depth_frag:zd,distance_vert:Vd,distance_frag:kd,equirect_vert:Gd,equirect_frag:Hd,linedashed_vert:Wd,linedashed_frag:Xd,meshbasic_vert:qd,meshbasic_frag:Yd,meshlambert_vert:$d,meshlambert_frag:Zd,meshmatcap_vert:Jd,meshmatcap_frag:jd,meshnormal_vert:Kd,meshnormal_frag:Qd,meshphong_vert:ep,meshphong_frag:tp,meshphysical_vert:np,meshphysical_frag:ip,meshtoon_vert:rp,meshtoon_frag:sp,points_vert:ap,points_frag:op,shadow_vert:lp,shadow_frag:cp,sprite_vert:up,sprite_frag:hp},F={common:{diffuse:{value:new me(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new J},alphaMap:{value:null},alphaMapTransform:{value:new J},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new J}},envmap:{envMap:{value:null},envMapRotation:{value:new J},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new J}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new J}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new J},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new J},normalScale:{value:new He(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new J},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new J}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new J}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new J}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new me(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},sunLights:{value:[],properties:{direction:{},color:{}}},sunLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},sunShadowMatrix:{value:[]},sunShadowCascade:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new z},probesMax:{value:new z},probesResolution:{value:new z}},points:{diffuse:{value:new me(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new J},alphaTest:{value:0},uvTransform:{value:new J}},sprite:{diffuse:{value:new me(16777215)},opacity:{value:1},center:{value:new He(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new J},alphaMap:{value:null},alphaMapTransform:{value:new J},alphaTest:{value:0}}},uo={basic:{uniforms:Ae([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.fog]),vertexShader:Q.meshbasic_vert,fragmentShader:Q.meshbasic_frag},lambert:{uniforms:Ae([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.fog,F.lights,{emissive:{value:new me(0)},envMapIntensity:{value:1}}]),vertexShader:Q.meshlambert_vert,fragmentShader:Q.meshlambert_frag},phong:{uniforms:Ae([F.common,F.specularmap,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.fog,F.lights,{emissive:{value:new me(0)},specular:{value:new me(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Q.meshphong_vert,fragmentShader:Q.meshphong_frag},standard:{uniforms:Ae([F.common,F.envmap,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.roughnessmap,F.metalnessmap,F.fog,F.lights,{emissive:{value:new me(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag},toon:{uniforms:Ae([F.common,F.aomap,F.lightmap,F.emissivemap,F.bumpmap,F.normalmap,F.displacementmap,F.gradientmap,F.fog,F.lights,{emissive:{value:new me(0)}}]),vertexShader:Q.meshtoon_vert,fragmentShader:Q.meshtoon_frag},matcap:{uniforms:Ae([F.common,F.bumpmap,F.normalmap,F.displacementmap,F.fog,{matcap:{value:null}}]),vertexShader:Q.meshmatcap_vert,fragmentShader:Q.meshmatcap_frag},points:{uniforms:Ae([F.points,F.fog]),vertexShader:Q.points_vert,fragmentShader:Q.points_frag},dashed:{uniforms:Ae([F.common,F.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Q.linedashed_vert,fragmentShader:Q.linedashed_frag},depth:{uniforms:Ae([F.common,F.displacementmap]),vertexShader:Q.depth_vert,fragmentShader:Q.depth_frag},normal:{uniforms:Ae([F.common,F.bumpmap,F.normalmap,F.displacementmap,{opacity:{value:1}}]),vertexShader:Q.meshnormal_vert,fragmentShader:Q.meshnormal_frag},sprite:{uniforms:Ae([F.sprite,F.fog]),vertexShader:Q.sprite_vert,fragmentShader:Q.sprite_frag},background:{uniforms:{uvTransform:{value:new J},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Q.background_vert,fragmentShader:Q.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new J}},vertexShader:Q.backgroundCube_vert,fragmentShader:Q.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Q.cube_vert,fragmentShader:Q.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Q.equirect_vert,fragmentShader:Q.equirect_frag},distance:{uniforms:Ae([F.common,F.displacementmap,{referencePosition:{value:new z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Q.distance_vert,fragmentShader:Q.distance_frag},shadow:{uniforms:Ae([F.lights,F.fog,{color:{value:new me(0)},opacity:{value:1}}]),vertexShader:Q.shadow_vert,fragmentShader:Q.shadow_frag}};uo.physical={uniforms:Ae([uo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new J},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new J},clearcoatNormalScale:{value:new He(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new J},dispersion:{value:0},retroreflectivity:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new J},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new J},sheen:{value:0},sheenColor:{value:new me(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new J},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new J},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new J},transmissionSamplerSize:{value:new He},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new J},attenuationDistance:{value:0},attenuationColor:{value:new me(0)},specularColor:{value:new me(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new J},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new J},anisotropyVector:{value:new He},anisotropyMap:{value:null},anisotropyMapTransform:{value:new J}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag};var fp=new J;fp.set(-1,0,0,0,1,0,0,0,1);var bS={[Gr]:"LINEAR_TONE_MAPPING",[Hr]:"REINHARD_TONE_MAPPING",[Wr]:"CINEON_TONE_MAPPING",[Xr]:"ACES_FILMIC_TONE_MAPPING",[Yr]:"AGX_TONE_MAPPING",[$r]:"NEUTRAL_TONE_MAPPING",[qr]:"CUSTOM_TONE_MAPPING"};var MS=new Float32Array(16),wS=new Float32Array(9),TS=new Float32Array(4);var ES={[Gr]:"Linear",[Hr]:"Reinhard",[Wr]:"Cineon",[Xr]:"ACESFilmic",[Yr]:"AgX",[$r]:"Neutral",[qr]:"Custom"};var AS={[qa]:"SHADOWMAP_TYPE_PCF",[Ya]:"SHADOWMAP_TYPE_VSM"};var CS={[ja]:"ENVMAP_TYPE_CUBE",[Jr]:"ENVMAP_TYPE_CUBE",[Ka]:"ENVMAP_TYPE_CUBE_UV"};var RS={[Jr]:"ENVMAP_MODE_REFRACTION"};var PS={[$a]:"ENVMAP_BLENDING_MULTIPLY",[Za]:"ENVMAP_BLENDING_MIX",[Ja]:"ENVMAP_BLENDING_ADD"};var dp=new J;dp.set(-1,0,0,0,1,0,0,0,1);var IS=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);import pp from"@giro3d/giro3d/core/geographic/CoordinateSystem.js";import mp from"@giro3d/giro3d/core/OperationCounter.js";import{defer as ho}from"@giro3d/giro3d/core/RequestQueue.js";import gp from"@giro3d/giro3d/utils/Fetcher.js";import{nonNull as wt}from"@giro3d/giro3d/utils/tsutils.js";import{getLazPerf as _p}from"@giro3d/giro3d/sources/las/config.js";import{extractAttributes as yp,getDimensionsToRead as vp}from"@giro3d/giro3d/sources/las/dimension.js";import{getPerPointFilters as xp}from"@giro3d/giro3d/sources/las/filter.js";import{createBufferAttribute as Sp,readColor as bp,readPosition as Mp,readScalarAttribute as wp}from"@giro3d/giro3d/sources/las/readers.js";import{createLasView as Tp}from"@giro3d/giro3d/sources/las/worker.js";import{PointCloudSourceBase as Ep}from"@giro3d/giro3d/sources/PointCloudSource.js";function Ap(s,e){let t=c=>async()=>{let h=await(await gp.blob(c)).arrayBuffer();return new Uint8Array(h)};async function n(c){let u=await _p();return Pi.Las.PointData.decompressFile(c,u)}async function i(c){return(await s.get()).queue("DecodeLazFile",{buffer:c.buffer},[c.buffer]).then(h=>new Uint8Array(h))}class r extends Ep{isLASSource=!0;type="LASSource";_opCounter=new mp;_filters=[];_options={decimate:1,enableWorkers:!0,compressColorsToUint8:!0};_header=null;_volume=null;_buffer=null;get loading(){return this._opCounter.loading}get progress(){return this._opCounter.progress}get filters(){return this._filters}set filters(u){this._filters.length=0,this._filters.push(...u),this.dispatchEvent({type:"updated"})}constructor(u){if(super(),this._opCounter.addEventListener("changed",()=>this.dispatchEvent({type:"progress"})),this._options.compressColorsToUint8=u.compressColorsTo8Bit??this._options.compressColorsToUint8,this._options.decimate=u.decimate??1,this._options.decimate<1)throw new Error("decimate should be at least 1");this._options.enableWorkers=u.enableWorkers??!0,u.filters!=null&&u.filters.length>0&&this._filters.push(...u.filters),this._getter=typeof u.url=="string"?t(u.url):u.url}async initializeOnce(){this._opCounter.increment(),this._buffer=await this._getter().finally(()=>this._opCounter.decrement()),this._header=fo.Header.parse(new Uint8Array(this._buffer));let{min:u,max:h}=this._header;return this._volume=new We().set(new z(u[0],u[1],u[2]),new z(h[0],h[1],h[2])),this}async getView(u){this._opCounter.increment();let h=new Uint8Array(wt(this._buffer)),d=wt(this._header),p;return this._options.enableWorkers===!1?p=await n(h).finally(()=>this._opCounter.decrement()):p=await i(h).finally(()=>this._opCounter.decrement()),Tp(p,d,void 0,u)}async getMetadata(){let u=wt(this._header,"not initialized"),h=await this.getView(),d={pointCount:u.pointCount,volume:wt(this._volume),attributes:yp(h.dimensions,wt(this._volume),this._options.compressColorsToUint8,null)},p=wt(this._buffer,"not initialized"),_=(M,b)=>{if(b>=p.byteLength)throw new Error;return new Uint8Array(p.slice(M,b))},y=await Pi.Las.Vlr.walk((M,b)=>Promise.resolve(_(M,b)),u),v=Pi.Las.Vlr.find(y,"LASF_Projection",2112);if(v&&v.contentLength){let M=v.contentOffset,b=M+v.contentLength,S=po.Binary.toCString(_(M,b));if(S!==null&&S)try{d.crs=pp.fromWkt(S)}catch(R){console.error(`Failed to parse WKT for LAS "${this.id}": `,R)}}return Promise.resolve(d)}async getHierarchy(){let{min:u,max:h,pointCount:d}=wt(this._header,"not initialized"),p=new We().set(new z(u[0],u[1],u[2]),new z(h[0],h[1],h[2]));return{depth:0,volume:p,id:"root",hasData:!0,geometricError:0,center:p.getCenter(new z),sourceId:this.id,pointCount:d}}async getNodeData(u){let h=u.attributes??[],d=vp(h,u.position,this._filters),p=await this.getView(d),{min:_}=wt(this._volume),y=_.clone(),v=this._options.decimate??1,M=u.signal,b=xp(this._filters,p),S=this._options.compressColorsToUint8;this._opCounter.increment(h.length);let R,L;if(u.position){this._opCounter.increment();let C=await ho(()=>Mp(p,y,v,b)).finally(()=>this._opCounter.decrement());R=new Tn(new Float32Array(C.buffer),3),L=C.localBoundingBox}let B=await Promise.all(h.map(async C=>{let G;C.interpretation==="color"?G=()=>bp(p,v,S,b):G=()=>wp(p,C,v,b);let O=await ho(G,M).finally(()=>this._opCounter.decrement());return Sp(O,C,S)}));return Promise.resolve({origin:y,pointCount:R?.count??B[0]?.count,localBoundingBox:L,position:R,attributes:B})}getMemoryUsage(u){this._buffer!=null&&u.objects.set(this.id,{cpuMemory:this._buffer.byteLength,gpuMemory:0})}dispose(){s.dispose(),this._buffer=null,this._header=null,this._volume=null,this._filters.length=0}}function l(c,u){return new class extends c{initialize(){return this._initializePromise||(this._initializePromise=Promise.resolve().then(()=>this.initializeOnce()).then(h=>(this._ready=!0,this.dispatchEvent({type:"initialized"}),h))),this._initializePromise}async getNodeData(h){h.signal?.throwIfAborted();try{let d=await super.getNodeData(h);return h.signal?.throwIfAborted(),d}catch(d){throw h.signal?.throwIfAborted(),d}}}(u)}return l(r,e)}var An=On(hr());import{GlobalCache as mo}from"@giro3d/giro3d/core/Cache.js";import go from"@giro3d/giro3d/core/geographic/CoordinateSystem.js";import*as Pt from"@giro3d/giro3d/core/Octree.js";import Cp from"@giro3d/giro3d/core/OperationCounter.js";import Rp from"@giro3d/giro3d/core/RequestQueue.js";import Pp from"@giro3d/giro3d/utils/Fetcher.js";import{nonNull as ts}from"@giro3d/giro3d/utils/tsutils.js";import{getLazPerf as Ip}from"@giro3d/giro3d/sources/las/config.js";import{extractAttributes as Lp,getDimensionsToRead as Dp}from"@giro3d/giro3d/sources/las/dimension.js";import{createBufferAttribute as Up}from"@giro3d/giro3d/sources/las/readers.js";import{createLasView as Np,readView as Fp}from"@giro3d/giro3d/sources/las/worker.js";import{PointCloudSourceBase as Op}from"@giro3d/giro3d/sources/PointCloudSource.js";function Bp(s,e){function t(M){let b=[...M].sort((R,L)=>R.pageOffset-L.pageOffset),S=[];for(let R of b){let L=R.pageOffset,B=L+R.pageLength;if(!Number.isSafeInteger(L)||L<0||!Number.isSafeInteger(R.pageLength)||R.pageLength<0||R.pageLength%32||!Number.isSafeInteger(B))throw new Error("Invalid COPC hierarchy page range.");let C=S.at(-1);C&&L===C.end&&B-C.begin<=512*1024?(C.end=B,C.pages.push(R)):S.push({begin:L,end:B,pages:[R]})}return S}let n=new Rp,i=M=>async(b,S)=>{let L=await(await Pp.blob(M,{headers:{Range:`bytes=${b}-${S-1}`}})).arrayBuffer();return new Uint8Array(L)};async function r(M,b){let S=await Ip();return An.Las.PointData.decompressChunk(M,b,S)}async function l(M,b){return(await s.get()).queue("DecodeLazChunk",{buffer:M.buffer,metadata:b},[M.buffer]).then(R=>new Uint8Array(R))}let c=new z,u=new z;function h(M,b,S,R,L,B,C){let G=S.depth+1,O=S.x*2+L,W=S.y*2+B,$=S.z*2+C,j=`${G}-${O}-${W}-${$}`,g=b.get(j);if(!g)return;let T=S.volume.getCenter(c),D=S.volume.getSize(u).divideScalar(2),V=It=>It===0?-1:0,k=T.x+D.x*V(L),Y=T.y+D.y*V(B),U=T.z+D.z*V(C),ge=new z(k,Y,U),ve=ge.clone().add(D),K=new We(ge,ve),ue=K.getCenter(new z);return Pt.create({depth:G,x:O,y:W,z:$,id:j,center:ue,pointCount:g.pointCount,geometricError:R,hasData:g.pointCount>0,sourceId:M,volume:K},K,S)}async function d(M,b,S){return p(An.Copc.loadHierarchyPage,M,b,S)}async function p(M,b,S,R){let L=[S],B=new Set;for(;L.length;){let C=L.filter($=>{let j=`${$.pageOffset}:${$.pageLength}`;return B.has(j)?!1:(B.add(j),!0)}),G=t(C);L=[];let O=0,W=!1;await Promise.all(Array.from({length:Math.min(8,G.length)},async()=>{for(;!W&&O<G.length;){let $=G[O++];try{let j=b;if($.pages.length>1){let g=await b($.begin,$.end);if(g.byteLength!==$.end-$.begin)throw new Error("Truncated COPC hierarchy group.");j=async(T,D)=>{if(T<$.begin||D>$.end||D<T)throw new Error("COPC hierarchy page escaped its declared group.");return g.slice(T-$.begin,D-$.begin)}}for(let g of $.pages){if(W)return;let{nodes:T,pages:D}=await M(j,g);for(let[V,k]of Object.entries(T))R.set(V,k);for(let V of Object.values(D))V&&L.push(V)}}catch(j){throw W=!0,j}}}))}}class _ extends Op{isCOPCSource=!0;type="COPCSource";_opCounter=new Cp;_nodeMap=new Map;_filters=[];_options={decimate:1,enableWorkers:!0,compressColorsToUint8:!0};get loading(){return this._opCounter.loading}get progress(){return this._opCounter.progress}get filters(){return this._filters}set filters(b){this._filters.length=0,b!=null&&this._filters.push(...b),this.dispatchEvent({type:"updated"})}constructor(b){if(super(),this._opCounter.addEventListener("changed",()=>this.dispatchEvent({type:"progress"})),this._options.compressColorsToUint8=b.compressColorsTo8Bit??this._options.compressColorsToUint8,this._options.decimate=b.decimate??1,this._options.decimate<1)throw new Error("decimate should be at least 1");this._options.enableWorkers=b.enableWorkers??!0,b.filters!=null&&b.filters.length>0&&this._filters.push(...b.filters),this._getter=typeof b.url=="string"?i(b.url):b.url}async initializeOnce(){let b=this._opCounter;b.increment(3);let S=await An.Copc.create(this._getter).finally(()=>b.decrement()),[R,L,B]=S.header.min,[C,G,O]=S.header.max,W=new We(new z(R,L,B),new z(C,G,O)),$=new Map;await d(this._getter,S.info.rootHierarchyPage,$).finally(()=>b.decrement());let j=ts($.get("0-0-0-0"),"FATAL: no root node in the LAS file."),g=await this.loadPointDataView(this._getter,S,j).finally(()=>b.decrement());return this._data={copc:S,nodes:$,volume:W,dimensions:g.dimensions},this}getMetadata(){let b=this.ensureInitialized(),S=go.unknown;if(typeof b.copc.wkt<"u")try{S=go.fromWkt(b.copc.wkt)}catch(L){console.error(`Failed to parse WKT for COPC "${this.id}": `,L)}let R={pointCount:b.copc.header.pointCount,attributes:Lp(b.dimensions,b.volume,this._options.compressColorsToUint8,b.copc.info.gpsTimeRange),volume:b.volume,crs:S};return Promise.resolve(R)}getHierarchy(){let{copc:b,nodes:S}=this.ensureInitialized(),[R,L,B,C,G,O]=b.info.cube,W=new We(new z(R,L,B),new z(C,G,O)),$=ts(S.get("0-0-0-0")),j=b.info.spacing,g=Pt.create({depth:0,x:0,y:0,z:0,id:"0-0-0-0",volume:W,center:W.getCenter(new z),pointCount:$.pointCount,geometricError:j,hasData:$.pointCount>0,sourceId:this.id},W);return Pt.populate(g,D=>{let V=j/2**(D.depth+1);return[h(this.id,S,D,V,0,0,0),h(this.id,S,D,V,1,0,0),h(this.id,S,D,V,1,1,0),h(this.id,S,D,V,0,1,0),h(this.id,S,D,V,0,0,1),h(this.id,S,D,V,1,0,1),h(this.id,S,D,V,1,1,1),h(this.id,S,D,V,0,1,1)]}),Pt.traverse(g,D=>(this._nodeMap.set(D.id,D),!0)),Promise.resolve(g)}async getNodeData(b){let{nodes:S,copc:R}=this.ensureInitialized(),L=b.node.id,B=-b.node.depth,C=S.get(L);if(!C)throw new Error("no such node: "+L);let G=b.signal;G?.throwIfAborted();let O=b.attributes??[],W=Dp(O,b.position,this._filters),$=ts(this._nodeMap.get(L)),j=this._options.decimate,{x:g,y:T,z:D}=b.node.center,V={pointCount:C.pointCount,pointDataRecordFormat:R.header.pointDataRecordFormat,pointDataRecordLength:R.header.pointDataRecordLength},k;this._options.enableWorkers?k=await this.loadNodeDataWithWorker(C,B,G,R,V,b,g,T,D,W,j):k=await this.loadNodeData(R,C,W,B,G,g,T,D,j,b),G?.throwIfAborted();let Y,U;if(k.position){Y=new sn(new Float32Array(k.position.buffer),3);let[ve,K,ue,an,It,Lt]=k.position.localBoundingBox;U=new We(new z(ve,K,ue),new z(an,It,Lt))}let ge=O.map((ve,K)=>{let ue=k.attributes[K];if(ue!=null)return Up(ue,ve,this._options.compressColorsToUint8)});return{pointCount:Y?.count??ge[0]?.count,origin:$.center,localBoundingBox:U,position:Y,attributes:ge}}async loadNodeData(b,S,R,L,B,C,G,O,W,$){let j=await this._opCounter.wrap(this.loadPointDataView(this._getter,b,S,R,L,B));return B?.throwIfAborted(),Fp({view:j,origin:{x:C,y:G,z:O},stride:W,position:$.position,attributes:$.attributes??[],compressColors:this._options.compressColorsToUint8,filters:this._filters})}async loadNodeDataWithWorker(b,S,R,L,B,C,G,O,W,$,j){let g=await this._opCounter.wrap(this.loadPointDataViewBuffer(this._getter,b,S));R?.throwIfAborted();let T=g.slice(0);try{return this._opCounter.increment(),await(await s.get()).queue("ReadView",{buffer:T,header:L.header,metadata:B,position:C.position,origin:{x:G,y:O,z:W},include:$,filters:this._filters,eb:L.eb,stride:j,attributes:C.attributes??[],compressColors:this._options.compressColorsToUint8},[T])}finally{this._opCounter.decrement()}}ensureInitialized(){if(!this._data)throw new Error("not initialized");return this._data}async loadPointDataViewBuffer(b,S,R){let{pointDataOffset:L,pointDataLength:B}=S,C=`${this.id}-${L}-${B}`,G=mo.get(C);return G!=null?G.buffer:n.enqueue({id:C,priority:R,request:async()=>{let O=await b(L,L+B);return mo.set(C,O,{size:O.byteLength}),O.buffer}})}async loadPointDataView(b,S,R,L,B,C){let G=await this.loadPointDataViewBuffer(b,R,B);C?.throwIfAborted();let O;if(this._options.enableWorkers){let W=new Uint8Array(G.slice(0));O=await l(W,{pointCount:R.pointCount,pointDataRecordFormat:S.header.pointDataRecordFormat,pointDataRecordLength:S.header.pointDataRecordLength})}else{let W=new Uint8Array(G);O=await r(W,{pointCount:R.pointCount,pointDataRecordFormat:S.header.pointDataRecordFormat,pointDataRecordLength:S.header.pointDataRecordLength})}return C?.throwIfAborted(),Np(O,S.header,S.eb,L)}getMemoryUsage(){}dispose(){s.dispose(),this._data=void 0,this._nodeMap.clear(),this._filters.length=0}}function y(M){return M.isCOPCSource===!0}function v(M,b){return new class extends M{initialize(){return this._initializePromise||(this._initializePromise=Promise.resolve().then(()=>this.initializeOnce()).then(S=>(this._ready=!0,this.dispatchEvent({type:"initialized"}),S))),this._initializePromise}async getNodeData(S){S.signal?.throwIfAborted();try{let R=await super.getNodeData(S);return S.signal?.throwIfAborted(),R}catch(R){throw S.signal?.throwIfAborted(),R}}}(b)}return v(_,e)}function Vp(s,e){if(typeof s.prototype.loadNodeData!="function")throw new Error("Missing reviewed PointCloud loading method.");let t=new AbortController,n,i=()=>{t.signal.aborted||(t.abort(new Error("aborted")),n&&(n.frozen=!0))};return n=new class extends s{async loadNodeData(r,l,c){if(t.signal.aborted||l?.aborted)return;let u=new AbortController,h=()=>u.abort(new Error("aborted"));t.signal.addEventListener("abort",h,{once:!0}),l?.addEventListener("abort",h,{once:!0});try{return(t.signal.aborted||l?.aborted)&&h(),await super.loadNodeData(r,u.signal,c)}finally{t.signal.removeEventListener("abort",h),l?.removeEventListener("abort",h)}}clear(){t.signal.aborted||super.clear()}dispose(){try{i()}finally{super.dispose()}}}(e),{entity:n,stop:i}}function cb(s){return Vp(zp,s)}export{Bp as createCOPCSource,Ap as createLASSource,cb as createOwnedPointCloud};
|
|
3826
3826
|
/*! Bundled license information:
|
|
3827
3827
|
|
|
3828
3828
|
three/build/three.core.js:
|